@font-face { font-family: Anton; src: url(/static/fonts/Anton-Regular.ttf); }
@font-face { font-family: Chakra; src: url(/static/fonts/ChakraPetch-Regular.ttf); font-weight: 400; }
@font-face { font-family: Chakra; src: url(/static/fonts/ChakraPetch-SemiBold.ttf); font-weight: 600; }
@font-face { font-family: Chakra; src: url(/static/fonts/ChakraPetch-Bold.ttf); font-weight: 700; }

:root {
  --ink: #0A0A0D; --panel: #17171E; --panel-hi: #202029; --line: #2C2C37;
  --volt: #FFE600; --volt-deep: #FFB800; --spark: #FFF7B0; --text: #F5F3EA; --muted: #9C9AA6;
  --good: #B6FF3B; --bad: #FF3D5A;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); }
body {
  font: 600 20px/1.3 Chakra, system-ui, sans-serif;
  background: radial-gradient(900px 500px at 85% -10%, rgba(255,184,0,.16), transparent 60%), var(--ink);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-20deg, transparent 0 160px, rgba(255,230,0,.04) 160px 161px);
}

/* Laid out on a 1280×720 canvas and scaled to the screen, like the app's TV view. */
#stage, .stage-copy { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; padding: 32px; transform-origin: 0 0; }

.head { font: 400 56px/1 Anton, Impact, sans-serif; letter-spacing: 3px; text-transform: uppercase; }
.volt { color: var(--volt); }
.muted { color: var(--muted); }
.label { font-weight: 700; font-size: 22px; letter-spacing: 4px; color: var(--muted); text-transform: uppercase; }
.cut { clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px); }
.bolt { filter: drop-shadow(0 0 18px rgba(255,230,0,.7)); }
.row { display: flex; gap: 40px; height: 100%; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.center { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; }

.logo { display: flex; align-items: center; gap: 14px; }
.logo b {
  font: italic 400 96px/1 Anton, Impact, sans-serif; letter-spacing: 2px; padding: 4px .2em 4px 0;
  background: linear-gradient(180deg, var(--volt), var(--volt-deep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 20px rgba(255,230,0,.4));
}
.logo.small b { font-size: 36px; }

.code {
  font: 400 84px/1 Anton, Impact, sans-serif; letter-spacing: 18px; color: var(--volt); padding: 14px 22px 14px 40px;
  background: var(--panel); border: 2px solid var(--volt); box-shadow: 0 0 30px rgba(255,230,0,.35);
  text-shadow: 0 0 20px rgba(255,230,0,.6);
}
.chips { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.chip { background: var(--panel); border: 2px solid rgba(255,230,0,.5); padding: 10px 20px; font-size: 26px; font-weight: 700; }
.chip.off { opacity: .45; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.team-col { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; background: rgba(23,23,30,.94); border-top: 5px solid var(--team); min-height: 120px; }
.team-name { font: 400 32px/1 Anton, Impact, sans-serif; letter-spacing: 3px; text-transform: uppercase; color: var(--team); }
.team-col .chip { border-color: var(--team); font-size: 22px; padding: 6px 16px; }
.team-col .muted { font-size: 18px; font-weight: 400; }

.progress { padding: 12px 22px; text-align: center; background: var(--panel); border: 3px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.progress.done { border-color: var(--good); box-shadow: 0 0 22px rgba(182,255,59,.45); }
.progress .name { font-size: 26px; font-weight: 700; }
.progress .dots { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.progress .dots i { width: 26px; height: 26px; border: 3px solid var(--line); border-radius: 50%; }
.claims { display: flex; gap: 16px; justify-content: center; }
.claims div { padding: 8px 18px; background: var(--panel); border: 2px solid var(--line); color: var(--muted); font-size: 22px; font-weight: 700; }
.claims div.on { border-color: var(--volt); color: var(--volt); }
.claim-flash { height: 100px; display: flex; align-items: center; justify-content: center; }
.claim-flash b { padding: 16px 32px; background: var(--volt); color: var(--ink); font: 44px Anton, sans-serif; letter-spacing: 2px; box-shadow: 0 0 40px rgba(255,230,0,.7); }
.claim-flash b.new { animation: pop .5s cubic-bezier(.34,1.56,.64,1) both; }
.progress .dots i.on { border: 0; border-radius: 0; background: var(--volt); clip-path: polygon(62% 0, 12% 58%, 46% 58%, 34% 100%, 88% 38%, 53% 38%); filter: drop-shadow(0 0 6px var(--volt)); }

.eq { display: flex; align-items: flex-end; gap: 6px; height: 220px; }
.eq i { width: 18px; height: 100%; background: linear-gradient(0deg, var(--volt-deep), var(--volt), var(--spark)); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite alternate; box-shadow: 0 0 12px rgba(255,230,0,.35); }
@keyframes eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }

.timer { display: flex; align-items: center; gap: 12px; width: 900px; }
.timer .track { flex: 1; height: 22px; background: var(--panel-hi); }
.timer .fill { height: 100%; background: linear-gradient(90deg, var(--volt-deep), var(--volt)); box-shadow: 0 0 16px rgba(255,230,0,.5); }
.timer.urgent .fill { background: linear-gradient(90deg, var(--bad), #FF8A1F); }
.timer .secs { width: 130px; text-align: right; font: 400 64px/1 Anton, Impact, sans-serif; color: var(--volt); }
.timer.urgent .secs { color: var(--bad); }
.count { font: 400 320px/1 Anton, Impact, sans-serif; color: var(--volt); text-shadow: 0 0 60px rgba(255,230,0,.7); }

.cover { width: 300px; height: 300px; object-fit: cover; border: 2px solid var(--volt); box-shadow: 0 0 40px rgba(255,230,0,.5); background: var(--panel-hi); }
.year { font: 400 130px/1 Anton, Impact, sans-serif; letter-spacing: 8px; color: var(--volt); text-shadow: 0 0 40px rgba(255,230,0,.7); margin-top: 24px; }
.title { font-size: 40px; font-weight: 700; text-align: center; }
.artist { font-size: 30px; color: var(--muted); text-align: center; font-weight: 400; }
.credit { font-size: 18px; color: var(--muted); margin-top: 12px; font-weight: 400; }

.board { width: 100%; max-height: 656px; overflow: hidden; }
.score { display: flex; align-items: center; gap: 16px; margin: 6px 0; padding: 12px 18px; background: rgba(23,23,30,.94); border: 1px solid var(--line); }
.score .rank { width: 46px; height: 46px; display: grid; place-items: center; font: 400 26px/1 Anton, Impact, sans-serif; background: var(--panel-hi); color: var(--muted); }
.score .rank.m0 { background: var(--volt); color: var(--ink); }
.score .rank.m1 { background: #D9D9E3; color: var(--ink); }
.score .rank.m2 { background: #E09B5A; color: var(--ink); }
.score .team { width: 8px; height: 40px; }
.score .who { flex: 1; min-width: 0; }
.score .who b { display: block; font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score .plus { color: var(--good); font-size: 24px; font-weight: 700; }
.score .pts { font: 400 40px/1 Anton, Impact, sans-serif; color: var(--volt); min-width: 70px; text-align: right; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; padding: 2px 8px; border: 1px solid; text-transform: uppercase; }

.winner { font: 400 110px/1 Anton, Impact, sans-serif; letter-spacing: 4px; text-align: center; text-transform: uppercase;
  background: linear-gradient(180deg, var(--volt), var(--volt-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.award { background: rgba(23,23,30,.94); border: 1px solid var(--line); padding: 12px 14px; }
.award small { display: block; color: var(--volt); font-size: 14px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; }
.award b { display: block; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.award span { color: var(--muted); font-size: 16px; font-weight: 400; }

.message { position: absolute; left: 32px; right: 32px; bottom: 24px; text-align: center; color: var(--ink); background: var(--volt); padding: 10px; font-weight: 700; }

form { display: flex; flex-direction: column; align-items: center; gap: 20px; }
input.code { width: 420px; text-align: center; text-transform: uppercase; outline: none; font-family: Anton, Impact, sans-serif; }
input.code::placeholder { color: rgba(255,230,0,.25); }
button {
  font: 400 30px/1 Anton, Impact, sans-serif; letter-spacing: 2px; color: var(--ink); border: 0; padding: 18px 44px; cursor: pointer;
  background: linear-gradient(180deg, var(--volt), var(--volt-deep)); box-shadow: 0 0 24px rgba(255,230,0,.4);
}
label.toggle { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 20px; }
label.toggle input { width: 22px; height: 22px; accent-color: var(--volt); }
.error { color: var(--bad); min-height: 26px; }

/* Entry animations only when the screen changes, not on every update. */
.enter .pop { animation: pop .6s cubic-bezier(.34,1.56,.64,1) both; }
.enter .slide { animation: slide .45s ease-out both; }
@keyframes pop { from { transform: scale(2.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.enter { animation: flash .5s ease-out; }

/* reveal: a bolt splits the round screen, the halves fly apart */
.strike { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.strike .half { position: absolute; inset: 0; overflow: hidden; animation: split-l .9s cubic-bezier(.55,0,.9,.45) .25s forwards;
  background: radial-gradient(900px 500px at 85% -10%, rgba(255,184,0,.16), transparent 60%), var(--ink); }
.strike .half.r { animation-name: split-r; }
.strike svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 6px var(--volt)) drop-shadow(0 0 18px var(--volt));
  clip-path: inset(0 0 100% 0); animation: bolt-down .14s ease-in forwards, fade .22s ease-out .3s forwards; }
.strike polyline { fill: none; stroke: #fff; stroke-width: 6px; stroke-linejoin: miter; vector-effect: non-scaling-stroke; }
.strike polyline.branch { stroke-width: 2.5px; }
.strike canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.strike .bang { position: absolute; inset: 0; background: var(--spark); opacity: 0; animation: bang .4s linear .14s; }
@keyframes split-l { to { transform: translateX(-85vw); } }
@keyframes split-r { to { transform: translateX(85vw); } }
@keyframes bolt-down { to { clip-path: inset(0 0 0 0); } }
@keyframes fade { to { opacity: 0; } }
@keyframes bang { 0% { opacity: .55; } 15% { opacity: .18; } 30% { opacity: .5; } 100% { opacity: 0; } }
@keyframes flash { from { box-shadow: inset 0 0 0 2000px rgba(255,230,0,.18); } to { box-shadow: none; } }
