/* ============================================================
   EOS Player — immersive video stage with overlay controls.
   Built to host YouTube / Vimeo / Bunny / HLS / generic iframes.
   ============================================================ */

.eos-watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--eos-side-w);
  gap: 24px;
  max-width: var(--eos-content-max);
  margin: 24px auto 80px;
  padding: 0 24px;
}

.eos-watch-stage { min-width: 0; }

.eos-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--eos-radius-lg);
  overflow: hidden;
  box-shadow: var(--elevation-card-hover);
  isolation: isolate;
}

/* Live iframe takes over the whole stage */
.eos-player-frame {
  position: absolute; inset: 0;
}
.eos-player-frame iframe,
.eos-player-frame .eos-hls,
.eos-player-frame video {
  width: 100%; height: 100%; border: 0; background: #000;
}

/* Off-air poster + countdown */
.eos-player-offair {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;        /* shorthand for align + justify */
  text-align: center;
  color: #fff;
  overflow: hidden;
  padding: 24px;
  box-sizing: border-box;
}
.eos-player-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.6) saturate(.95);
  z-index: 0;
}
.eos-player-offair::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 60%, transparent, rgba(0,0,0,.7));
  z-index: 1;
}
/* v2.1.73 — Off-air content is centred BOTH horizontally and vertically
   in the player stage. Inner children sit in a column so spacing is
   consistent regardless of which optional pieces are present (audience
   banner, replay button etc.). */
.eos-player-offair-content {
  position: relative; z-index: 2;
  padding: 0;
  max-width: 720px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 18px);
  text-align: center;
  margin: 0 auto;
  /* No fixed height — place-items:center on the parent centres us as a whole. */
}
.eos-player-offair-content > * { margin: 0; }
/* Hide the title when empty (e.g., when no live event is configured). */
.eos-player-offair h2 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4.4vw, 56px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.eos-player-offair h2:empty { display: none; }
.eos-player-offair .eos-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .12em; font-weight: 800;
  text-transform: uppercase;
  /* v2.1.86 — On the dark player stage the default accent (gold) on text
     was washing out / showing as dark navy in some palettes. Force a bright
     warm-gold so "COMING UP" reads cleanly against the black background
     regardless of which palette is active. */
  color: #FFD27A !important;
  opacity: 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.eos-player-offair .eos-eyebrow svg { color: #FFD27A !important; stroke: #FFD27A !important; }
.eos-player-offair .eos-player-when { color: rgba(255, 255, 255, 0.9); }
.eos-player-when {
  opacity: .85;
  font-size: 14px;
  margin: 0;
}
/* Countdown sits in the middle — keep a sensible vertical rhythm. */
.eos-player-offair .eos-countdown-lg {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
}
/* Watch a replay button — keep self-centred. */
.eos-player-offair .eos-btn-light {
  align-self: center;
  margin: 0;
}

/* Player control overlay */
.eos-player-controls {
  position: absolute;
  left: 12px; bottom: 12px; right: 12px;
  display: flex;
  gap: 6px;
  /* v2.1.29 — modern, centered, auto-hide */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(11,15,23,.78), rgba(11,15,23,.62));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.05);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s cubic-bezier(.4,0,.2,1), transform .35s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  z-index: 4;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  left: 0; right: 0;
  bottom: 18px;
}

/* Pin the bar centred-bottom regardless of inner left/right values */
.eos-player .eos-player-controls { left: 50%; right: auto; transform: translateX(-50%) translateY(12px); }

/* Visible state — set by JS on player activity. Pointer-events on so buttons click. */
.eos-player.is-active .eos-player-controls,
.eos-player:focus-within .eos-player-controls {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Iframe-based providers (YouTube/Vimeo/etc) get their own native chrome;
   hide ours so we never block or compete with theirs. */
.eos-player-controls.is-iframe { display: none !important; }

/* Modern button — 38px pill, white SVG, soft hover */
.eos-pc-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, transform .15s ease, color .18s ease;
  position: relative;
  padding: 0;
}
.eos-pc-btn svg { width: 18px; height: 18px; display: block; }
.eos-pc-btn:hover {
  background: rgba(255,255,255,.16);
  transform: translateY(-1px);
}
.eos-pc-btn:active { transform: translateY(0) scale(.94); }
.eos-pc-btn:focus-visible {
  outline: 2px solid var(--color-accent, #F5A312);
  outline-offset: 2px;
}
.eos-pc-btn[disabled] { opacity: .3; cursor: not-allowed; pointer-events: none; }

/* Play/pause swap — show one SVG at a time */
.eos-pc-btn[data-action="play"] svg.is-pause { display: none; }
.eos-pc-btn[data-action="play"].is-playing svg:not(.is-pause) { display: none; }
.eos-pc-btn[data-action="play"].is-playing svg.is-pause { display: block; }

/* Pressed-state highlight (CC active, theater on, etc.) */
.eos-pc-btn.is-on {
  background: var(--color-accent, #F5A312);
  color: #1a1a1a;
}

/* Mobile — slightly smaller buttons + tighter gap */
@media (max-width: 720px) {
  .eos-player-controls { padding: 6px 8px; gap: 2px; bottom: 12px; }
  .eos-pc-btn { width: 34px; height: 34px; }
  .eos-pc-btn svg { width: 16px; height: 16px; }
}

/* Theatre mode (wider stage, no side panel) */
body.eos-theatre .eos-watch { grid-template-columns: 1fr; max-width: 1600px; }
body.eos-theatre .eos-side  { display: none; }

/* When the player frame contains an HLS native video */
.eos-hls { width: 100%; height: 100%; background: #000; }

/* Responsive */
@media (max-width: 1100px) {
  .eos-watch { grid-template-columns: 1fr; }
  .eos-side {
    margin: 0 -24px -80px;
    border-radius: 0;
    border-left: 0; border-right: 0;
  }
}
