:root {
  --ink: #2b1d0e;
  --ink-soft: #6b5640;
  --parchment: #fbf3e2;
  --parchment-deep: #eddcb8;
  --gold: #e8a923;
  --ember: #d4562a;
  --ember-deep: #9c3814;
  --light: #fff6e2;
  --good: #2f8a4a;
  --bad: #b8432f;
  --radius: 16px;
  --ease-out: cubic-bezier(.2, .9, .3, 1);
  --ease-spring: cubic-bezier(.3, 1.45, .55, 1);
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100dvh; background: #120d0a; overflow-x: hidden; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sans { font-family: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif; }
#app { position: relative; z-index: 1; }

/* ---------- sky: the pit brightens into dawn, one step per round ---------- */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky .l { position: absolute; inset: 0; opacity: 0; transition: opacity 2.2s ease; }
.sky .l0 {
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8 50%, transparent), radial-gradient(1px 1px at 28% 8%, #fff9 50%, transparent),
    radial-gradient(1.5px 1.5px at 47% 22%, #fff7 50%, transparent), radial-gradient(1px 1px at 66% 12%, #fffa 50%, transparent),
    radial-gradient(1.5px 1.5px at 81% 27%, #fff6 50%, transparent), radial-gradient(1px 1px at 92% 6%, #fff9 50%, transparent),
    radial-gradient(1px 1px at 6% 40%, #fff5 50%, transparent), radial-gradient(1px 1px at 58% 38%, #fff5 50%, transparent),
    linear-gradient(#141029 0%, #1d1424 45%, #1a120c 75%, #0d0806 100%);
}
.sky .l1 { background: linear-gradient(#1f1b46 0%, #3b2a58 40%, #6a3b4e 72%, #2a1a10 100%); }
.sky .l2 { background: linear-gradient(#3b3a7a 0%, #8a5a8c 35%, #e0806a 70%, #f3b06a 100%); }
.sky .l3 { background: linear-gradient(#6f8fd0 0%, #e6a9a0 38%, #ffc27a 70%, #ffdf9a 100%); }
.sky .l4 { background: linear-gradient(#8fc3f0 0%, #cfe2f2 40%, #ffe7b8 75%, #fff1cf 100%); }
.sky[data-stage="0"] .l0, .sky[data-stage="1"] .l1, .sky[data-stage="2"] .l2, .sky[data-stage="3"] .l3, .sky[data-stage="4"] .l4 { opacity: 1; }
.sky .sun {
  position: absolute; left: 50%; width: 46vmax; height: 46vmax; margin-left: -23vmax; top: 100%; border-radius: 50%;
  background: radial-gradient(circle, #fff7d6 0%, #ffd77a 22%, rgba(255, 196, 92, .55) 38%, rgba(255, 170, 80, 0) 68%);
  transition: transform 3s var(--ease-out), opacity 2s; opacity: 0;
}
.sky[data-stage="1"] .sun { transform: translateY(-14vh); opacity: .55; }
.sky[data-stage="2"] .sun { transform: translateY(-30vh); opacity: .8; }
.sky[data-stage="3"] .sun { transform: translateY(-52vh); opacity: .95; }
.sky[data-stage="4"] .sun { transform: translateY(-82vh); opacity: 1; }
.sky .motes {
  position: absolute; inset: -50% 0 0; opacity: .5;
  background-image:
    radial-gradient(2px 2px at 10% 20%, #ffe9b5, transparent), radial-gradient(1.5px 1.5px at 35% 60%, #ffe9b5, transparent),
    radial-gradient(2px 2px at 70% 35%, #ffe9b5, transparent), radial-gradient(1.5px 1.5px at 85% 80%, #ffe9b5, transparent),
    radial-gradient(1px 1px at 55% 90%, #ffe9b5, transparent);
  background-size: 320px 320px; animation: drift 40s linear infinite;
}
@keyframes drift { to { transform: translateY(33%); background-position: 80px 0; } }

/* ---------- shared motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 169, 35, .55); } 50% { box-shadow: 0 0 0 14px rgba(232, 169, 35, 0); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.15) rotate(3deg); } }
.enter { animation: rise .38s var(--ease-out) both; }
.pop { animation: pop .45s var(--ease-spring) both; }
.shake { animation: shake .45s ease; }

/* ---------- player (phone) ---------- */
.phone {
  max-width: 520px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.card {
  position: relative; background: var(--parchment); border-radius: var(--radius); padding: 22px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(107, 86, 64, .14);
}
.brand { text-align: center; color: var(--light); margin: 10px 0 18px; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.brand h1 { font-size: 2.3rem; margin: 0; letter-spacing: .01em; }
.brand p { margin: 6px 0 0; opacity: .8; font-size: .92rem; }
.hud { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--light); font-weight: 700; }
.pill { background: rgba(20, 13, 8, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.pill.streak { background: linear-gradient(90deg, #d4562a, #e8a923); }
.pill.streak b { display: inline-block; animation: flicker .8s ease-in-out infinite; }
.pill.top { background: var(--gold); color: var(--ink); }
.hud-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-metrics { display: flex; gap: 6px; flex-shrink: 0; }
.qcount { color: var(--light); font-size: .8rem; font-weight: 700; margin: -4px 0 10px; opacity: .85; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input[type=text] {
  width: 100%; font-size: 1.3rem; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--parchment-deep); background: #fff; color: var(--ink);
}
input[type=text]:focus { outline: none; border-color: var(--gold); }
.btn {
  display: block; width: 100%; margin-top: 14px; padding: 15px; border: none; border-radius: 12px;
  background: var(--ember); color: #fff; font-size: 1.2rem; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 3px 0 var(--ember-deep); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ember-deep); }
.btn:disabled { opacity: .5; }
.err { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; }
.big-emoji { font-size: 3.4rem; text-align: center; line-height: 1; margin: 4px 0 10px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .74rem; color: var(--ember); font-weight: 800; }
.question { font-size: 1.32rem; line-height: 1.35; margin: 10px 0 16px; }
.choices { display: grid; gap: 10px; }
.choice {
  position: relative; text-align: left; padding: 14px 16px 14px 48px; border-radius: 12px; border: 2px solid var(--parchment-deep);
  background: #fff; color: var(--ink); font-size: 1.05rem; line-height: 1.3;
  animation: rise .35s var(--ease-out) both; animation-delay: calc(var(--i) * 70ms + 120ms);
  transition: background .2s, border-color .2s, transform .15s, opacity .3s;
}
.choice::before {
  content: attr(data-letter); position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--parchment-deep); color: var(--ink-soft); font-weight: 800; font-size: .85rem;
}
.choice:active { transform: scale(.98); }
.choice:disabled { cursor: default; }
.choices.locked .choice:not(.right):not(.wrong) { opacity: .45; }
.choice.right { background: #e2f4e6; border-color: var(--good); }
.choice.right::before { content: '✓'; background: var(--good); color: #fff; }
.choice.wrong { background: #f9e0da; border-color: var(--bad); }
.choice.wrong::before { content: '✕'; background: var(--bad); color: #fff; }
.timer { position: relative; height: 10px; border-radius: 99px; background: var(--parchment-deep); overflow: hidden; margin-top: 10px; }
.timer > div { height: 100%; width: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); transform-origin: left; transition: transform .1s linear; }
.timer-label { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-soft); margin-top: 4px; font-weight: 700; letter-spacing: .04em; }
.verdict { font-size: 2.1rem; font-weight: 800; text-align: center; margin: 2px 0; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.points { text-align: center; font-size: 1.15rem; font-weight: 700; }
.ref { font-style: italic; color: var(--ink-soft); text-align: center; margin-top: 10px; }
.note { text-align: center; margin: 8px 0 0; line-height: 1.45; }
.progress { display: flex; gap: 5px; margin: 0 0 12px; }
.progress span { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 246, 226, .22); transition: background .4s; }
.progress span.ok { background: var(--gold); }
.progress span.miss { background: repeating-linear-gradient(45deg, rgba(255, 246, 226, .65) 0 3px, rgba(255, 246, 226, .2) 3px 6px); }
.progress span.skip { background: rgba(255, 246, 226, .35); }
.progress span.now { background: var(--light); animation: glow 1.6s infinite; }
.progress .gap { flex: 0 0 6px; background: none; }
.verse { font-size: 1.12rem; line-height: 1.55; font-style: italic; text-align: center; margin: 14px 0 4px; }
.dots { display: flex; justify-content: center; gap: 10px; margin: 14px 0 6px; }
.dots span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; animation: pop .45s var(--ease-spring) both; animation-delay: calc(var(--i) * 110ms + 200ms); }
.dots .ok { background: var(--good); }
.dots .miss { background: var(--bad); }
.dots .skip, .dots .none { background: #c9b796; }
.eyes { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--light); font-weight: 700; animation: glow 1.8s infinite; }

/* correct-answer burst */
.burst { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 12px; border-radius: 2px; background: var(--c); animation: fly .9s var(--ease-out) forwards; }
@keyframes fly { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
.float-pts { position: absolute; right: 16px; top: 50%; font-weight: 800; color: var(--good); font-size: 1.3rem; pointer-events: none; animation: floatup 1s var(--ease-out) forwards; }
@keyframes floatup { from { transform: translateY(-50%); opacity: 1; } to { transform: translateY(-260%); opacity: 0; } }

/* round title card */
.roundcard { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(12, 8, 6, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .3s both; padding: 24px; }
.roundcard.out { animation: fade .35s reverse both; }
.roundcard .inner { text-align: center; color: var(--light); max-width: 440px; }
.roundcard .num { font-size: .85rem; letter-spacing: .4em; text-transform: uppercase; font-weight: 800; color: var(--gold); animation: track 1s var(--ease-out) both; }
.roundcard .icon { font-size: 4.5rem; margin: 14px 0 4px; animation: pop .6s var(--ease-spring) .15s both; }
.roundcard h2 { font-size: 2.3rem; margin: 6px 0; animation: rise .5s var(--ease-out) .25s both; }
.roundcard p { opacity: .85; line-height: 1.45; animation: rise .5s var(--ease-out) .4s both; }
.roundcard .begin { margin-top: 22px; animation: rise .5s var(--ease-out) .55s both; }
.roundcard small { display: block; margin-top: 12px; opacity: .6; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes track { from { letter-spacing: 1.2em; opacity: 0; } to { letter-spacing: .4em; opacity: 1; } }

/* ---------- host (iPad) ---------- */
.host { padding: 22px 26px; min-height: 100dvh; display: grid; grid-template-columns: 290px 1fr; gap: 24px; }
.host.play { grid-template-columns: 220px 1fr; }
.host aside { display: flex; flex-direction: column; gap: 14px; }
.qr { background: #fffaf0; border-radius: var(--radius); padding: 14px; box-shadow: 0 14px 34px rgba(0, 0, 0, .35); animation: rise .4s var(--ease-out) both; }
.qr svg { width: 100%; height: auto; display: block; }
.qr .url { text-align: center; font-weight: 700; margin-top: 8px; word-break: break-all; font-size: .9rem; }
.controls { display: grid; gap: 10px; }
.controls .btn { margin: 0; font-size: 1.02rem; padding: 13px; }
.btn.secondary { background: var(--parchment); color: var(--ink); box-shadow: 0 3px 0 #b9a27a; }
.btn.ghost { background: rgba(20, 13, 8, .35); color: var(--light); box-shadow: none; border: 1.5px solid rgba(255, 246, 226, .45); }
.btn.go { background: var(--good); box-shadow: 0 3px 0 #1d5a2f; }
.btn.pulse { animation: glow 1.6s infinite; }
.host header { color: var(--light); text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.host header h1 { margin: 0; font-size: 2.4rem; }
.host header p { margin: 2px 0 0; opacity: .8; }
.stat { display: flex; gap: 10px; flex-wrap: wrap; }
.stat div { flex: 1 1 40%; background: rgba(20, 13, 8, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--light); border-radius: 12px; padding: 9px 10px; text-align: center; font-size: .85rem; }
.stat b { display: block; font-size: 1.6rem; }
.roundhead { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 14px 18px; border-radius: var(--radius); background: rgba(20, 13, 8, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--light); }
.roundhead .icon { font-size: 2.4rem; }
.roundhead h2 { margin: 0; font-size: 1.5rem; }
.roundhead .kicker { color: var(--gold); }
.roundhead .ready { margin-left: auto; text-align: right; min-width: 180px; }
.roundhead .ready b { font-size: 1.6rem; }
.meter { height: 8px; border-radius: 8px; background: rgba(255, 246, 226, .2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffe08a); border-radius: 8px; transition: width .8s var(--ease-out); }
.board { margin-top: 14px; display: grid; gap: 9px; }
.lane {
  display: grid; grid-template-columns: 200px 1fr 80px; gap: 12px; align-items: center;
  background: rgba(251, 243, 226, .93); border-radius: 12px; padding: 7px 12px;
}
.lane.new { animation: rise .4s var(--ease-out) both; }
.lane .rank.none { background: transparent; }
.lane .who { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.08rem; min-width: 0; white-space: nowrap; cursor: pointer; background: none; border: none; padding: 0; color: inherit; font-family: inherit; text-align: left; border-radius: 8px; }
.lane .player-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lane.labels { background: none; color: var(--light); font-weight: 700; padding-top: 0; padding-bottom: 0; }
.lane.labels span { text-align: center; font-size: 1rem; text-shadow: 0 1px 6px #0008; }
/* big classes: shorter lanes, two columns so 30 fit on an iPad without scrolling */
.board.many { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.board.many .lane.labels { grid-column: 1 / -1; }
.board.many .lane { grid-template-columns: 130px 1fr 52px; padding: 4px 10px; gap: 8px; }
.board.many .track { height: 26px; }
.board.many .runner { font-size: 1.25rem; }
.board.many .who { font-size: .98rem; }
.board.many .score { font-size: 1.05rem; }
.lane .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; flex: none; color: #fff; }
.rank.r1 { background: var(--gold); }
.rank.r2 { background: #a9a9a9; }
.rank.r3 { background: #c0834a; }
.track { position: relative; height: 34px; border-radius: 9px; background: linear-gradient(90deg, #2a1d14 0%, #6b4128 35%, #cf8a52 70%, #ffd58a 100%); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35); }
.track .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 250, 240, .3); }
.track .tick.open { background: var(--light); box-shadow: 0 0 8px var(--light); }
.track .runner { position: absolute; top: 50%; font-size: 1.6rem; transition: left .7s var(--ease-spring), transform .7s var(--ease-spring); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.lane.lead .runner { filter: drop-shadow(0 0 8px #ffd76a) drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.lane .score { text-align: right; font-weight: 800; font-size: 1.25rem; }
.lane .fire { font-size: .95rem; }
.lane.ready .who::after { content: ' ✓'; color: var(--good); }
.lane.done .who::after { content: ' 🌅'; }
.lobby-names { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.lobby-names button, .everyone button { background: var(--parchment); border: none; color: var(--ink); font-family: inherit; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 1.12rem; cursor: pointer; }
.lobby-names button.new { animation: pop .5s var(--ease-spring) both; }
.lobby-names button.armed, .everyone button.armed, .podium > button.armed, .lane .who.armed { background: var(--bad); color: #fff; }
.empty { color: var(--light); font-size: 1.3rem; margin-top: 26px; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.hint { color: var(--light); opacity: .7; margin-top: 10px; }
.keygate { max-width: 420px; margin: 15vh auto; }

/* round reveal */
.reveal { margin-top: 14px; background: var(--parchment); border-radius: var(--radius); padding: 22px 26px; box-shadow: 0 18px 40px rgba(0, 0, 0, .38); animation: rise .45s var(--ease-out) both; }
.reveal h3 { margin: 0 0 14px; font-size: 1.4rem; }
.rq { display: grid; grid-template-columns: 1fr 110px; gap: 6px 16px; align-items: center; margin: 0 0 6px; padding: 6px 10px; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 2px solid transparent; border-radius: 12px; animation: rise .4s var(--ease-out) both; animation-delay: calc(var(--i) * 140ms); }
.rq.on { border-color: var(--gold); background: #fff8e6; }
.rq p { margin: 0; font-size: 1.3rem; line-height: 1.3; }
.rq p small { display: block; color: var(--good); font-weight: 700; margin-top: 2px; }
.rq .bar { grid-column: 1; height: 14px; border-radius: 8px; background: var(--parchment-deep); overflow: hidden; }
.rq .bar i { display: block; height: 100%; width: var(--w); border-radius: 8px; background: linear-gradient(90deg, var(--good), #6cc184); animation: grow 1.1s var(--ease-out) both; animation-delay: calc(var(--i) * 140ms + 250ms); }
.rq .bar i.low { background: linear-gradient(90deg, var(--ember), var(--gold)); }
.rq .pct { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 800; font-size: 2rem; line-height: 1.1; }
.rq .pct small { display: block; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
@keyframes grow { from { width: 0; } }
.discuss { margin-top: 18px; padding: 16px 18px; border-left: 5px solid var(--gold); background: #fff8e6; border-radius: 0 12px 12px 0; font-size: 1.65rem; line-height: 1.4; font-style: italic; animation: rise .5s var(--ease-out) .7s both; }
.discuss .kicker { font-style: normal; display: block; margin-bottom: 4px; }

/* banner sweeping across the dashboard when a round opens */
.banner { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; }
.banner > div { background: linear-gradient(90deg, transparent, rgba(12, 8, 6, .85) 15%, rgba(12, 8, 6, .85) 85%, transparent); color: var(--light); width: 100%; text-align: center; padding: 26px 0; animation: sweep 2.6s var(--ease-out) both; }
.banner .kicker { color: var(--gold); font-size: 1rem; }
.banner h2 { margin: 4px 0 0; font-size: 3rem; }
@keyframes sweep { 0% { transform: translateX(-100%); } 18%, 78% { transform: none; } 100% { transform: translateX(100%); opacity: 0; } }

/* podium */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 14px 0 12px; min-height: 160px; }
.podium > button { border: none; font-family: inherit; color: var(--ink); background: var(--parchment); border-radius: 14px 14px 0 0; width: 180px; text-align: center; padding: 14px 8px; box-shadow: 0 16px 34px rgba(0, 0, 0, .35); transform-origin: bottom; animation: riseup 1s var(--ease-spring) both; cursor: pointer; }
.podium > button:nth-child(1) { animation-delay: .5s; }
.podium > button:nth-child(2) { animation-delay: 1.1s; background: linear-gradient(#fff2c4, var(--parchment)); }
.podium > button:nth-child(3) { animation-delay: .2s; }
@keyframes riseup { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }
.podium .e { font-size: 2.4rem; }
.podium .n { font-weight: 800; font-size: 1.15rem; overflow-wrap: anywhere; }
.podium .medal { font-size: 2rem; }
.everyone { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.everyone button { background: rgba(251, 243, 226, .9); padding: 6px 12px; font-size: 1rem; animation: rise .4s var(--ease-out) both; animation-delay: calc(1.6s + var(--i) * 50ms); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (max-width: 820px) {
  .host, .host.play { grid-template-columns: 1fr; }
  .lane { grid-template-columns: 120px 1fr 60px; }
  .roundhead .ready { min-width: 120px; }
}

/* ---------- scripture drawer ---------- */
.read {
  background: none; border: 1.5px solid var(--parchment-deep); color: var(--ink-soft); border-radius: 999px;
  padding: 7px 14px; margin-top: 12px; font-size: .92rem; min-height: 44px;
}
.read:active { background: var(--parchment-deep); }
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 13, 8, .55); opacity: 0; transition: opacity .25s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 92vw);
  background: var(--parchment); display: flex; flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, .35); transform: translateX(100%); transition: transform .3s var(--ease-out);
}
.drawer-wrap.open .drawer { transform: none; }
.drawer-wrap.open .drawer-backdrop { opacity: 1; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--parchment-deep); padding-top: max(12px, env(safe-area-inset-top)); }
.drawer-title { font-weight: 700; flex: 1; }
.drawer-tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.drawer-tabs button { border: 1.5px solid var(--parchment-deep); background: #fff; border-radius: 999px; padding: 6px 12px; white-space: nowrap; color: var(--ink); min-height: 44px; }
.drawer-tabs button.on { background: var(--ember); border-color: var(--ember); color: #fff; }
.drawer-close { border: none; background: none; font-size: 1.4rem; padding: 4px 8px; color: var(--ink-soft); min-width: 44px; min-height: 44px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 18px 18px; -webkit-overflow-scrolling: touch; }
.drawer-body h3 { margin: 14px 0 6px; }
.drawer-body .heading { font-style: italic; color: var(--ink-soft); line-height: 1.45; margin: 0 0 12px; }
body.locked { overflow: hidden; }
.drawer-body .vs { line-height: 1.55; margin: 0 0 10px; font-size: 1.05rem; }
.drawer-body .vs sup { color: var(--ember); font-weight: 700; font-size: .7rem; }
.drawer-body .vs.mark { background: #fbe3a6; border-radius: 6px; padding: 4px 6px; margin-left: -6px; margin-right: -6px; }
.drawer-src { font-size: .75rem; color: var(--ink-soft); text-align: center; margin: 0; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--parchment-deep); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .sky .motes, .confetti, .burst { display: none; }
}

/* bright dawn sky (rounds 4 and finish): exposed text switches to dark ink */
.sky:is([data-stage="3"], [data-stage="4"]) ~ #app :is(.brand, .host header, .empty, .hint, .qcount, .lane.labels, .lane.labels span) { color: var(--ink); text-shadow: 0 1px 8px rgba(255, 246, 226, .7); }
.sky:is([data-stage="3"], [data-stage="4"]) ~ #app .btn.ghost { color: var(--ink); border-color: rgba(43, 29, 14, .45); background: rgba(255, 250, 240, .45); }
@media (max-width: 360px) { .hud .pill { padding: 6px 9px; } .pill.streak { display: none; } }
/* small phones (320px): keep all four answers and the lookup within reach */
@media (max-width: 360px) {
  .phone { padding-left: 10px; padding-right: 10px; }
  .card { padding: 16px 14px; }
  .question { font-size: 1.15rem; margin: 6px 0 12px; }
  .choice { padding: 11px 12px 11px 44px; font-size: 1rem; }
  .choices { gap: 8px; }
  .timer-label { font-size: .68rem; letter-spacing: .02em; }
}
.toast, .offline { position: fixed; left: 50%; transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); max-width: 90vw; }
.toast { bottom: 24px; background: var(--bad); color: #fff; }
.offline { top: 12px; background: #fff3c4; color: var(--ink); }
.qr .warn { margin-top: 8px; font-size: .8rem; font-weight: 700; color: var(--bad); background: #fff3e8; border-radius: 8px; padding: 6px 8px; }

.linkbtn { background: none; border: none; color: var(--ink-soft); text-decoration: underline; font-size: inherit; font-weight: 700; padding: 10px; min-height: 44px; cursor: pointer; }
.sheet-wrap { position: fixed; inset: 0; z-index: 55; background: rgba(12, 8, 6, .55); display: grid; place-items: center; padding: 20px; animation: fade .2s both; }
.sheet { background: var(--parchment); color: var(--ink); border-radius: 18px; padding: 22px; width: min(420px, 100%); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); text-align: center; }
.sheet h3 { margin: 0 0 4px; font-size: 1.6rem; }
.sheet .btn { margin-top: 10px; }
.paircode { font-size: 3.6rem; font-weight: 800; letter-spacing: .2em; margin: 6px 0; font-variant-numeric: tabular-nums; }
.sheet input { text-align: center; font-size: 1.6rem; letter-spacing: .2em; }
.sheet .btn.danger { background: var(--bad); }
.sheet .btn.danger.armed { outline: 3px solid var(--gold); }
.sheet .btn.ghost { color: var(--ink); background: transparent; border-color: rgba(43, 29, 14, .35); }
.controls .signout { color: var(--light); opacity: .85; justify-self: center; }
.sky:is([data-stage="3"], [data-stage="4"]) ~ #app .controls .signout { color: var(--ink); }
