/* Live page player + YouTube chat (Phase 1) */

.aifo-live-stage {
  --aifo-orange: #f98715;
  --aifo-stroke: rgba(255, 255, 255, 0.14);
  --aifo-text: rgba(255, 255, 255, 0.92);
  --aifo-live-radius: 24px;
  --aifo-live-chat-height: min(42vh, 400px);
  --aifo-live-chat-height-mobile: min(36vh, 320px);
  padding: 44px 0;
  background:
    radial-gradient(900px 420px at 18% 8%, rgba(249, 135, 21, 0.22), rgba(0, 0, 0, 0) 62%),
    linear-gradient(180deg, #070707 0%, #0b0b0b 45%, #070707 100%);
  color: var(--aifo-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.aifo-live-stage__inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.aifo-live-stage__grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aifo-live-player {
  border: 1px solid var(--aifo-stroke);
  border-radius: var(--aifo-live-radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
  min-width: 0;
}

.aifo-live-player__ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.aifo-live-player__ph,
.aifo-live-player__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.aifo-live-player__iframe {
  z-index: 1;
}

.aifo-live-player__iframe iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.aifo-live-player__ph {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000 center / cover no-repeat;
}

.aifo-live-player__ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px 320px at 20% 20%, rgba(249, 135, 21, 0.25), rgba(0, 0, 0, 0) 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.82));
}

.aifo-live-player__ph-inner {
  position: relative;
  z-index: 2;
  margin: 0 14px;
  max-width: 760px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 16px 16px 14px;
  backdrop-filter: blur(6px);
}

.aifo-live-player__title {
  font-weight: 900;
  font-size: 20px;
  margin: 0 0 8px;
  color: #fff;
}

.aifo-live-player__sub {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
}

.aifo-live-player__sub strong {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
}

.aifo-live-countdown {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.aifo-live-countdown__item {
  min-width: 86px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.aifo-live-countdown__num {
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  color: var(--aifo-orange);
}

.aifo-live-countdown__lbl {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.aifo-live-unmute {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 4;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(249, 135, 21, 0.45);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.aifo-live-unmute[hidden] {
  display: none !important;
}

.aifo-live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--aifo-orange);
  color: #111;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aifo-live-badge[hidden] {
  display: none !important;
}

.aifo-live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #111;
  animation: aifo-live-pulse 1.5s ease-in-out infinite;
}

@keyframes aifo-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.aifo-live-player__iframe[hidden],
.aifo-live-player__ph[hidden] {
  display: none !important;
}

.aifo-live-chat {
  display: none !important;
  flex-direction: column;
  min-height: 0;
  height: var(--aifo-live-chat-height);
  border: 1px solid var(--aifo-stroke);
  border-radius: calc(var(--aifo-live-radius) - 4px);
  overflow: hidden;
  background: #0b0b0b;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
}

.aifo-live-chat[hidden] {
  display: none !important;
}

.aifo-live-stage.is-playing .aifo-live-chat {
  display: flex !important;
}

.aifo-live-stage.is-playing .aifo-live-chat[hidden] {
  display: none !important;
}

.aifo-live-chat__head {
  flex-shrink: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.aifo-live-chat__body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.aifo-live-chat__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
}

.aifo-live-chat__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.aifo-live-chat__iframe[hidden],
.aifo-live-chat__placeholder[hidden] {
  display: none !important;
}

.aifo-live-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.aifo-live-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.aifo-live-actions .btn.orange {
  background: var(--aifo-orange);
  color: #111;
  border-color: rgba(249, 135, 21, 0.35);
}

.aifo-live-note {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

#live-page .aifo-live-stage .risk-notice {
  background: rgba(249, 135, 21, 0.1);
  border: 1px solid rgba(249, 135, 21, 0.3);
  border-radius: 8px;
  padding: 2px;
  text-align: center;
  margin-bottom: 0;
  margin-top: 10px;
}

#live-page .aifo-live-stage .risk-notice-title {
  margin-bottom: 0;
}

#live-page .aifo-live-stage .risk-notice-text {
  margin-left: 20px !important;
}

@media (max-width: 767.98px) {
  .aifo-live-stage {
    padding-top: 8px;
  }

  .aifo-live-countdown__item {
    min-width: 74px;
    padding: 9px 10px;
  }

  .aifo-live-countdown__num {
    font-size: 20px;
  }

  .aifo-live-chat {
    height: var(--aifo-live-chat-height-mobile);
  }
}
