/* Bazing-ga! design system: a loud, warm 1970s TV game show. See DESIGN.md.
   Host (TV) uses body.tv (rem scales with the viewport so 720p and 1080p read the same from the couch).
   Phone uses body.phone (thumb-first, 320 px up). Landing uses body.landing. */

:root {
  --night: #140b34;
  --night-2: #1d1048;
  --plum: #2c1868;
  --plum-2: #3b2283;
  --pink: #ff3d7f;
  --pink-dk: #c81e5b;
  --yellow: #ffd23f;
  --yellow-dk: #e0a800;
  --cyan: #29e0e8;
  --cyan-dk: #10a9b0;
  --orange: #ff8a3d;
  --green: #4ade80;
  --cream: #fff6e5;
  --ink: #1a0f2e;
  --muted: #b9a8e6;
  --font-display: 'Bungee', 'Arial Black', Impact, sans-serif;
  --font-body: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --radius: 1.1rem;
  --shadow-hard: 0 .3rem 0 var(--ink);
  --ease-pop: cubic-bezier(.2, 1.6, .4, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--night);
  background:
    radial-gradient(120% 80% at 50% 110%, #3a1d86 0%, rgba(58, 29, 134, 0) 60%),
    radial-gradient(80% 60% at 50% -10%, #2a1468 0%, rgba(42, 20, 104, 0) 70%),
    var(--night);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hide { display: none !important; }

/* ---------- Atmosphere: sweeping stage beams + floor glow ---------- */
.beams { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.beams i {
  position: absolute; top: -20vh; width: 40vw; height: 140vh; transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(255, 210, 63, .22), rgba(255, 210, 63, 0) 75%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  filter: blur(6px); mix-blend-mode: screen;
  animation: beam 9s ease-in-out infinite alternate;
}
.beams i:nth-child(1) { left: 2vw; }
.beams i:nth-child(2) { right: 2vw; animation-delay: -4.5s; background: linear-gradient(180deg, rgba(41, 224, 232, .2), rgba(41, 224, 232, 0) 75%); }
.beams i:nth-child(3) { left: 30vw; animation-duration: 13s; background: linear-gradient(180deg, rgba(255, 61, 127, .16), rgba(255, 61, 127, 0) 70%); }
@keyframes beam { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
.beams.hot i { animation-duration: 2.4s; }

/* chase bulbs: a strip of lights that alternate */
.bulbs {
  height: .9rem; background-image: radial-gradient(circle, var(--yellow) 0 .22rem, rgba(255, 210, 63, 0) .3rem);
  background-size: 1.6rem .9rem; animation: chase 1.1s steps(1) infinite;
  filter: drop-shadow(0 0 .35rem rgba(255, 210, 63, .8));
}
.bulbs.alt { background-image: radial-gradient(circle, var(--pink) 0 .22rem, rgba(255, 61, 127, 0) .3rem); filter: drop-shadow(0 0 .35rem rgba(255, 61, 127, .8)); }
@keyframes chase { 0% { background-position: 0 0; } 50% { background-position: .8rem 0; } }

/* ---------- Logo ---------- */
.logo { position: relative; display: inline-flex; flex-direction: column; align-items: center; isolation: isolate; }
.logo-word {
  font-family: var(--font-display); font-size: 4.6rem; line-height: .95; letter-spacing: .02em; color: var(--yellow);
  text-shadow: .06em .06em 0 var(--pink), .12em .12em 0 var(--ink), 0 0 .5em rgba(255, 210, 63, .45);
  transform: rotate(-4deg); white-space: nowrap;
}
.logo-word .dash { color: var(--cyan); }
.logo-word .bang { display: inline-block; color: var(--pink); text-shadow: .06em .06em 0 var(--yellow), .12em .12em 0 var(--ink); animation: bang 2.2s var(--ease-pop) infinite; transform-origin: 50% 90%; }
@keyframes bang { 0%, 70%, 100% { transform: rotate(0) scale(1); } 78% { transform: rotate(14deg) scale(1.25); } 86% { transform: rotate(-8deg) scale(1.05); } }
.logo-burst {
  position: absolute; z-index: -1; left: 50%; top: 46%; width: 2.6em; height: 2.6em; font-size: 4.6rem; margin: -1.3em 0 0 -1.3em;
  background: url(/assets/art/burst.svg) center / contain no-repeat; opacity: .95; animation: spin 40s linear infinite;
}
.logo-burst::after { content: ''; position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, var(--plum-2), var(--night-2)); }
.logo-sub {
  margin-top: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .28em; font-size: .9rem; color: var(--cyan);
  background: var(--ink); padding: .25rem .8rem; border-radius: 99px; transform: rotate(-2deg);
}
.logo.sm .logo-word { font-size: 1.7rem; text-shadow: .05em .05em 0 var(--pink), .1em .1em 0 var(--ink); }
.logo.sm .logo-burst, .logo.sm .logo-sub { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons (buzzers) ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 3.2rem; padding: .8rem 1.6rem; border-radius: 99px;
  background: var(--yellow); color: var(--ink); font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .03em;
  box-shadow: 0 .35rem 0 var(--yellow-dk), 0 .35rem 0 .15rem var(--ink), 0 .8rem 1.4rem rgba(0, 0, 0, .35);
  transition: transform .08s, box-shadow .08s, filter .15s; touch-action: manipulation; user-select: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active, .btn.pressed { transform: translateY(.3rem); box-shadow: 0 .05rem 0 var(--yellow-dk), 0 .05rem 0 .15rem var(--ink), 0 .3rem .6rem rgba(0, 0, 0, .3); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; transform: none; }
.btn.pink { background: var(--pink); color: #fff; box-shadow: 0 .35rem 0 var(--pink-dk), 0 .35rem 0 .15rem var(--ink), 0 .8rem 1.4rem rgba(0, 0, 0, .35); }
.btn.cyan { background: var(--cyan); box-shadow: 0 .35rem 0 var(--cyan-dk), 0 .35rem 0 .15rem var(--ink), 0 .8rem 1.4rem rgba(0, 0, 0, .35); }
.btn.ghost { background: rgba(255, 255, 255, .08); color: var(--cream); box-shadow: inset 0 0 0 .15rem rgba(255, 255, 255, .25); font-family: var(--font-body); font-weight: 900; }
.btn.ghost:active { transform: translateY(.1rem); }
.btn.big { min-height: 4rem; font-size: 1.5rem; padding: 1rem 2.4rem; }
.btn.block { display: flex; width: 100%; }
:focus { outline: none; }
:focus-visible, .tv .focusable:focus { outline: .3rem solid var(--cyan); outline-offset: .3rem; }
.tv .btn:focus { outline: .35rem solid var(--cyan); outline-offset: .35rem; animation: focuspulse 1.2s ease-in-out infinite; }
@keyframes focuspulse { 50% { outline-color: #fff; } }

/* toggles */
.toggle { min-height: 2.6rem; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; padding: .55rem .9rem; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 0; font-weight: 800; color: var(--cream); }
.toggle .knob { width: 2.4rem; height: 1.35rem; border-radius: 99px; background: rgba(255, 255, 255, .2); position: relative; transition: background .2s; flex: none; }
.toggle .knob::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #fff; transition: transform .2s var(--ease-out); }
.toggle[aria-pressed="true"] .knob { background: var(--green); }
.toggle[aria-pressed="true"] .knob::after { transform: translateX(1.05rem); }

/* ---------- Cards ---------- */
.card {
  position: relative; background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 1.2rem 1.4rem;
  box-shadow: 0 .4rem 0 var(--ink), 0 1rem 2rem rgba(0, 0, 0, .35);
}
.panel { background: rgba(255, 255, 255, .06); border: .12rem solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.prompt-card {
  background: var(--cream); color: var(--ink); border-radius: 1.4rem; padding: 1.4rem 2rem; text-align: center;
  font-weight: 900; font-size: 2.2rem; line-height: 1.15; box-shadow: 0 .45rem 0 var(--pink), 0 .45rem 0 .2rem var(--ink), 0 1.4rem 2.4rem rgba(0, 0, 0, .4);
  position: relative;
}
.prompt-card::before {
  content: attr(data-tag); position: absolute; top: -1rem; left: 50%; transform: translateX(-50%) rotate(-2deg);
  background: var(--pink); color: #fff; font-family: var(--font-display); font-size: .9rem; padding: .2rem .9rem; border-radius: 99px; white-space: nowrap;
  box-shadow: 0 .2rem 0 var(--ink);
}
.prompt-card:not([data-tag])::before { display: none; }

/* ---------- Avatars ---------- */
.av {
  --c: var(--pink); width: 2.6rem; height: 2.6rem; flex: none; border-radius: 50%; background: var(--c);
  display: inline-grid; place-items: center; color: var(--ink); font-family: var(--font-display); font-size: 1.2rem;
  box-shadow: 0 .2rem 0 var(--ink), inset 0 -.25rem 0 rgba(0, 0, 0, .18); position: relative;
}
.av[data-shape="1"] { border-radius: .6rem; }
.av[data-shape="2"] { border-radius: 50% 50% .5rem .5rem; }
.av[data-shape="3"] { border-radius: .5rem 50% .5rem 50%; }
.av.off { filter: grayscale(1) brightness(.6); }
.av .tick {
  position: absolute; right: -.35rem; bottom: -.35rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--green);
  color: var(--ink); font-family: var(--font-body); font-weight: 900; font-size: .8rem; display: grid; place-items: center; box-shadow: 0 0 0 .15rem var(--ink);
  animation: popin .35s var(--ease-pop);
}

/* ---------- Motion ---------- */
.rise { animation: rise .55s var(--ease-pop) both; }
.pop { animation: popin .45s var(--ease-pop) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; }
.d5 { animation-delay: .4s; } .d6 { animation-delay: .48s; } .d7 { animation-delay: .56s; } .d8 { animation-delay: .64s; }
@keyframes rise { from { opacity: 0; transform: translateY(1.6rem) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes popin { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slideL { from { opacity: 0; transform: translateX(-30vw) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(30vw) rotate(6deg); } to { opacity: 1; transform: none; } }
@keyframes flipin { from { opacity: 0; transform: perspective(60rem) rotateX(-80deg); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translate(0); } 20% { transform: translate(-.3rem, .15rem) rotate(-.5deg); } 40% { transform: translate(.3rem, -.1rem) rotate(.5deg); } 60% { transform: translate(-.2rem, .1rem); } 80% { transform: translate(.2rem, 0); } }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.6) rotate(-14deg); } 60% { opacity: 1; transform: scale(.92) rotate(-8deg); } 100% { opacity: 1; transform: scale(1) rotate(-8deg); } }
@keyframes breathe { 50% { transform: scale(1.06) rotate(3deg); } }
.shake { animation: shake .12s linear infinite; }

/* ================= TV / HOST ================= */
.tv { font-size: clamp(12px, 1.25vw, 30px); height: 100vh; overflow: hidden; }
@media (max-aspect-ratio: 4/3) { .tv { font-size: clamp(12px, 1.9vw, 30px); } }
.tv-frame { position: relative; z-index: 1; height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.tv-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.6rem .4rem; }
.joinchip {
  display: flex; align-items: center; gap: .9rem; background: var(--ink); border: .15rem solid rgba(255, 255, 255, .18);
  border-radius: 99px; padding: .35rem .5rem .35rem 1.2rem; font-size: 1.05rem;
}
.joinchip b { color: var(--yellow); }
.joinchip .code { font-family: var(--font-display); background: var(--yellow); color: var(--ink); border-radius: 99px; padding: .15rem .8rem; letter-spacing: .12em; font-size: 1.3rem; }
.tv-tools { display: flex; gap: .6rem; }
.iconbtn { min-height: 2.8rem; border: 0; background: rgba(255, 255, 255, .08); color: var(--cream); border-radius: 99px; padding: .55rem 1rem; font-weight: 900; font-size: .95rem; cursor: pointer; }

.screen { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .5rem 3rem; min-height: 0; }
.tv-bottom { padding: .2rem 1.6rem 1rem; display: grid; gap: .6rem; }
.caption {
  justify-self: center; max-width: 70rem; min-height: 2.4rem; text-align: center; font-size: 1.25rem; font-weight: 800;
  color: var(--cream); background: rgba(10, 5, 30, .72); border-radius: .8rem; padding: .35rem 1.2rem; opacity: 0; transition: opacity .25s;
}
.caption.on { opacity: 1; }
.caption::before { content: '🎙 '; }
.strip { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
.strip .who { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .95rem; font-weight: 900; max-width: 7rem; }
.strip .who span { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .who.waiting .av { animation: wobble 1s ease-in-out infinite; }

/* timer ring */
.ring { position: fixed; top: 4.6rem; right: 2rem; z-index: 5; width: 6.5rem; height: 6.5rem; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .bg { stroke: rgba(255, 255, 255, .1); }
.ring .fg { stroke: var(--cyan); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.ring.low .fg { stroke: var(--pink); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 2.2rem; }
.ring.low .num { color: var(--pink); animation: breathe .5s ease-in-out infinite; }

/* lobby */
.lobby { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; width: 100%; max-width: 92rem; }
.lobby .left { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; }
.lobby .left .logo-word, .lobby .left .logo-burst { font-size: 3.8rem; }
.howto { text-align: center; font-size: 1.35rem; }
.howto .url { display: inline-block; margin-top: .3rem; font-family: var(--font-display); color: var(--cyan); font-size: 1.9rem; letter-spacing: .02em; }
.joinrow { display: flex; gap: 2.2rem; align-items: center; }
.qrcard { background: #fff; border-radius: 1.2rem; padding: 1rem 1rem .5rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; box-shadow: 0 .45rem 0 var(--cyan), 0 .45rem 0 .2rem var(--ink), 0 1.2rem 2rem rgba(0, 0, 0, .4); animation: popin .6s var(--ease-pop) .2s both; }
.qrcard svg { width: 13.5rem; height: 13.5rem; display: block; }
.qrcard span { font-family: var(--font-display); color: var(--ink); font-size: 1.05rem; letter-spacing: .04em; }
.joinside { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.joinside .howto { font-size: 1.2rem; }
.joinside .howto .url { font-size: 1.5rem; }
.codetiles { display: flex; gap: .8rem; justify-content: center; }
.codetiles span {
  width: 4.6rem; height: 5.8rem; display: grid; place-items: center; background: var(--cream); color: var(--ink); border-radius: .9rem;
  font-family: var(--font-display); font-size: 3.7rem; box-shadow: 0 .5rem 0 var(--pink), 0 .5rem 0 .2rem var(--ink), 0 1.2rem 2rem rgba(0, 0, 0, .4);
  animation: flipin .7s var(--ease-pop) both;
}
.codetiles span:nth-child(2) { animation-delay: .1s; } .codetiles span:nth-child(3) { animation-delay: .2s; } .codetiles span:nth-child(4) { animation-delay: .3s; }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.seat {
  height: 6.9rem; border-radius: 1.1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem;
  background: rgba(255, 255, 255, .05); border: .15rem dashed rgba(255, 255, 255, .18); font-weight: 900; font-size: 1.05rem; color: var(--muted);
  position: relative;
}
.seat.taken { background: linear-gradient(180deg, var(--plum-2), var(--plum)); border: .15rem solid rgba(255, 255, 255, .22); color: var(--cream); animation: popin .5s var(--ease-pop) both; box-shadow: 0 .35rem 0 var(--ink); }
.seat.taken .av { width: 3rem; height: 3rem; font-size: 1.35rem; }
.seat .nm { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .kick { position: absolute; top: .3rem; right: .3rem; border: 0; background: rgba(0, 0, 0, .3); color: var(--cream); border-radius: 99px; width: 1.8rem; height: 1.8rem; cursor: pointer; font-weight: 900; opacity: .55; }
.seat .kick:focus, .seat .kick:hover { opacity: 1; }
.seat.off { opacity: .55; }
.lobby .controls { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin-top: 1.1rem; }
.lobby .opts { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; font-size: .85rem; max-width: 40rem; }
.need { font-size: 1.1rem; color: var(--muted); }

/* intro title card */
.titlecard { text-align: center; }
.titlecard .burstbg { position: absolute; left: 50%; top: 50%; width: 46rem; height: 46rem; margin: -23rem 0 0 -23rem; background: url(/assets/art/burst.svg) center/contain no-repeat; opacity: .14; animation: spin 30s linear infinite; z-index: -1; }
.titlecard .kicker { font-family: var(--font-display); color: var(--cyan); font-size: 2rem; letter-spacing: .1em; animation: rise .5s var(--ease-pop) both; }
.titlecard .big {
  font-family: var(--font-display); font-size: 10rem; line-height: .95; color: var(--yellow); text-shadow: .05em .05em 0 var(--pink), .1em .1em 0 var(--ink);
  animation: stamp .7s var(--ease-pop) .15s both;
}
.titlecard .sub { margin-top: 1.4rem; font-size: 1.8rem; font-weight: 900; animation: rise .5s var(--ease-pop) .5s both; }
.titlecard .x2 { display: inline-block; margin-left: .6rem; background: var(--pink); color: #fff; padding: .1rem .8rem; border-radius: .6rem; transform: rotate(-4deg); }
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 2.2rem; max-width: 80rem; }
.rules .step { background: var(--cream); color: var(--ink); border-radius: 1.2rem; padding: 1.3rem 1.2rem; text-align: center; font-size: 1.3rem; font-weight: 900; box-shadow: 0 .4rem 0 var(--ink); animation: rise .6s var(--ease-pop) both; }
.rules .step b { display: block; font-family: var(--font-display); font-size: 3rem; color: var(--pink); line-height: 1; margin-bottom: .4rem; }
.rules .step:nth-child(2) { animation-delay: 2s; } .rules .step:nth-child(3) { animation-delay: 4s; }

/* answering */
.writing { display: flex; flex-direction: column; align-items: center; gap: 1.8rem; text-align: center; }
.phonepic { font-size: 7rem; animation: wobble 1.6s ease-in-out infinite; filter: drop-shadow(0 .5rem 0 var(--ink)); }
.writing h2 { font-family: var(--font-display); font-size: 4rem; margin: 0; color: var(--yellow); text-shadow: .05em .05em 0 var(--ink); }
.meter { width: 40rem; max-width: 80vw; height: 1.6rem; background: rgba(255, 255, 255, .1); border-radius: 99px; overflow: hidden; box-shadow: inset 0 .2rem 0 rgba(0, 0, 0, .3); }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: 99px; transition: width .5s var(--ease-out); }
.writing .count { font-size: 1.6rem; font-weight: 900; }
.allin { font-family: var(--font-display); font-size: 3rem; color: var(--green); animation: stamp .5s var(--ease-pop) both; text-shadow: .05em .05em 0 var(--ink); }

/* versus */
.versus { width: 100%; max-width: 96rem; display: flex; flex-direction: column; gap: 2.2rem; align-items: center; }
.versus .prompt-card { max-width: 72rem; animation: flipin .6s var(--ease-pop) both; }
.vrow { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.6rem; align-items: center; width: 100%; }
.vs-badge { font-family: var(--font-display); font-size: 2.6rem; color: var(--ink); background: var(--yellow); width: 5.5rem; height: 5.5rem; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 .3rem 0 var(--ink); animation: popin .5s var(--ease-pop) .5s both; transform: rotate(-8deg); }
.ans { perspective: 80rem; min-height: 16rem; }
.ans .inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .8s var(--ease-pop); min-height: 16rem; }
.ans.flipped .inner { transform: rotateY(180deg); }
.ans .face, .ans .back {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 1.4rem; padding: 1.4rem 1.6rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.ans .face { background: var(--cream); color: var(--ink); font-size: 2.3rem; font-weight: 900; line-height: 1.15; box-shadow: 0 .45rem 0 var(--ink), 0 1.2rem 2rem rgba(0, 0, 0, .35); }
.ans.a .face { border: .45rem solid var(--yellow); }
.ans.b .face { border: .45rem solid var(--cyan); }
.ans .tag { position: absolute; top: -1.1rem; left: 1.2rem; font-family: var(--font-display); font-size: 1.2rem; background: var(--yellow); color: var(--ink); border-radius: .6rem; padding: .05rem .7rem; box-shadow: 0 .2rem 0 var(--ink); }
.ans.b .tag { background: var(--cyan); left: auto; right: 1.2rem; }
.ans.a { animation: slideL .65s var(--ease-pop) .2s both; }
.ans.b { animation: slideR .65s var(--ease-pop) .35s both; }
.ans .back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--plum-2), var(--plum)); border: .35rem solid rgba(255, 255, 255, .25); box-shadow: 0 .45rem 0 var(--ink); gap: .3rem; }
.ans .back .atext { font-size: 1.45rem; font-weight: 900; color: var(--cream); line-height: 1.15; max-height: 3.5em; overflow: hidden; }
.ans .back .q { font-size: 1.1rem; color: var(--muted); font-weight: 800; }
.ans .back .who { display: flex; align-items: center; gap: .7rem; font-family: var(--font-display); font-size: 1.9rem; color: var(--cream); }
.ans .back .who .av { width: 3rem; height: 3rem; }
.ans .back .pts { font-family: var(--font-display); font-size: 2.5rem; color: var(--yellow); text-shadow: .05em .05em 0 var(--ink); }
.ans .back .votes { font-size: 1.2rem; font-weight: 900; color: var(--cyan); }
.ans.win .back { border-color: var(--yellow); box-shadow: 0 .45rem 0 var(--ink), 0 0 3rem rgba(255, 210, 63, .55); }
.ans.lose .back { filter: saturate(.6) brightness(.85); }
.ans .votedots { position: absolute; bottom: -1.5rem; left: 0; right: 0; display: flex; justify-content: center; gap: .35rem; }
.votedots i { width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--yellow); box-shadow: 0 .15rem 0 var(--ink); animation: popin .4s var(--ease-pop) both; }
.ans.b .votedots i { background: var(--cyan); }
.castline { display: flex; gap: .5rem; align-items: center; font-size: 1.25rem; font-weight: 900; color: var(--muted); }
.castline .pip { width: .9rem; height: .9rem; border-radius: 50%; background: rgba(255, 255, 255, .15); transition: background .3s; }
.castline .pip.on { background: var(--green); animation: popin .35s var(--ease-pop); }
.stampx { position: absolute; z-index: 3; left: 50%; top: -2.2rem; margin-left: -9rem; width: 18rem; text-align: center; font-family: var(--font-display); font-size: 3.4rem; color: var(--pink); border: .4rem solid var(--pink); border-radius: 1rem; padding: .2rem 1.2rem; background: rgba(20, 11, 52, .85); animation: stamp .55s var(--ease-pop) both; white-space: nowrap; }
.stampx.gold { color: var(--yellow); border-color: var(--yellow); }
.stampx.cyan { color: var(--cyan); border-color: var(--cyan); }
.bazburst { position: absolute; z-index: 4; width: 19rem; height: 19rem; left: calc(50% - 9.5rem); top: calc(50% - 9.5rem); display: grid; place-items: center; background: url(/assets/art/burst.svg) center/contain no-repeat; animation: stamp .6s var(--ease-pop) both; text-align: center; }
.bazburst b { font-family: var(--font-display); color: var(--ink); font-size: 2.4rem; line-height: 1; transform: rotate(-8deg); }
.bazburst small { display: block; font-size: 1.3rem; margin-top: .3rem; }
.matchno { font-size: 1.1rem; color: var(--muted); font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }

/* scoreboard race */
.board { width: 100%; max-width: 70rem; display: flex; flex-direction: column; gap: .7rem; position: relative; }
.board h2 { font-family: var(--font-display); text-align: center; font-size: 3.4rem; margin: 0 0 1rem; color: var(--yellow); text-shadow: .05em .05em 0 var(--pink), .1em .1em 0 var(--ink); animation: popin .6s var(--ease-pop) both; }
.lane { --c: var(--pink); display: grid; grid-template-columns: 3rem 3rem 1fr 7rem; align-items: center; gap: 1rem; height: 4.1rem; transition: transform .9s var(--ease-out); }
.lane .rank { font-family: var(--font-display); font-size: 1.8rem; color: var(--muted); text-align: right; }
.lane .bar { height: 3.2rem; border-radius: .9rem; background: rgba(255, 255, 255, .07); position: relative; overflow: hidden; }
.lane .bar i { position: absolute; inset: 0 auto 0 0; background: var(--c); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c)); border-radius: .9rem; transition: width 1.4s var(--ease-out); box-shadow: inset 0 -.3rem 0 rgba(0, 0, 0, .2); }
.lane .bar .nm { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 1.5rem; color: #fff; text-shadow: 0 .12rem 0 rgba(0, 0, 0, .55); white-space: nowrap; }
.lane .bar .gain { position: absolute; right: .8rem; top: .75rem; font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); background: var(--yellow); border-radius: .5rem; padding: .05rem .5rem; animation: popin .5s var(--ease-pop) 1.2s both; }
.lane .score { font-family: var(--font-display); font-size: 1.9rem; text-align: right; color: var(--yellow); }
.lane.first .rank { color: var(--yellow); }
.lane.first .bar { box-shadow: 0 0 0 .2rem var(--yellow), 0 0 1.6rem rgba(255, 210, 63, .5); }

/* finale */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.4rem 1.6rem; width: 100%; max-width: 96rem; margin-top: 2rem; }
.fcard { position: relative; background: var(--cream); color: var(--ink); border-radius: 1.2rem; padding: 1.3rem 1.2rem 1.1rem; font-weight: 900; font-size: 1.45rem; line-height: 1.2; box-shadow: 0 .4rem 0 var(--ink); animation: flipin .55s var(--ease-pop) both; }
.fcard .n { position: absolute; top: -.9rem; left: 1rem; font-family: var(--font-display); font-size: 1.1rem; background: var(--pink); color: #fff; border-radius: .5rem; padding: 0 .6rem; box-shadow: 0 .2rem 0 var(--ink); }
.finaletag { font-family: var(--font-display); font-size: 1.4rem; background: var(--pink); color: #fff; padding: .2rem 1.2rem; border-radius: 99px; transform: rotate(-3deg); display: inline-block; box-shadow: 0 .25rem 0 var(--ink); margin-bottom: 1.2rem; }

/* podium */
.podium-wrap { width: 100%; max-width: 96rem; display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: end; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: .8rem; }
.pstep { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.pstep .av { width: 4.6rem; height: 4.6rem; font-size: 2rem; }
.pstep .nm { font-weight: 900; font-size: 1.5rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstep .sc { font-family: var(--font-display); color: var(--yellow); font-size: 1.5rem; }
.pstep .block { width: 100%; border-radius: 1rem 1rem 0 0; display: grid; place-items: start center; padding-top: .8rem; font-family: var(--font-display); font-size: 3.6rem; color: var(--ink); box-shadow: inset 0 -.6rem 0 rgba(0, 0, 0, .18); transform-origin: bottom; animation: grow 1s var(--ease-pop) both; }
.pstep.p1 .block { height: 12rem; background: var(--yellow); animation-delay: 2.6s; }
.pstep.p2 .block { height: 8.5rem; background: var(--cyan); animation-delay: 1.6s; }
.pstep.p3 .block { height: 6rem; background: var(--pink); animation-delay: .8s; }
.pstep.p1 .who-wrap { animation: rise .6s var(--ease-pop) 3.1s both; } .pstep.p2 .who-wrap { animation: rise .6s var(--ease-pop) 2.1s both; } .pstep.p3 .who-wrap { animation: rise .6s var(--ease-pop) 1.3s both; }
.who-wrap { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.trophy { width: 5.5rem; animation: breathe 1.6s ease-in-out infinite, rise .6s var(--ease-pop) 3.4s both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.podium-side { display: flex; flex-direction: column; gap: .6rem; }
.podium-side h3 { margin: 0; font-family: var(--font-display); color: var(--cyan); font-size: 1.4rem; }
.finrow { display: flex; gap: .7rem; align-items: center; background: rgba(255, 255, 255, .06); border-radius: .8rem; padding: .35rem .8rem; font-size: 1.05rem; }
.finrow .av { width: 2rem; height: 2rem; font-size: .95rem; }
.fscores { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.fscores.one { grid-template-columns: 1fr; }
.finrow .t { flex: 1; font-weight: 900; }
.finrow .v { font-family: var(--font-display); color: var(--yellow); }
.champ { text-align: center; margin-bottom: 1rem; }
.champ .label { font-family: var(--font-display); color: var(--cyan); font-size: 1.6rem; letter-spacing: .1em; }
.champ .name { font-family: var(--font-display); font-size: 4.2rem; color: var(--yellow); text-shadow: .05em .05em 0 var(--pink), .1em .1em 0 var(--ink); animation: stamp .7s var(--ease-pop) 3.3s both; line-height: 1; }

/* gate (sound unlock) */
.gate { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; gap: 2.4rem; align-items: center; justify-content: center; background: rgba(12, 6, 32, .92); backdrop-filter: blur(6px); text-align: center; }
.gate p { font-size: 1.3rem; color: var(--muted); max-width: 40rem; margin: 0; }
.toast { position: fixed; left: 50%; top: 1.2rem; transform: translateX(-50%); z-index: 60; background: var(--pink); color: #fff; font-weight: 900; padding: .7rem 1.4rem; border-radius: 99px; box-shadow: 0 .3rem 0 var(--ink); animation: rise .4s var(--ease-pop) both; max-width: 90vw; text-align: center; }

/* ================= PHONE ================= */
.phone { font-size: 16px; min-height: 100vh; min-height: 100dvh; }
.ph { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
.ph-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 8px; }
.ph-top .logo.sm .logo-word { font-size: 1.3rem; }
.ph-me { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: .95rem; max-width: 55%; }
.ph-me .av { width: 2rem; height: 2rem; font-size: .95rem; }
.ph-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-me .sc { color: var(--yellow); font-family: var(--font-display); font-size: .9rem; }
.pbar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 4px 0 10px; visibility: hidden; }
.pbar.on { visibility: visible; }
.pbar i { display: block; height: 100%; background: var(--cyan); border-radius: 99px; transition: width .25s linear, background .3s; }
.pbar.low i { background: var(--pink); }
.ph-main { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.doing {
  text-align: center; font-family: var(--font-display); font-size: clamp(1.25rem, 6.4vw, 1.75rem); line-height: 1.1; color: var(--yellow);
  text-shadow: 0 .08em 0 var(--ink); margin: 6px 0 2px;
}
.doing small { display: block; font-family: var(--font-body); font-weight: 800; font-size: .95rem; color: var(--muted); text-shadow: none; margin-top: 6px; letter-spacing: 0; }
.ph .prompt-card { font-size: clamp(1.1rem, 5.4vw, 1.45rem); padding: 18px 16px; border-radius: 18px; }
.ph .prompt-card::before { font-size: .75rem; top: -11px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 900; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.input, textarea.input {
  width: 100%; background: var(--cream); color: var(--ink); border: 0; border-radius: 14px; padding: 14px 16px; font-size: 1.15rem; font-weight: 800;
  box-shadow: inset 0 .2rem 0 rgba(0, 0, 0, .12), 0 0 0 .2rem transparent; transition: box-shadow .15s; resize: none;
}
.input:focus { box-shadow: inset 0 .2rem 0 rgba(0, 0, 0, .12), 0 0 0 .22rem var(--cyan); }
.input.code { font-family: var(--font-display); text-align: center; font-size: 2rem; letter-spacing: .3em; text-transform: uppercase; }
.chars { align-self: flex-end; font-size: .85rem; color: var(--muted); font-weight: 800; }
.chars.near { color: var(--orange); }
.steps { display: flex; gap: 6px; justify-content: center; }
.steps i { width: 34px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .15); }
.steps i.on { background: var(--yellow); }
.steps i.done { background: var(--green); }
.choice {
  width: 100%; text-align: left; border: 0; cursor: pointer; border-radius: 18px; padding: 18px 18px 18px 64px; min-height: 76px; position: relative;
  background: var(--cream); color: var(--ink); font-weight: 900; font-size: 1.15rem; line-height: 1.2;
  box-shadow: 0 .3rem 0 var(--ink); transition: transform .08s, box-shadow .08s; touch-action: manipulation;
}
.choice::before { content: attr(data-l); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.15rem; background: var(--yellow); color: var(--ink); }
.choice.b::before { background: var(--cyan); }
.choice.c2::before { background: var(--pink); color: #fff; }
.choice:active { transform: translateY(.25rem); box-shadow: 0 .05rem 0 var(--ink); }
.choice:disabled { opacity: .45; }
.choice.picked { box-shadow: 0 0 0 .25rem var(--green), 0 .3rem 0 var(--ink); }
.bigstate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 10px 0 30px; }
.bigstate .emoji { font-size: 4.2rem; line-height: 1; animation: wobble 1.8s ease-in-out infinite; }
.bigstate h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 8vw, 2.1rem); color: var(--yellow); text-shadow: 0 .08em 0 var(--ink); line-height: 1.1; }
.bigstate p { margin: 0; font-size: 1.05rem; color: var(--muted); max-width: 22rem; }
.bigpts { font-family: var(--font-display); font-size: 3.6rem; color: var(--yellow); text-shadow: .05em .05em 0 var(--pink), .1em .1em 0 var(--ink); animation: stamp .6s var(--ease-pop) both; }
.mini-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mini { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .07); border-radius: 99px; padding: 4px 10px 4px 4px; font-size: .9rem; font-weight: 900; }
.mini .av { width: 1.7rem; height: 1.7rem; font-size: .8rem; }
.colors { display: flex; gap: 8px; justify-content: center; }
.err { background: rgba(255, 61, 127, .16); border: 2px solid var(--pink); color: #ffd0de; padding: 10px 14px; border-radius: 12px; font-weight: 800; }
.locked { display: flex; align-items: center; gap: 10px; background: rgba(74, 222, 128, .14); border: 2px solid var(--green); border-radius: 14px; padding: 12px 14px; font-weight: 900; }
.locked .t { color: var(--cream); font-weight: 800; overflow-wrap: anywhere; }
.phone .btn { font-size: 1.1rem; }
.ph-foot { text-align: center; font-size: .78rem; color: rgba(185, 168, 230, .7); padding-top: 14px; }

/* ================= LANDING ================= */
.landing .wrap { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.landing .hero { padding: 40px 0 10px; text-align: center; }
.landing .logo-word { font-size: clamp(3rem, 13vw, 6.4rem); }
.landing .logo-burst { font-size: clamp(3rem, 13vw, 6.4rem); }
.landing .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.landing .tile { background: linear-gradient(180deg, var(--plum-2), var(--plum)); border-radius: 22px; padding: 24px; box-shadow: 0 .4rem 0 var(--ink); display: flex; flex-direction: column; gap: 14px; }
.landing .tile h2 { margin: 0; font-family: var(--font-display); color: var(--yellow); font-size: 1.6rem; }
.landing .tile p { margin: 0; color: var(--muted); }
.landing .how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.landing .how div { background: rgba(255, 255, 255, .05); border-radius: 16px; padding: 16px; text-align: center; font-weight: 800; }
.landing .how b { display: block; font-family: var(--font-display); font-size: 1.8rem; color: var(--pink); }
.landing footer { color: rgba(185, 168, 230, .7); font-size: .85rem; text-align: center; }
@media (max-width: 680px) { .landing .cards, .landing .how { grid-template-columns: 1fr; } }

/* ================= Reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .beams { display: none; }
  .bulbs { animation: none; }
}
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
html.calm .beams { display: none; }
