/* The lightning round's phone page: the art on top, three big buttons at the bottom. Silent. */
:root {
  --bg: #1d1b2f; --bg2: #2a2745; --ink: #ffffff; --muted: #c9c4ea; --card: #fffdf8; --card-ink: #1d1b2f;
  --yes: #22c55e; --yes-dark: #15803d; --no: #ef4444; --no-dark: #b91c1c; --mic: #fbbf24; --mic-dark: #d97706; --gold: #fde047;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overscroll-behavior: none; }
body { position: fixed; inset: 0; overflow: hidden; font: 20px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
#app { position: absolute; inset: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* ---------- header ---------- */
.top { flex: none; height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.hi { flex: 1; min-width: 0; font-weight: 800; color: var(--muted); font-size: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip { background: var(--bg2); border-radius: 999px; height: 40px; padding: 0 12px; font-size: 20px; display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-size: 17px; }
.chip.ready { background: var(--gold); color: var(--card-ink); }
.net { font-size: 22px; animation: pulse 1.2s ease-in-out infinite; }

/* ---------- screens ---------- */
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; }
.screen.on { display: flex; }
.center { align-items: center; justify-content: center; text-align: center; padding: 16px 20px 28px; gap: 14px; }
.center h2 { font-size: clamp(28px, 8vw, 40px); margin: 0; }
.big-emoji { font-size: clamp(88px, 28vw, 140px); line-height: 1; }
.go { border: 0; width: 132px; height: 132px; border-radius: 50%; background: var(--yes); font-size: 60px; box-shadow: 0 8px 0 var(--yes-dark); margin-top: 8px; }
.go:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--yes-dark); }
#s-nolink a, .boardLogin { color: var(--muted); font-size: 16px; }
button.hi { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }

/* ---------- passcode, and who is playing ---------- */
.ask { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 360px; }
.ask label { font-size: 18px; color: var(--muted); font-weight: 700; }
.ask input { width: 100%; padding: 14px 16px; border: 0; border-radius: 16px; font: 800 26px/1.2 system-ui, -apple-system, sans-serif; text-align: center; color: var(--card-ink); background: var(--card); -webkit-user-select: text; user-select: text; }
.ask .go { width: 96px; height: 96px; font-size: 44px; margin-top: 0; }
.people { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 520px; }
.person { border: 0; border-radius: 20px; padding: 16px 22px; min-width: 130px; font-size: 24px; font-weight: 800; background: var(--card); color: var(--card-ink); box-shadow: 0 5px 0 #8f8aa8; }
.person:active { transform: translateY(4px); box-shadow: 0 1px 0 #8f8aa8; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
#s-play { position: relative; }

/* ---------- the card ---------- */
.stage { position: relative; flex: 1; min-height: 0; margin: 2px 12px 0; }
.card { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--card); color: var(--card-ink); border-radius: 26px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.card.fly { transition: transform .3s ease-in, opacity .3s ease-in; opacity: 0; }
.card.enter { animation: enter .2s ease-out; }
.name { flex: none; padding: 10px 18px 6px; }
.name h1 { margin: 0; font-size: clamp(24px, 7.4vw, 38px); line-height: 1.1; overflow-wrap: anywhere; }
.art { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #fff; }
.art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.art > img.cropped { inset: auto; max-width: none; max-height: none; object-fit: fill; }
.ribbon { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--gold); color: var(--card-ink); font-weight: 900; font-size: 20px; padding: 6px 14px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.ribbon.new { background: #a5f3fc; }
.was { position: absolute; right: 10px; top: 10px; z-index: 2; width: 26%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 3px solid #fff; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.was img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.was img.cropped { inset: auto; max-width: none; max-height: none; object-fit: fill; }
.stamp { position: absolute; top: 38%; left: 50%; z-index: 3; font-size: 120px; line-height: 1; opacity: 0; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
.toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: calc(100% - 40px); background: var(--card-ink); color: #fff; font-weight: 800; font-size: 20px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.35); text-align: center; }

/* ---------- the three buttons, and ↩ / ⏭ beside the card ---------- */
.controls { flex: none; display: flex; justify-content: space-evenly; align-items: center; padding: 12px 8px 14px; }
.btn { border: 0; border-radius: 50%; width: 88px; height: 88px; font-size: 44px; display: grid; place-items: center; }
.btn:disabled { opacity: .45; }
.btn.no { background: var(--no); box-shadow: 0 6px 0 var(--no-dark); }
.btn.yes { background: var(--yes); box-shadow: 0 6px 0 var(--yes-dark); }
.btn.mic { width: 112px; height: 112px; font-size: 56px; background: var(--mic); box-shadow: 0 7px 0 var(--mic-dark); }
.btn:active, .btn.pressed { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn.small { width: 68px; height: 68px; font-size: 30px; background: var(--bg2); box-shadow: 0 5px 0 #0f0d1d; }
.undo, .skip { position: absolute; bottom: calc(150px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: #fff; color: var(--card-ink); font-size: 26px; box-shadow: 0 5px 0 #8f8aa8; z-index: 5; }
.undo { left: 20px; }
.skip { right: 20px; }
.skip:active, .undo:active { transform: translateY(4px); box-shadow: 0 1px 0 #8f8aa8; }
@media (max-height: 640px) {
  .btn { width: 76px; height: 76px; font-size: 38px; } .btn.mic { width: 96px; height: 96px; font-size: 48px; }
  .undo, .skip { bottom: calc(128px + env(safe-area-inset-bottom)); }
}

/* ---------- saying what to change: a panel under the art, which stays in view ---------- */
#s-play[data-talk="on"] .controls, #s-play[data-talk="on"] .undo, #s-play[data-talk="on"] .skip { display: none; }
.talk { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 14px 14px; }
.live { margin: 0; min-height: 1.3em; max-width: 100%; font-size: clamp(22px, 6.4vw, 30px); font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.hint { margin: 0; font-size: 20px; color: var(--muted); text-align: center; }
.key { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--card-ink); margin: 0 4px; }
#words { width: 100%; max-width: 560px; height: 4.2em; border: 0; border-radius: 18px; padding: 10px 14px; font: 800 clamp(20px, 5.8vw, 28px)/1.25 system-ui, -apple-system, sans-serif; color: var(--card-ink); background: var(--card); resize: none; -webkit-user-select: text; user-select: text; }
.row { display: flex; gap: 14px; align-items: center; justify-content: center; }
.talk .btn.mic, .talk .btn.yes { width: 84px; height: 84px; font-size: 40px; }
.oops { margin: 0; font-size: 24px; }

/* ---------- motion ---------- */
.pulse { display: inline-block; animation: pulse 1.1s ease-in-out infinite; }
.bounce { animation: bounce 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .8; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes enter { from { transform: scale(.96); opacity: .5; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pulse, .bounce, .net { animation: none; } }
