/* Party games: clean and light. Off-white page, black type, one red accent,
   thin borders. The pictures and drawings are the only loud colour on screen. */
:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #111111;
  --soft: #5f5f5a;
  --faint: #8c8c86;
  --line: #e6e6e0;
  --line-2: #d8d8d1;
  --accent: #e5432d;
  --star: #f2a900;
  --ok: #1f9d55;
  --r: 14px;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.05), 0 4px 16px rgba(17, 17, 17, 0.04);
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }

#app { max-width: 460px; margin: 0 auto; min-height: 100dvh; padding: max(28px, env(safe-area-inset-top)) 20px calc(28px + var(--safe-b)); display: flex; flex-direction: column; }
.scr { display: flex; flex-direction: column; gap: 22px; flex: 1; animation: in 0.25s ease-out both; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }

/* ── type ──────────────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 18px; letter-spacing: -0.015em; }
.sub { margin: 0; color: var(--soft); }
.small { font-size: 14px; }
.lbl { display: block; font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.center { text-align: center; }
.word { font-size: 15px; font-weight: 600; text-decoration: none; color: var(--soft); }
.word:hover { color: var(--ink); }

/* ── controls ──────────────────────────────────────────────────────── */
.btn {
  appearance: none; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink);
  min-height: 52px; padding: 0 20px; font-weight: 700; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; user-select: none;
  transition: background 0.15s, transform 0.08s, opacity 0.15s;
}
.btn:hover { background: #f3f3ee; }
.btn:active { transform: scale(0.98); }
.btn.primary, .btn.gold { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover, .btn.gold:hover { background: #2a2a2a; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 42px; font-size: 15px; padding: 0 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn.busy { pointer-events: none; opacity: 0.8; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; color: var(--faint); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px; font-size: 14px; }
.link:hover { color: var(--ink); }

.field { width: 100%; height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 0 16px; font-size: 17px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.field:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
.field::placeholder { color: #a8a8a2; }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }


.seg { display: flex; padding: 3px; gap: 3px; background: #f0f0eb; border-radius: 12px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--soft); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.seg.ro button { cursor: default; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch .knob { width: 44px; height: 26px; border-radius: 99px; background: #dcdcd5; position: relative; flex: none; transition: background 0.2s; }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch.on .knob { background: var(--ink); }
.switch.on .knob::after { transform: translateX(18px); }

/* ── players (just names) ──────────────────────────────────────────── */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.pl .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .tag { font-size: 13px; color: var(--faint); }
.pl .x { margin-left: auto; background: none; border: 0; font-size: 18px; cursor: pointer; padding: 0 4px; color: var(--faint); }
.pl .x:hover { color: var(--ink); }
.pl.off { opacity: 0.45; }
.pl.done .tag { color: var(--ok); }

/* ── home ──────────────────────────────────────────────────────────── */
.home .hero { padding-top: 2vh; }
.home .pitch { font-size: 18px; color: var(--soft); margin: 12px 0 0; max-width: 30ch; }
.or { text-align: center; color: var(--faint); font-size: 14px; }
.codein { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 700; }
.foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: auto; padding-top: 16px; }
.foot a { color: var(--faint); }
.foot a:hover { color: var(--ink); }


/* games on the front door, and the picker in the lobby */
.gamecard { display: grid; gap: 4px; }
.gopts { display: grid; gap: 8px; }
.gopt { text-align: left; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.gopt span { font-size: 13px; color: var(--faint); line-height: 1.4; }
.gopt.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.gopt[disabled] { cursor: default; opacity: 0.5; }
.settings .opt.rule { border-top: 1px solid var(--line); padding-top: 18px; }

/* ── lobby ─────────────────────────────────────────────────────────── */
.roomhead { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.code { font-size: 64px; font-weight: 800; letter-spacing: 0.04em; line-height: 0.95; }
.joinat { margin: 6px 0 0; color: var(--soft); font-size: 14px; overflow-wrap: anywhere; }
.joinat b { color: var(--ink); font-weight: 600; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; width: 112px; height: 112px; cursor: zoom-in; }
.qr svg { width: 100%; height: 100%; display: block; }
button.code { background: none; border: 0; padding: 0; color: inherit; font-family: inherit; cursor: zoom-in; text-align: left; }
.bigcode { position: fixed; inset: 0; z-index: 90; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; padding: 24px; cursor: zoom-out; animation: in 0.15s both; text-align: center; }
.bc-label { font-size: clamp(16px, 2.2vw, 28px); font-weight: 600; color: var(--faint); }
.bc-code { font-size: min(33vw, 46vh); font-weight: 800; letter-spacing: 0.06em; line-height: 0.88; margin-right: -0.06em; }
.bc-url { font-size: clamp(18px, 3vw, 40px); font-weight: 600; }
.bc-qr { width: min(17vh, 32vw); height: min(17vh, 32vw); }
.bc-qr svg { width: 100%; height: 100%; display: block; }
.bc-hint { font-size: 14px; color: var(--faint); }
.roomchip { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 30; background: var(--surface); border: 1px solid var(--line-2); border-radius: 99px; padding: 7px 14px; font: 700 14px var(--font); color: var(--ink); cursor: zoom-in; box-shadow: var(--shadow); letter-spacing: 0.02em; }
.roomchip[hidden] { display: none; }
.qrbig { position: fixed; inset: 0; z-index: 50; background: rgba(250, 250, 247, 0.96); display: grid; place-items: center; padding: 24px; animation: in 0.15s both; }
.qrbig .qr { width: min(80vw, 420px); height: auto; aspect-ratio: 1; cursor: zoom-out; padding: 16px; box-shadow: var(--shadow); }
.settings .opt + .opt { margin-top: 18px; }
.hint { font-size: 13px; color: var(--faint); margin: 6px 0 0; }

/* ── gather ────────────────────────────────────────────────────────── */
.mypics { display: flex; flex-direction: column; gap: 10px; }
.mypic { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 10px; }
.mypic img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: #eee; }
.mypic .field { height: 42px; font-size: 15px; }
.mypic .rm { background: none; border: 0; font-size: 20px; cursor: pointer; padding: 6px; color: var(--faint); }
.mypic .rm:hover { color: var(--ink); }
.adder .row .btn { flex: 1; }
.adder.drag { border-color: var(--ink); background: #f5f5f0; }
.tip { font-size: 13px; color: var(--faint); line-height: 1.5; }
.tip a { color: var(--ink); font-weight: 600; }
.progress { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.uploading { display: flex; gap: 10px; align-items: center; color: var(--soft); font-size: 14px; }
.uploading::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); border-right-color: transparent; animation: spin 0.7s linear infinite; }

/* ── timer: a thin bar ─────────────────────────────────────────────── */
.timer { display: flex; align-items: center; gap: 10px; }
.timer svg { flex: 1; height: 6px; overflow: visible; }
.timer path { fill: none; stroke-linecap: round; stroke-width: 6; }
.timer .bg { stroke: #e8e8e2; }
.timer .fg { stroke: var(--ink); transition: stroke 0.3s; }
.timer.low .fg { stroke: var(--accent); }
.timer .t { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2.4ch; text-align: right; font-size: 14px; color: var(--soft); }
.timer.low .t { color: var(--accent); }

/* ── drawing ───────────────────────────────────────────────────────── */
body.drawing { background: #f2f2ed; }
body.drawing #app { max-width: none; padding: max(10px, env(safe-area-inset-top)) 10px calc(10px + var(--safe-b)); height: 100dvh; min-height: 0; }
.draw { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; height: 100%; min-height: 0; animation: none; }
.drawtop { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.ref { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 0; padding: 0; background: #e6e6e0; cursor: zoom-in; box-shadow: 0 0 0 1px var(--line-2); }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref.gone { cursor: default; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--faint); background: var(--surface); line-height: 1.2; text-align: center; padding: 4px; }
.drawtop .what { min-width: 0; }
.drawtop .what h3 { font-size: 17px; }
.drawtop .what .cap { color: var(--faint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 6px; }
.canvaswrap { display: grid; place-items: center; min-height: 0; min-width: 0; position: relative; }
.canvaswrap canvas { max-width: 100%; max-height: 100%; background: #fff; border-radius: 8px; touch-action: none; box-shadow: 0 0 0 1px var(--line-2), 0 6px 24px rgba(17, 17, 17, 0.06); cursor: crosshair; }
.tools { display: flex; flex-direction: column; gap: 8px; }
.palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.palette button { aspect-ratio: 1; width: 100%; max-width: 34px; max-height: 34px; justify-self: center; border-radius: 50%; border: 0; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); transition: transform 0.1s; }
.palette button.on { box-shadow: 0 0 0 2px #f2f2ed, 0 0 0 4px var(--ink); }
.toolrow { display: flex; gap: 6px; }
.tool { flex: 1; min-height: 48px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0; transition: background 0.12s; }
.tool:hover { background: #f5f5f0; }
.tool.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tool svg { width: 21px; height: 21px; }
.tool .dot { border-radius: 50%; background: currentColor; display: block; }
.tool[disabled] { opacity: 0.35; }
.toolrow .done { flex: 1.7; background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; font-size: 16px; }
.peek { position: fixed; inset: 0; z-index: 40; background: rgba(17, 17, 17, 0.92); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: in 0.15s both; }
.peek img { max-width: 100%; max-height: 80dvh; border-radius: 10px; }
.peek .ring { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: #fff; color: var(--ink); font-weight: 700; padding: 8px 14px; border-radius: 99px; font-size: 15px; }
.peek p { position: absolute; bottom: calc(24px + var(--safe-b)); left: 16px; right: 16px; text-align: center; color: #ddd; margin: 0; }
.sending { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: rgba(242, 242, 237, 0.75); }

@media (min-width: 900px) and (min-height: 560px) {
  .draw { grid-template-columns: 220px minmax(0, 1fr) 270px; grid-template-rows: minmax(0, 1fr); gap: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
  .drawtop { grid-template-columns: 1fr; align-content: start; }
  .ref { width: 220px; height: auto; aspect-ratio: var(--ar, 1); }
  .tools { justify-content: center; }
  .palette { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .toolrow { flex-wrap: wrap; }
  .toolrow .tool { flex: 1 1 28%; }
  .toolrow .done { flex: 1 1 100%; min-height: 54px; }
}

/* ── waiting ───────────────────────────────────────────────────────── */
.wait .mine { width: 160px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.artists { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.artists .pl.done .tag { color: var(--ok); }
.scribbling { display: inline-block; animation: scrib 0.6s ease-in-out infinite alternate; }
@keyframes scrib { from { transform: rotate(-12deg); } to { transform: rotate(10deg); } }

/* ── reveal ────────────────────────────────────────────────────────── */
.reveal { gap: 16px; }
.rhead { display: flex; justify-content: space-between; align-items: baseline; color: var(--faint); font-size: 14px; font-weight: 600; }
.stage { position: relative; display: grid; gap: 14px; }
.art { margin: 0; position: relative; }
.art .frame { border-radius: 12px; overflow: hidden; background: #ececE6; box-shadow: 0 0 0 1px var(--line); }
.art img, .art canvas { width: 100%; height: auto; display: block; max-height: 56dvh; object-fit: contain; margin: 0 auto; }
.art.mast canvas { background: #fff; }
.art figcaption { margin-top: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.art figcaption .k { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.art figcaption .by { font-size: 14px; color: var(--soft); }
.art figcaption .by b { color: var(--ink); font-weight: 600; }
.art figcaption .cap { font-size: 14px; color: var(--soft); width: 100%; margin-top: -2px; }
.stage .mast { display: none; }
.stage.two .mast { display: block; animation: in 0.3s ease-out both; }
.stage.two .orig { position: absolute; z-index: 3; top: 10px; left: 10px; width: 28%; cursor: pointer; }
.stage.two .orig .frame { box-shadow: 0 0 0 3px #fff, 0 4px 16px rgba(0, 0, 0, 0.18); border-radius: 8px; }
.stage.two .orig figcaption { display: none; }
.stage.two .orig img { max-height: 22dvh; }
.stage.two.swap .orig { position: static; width: auto; }
.stage.two.swap .orig figcaption { display: flex; }
.stage.res { grid-template-columns: 1fr 1fr; align-items: start; }
.stage.res .orig { position: static; width: auto; }
.stage.res .orig .frame { box-shadow: 0 0 0 1px var(--line); border-radius: 12px; }
.stage.res .orig figcaption { display: flex; }
.stage.res .art img, .stage.res .art canvas { max-height: 34dvh; }
@media (min-width: 900px) {
  .stage.two { grid-template-columns: 1fr 1fr; }
  .stage.two .orig { position: static; width: auto; }
  .stage.two .orig .frame { box-shadow: 0 0 0 1px var(--line); border-radius: 12px; }
  .stage.two .orig figcaption { display: flex; }
  .stage.two .art img, .stage.two .art canvas { max-height: 60dvh; }
}
.drum { display: flex; gap: 6px; justify-content: center; padding: 6px 0; }
.drum i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: drum 0.5s ease-in-out infinite alternate; }
.drum i:nth-child(2) { animation-delay: 0.15s; } .drum i:nth-child(3) { animation-delay: 0.3s; }
@keyframes drum { from { opacity: 0.25; } to { opacity: 1; } }

.panel { min-height: 120px; }
.say { text-align: center; font-size: 18px; font-weight: 700; min-height: 26px; color: var(--ink); }
.stars { display: flex; gap: 2px; justify-content: center; }
.stars button { background: none; border: 0; cursor: pointer; padding: 3px; width: 54px; height: 54px; transition: transform 0.12s; }
.stars button:hover { transform: scale(1.06); }
.stars button svg { width: 100%; height: 100%; overflow: visible; }
.stars button path { fill: transparent; stroke: #c9c9c2; stroke-width: 1.6; stroke-linejoin: round; transition: fill 0.12s, stroke 0.12s; }
.stars button.on path { fill: var(--star); stroke: var(--star); }
.stars button.pick { animation: boing 0.35s ease-out; }
@keyframes boing { 40% { transform: scale(1.2); } }
.voted { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; align-items: center; color: var(--faint); font-size: 14px; }
.score { display: flex; align-items: center; justify-content: center; gap: 16px; }
.score .num { font-size: 64px; font-weight: 800; line-height: 0.9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.fill-stars { position: relative; width: 150px; height: 28px; }
.fill-stars .on { position: absolute; inset: 0; overflow: hidden; width: 0; transition: width 0.9s ease-out 0.15s; }
.fill-stars svg { width: 150px; height: 28px; display: block; }
.score .say { text-align: left; color: var(--soft); font-weight: 600; font-size: 16px; }
.votes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.votes .v { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 13px; }
.votes .v b { color: var(--star); letter-spacing: -1px; font-weight: 700; }
.reacts { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.reacts button { font-size: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; cursor: pointer; padding: 0; transition: transform 0.1s; }
.reacts button:active { transform: scale(0.88); }
.fled { text-align: center; padding: 20px 10px; }

/* ── final ─────────────────────────────────────────────────────────── */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; margin-top: 8px; }
.podium .spot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.podium .spot .nm { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border-radius: 10px 10px 0 0; display: grid; place-items: start center; padding-top: 8px; font-size: 22px; font-weight: 800; color: var(--soft); background: #ececE6; animation: grow 0.6s ease-out both; transform-origin: bottom; }
.podium .p1 .block { height: 120px; background: var(--ink); color: #fff; animation-delay: 0.3s; }
.podium .p2 .block { height: 88px; animation-delay: 0.15s; }
.podium .p3 .block { height: 64px; }
.podium .pts { font-size: 13px; color: var(--faint); }
@keyframes grow { from { transform: scaleY(0); } }
.rest { display: flex; flex-direction: column; gap: 6px; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.award { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.award .t { font-size: 15px; font-weight: 700; }
.award .n { font-size: 13px; color: var(--faint); }
.gallery { display: flex; flex-direction: column; gap: 12px; }
.pair { padding: 12px; }
.pair .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair .two img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #f0f0ea; }
.pair .two img.m { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.pair .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--soft); }
.pair .meta b { color: var(--ink); font-weight: 600; }
.pair .meta .s { margin-left: auto; font-weight: 700; white-space: nowrap; color: var(--ink); }

/* ── chrome ────────────────────────────────────────────────────────── */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); animation: in 0.2s both; max-width: 460px; text-align: center; }
.status { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 99px; display: none; }
.status.show { display: block; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.float { position: absolute; bottom: -60px; font-size: 34px; animation: floatup 2.8s ease-out forwards; }
.float small { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; color: #fff; background: var(--ink); white-space: nowrap; font-family: var(--font); }
@keyframes floatup { 0% { transform: translate(0, 0) scale(0.7); opacity: 0; } 12% { opacity: 1; transform: translate(var(--dx), -12vh) scale(1); } 100% { transform: translate(calc(var(--dx) * -1), -90vh) rotate(var(--rot)); opacity: 0; } }
.confetti { position: absolute; top: -20px; width: 8px; height: 12px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }
.interstitial { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(250, 250, 247, 0.97); animation: inter 1.8s ease forwards; pointer-events: none; padding: 24px; }
.interstitial h1 { font-size: clamp(48px, 14vw, 88px); text-align: center; letter-spacing: -0.045em; }
.interstitial p { text-align: center; color: var(--soft); font-size: 18px; margin: 8px 0 0; }
@keyframes inter { 0% { opacity: 0; } 12%, 78% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ── computers: use the whole screen ──────────────────────────────── */
@media (min-width: 960px) {
  #app { max-width: 1120px; padding: 48px 48px 36px; }
  h1 { font-size: 48px; }
  h2 { font-size: 36px; }
  .card { padding: 22px; }

  .home { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-areas: 'hero who' 'hero act' 'games games' 'foot foot'; column-gap: 80px; row-gap: 22px; align-content: start; }
  .home .a-games { grid-area: games; margin-top: 28px; }
  .home h1 { font-size: 56px; letter-spacing: -0.04em; }
  .home .a-hero { grid-area: hero; align-self: center; padding-top: 0; }
  .home .a-who { grid-area: who; align-self: end; }
  .home .a-act { grid-area: act; align-self: start; }
  .home .a-foot { grid-area: foot; }
  .home .pitch { font-size: 20px; }

  .lobby { display: grid; grid-template-columns: 1fr 1.15fr; grid-template-areas: 'head players' 'head settings' 'head foot' 'leave leave'; column-gap: 64px; row-gap: 20px; align-content: start; }
  .lobby .roomhead { grid-area: head; grid-template-columns: 1fr; align-items: start; align-self: start; position: sticky; top: 48px; }
  .lobby .roomhead .qr { width: 260px; height: 260px; padding: 12px; order: 2; }
  .lobby .code { font-size: 112px; }
  .lobby .a-players { grid-area: players; }
  .lobby .settings { grid-area: settings; }
  .lobby .a-foot { grid-area: foot; }
  .lobby .a-leave { grid-area: leave; }
  .lobby .players { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

  .gather { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-areas: 'head head' 'list side' 'adder side' 'foot side'; column-gap: 40px; row-gap: 18px; align-content: start; }
  .gather .a-head { grid-area: head; }
  .gather .mypics { grid-area: list; }
  .gather .adder { grid-area: adder; }
  .gather .a-side { grid-area: side; align-self: start; }
  .gather .a-foot { grid-area: foot; }
  .gather .mypic { grid-template-columns: 120px 1fr auto; }
  .gather .mypic img { width: 120px; height: 120px; }

  .wait { display: grid; grid-template-columns: 1fr 1.3fr; grid-template-areas: 'head head' 'timer timer' 'thumb side' 'foot side'; column-gap: 40px; row-gap: 22px; align-content: start; }
  .wait .a-head { grid-area: head; }
  .wait .a-timer { grid-area: timer; }
  .wait .a-thumb { grid-area: thumb; align-self: start; }
  .wait .a-side { grid-area: side; align-self: start; }
  .wait .a-foot { grid-area: foot; }
  .wait .mine { width: 280px; }
  .artists { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

  .reveal .panel, .reveal .reacts { width: 100%; max-width: 640px; margin: 0 auto; }
  .stars button { width: 64px; height: 64px; }

  .final { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: 'title title' 'podium awards' 'rest awards' 'gallery gallery' 'foot foot' 'leave leave'; column-gap: 56px; row-gap: 24px; align-content: start; }
  .final .a-title { grid-area: title; }
  .final .podium { grid-area: podium; align-self: end; }
  .final .rest { grid-area: rest; }
  .final .a-awards { grid-area: awards; align-self: center; }
  .final .a-gallery { grid-area: gallery; }
  .final .a-foot { grid-area: foot; max-width: 400px; justify-self: center; width: 100%; }
  .final .a-leave { grid-area: leave; }
  .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .podium .p1 .block { height: 160px; } .podium .p2 .block { height: 116px; } .podium .p3 .block { height: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
