/* Station OS — Dedicated Broadcast Motion & Visual System (720x1280 9:16 mobile-first)
 * 11 distinct visual templates with 3-phase choreography: enter -> develop -> exit.
 * Honors prefers-reduced-motion cleanly.
 */
:root {
  --bg: #0a0c12;
  --ink: #f8f9fc;
  --muted: #a6b1c6;
  --entity-primary: #e63946;
  --entity-secondary: #14213d;
  --entity-accent: #ffb703;
  --glass: rgba(13, 17, 27, 0.90);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 720px;
  height: 1280px;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  width: 720px;
  height: 1280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 26px 26px;
  background:
    radial-gradient(circle at 15% 12%, color-mix(in srgb, var(--entity-primary) 34%, transparent), transparent 52%),
    radial-gradient(circle at 88% 76%, color-mix(in srgb, var(--entity-secondary) 55%, transparent), transparent 58%),
    linear-gradient(165deg, #0b0f19 0%, #07090f 100%);
  transition: background 520ms ease;
}

/* Top broadcast header */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}
.brand-group { display: flex; align-items: center; gap: 12px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: #e11d48; color: #fff;
  font-weight: 900; font-size: 16px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 16px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.45);
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: livePulse 1.15s infinite; }
.show-tag {
  font-weight: 900; font-size: 17px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}
.clock-chip {
  font-variant-numeric: tabular-nums;
  font-weight: 900; font-size: 18px; letter-spacing: 0.08em;
  background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.16);
  padding: 8px 14px; border-radius: 12px;
}

/* Main visual viewport (carries bespoke template per SceneKind) */
.scene-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 18px 0;
  position: relative;
}

/* Shared enter / develop / exit motion keyframes */
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.85); } }
@keyframes enterSlideUp { from { opacity: 0; transform: translateY(34px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes enterWipeLeft { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: translateX(0); } }
@keyframes enterStampSlam { 0% { opacity: 0; transform: scale(1.24) rotate(-5deg); } 70% { opacity: 1; transform: scale(0.97) rotate(1deg); } 100% { opacity: 1; transform: scale(1) rotate(0deg); } }
@keyframes enterBurst { 0% { opacity: 0; transform: scale(0.75); } 65% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
@keyframes holdKenBurns { 0% { transform: scale(1); } 100% { transform: scale(1.06); } }
@keyframes holdGlow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--entity-accent) 45%, transparent); } 50% { box-shadow: 0 0 28px 4px color-mix(in srgb, var(--entity-accent) 50%, transparent); } }
@keyframes playheadSweep { 0% { left: 0%; } 100% { left: 88%; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.tpl {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  animation: enterSlideUp 420ms cubic-bezier(.16,.84,.3,1) both;
}

.source-footer {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.verdict-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--entity-accent); color: #0a0c12;
  font-weight: 950; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 10px 18px; border-radius: 12px;
  margin-top: 18px;
  animation: holdGlow 2.4s ease-in-out infinite 600ms;
}

/* 1. SCORE TICKER BOARD */
.tpl-score-ticker {
  background: var(--glass);
  border: 2px solid color-mix(in srgb, var(--entity-accent) 45%, transparent);
  padding: 28px;
}
.tpl-score-ticker .eyebrow { font-size: 15px; font-weight: 900; letter-spacing: 0.16em; color: var(--entity-accent); text-transform: uppercase; margin-bottom: 8px; }
.tpl-score-ticker h1 { font-size: 36px; font-weight: 950; line-height: 1.06; margin-bottom: 8px; }
.tpl-score-ticker .sub { font-size: 19px; color: var(--muted); margin-bottom: 20px; }
.ticker-rows { display: grid; gap: 12px; }
.ticker-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.06);
  border-left: 6px solid var(--entity-primary);
  border-radius: 14px; padding: 16px 18px;
  animation: enterWipeLeft 420ms ease-out both;
}
.ticker-row:nth-child(2) { animation-delay: 140ms; border-left-color: var(--entity-accent); }
.ticker-row:nth-child(3) { animation-delay: 280ms; border-left-color: #38bdf8; }
.ticker-phase { font-size: 14px; font-weight: 900; color: var(--entity-accent); text-transform: uppercase; letter-spacing: 0.08em; }
.ticker-match { font-size: 22px; font-weight: 900; margin-top: 3px; }
.ticker-period { font-size: 14px; font-weight: 800; background: rgba(255,255,255,0.12); padding: 6px 10px; border-radius: 8px; white-space: nowrap; }

/* 2. DUEL BARS (True split arena) */
.tpl-duel-bars {
  background: linear-gradient(115deg, color-mix(in srgb, var(--entity-primary) 26%, #0d1220) 0%, #0d1220 50%, color-mix(in srgb, var(--entity-secondary) 48%, #0d1220) 100%);
  border: 2px solid rgba(255,255,255,0.14);
  padding: 28px;
}
.duel-banner { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.duel-vs {
  background: var(--entity-accent); color: #0a0c12; font-weight: 950; font-size: 15px;
  padding: 6px 12px; border-radius: 999px; letter-spacing: 0.14em;
}
.tpl-duel-bars h1 { font-size: 36px; font-weight: 950; line-height: 1.06; margin-bottom: 8px; }
.tpl-duel-bars .sub { font-size: 19px; color: var(--muted); margin-bottom: 20px; }
.duel-stack { display: grid; gap: 14px; }
.duel-item { background: rgba(0,0,0,0.34); border-radius: 16px; padding: 16px 18px; border: 1px solid rgba(255,255,255,0.08); }
.duel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 10px; }
.duel-name { font-size: 18px; font-weight: 800; color: rgba(255,255,255,0.88); }
.duel-val { font-size: 28px; font-weight: 950; color: var(--entity-accent); }
.duel-bar-bg { height: 12px; background: rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; }
.duel-bar-fill {
  height: 100%; border-radius: 999px; transform-origin: left center;
  background: linear-gradient(90deg, var(--entity-primary), var(--entity-accent));
  animation: barGrow 780ms cubic-bezier(.18,.89,.32,1.08) both;
}

/* 3. PLAYER PHOTO / FLOWERS MAGAZINE COVER */
.tpl-player-photo {
  background: linear-gradient(180deg, color-mix(in srgb, var(--entity-primary) 35%, #111624) 0%, #0b0e17 100%);
  border: 2px solid color-mix(in srgb, var(--entity-accent) 50%, transparent);
  padding: 28px;
}
.photo-hero {
  display: flex; align-items: center; gap: 22px; margin-bottom: 20px;
}
.photo-frame {
  width: 152px; height: 152px; border-radius: 24px; overflow: hidden; flex-shrink: 0;
  border: 4px solid var(--entity-accent);
  background: linear-gradient(135deg, var(--entity-primary), var(--entity-secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; font-weight: 950; color: #fff; letter-spacing: -0.04em;
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; animation: holdKenBurns 9s ease-out forwards; }
.photo-meta .eyebrow { font-size: 15px; font-weight: 900; letter-spacing: 0.14em; color: var(--entity-accent); text-transform: uppercase; margin-bottom: 6px; }
.photo-meta h1 { font-size: 34px; font-weight: 950; line-height: 1.06; margin-bottom: 8px; }
.photo-meta .sub { font-size: 18px; color: var(--muted); line-height: 1.28; }

/* 4. DISTRIBUTION / xG PARADOX DIVERGING VISUAL */
.tpl-distribution {
  background: linear-gradient(160deg, #0b132b 0%, #111c36 100%);
  border: 2px solid color-mix(in srgb, var(--entity-accent) 45%, transparent);
  padding: 28px;
}
.dist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.dist-box {
  background: rgba(255,255,255,0.06); border-radius: 18px; padding: 20px;
  border-top: 6px solid var(--entity-primary);
  display: flex; flex-direction: column; justify-content: space-between; min-height: 190px;
}
.dist-box:nth-child(2) { border-top-color: var(--entity-accent); }
.dist-label { font-size: 16px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.dist-big { font-size: 30px; font-weight: 950; line-height: 1.12; margin: 12px 0; color: #fff; }
.dist-period { font-size: 14px; font-weight: 700; color: var(--entity-accent); }

/* 5. TIMELINE (0'-90'+ Match Clock Heat Bar) */
.tpl-timeline {
  background: var(--glass);
  border: 2px solid rgba(255,255,255,0.14);
  padding: 28px;
}
.clock-track-wrap { margin: 22px 0; }
.clock-track {
  position: relative; height: 28px; border-radius: 999px; overflow: hidden;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.6fr; gap: 4px;
  background: rgba(255,255,255,0.08); padding: 4px;
}
.clock-seg { border-radius: 999px; background: rgba(255,255,255,0.16); }
.clock-seg.hot { background: linear-gradient(90deg, var(--entity-primary), var(--entity-accent)); animation: holdGlow 1.8s infinite; }
.clock-playhead {
  position: absolute; top: 0; bottom: 0; width: 6px; background: #fff; border-radius: 999px;
  box-shadow: 0 0 14px #fff; animation: playheadSweep 4.5s ease-out forwards;
}
.clock-labels { display: flex; justify-content: space-between; font-size: 14px; font-weight: 800; color: var(--muted); margin-top: 8px; }
.clock-labels .hot-lbl { color: var(--entity-accent); font-weight: 950; }

/* 6. CLUB IDENTITY / HOODOO SPLIT POSTER */
.tpl-club-identity {
  background: linear-gradient(135deg, var(--entity-primary) 0%, color-mix(in srgb, var(--entity-primary) 50%, #090c14) 46%, var(--entity-secondary) 100%);
  border: 3px solid rgba(255,255,255,0.22);
  padding: 30px;
}
.hoodoo-card {
  background: rgba(9, 12, 20, 0.84);
  border-radius: 20px; padding: 24px;
  backdrop-filter: blur(8px);
}

/* 7. EDITORIAL MEME (Unmistakable SOFA MEME · EDITORIAL Tabloid Stamp) */
.tpl-editorial-meme {
  background: #f5f0e1;
  color: #111;
  border: 8px solid #111;
  padding: 28px;
  box-shadow: 12px 12px 0 var(--entity-primary);
  animation: enterStampSlam 460ms cubic-bezier(.18,.89,.32,1.15) both;
}
.meme-stamp {
  display: inline-block; background: #111; color: #ffd166;
  font-weight: 950; font-size: 16px; letter-spacing: 0.16em;
  padding: 8px 16px; text-transform: uppercase; transform: rotate(-1.5deg);
  margin-bottom: 18px;
}
.meme-top {
  font-size: 36px; font-weight: 950; line-height: 1.08; text-transform: uppercase;
  color: #111; border-bottom: 4px solid #111; padding-bottom: 16px; margin-bottom: 16px;
}
.meme-bottom {
  font-size: 38px; font-weight: 950; line-height: 1.06; text-transform: uppercase;
  color: var(--entity-primary);
}
.tpl-editorial-meme .source-footer { color: #333; margin-top: 22px; border-top: 2px dashed #555; padding-top: 12px; }

/* 8. STAT CALLOUT (Hero Giant Focal Number) */
.tpl-stat-callout {
  background: var(--glass);
  border-left: 10px solid var(--entity-primary);
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: 30px;
}
.hero-stat {
  margin: 18px 0;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--entity-primary) 30%, transparent), rgba(255,255,255,0.04));
  border: 1px solid color-mix(in srgb, var(--entity-primary) 55%, transparent);
}
.hero-stat .big-num { font-size: 46px; font-weight: 950; line-height: 1.05; color: var(--entity-accent); }
.hero-stat .big-lbl { font-size: 19px; font-weight: 800; color: #fff; margin-top: 6px; }

/* 9. MATCH TRANSITION (Evening Headliners / Kampskift) */
.tpl-match-transition {
  background: linear-gradient(145deg, var(--entity-secondary) 0%, #090d16 55%, color-mix(in srgb, var(--entity-primary) 42%, #090d16) 100%);
  border: 2px solid color-mix(in srgb, var(--entity-accent) 45%, transparent);
  padding: 28px;
}

/* 10. GOALCARD (Breaking Goal Flash Burst) */
.tpl-goalcard {
  background: radial-gradient(circle at 50% 35%, var(--entity-primary) 0%, #1a060a 78%);
  border: 4px solid var(--entity-accent);
  padding: 36px 28px;
  text-align: center;
  animation: enterBurst 420ms cubic-bezier(.18,.89,.32,1.18) both;
}
.goal-scream {
  font-size: 76px; font-weight: 950; letter-spacing: 0.08em; line-height: 1;
  color: var(--entity-accent); text-shadow: 0 8px 28px rgba(0,0,0,0.6);
  margin-bottom: 16px;
}

/* 11. ENDCARD (Clean Broadcast Sign-off) */
.tpl-endcard {
  background: linear-gradient(160deg, var(--entity-primary) 0%, #0a0d16 68%);
  border: 2px solid color-mix(in srgb, var(--entity-accent) 55%, transparent);
  padding: 40px 30px;
  text-align: center;
}
.tpl-endcard h1 { font-size: 44px; font-weight: 950; margin: 14px 0 12px; line-height: 1.05; }
.tpl-endcard .sub { font-size: 22px; color: rgba(255,255,255,0.85); line-height: 1.35; }

/* Speaker Bar & Captions (Inherits Theo LiveAvatar + Sam/Jack/Alistair Portraits) */
.captions-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(10, 13, 21, 0.94);
  border-radius: 20px;
  padding: 16px 20px;
  border-top: 4px solid var(--entity-accent);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
}
.host-avatar {
  width: 76px; height: 76px; border-radius: 16px; overflow: hidden; flex-shrink: 0;
  border: 3px solid var(--entity-accent);
  background: linear-gradient(135deg, #1d3557, #e63946);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 950; color: #fff;
}
.host-avatar img { width: 100%; height: 100%; object-fit: cover; }
.caption-body { flex: 1; min-width: 0; }
.speaker-name {
  font-size: 14px; font-weight: 950; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--entity-accent); margin-bottom: 5px;
}
.caption-text { font-size: 21px; font-weight: 800; line-height: 1.22; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
