/* The race stage. Everything is sized in "em" so the same layout scales from a phone
   to a 1920×1080 YouTube Live frame. stage.js sets the root font-size from the stage width. */
.stage {
  position: relative; overflow: hidden; color: var(--text); font-family: 'Outfit', sans-serif;
  background:
    radial-gradient(60em 30em at 80% -10%, rgba(0, 229, 255, .18), transparent 60%),
    radial-gradient(50em 30em at 0% 110%, rgba(34, 224, 122, .14), transparent 60%),
    #040b1f;
  border: .22em solid var(--green); border-radius: 1em; display: flex; flex-direction: column;
  box-shadow: 0 0 2em rgba(0, 229, 255, .25);
}
.stage:not(.compact) { aspect-ratio: 16 / 9; width: 100%; }
.stage.flat { border-radius: 0; border-width: .3em; }

.st-top { display: flex; align-items: center; gap: 1em; padding: .7em 1.2em; border-bottom: .12em solid rgba(34, 224, 122, .5); background: rgba(0, 229, 255, .06); }
.st-brand { font-size: 1.45em; font-weight: 800; white-space: nowrap; }
.st-brand b { color: var(--cyan); }
.st-title { margin-left: .5em; color: var(--gold); font-weight: 700; }
.st-meta { flex: 1; text-align: center; font-size: 1.15em; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-meta b { color: var(--text); }
.st-timer { position: relative; width: 15em; height: 1.9em; background: #0a1d44; border-radius: 1em; overflow: hidden; border: .1em solid var(--cyan); flex: none; }
.st-timer-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); }
.st-timer.low .st-timer-fill { background: linear-gradient(90deg, var(--red), var(--gold)); }
.st-timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05em; text-shadow: 0 1px 3px #000; }

.st-main { flex: 1; display: grid; grid-template-columns: 57fr 43fr; gap: 1em; padding: 1em; min-height: 0; }
.st-card {
  background: linear-gradient(180deg, rgba(15, 35, 80, .96), rgba(8, 20, 50, .96)); border: .15em solid rgba(0, 229, 255, .55);
  border-radius: 1em; padding: 1.1em 1.3em; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.st-race {
  position: relative; border: .15em solid rgba(34, 224, 122, .6); border-radius: 1em; display: flex; flex-direction: column; overflow: hidden; min-height: 0;
  background: linear-gradient(180deg, #0b0f3a 0%, #0a1a40 60%, #0b2c2a 100%);
}
.st-moon { text-align: center; font-size: 1.2em; font-weight: 800; color: var(--gold); padding: .3em; border-bottom: .12em dashed rgba(255, 201, 60, .6); letter-spacing: .1em; }
.st-teams { display: flex; gap: .5em; justify-content: center; flex-wrap: wrap; padding: .35em .5em 0; font-size: .95em; }
.st-teams .tm { background: rgba(255, 201, 60, .12); border: .08em solid rgba(255, 201, 60, .5); border-radius: 1em; padding: .1em .6em; font-weight: 700; }
.st-teams .tm b { color: var(--gold); }
.st-lanes { flex: 1; display: flex; gap: .4em; padding: .5em .6em .6em; min-height: 0; }
.st-empty { margin: auto; color: var(--muted); font-size: 1.2em; text-align: center; }

.lane { flex: 1; display: flex; flex-direction: column; min-width: 0; transition: opacity .3s; }
.lane .track {
  position: relative; flex: 1; border-radius: .6em; min-height: 6em;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 .08em, transparent .08em 2.4em);
  border: .08em solid rgba(0, 229, 255, .2); transition: box-shadow .3s;
}
.lane.locked .track { box-shadow: inset 0 0 1.2em rgba(34, 224, 122, .55); border-color: rgba(34, 224, 122, .7); }
.rocket {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; transition: bottom 1.4s cubic-bezier(.2, .8, .2, 1);
}
.r-ship { font-size: 2.5em; line-height: 1; transform: rotate(-45deg); filter: drop-shadow(0 0 .25em rgba(0, 229, 255, .8)); }
.r-av { font-size: 1.35em; line-height: 1; margin-top: -.1em; }
.r-flame { width: .5em; height: .9em; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; background: radial-gradient(circle at 50% 30%, #fff 0 15%, var(--gold) 40%, #ff6a00 80%); opacity: 0; margin-top: -.1em; }
.lane.boost .r-flame { opacity: 1; animation: flame .15s infinite alternate; }
@keyframes flame { from { transform: scaleY(.8); } to { transform: scaleY(1.25); } }
.r-badge { position: absolute; top: -1.5em; font-weight: 800; font-size: 1.15em; white-space: nowrap; opacity: 0; transform: translateY(.4em); transition: all .35s; }
.r-badge.show { opacity: 1; transform: none; }
.r-badge.ok { color: var(--green); } .r-badge.no { color: var(--red); }
.lane-foot { text-align: center; padding: .35em .1em 0; line-height: 1.2; }
.lane-foot .nm { font-weight: 800; font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-foot .sc { color: var(--gold); font-weight: 800; font-size: 1.35em; font-variant-numeric: tabular-nums; }
.lane-foot .sub { font-size: .8em; color: var(--muted); white-space: nowrap; }
.lane-foot .sup { color: var(--pink); }
.lane.lead .nm::before { content: '👑 '; }
.lane.off { opacity: .45; }
.lane .lock { display: inline-block; min-width: 1em; }

.st-bottom { display: flex; gap: 1em; align-items: center; padding: .5em 1.2em; border-top: .12em solid rgba(34, 224, 122, .5); font-size: 1.05em; background: rgba(0, 0, 0, .28); }
.st-info { white-space: nowrap; }
.st-info b { color: var(--gold); }
.st-feed { flex: 1; overflow: hidden; white-space: nowrap; text-align: right; color: var(--muted); }
.st-feed span { margin-left: 1.2em; }
.st-feed span b { color: var(--text); }

/* Question card */
.q-sub { color: var(--cyan); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 1em; }
.q-text { font-size: 1.85em; font-weight: 700; margin: .25em 0 .5em; line-height: 1.22; }
.q-code { background: #020817; border: .1em solid #1d4b8f; border-radius: .6em; padding: .55em .9em; font-size: 1.2em; line-height: 1.38; margin: 0 0 .6em; white-space: pre; overflow: auto; color: #b6f5ff; }
.q-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; margin-top: auto; }
.q-ch { position: relative; border-radius: .7em; padding: .5em .7em; font-size: 1.35em; font-weight: 700; background: #102a5c; border: .12em solid rgba(0, 229, 255, .35); display: flex; gap: .5em; align-items: center; min-height: 2.5em; transition: all .3s; }
.q-ch .L { display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; border-radius: .4em; background: var(--cyan); color: #04223a; font-weight: 800; flex: none; }
.q-ch .tx { min-width: 0; overflow-wrap: anywhere; }
.q-ch.ok { background: linear-gradient(180deg, #1bb066, #0e7a45); border-color: var(--green); box-shadow: 0 0 1em rgba(34, 224, 122, .5); }
.q-ch.ok .L { background: var(--gold); }
.q-ch.dim { opacity: .4; }
.q-ch .picks { margin-left: auto; font-size: .85em; white-space: nowrap; }
.q-foot { margin-top: .6em; color: var(--muted); font-weight: 600; font-size: 1.05em; }

/* Lobby / countdown / finish cards */
.lob { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; flex: 1; gap: .3em; }
.lob-code { font-size: 4.6em; font-weight: 800; letter-spacing: .12em; color: var(--gold); text-shadow: 0 0 .3em rgba(255, 201, 60, .5); line-height: 1; }
.lob-url { font-size: 1.3em; color: var(--muted); }
.lob-url b { color: var(--cyan); }
.pred { width: 100%; max-width: 30em; margin-top: .8em; }
.pred-title { font-weight: 800; color: var(--cyan); font-size: 1.15em; margin-top: .6em; }
.pbar { display: flex; align-items: center; gap: .5em; margin: .3em 0; font-weight: 600; }
.pbar .nm { width: 8em; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .bar { flex: 1; height: .8em; background: #0a1d44; border-radius: 1em; overflow: hidden; }
.pbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: 1em; transition: width .6s; }
.pbar .pc { width: 3em; text-align: right; color: var(--gold); }
.big-count { font-size: 9em; font-weight: 800; color: var(--gold); text-align: center; margin: auto; text-shadow: 0 0 .2em rgba(255, 201, 60, .6); line-height: 1; }
.ready { text-align: center; font-size: 1.8em; font-weight: 800; color: var(--cyan); }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: .8em; margin: auto 0 .6em; }
.pod { text-align: center; width: 9em; }
.pod .av { font-size: 2.6em; }
.pod .nm { font-weight: 800; font-size: 1.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .sc { color: var(--gold); font-weight: 800; }
.pod .blk { margin-top: .3em; border-radius: .6em .6em 0 0; display: flex; align-items: center; justify-content: center; font-size: 2em; font-weight: 800; color: #04223a; }
.pod.p1 .blk { height: 4em; background: linear-gradient(180deg, #ffe08a, #ffb300); }
.pod.p2 .blk { height: 2.8em; background: linear-gradient(180deg, #e8f4ff, #9fb7cc); }
.pod.p3 .blk { height: 2em; background: linear-gradient(180deg, #ffc79a, #d9813f); }
.fin-title { text-align: center; font-size: 2em; font-weight: 800; color: var(--gold); }
.fin-note { text-align: center; color: var(--muted); font-size: 1.1em; margin-top: .2em; }

.st-float { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bubble { position: absolute; bottom: 4em; padding: .3em .8em; border-radius: 1em; background: rgba(255, 201, 60, .96); color: #2a1a00; font-weight: 800; font-size: 1.1em; white-space: nowrap; animation: floatUp 3.2s ease-out forwards; box-shadow: 0 .3em 1em rgba(0, 0, 0, .4); }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translateY(-1em) scale(1); } 100% { transform: translateY(-16em); opacity: 0; } }
.st-pause { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 4em; font-weight: 800; background: rgba(2, 8, 23, .65); color: var(--gold); }
.stage.paused .st-pause { display: flex; }

/* Phone layout for the watch link */
.stage.compact { font-size: 13px; }
.stage.compact .st-top { flex-wrap: wrap; padding: .6em .8em; gap: .5em; }
.stage.compact .st-brand { font-size: 1.2em; }
.stage.compact .st-meta { order: 3; flex-basis: 100%; text-align: left; font-size: 1em; }
.stage.compact .st-timer { width: 9em; margin-left: auto; }
.stage.compact .st-main { grid-template-columns: 1fr; }
.stage.compact .st-race { height: 22em; order: -1; }
.stage.compact .q-text { font-size: 1.45em; }
.stage.compact .q-choices { grid-template-columns: 1fr; }
.stage.compact .q-ch { font-size: 1.15em; }
.stage.compact .lob-code { font-size: 3.2em; }
.stage.compact .st-bottom { flex-direction: column; align-items: flex-start; gap: .2em; }
.stage.compact .st-feed { text-align: left; }
.stage.compact .st-info { white-space: normal; }
