:root {
  --ink: #f4f7ef;
  --night: #060907;
  --forest: #153122;
  --green: #244f39;
  --lime: #b8f34a;
  --cream: #f3f4ec;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--night); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
.tv-app, .setup-view, .paired-view, .player-view, .player-content { width: 100%; height: 100%; }
.is-hidden { display: none !important; }

.setup-view { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 45%, #183526 0, #0b1710 36%, #050806 75%); }
.setup-view::before { content: ""; position: absolute; inset: 0; opacity: .2; background: repeating-linear-gradient(90deg, transparent 0 9.8%, rgba(184,243,74,.12) 10% 10.1%); transform: perspective(500px) rotateX(62deg) scale(1.6); transform-origin: center 100%; }
.ambient-ring { position: absolute; border: 1px solid rgba(184,243,74,.12); border-radius: 50%; animation: expand 5s ease-in-out infinite; }
.ring-one { width: 58vw; height: 58vw; }
.ring-two { width: 36vw; height: 36vw; animation-delay: -2.5s; }
.setup-card { position: relative; z-index: 2; width: min(680px, 70vw); text-align: center; }
.setup-brand { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 8vh; text-align: left; }
.setup-brand > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: var(--lime); color: #112018; font-size: 28px; font-weight: 950; box-shadow: 0 0 38px rgba(184,243,74,.18); }
.setup-brand strong, .setup-brand small { display: block; }
.setup-brand strong { font-size: clamp(18px,2vw,27px); letter-spacing: -.03em; }
.setup-brand small { margin-top: 2px; color: #95a497; font-size: clamp(9px,.8vw,12px); text-transform: uppercase; letter-spacing: .16em; }
.setup-kicker { margin: 0 0 1.2vh; color: var(--lime); font-size: clamp(9px,.85vw,13px); font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.setup-card h1 { margin: 0; font-size: clamp(34px,5vw,68px); letter-spacing: -.055em; }
.setup-copy { margin: 2vh auto 4vh; color: #a9b5aa; font-size: clamp(13px,1.25vw,19px); line-height: 1.55; }
.setup-copy strong { color: white; }
.pair-code { display: flex; justify-content: center; align-items: center; gap: clamp(8px,1vw,15px); }
.pair-code span { width: clamp(50px,5.2vw,76px); height: clamp(64px,6.4vw,92px); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; background: rgba(255,255,255,.075); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 15px 30px rgba(0,0,0,.15); font-size: clamp(28px,3.7vw,52px); font-weight: 800; font-variant-numeric: tabular-nums; }
.pair-code i { width: 16px; }
.setup-status { display: inline-flex; align-items: center; gap: 9px; margin-top: 4vh; color: #aab7ab; font-size: clamp(9px,.9vw,13px); }
.setup-status i, .sync-toast i { width: 8px; height: 8px; border-radius: 50%; background: #5bcd77; box-shadow: 0 0 0 4px rgba(91,205,119,.13); }
.device-footer { position: absolute; left: 4vw; right: 4vw; bottom: 3vh; display: flex; justify-content: space-between; color: #68756b; font-size: clamp(8px,.7vw,11px); letter-spacing: .04em; }
.device-footer b { color: #9aa69b; font-variant-numeric: tabular-nums; }

.paired-view { display: grid; place-content: center; text-align: center; background: radial-gradient(circle,#1a3b29,#070c09 62%); }
.paired-check { width: 90px; height: 90px; display: grid; place-items: center; margin: auto; border-radius: 50%; color: #12251a; background: var(--lime); font-size: 46px; box-shadow: 0 0 0 18px rgba(184,243,74,.07), 0 0 70px rgba(184,243,74,.18); animation: pop .45s ease-out; }
.paired-view p { margin: 5vh 0 1vh; color: var(--lime); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .2em; }
.paired-view h1 { margin: 0; font-size: clamp(38px,5vw,76px); letter-spacing: -.05em; }
.paired-view > span { display: block; margin-top: 2vh; color: #98a69b; font-size: clamp(11px,1vw,15px); }

.player-view { position: relative; background: #050806; }
.sync-toast { position: absolute; right: 2vw; top: 2vh; z-index: 12; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 30px; background: rgba(8,13,9,.68); color: #c3cdc5; font-size: clamp(8px,.72vw,11px); backdrop-filter: blur(10px); opacity: 0; transform: translateY(-10px); transition: .25s ease; }
.sync-toast.show { opacity: 1; transform: none; }
.message-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 8vw; background: rgba(5,9,6,.89); backdrop-filter: blur(18px); text-align: center; }
.message-overlay > div { max-width: 1100px; }
.message-overlay span { display: block; color: var(--lime); font-size: clamp(10px,1vw,16px); font-weight: 850; letter-spacing: .2em; text-transform: uppercase; }
.message-overlay strong { display: block; margin-top: 3vh; font-size: clamp(36px,5vw,76px); line-height: 1.08; letter-spacing: -.045em; }
.message-overlay small { display: block; margin-top: 4vh; color: #9eaba0; font-size: clamp(10px,.9vw,14px); }
.offline-banner { position: absolute; z-index: 14; left: 50%; bottom: 3vh; transform: translateX(-50%); padding: 11px 16px; border: 1px solid rgba(255,193,80,.28); border-radius: 8px; background: rgba(40,29,10,.88); color: #ffd892; font-size: clamp(9px,.85vw,13px); backdrop-filter: blur(8px); }
.offline-banner i { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #ffb62f; }

/* Player modes */
.clock-player { width: 100%; height: 100%; display: grid; grid-template-rows: 90% 10%; }
.clock-main { position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 50%,#294b37 0,#102219 42%,#050806 80%); }
.clock-main::before { content: ""; position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg,transparent 0deg 9deg,rgba(184,243,74,.055) 10deg 11deg); animation: spin 26s linear infinite; }
.clock-main::after { content: ""; position: absolute; width: 34vw; height: 34vw; border: 1px solid rgba(184,243,74,.26); border-radius: 50%; box-shadow: 0 0 0 4vw rgba(184,243,74,.025),0 0 0 8vw rgba(184,243,74,.018),0 0 9vw rgba(184,243,74,.1); animation: breathe 3.7s ease-in-out infinite; }
.player-wordmark { position: relative; z-index: 2; text-align: center; }
.player-l { width: clamp(90px,9vw,150px); height: clamp(90px,9vw,150px); margin: auto; display: grid; place-items: center; border: 3px solid var(--lime); border-radius: 26%; color: var(--lime); font-size: clamp(48px,5vw,82px); font-weight: 950; transform: rotate(-4deg); box-shadow: 0 0 4vw rgba(184,243,74,.12); }
.player-wordmark strong { display: block; margin-top: 3vh; font-size: clamp(26px,3.2vw,52px); letter-spacing: .24em; text-transform: uppercase; }
.player-wordmark span { display: block; margin-top: 1vh; color: var(--lime); font-size: clamp(8px,.9vw,14px); letter-spacing: .28em; text-transform: uppercase; }
.info-strip { background: var(--cream); color: #101510; padding: .5vh 3vw; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 2.5vw; }
.tv-team { height: 100%; display: flex; align-items: center; gap: 1.2vw; }
.tv-team.away { justify-content: flex-end; text-align: right; }
.tv-team-logo { height: 74%; max-height: 68px; aspect-ratio: 1; display: grid; place-items: center; border: 2px solid #bcc5b8; border-radius: 50%; font-size: clamp(9px,1vw,17px); font-weight: 900; }
.tv-team strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(12px,1.35vw,22px); letter-spacing: .07em; text-transform: uppercase; }
.info-strip .versus { color: #768075; font-size: clamp(8px,.8vw,13px); font-weight: 900; text-transform: uppercase; }
.tv-clock { min-width: 12vw; padding-left: 2.5vw; border-left: 1px solid #cbd1c7; text-align: right; font-variant-numeric: tabular-nums; }
.tv-clock span { display: block; color: #697368; font-size: clamp(6px,.62vw,10px); font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.tv-clock strong { display: block; font-size: clamp(22px,3vw,48px); line-height: 1; letter-spacing: -.07em; }

.menu-player { width: 100%; height: 100%; padding: 5vh 5vw; color: #182018; background: linear-gradient(125deg,#f4ead1 0,#fffaf0 48%,#dfe9d5 100%); position: relative; overflow: hidden; }
.menu-player::after { content: ""; position: absolute; width: 40%; height: 150%; right: -16%; top: -25%; transform: rotate(14deg); background: repeating-linear-gradient(90deg,rgba(31,79,52,.05) 0 8px,transparent 8px 30px); }
.menu-player.theme-stadium { color: #f5f7f0; background: radial-gradient(circle at 25% 0,#244a35,#0b1510 62%,#050806); }
.menu-player.theme-stadium::after { background: repeating-linear-gradient(90deg,rgba(184,243,74,.035) 0 8px,transparent 8px 30px); }
.tv-menu-background { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .2; }
.tv-menu-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: end; padding-bottom: 2.5vh; border-bottom: .4vh solid #244d36; }
.tv-menu-head h1 { margin: 0; font: italic 700 clamp(44px,6vw,94px)/.95 Georgia,serif; letter-spacing: -.055em; }
.tv-menu-head span { color: #385844; font-size: clamp(9px,1vw,16px); font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.theme-stadium .tv-menu-head { border-color: var(--lime); }
.theme-stadium .tv-menu-head span { color: #b8c6ba; }
.tv-menu-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,1fr); gap: 6vw; margin-top: 5vh; }
.tv-menu-section h2 { margin: 0 0 3vh; color: #a45c23; font-size: clamp(15px,1.7vw,28px); letter-spacing: .14em; text-transform: uppercase; }
.theme-stadium .tv-menu-section h2 { color: var(--lime); }
.tv-menu-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.3vw; margin-bottom: 2.4vh; font-size: clamp(15px,1.55vw,27px); font-weight: 760; }
.tv-menu-item.has-image { grid-template-columns: minmax(54px,22%) minmax(0,1fr) auto; }
.tv-menu-item-image { width: 100%; aspect-ratio: 1.28; object-fit: cover; border-radius: .55vw; }
.tv-menu-item span { min-width: 0; }
.tv-menu-item strong, .tv-menu-item small { display: block; }
.tv-menu-item small { margin-top: .45vh; color: #6d776c; font-size: .58em; font-weight: 500; }
.theme-stadium .tv-menu-item small { color: #a9b4ab; }
.tv-menu-item b { color: #244d36; font-variant-numeric: tabular-nums; white-space: nowrap; }
.theme-stadium .tv-menu-item b { color: var(--lime); }
.tv-menu-item.is-sold-out { opacity: .55; }
.tv-menu-item.is-sold-out strong { text-decoration: line-through; }
.tv-menu-item.is-featured { padding: 1.3vh 1vw; border-radius: .7vw; background: rgba(255,255,255,.32); }
.theme-stadium .tv-menu-item.is-featured { background: rgba(255,255,255,.07); }
.layout-featured .tv-menu-grid { gap: 3.5vw; }
.layout-featured .tv-menu-item.has-image { grid-template-columns: 34% minmax(0,1fr) auto; }
.tv-menu-footer { position: absolute; z-index: 2; left: 5vw; bottom: 4vh; color: #687366; font-size: clamp(9px,.85vw,14px); letter-spacing: .12em; text-transform: uppercase; }
.theme-stadium .tv-menu-footer { color: #a9b4ab; }

.image-player { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; position: relative; overflow: hidden; background: linear-gradient(145deg,#111a15,#284e38 48%,#d39a35); }
.image-player::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(circle at 30% 20%,rgba(184,243,74,.22),transparent 25%),radial-gradient(circle at 70% 80%,rgba(255,184,46,.25),transparent 28%); filter: blur(15px); }
.event-card { position: relative; width: 62vw; padding: 8vh 7vw; border: 1px solid rgba(255,255,255,.35); border-radius: 24px; background: rgba(8,14,10,.52); box-shadow: 0 3vw 9vw rgba(0,0,0,.26); backdrop-filter: blur(16px); }
.event-card span { color: var(--lime); font-size: clamp(10px,1vw,16px); letter-spacing: .2em; text-transform: uppercase; }
.event-card h1 { margin: 3vh 0 1vh; font-size: clamp(48px,7vw,116px); line-height: .95; letter-spacing: -.06em; }
.event-card p { margin: 0; color: #d7e0d8; font-size: clamp(16px,1.7vw,28px); }

.video-player { width: 100%; height: 100%; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(rgba(7,10,8,.2),rgba(7,10,8,.55)),linear-gradient(135deg,#819384,#1f3427 50%,#121713); }
.video-field { position: absolute; inset: 0; opacity: .5; background: linear-gradient(90deg,transparent 49.6%,rgba(255,255,255,.5) 49.8% 50.2%,transparent 50.4%),repeating-linear-gradient(90deg,transparent 0 9%,rgba(255,255,255,.18) 9.1% 9.3%,transparent 9.4% 10%); transform: perspective(600px) rotateX(55deg) scale(1.45); transform-origin: center 85%; }
.live-badge { position: absolute; left: 3vw; top: 3vh; padding: .7vh 1vw; border-radius: 5px; background: #df3b32; font-size: clamp(9px,.9vw,15px); font-weight: 900; letter-spacing: .13em; }
.stream-title { position: absolute; left: 3vw; right: 3vw; bottom: 3vh; display: flex; justify-content: space-between; color: rgba(255,255,255,.85); font-size: clamp(10px,.9vw,15px); }
.broadcast-mark { width: 9vw; height: 9vw; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.58); border-radius: 50%; background: rgba(13,21,15,.35); font-size: clamp(30px,3vw,52px); backdrop-filter: blur(8px); }

.website-player { width: 100%; height: 100%; padding: 3vh 3vw; background: #f2f4ef; color: #172019; }
.stats-nav { height: 9%; display: flex; align-items: center; gap: 4vw; border-bottom: 1px solid #d5dbd1; font-size: clamp(10px,1vw,17px); }
.stats-nav strong { color: #275039; font-size: 1.1em; }
.stats-layout { display: grid; grid-template-columns: .9fr 2.1fr; gap: 2.5vw; height: 86%; padding-top: 3vh; }
.score-panel { border-radius: 16px; background: #183924; color: white; padding: 4vh 3vw; display: flex; flex-direction: column; justify-content: space-between; }
.score-panel span { color: #bdcebf; font-size: clamp(9px,.9vw,15px); text-transform: uppercase; letter-spacing: .14em; }
.score-panel strong { font-size: clamp(58px,7vw,116px); line-height: .9; font-variant-numeric: tabular-nums; }
.score-panel small { color: var(--lime); font-size: clamp(13px,1.3vw,22px); }
.table-panel { border: 1px solid #dce1d8; border-radius: 16px; background: white; padding: 3vh 2vw; }
.table-panel h1 { margin: 0 0 2vh; font-size: clamp(22px,2vw,34px); }
.stats-row { display: grid; grid-template-columns: 1.5fr repeat(4,1fr); padding: 2.2vh 1vw; border-top: 1px solid #e8ece6; font-size: clamp(11px,1.1vw,19px); }
.stats-row.header { color: #737e74; font-size: .78em; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }

.softoff-player { width: 100%; height: 100%; display: grid; place-items: center; background: #000; color: #303630; text-align: center; }
.softoff-player strong { display: block; color: #515951; font-size: clamp(18px,2vw,32px); }
.softoff-player span { display: block; margin-top: 1vh; font-size: clamp(9px,.8vw,13px); }

.remote-image-player, .remote-video-player, .remote-website-player { position: relative; width: 100%; height: 100%; overflow: hidden; background: #000; }
.remote-image-player img, .remote-video-player video { display: block; width: 100%; height: 100%; }
.remote-video-player video { object-fit: contain; }
.remote-website-player iframe { width: calc(100% / var(--page-zoom,1)); height: calc(100% / var(--page-zoom,1)); border: 0; background: white; transform: scale(var(--page-zoom,1)); transform-origin: 0 0; }
.setup-status.offline { color: #e6b35a; }
.setup-status.offline i { background: #e6b35a; box-shadow: 0 0 12px rgba(230,179,90,.55); }

.demo-dock { position: fixed; z-index: 50; left: 50%; bottom: 16px; transform: translate(-50%,8px); display: flex; align-items: center; gap: 4px; padding: 5px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(8,13,9,.82); box-shadow: 0 12px 38px rgba(0,0,0,.35); backdrop-filter: blur(16px); opacity: .22; transition: .2s ease; }
.demo-dock:hover, .demo-dock:focus-within { opacity: 1; transform: translate(-50%,0); }
.demo-dock > span { padding: 0 8px; color: #829086; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.demo-dock button { border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: #aeb9b0; font-size: 10px; cursor: pointer; }
.demo-dock button:hover, .demo-dock button.is-active { background: #294a36; color: white; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .65; } }
@keyframes expand { 50% { transform: scale(1.05); opacity: .5; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 75% { transform: scale(1.08); } }

@media (max-width: 700px) {
  .setup-card { width: 88vw; }
  .setup-brand { margin-bottom: 5vh; }
  .device-footer span:nth-child(2) { display: none; }
  .demo-dock { max-width: 94vw; overflow-x: auto; justify-content: flex-start; }
  .demo-dock > span { display: none; }
}

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