/* Szpontalisa. Flat colour fields that change with the phase, thick ink
   outlines, hard shadows. Every decoration is a drawn mark (doodles.js). */
:root {
  --ink: #17130f;
  --paper: #fffaf0;
  --yellow: #ffd23f;
  --red: #ff4a1c;
  --blue: #3d5afe;
  --green: #2fd38a;
  --pink: #ff7eb6;
  --orange: #ff8a3d;
  --field: var(--yellow);
  --on: var(--ink);
  --soft: rgba(23, 19, 15, 0.62);
  --b: 3px solid var(--ink);
  --sh: 4px 4px 0 var(--ink);
  --r: 16px;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
body[data-phase='lobby'] { --field: var(--blue); --on: var(--paper); --soft: rgba(255, 250, 240, 0.78); }
body[data-phase='gather'] { --field: var(--green); }
body[data-phase='draw'] { --field: #e9e2d6; }
body[data-phase='wait'] { --field: var(--orange); }
body[data-phase='reveal'] { --field: var(--ink); --on: var(--paper); --soft: rgba(255, 250, 240, 0.7); }
body[data-phase='final'] { --field: var(--yellow); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--field); color: var(--on);
  font-family: var(--font); font-size: 17px; line-height: 1.4;
  font-variation-settings: 'opsz' 18;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.3s;
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }

#wall { position: fixed; inset: 0; z-index: 0; pointer-events: none; animation: drift 90s linear infinite alternate; }
@keyframes drift { to { transform: translate(-24px, -40px); } }
#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 18px calc(28px + var(--safe-b)); display: flex; flex-direction: column; }
.scr { display: flex; flex-direction: column; gap: 20px; flex: 1; animation: in 0.4s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes in { from { opacity: 0; transform: translateY(18px) rotate(-0.6deg); } }

/* ── type ──────────────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; font-stretch: 80%; font-variation-settings: 'opsz' 96; line-height: 0.98; }
h1 { font-size: 46px; }
h2 { font-size: 36px; }
h3 { font-size: 22px; font-stretch: 85%; }
.sub { margin: 0; color: var(--soft); }
.small { font-size: 14px; }
.lbl { font-size: 15px; font-weight: 700; margin: 0 0 8px; display: block; }
.center { text-align: center; }
.logo { font-size: clamp(64px, 19vw, 104px); font-weight: 800; font-stretch: 75%; letter-spacing: -0.035em; line-height: 0.86; margin: 0; }
.logo .lisa { display: inline-block; color: var(--red); }

/* ── controls ──────────────────────────────────────────────────────── */
.btn {
  appearance: none; cursor: pointer; border: var(--b); border-radius: 14px; box-shadow: var(--sh);
  background: var(--paper); color: var(--ink);
  min-height: 58px; padding: 0 22px; font-weight: 800; font-size: 19px; font-stretch: 90%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.08s ease, box-shadow 0.08s ease; user-select: none;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--red); }
.btn.primary:active { box-shadow: 1px 1px 0 var(--red); }
body[data-phase='reveal'] .btn.primary, body[data-phase='lobby'] .btn.primary { background: var(--yellow); color: var(--ink); box-shadow: 4px 4px 0 var(--paper); border-color: var(--ink); }
.btn.hot { background: var(--red); color: var(--ink); }
.btn.small { min-height: 46px; font-size: 16px; padding: 0 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; box-shadow: none; }
.btn.busy { pointer-events: none; }
.btn.busy::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; color: inherit; opacity: 0.8; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; padding: 10px; font-size: 15px; font-weight: 600; }

.field { width: 100%; min-height: 56px; border-radius: 12px; border: var(--b); background: var(--paper); color: var(--ink); padding: 0 16px; font-size: 19px; font-weight: 600; outline: none; transition: box-shadow 0.12s; }
.field:focus { box-shadow: 4px 4px 0 var(--ink); }
.field::placeholder { color: rgba(23, 19, 15, 0.38); font-weight: 500; }
.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-7px) rotate(-1deg); } 50% { transform: translateX(6px) rotate(1deg); } 75% { transform: translateX(-3px); } }

.card { background: var(--paper); color: var(--ink); border: var(--b); border-radius: var(--r); box-shadow: 5px 5px 0 var(--ink); padding: 18px; }
body[data-phase='reveal'] .card, body[data-phase='lobby'] .card { box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.35); }
.card .sub { color: rgba(23, 19, 15, 0.62); }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: var(--b); cursor: pointer; transition: transform 0.12s; padding: 0; }
.swatch.on { transform: scale(1.15) rotate(-8deg); box-shadow: 3px 3px 0 var(--ink); }

.seg { display: flex; gap: 6px; }
.seg button { flex: 1; min-height: 46px; border: var(--b); border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 800; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.seg button.on { background: var(--yellow); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.seg.ro button { cursor: default; }
.seg.ro button:not(.on) { opacity: 0.55; }

.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch .knob { width: 58px; height: 34px; border-radius: 99px; border: var(--b); background: var(--paper); position: relative; flex: none; transition: background 0.2s; }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
.switch.on .knob { background: var(--red); }
.switch.on .knob::after { transform: translateX(24px); }

/* ── avatars & players ─────────────────────────────────────────────── */
.av { --c: #888; width: 42px; height: 42px; border-radius: 50%; background: var(--c); color: var(--ink); border: var(--b); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; position: relative; text-transform: uppercase; }
.av.sm { width: 30px; height: 30px; font-size: 13px; border-width: 2.5px; }
.av.lg { width: 66px; height: 66px; font-size: 28px; }
.av.off { filter: grayscale(1); opacity: 0.55; }
.av .badge { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); border: 2.5px solid var(--ink); font-size: 11px; display: grid; place-items: center; }
.av .crown { position: absolute; top: -15px; left: 50%; width: 26px; transform: translateX(-50%) rotate(-10deg); }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pl { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 14px; background: var(--paper); color: var(--ink); border: var(--b); min-width: 0; animation: pop 0.35s cubic-bezier(.3, 1.6, .5, 1) both; }
.pl .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .tag { font-size: 13px; color: rgba(23, 19, 15, 0.6); font-weight: 600; }
.pl .x { margin-left: auto; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 2px 6px; color: var(--ink); }
@keyframes pop { from { transform: scale(0.8) rotate(-4deg); opacity: 0; } }

/* ── home ──────────────────────────────────────────────────────────── */
.home { gap: 22px; }
.home .hero { padding-top: 3vh; }
.home .pitch { font-size: 21px; font-weight: 600; max-width: 22ch; margin: 18px 0 0; line-height: 1.25; }
.or { text-align: center; font-weight: 700; opacity: 0.7; }
.codein { text-transform: uppercase; letter-spacing: 0.35em; text-align: center; font-weight: 800; font-size: 24px; }
.foot { text-align: center; font-size: 14px; margin-top: auto; padding-top: 12px; opacity: 0.75; }

/* ── lobby ─────────────────────────────────────────────────────────── */
.roomhead { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.code { font-size: 86px; font-weight: 800; font-stretch: 75%; letter-spacing: 0.02em; line-height: 0.85; }
.code span { display: inline-block; animation: pop 0.5s cubic-bezier(.3, 1.6, .5, 1) both; }
.code span:nth-child(odd) { transform: rotate(-3deg); }
.code span:nth-child(2) { animation-delay: 0.06s; } .code span:nth-child(3) { animation-delay: 0.12s; } .code span:nth-child(4) { animation-delay: 0.18s; }
.joinat { margin: 8px 0 0; color: var(--soft); font-size: 15px; overflow-wrap: anywhere; }
.joinat b { color: var(--on); }
.qr { background: var(--paper); border: var(--b); border-radius: 14px; padding: 6px; width: 118px; height: 118px; cursor: zoom-in; box-shadow: 4px 4px 0 var(--ink); }
.qr svg { width: 100%; height: 100%; display: block; }
.qrbig { position: fixed; inset: 0; z-index: 50; background: rgba(23, 19, 15, 0.9); display: grid; place-items: center; padding: 24px; animation: in 0.2s both; }
.qrbig .qr { width: min(82vw, 440px); height: auto; aspect-ratio: 1; cursor: zoom-out; padding: 16px; }
.settings .opt + .opt { margin-top: 18px; }
.hint { font-size: 14px; color: rgba(23, 19, 15, 0.62); margin: 8px 0 0; }

/* ── gather ────────────────────────────────────────────────────────── */
.mypics { display: flex; flex-direction: column; gap: 14px; }
.mypic { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; padding: 10px; animation: pop 0.35s both; }
.mypic img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: var(--b); background: #ddd; }
.mypic .field { min-height: 46px; font-size: 16px; }
.mypic .rm { background: none; border: 0; font-size: 26px; cursor: pointer; padding: 6px; color: var(--ink); }
.adder .row .btn { flex: 1; }
.adder.drag { background: var(--yellow); }
.tip { font-size: 14px; color: rgba(23, 19, 15, 0.7); line-height: 1.4; }
.tip a { font-weight: 800; color: var(--ink); }
.progress { display: flex; flex-wrap: wrap; gap: 14px; }
.progress .p { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; width: 58px; text-align: center; font-weight: 700; }
.progress .p small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; font-weight: 600; opacity: 0.7; }
.uploading { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.uploading::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ink); border-right-color: transparent; animation: spin 0.7s linear infinite; }

/* ── timer: a fat marker line that gets shorter ───────────────────── */
.timer { display: flex; align-items: center; gap: 10px; }
.timer svg { flex: 1; height: 18px; overflow: visible; }
.timer path { fill: none; stroke-linecap: round; }
.timer .bg { stroke: currentColor; opacity: 0.15; stroke-width: 10; }
.timer .fg { stroke: currentColor; stroke-width: 10; }
.timer.low .fg { stroke: var(--red); }
.timer .t { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 2.6ch; text-align: right; font-size: 18px; }
.timer.low .t { color: var(--red); animation: thump 1s infinite; }
@keyframes thump { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } }

/* ── drawing ───────────────────────────────────────────────────────── */
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: 76px; height: 76px; border-radius: 12px; overflow: hidden; border: var(--b); padding: 0; background: #ddd; cursor: zoom-in; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg); }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref.gone { cursor: default; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--paper); color: var(--ink); line-height: 1.1; text-align: center; padding: 4px; }
.drawtop .what { min-width: 0; }
.drawtop .what h3 { font-size: 21px; line-height: 1.05; }
.drawtop .what .cap { color: var(--soft); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 6px; font-weight: 600; }
.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: var(--b); border-radius: 6px; touch-action: none; box-shadow: 6px 6px 0 var(--ink); 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: 40px; max-height: 40px; justify-self: center; border-radius: 50%; border: 2.5px solid var(--ink); cursor: pointer; transition: transform 0.1s; padding: 0; }
.palette button.on { transform: scale(1.18) translateY(-2px); box-shadow: 0 3px 0 var(--ink); }
.toolrow { display: flex; gap: 6px; }
.tool { flex: 1; min-height: 52px; border: var(--b); border-radius: 12px; background: var(--paper); color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: 2px 2px 0 var(--ink); }
.tool.on { background: var(--yellow); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.tool svg { width: 24px; height: 24px; }
.tool .dot { border-radius: 50%; background: currentColor; display: block; }
.tool[disabled] { opacity: 0.35; box-shadow: none; }
.toolrow .done { flex: 1.7; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 18px; box-shadow: 3px 3px 0 var(--red); }
.peek { position: fixed; inset: 0; z-index: 40; background: rgba(23, 19, 15, 0.94); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: in 0.2s both; }
.peek img { max-width: 100%; max-height: 80dvh; border: 3px solid var(--paper); border-radius: 8px; }
.peek .ring { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: var(--yellow); color: var(--ink); border: var(--b); font-weight: 800; padding: 8px 16px; border-radius: 12px; font-size: 18px; }
.peek p { position: absolute; bottom: calc(24px + var(--safe-b)); left: 16px; right: 16px; text-align: center; color: var(--paper); margin: 0; font-weight: 600; }
.sending { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: var(--ink); background: rgba(233, 226, 214, 0.7); }

@media (min-width: 900px) and (min-height: 560px) {
  .draw { grid-template-columns: 230px minmax(0, 1fr) 290px; 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: 230px; 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: 60px; }
}

/* ── waiting ───────────────────────────────────────────────────────── */
.wait .mine { width: 150px; border: var(--b); border-radius: 6px; background: #fff; box-shadow: 5px 5px 0 var(--ink); transform: rotate(-4deg); }
.artists { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.artists .pl.done { background: var(--yellow); }
.scribbling { display: inline-block; animation: scrib 0.6s ease-in-out infinite alternate; }
@keyframes scrib { from { transform: rotate(-14deg) translateX(-2px); } to { transform: rotate(12deg) translateX(3px); } }

/* ── reveal (the one dark room: pictures need it) ─────────────────── */
.reveal { gap: 14px; }
.rhead { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: var(--soft); font-size: 15px; }
.stage { position: relative; display: grid; gap: 14px; }
.art { margin: 0; position: relative; }
.art .frame { border: 3px solid var(--paper); border-radius: 8px; overflow: hidden; background: #2a241e; }
.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: 10px; }
.art figcaption .k { font-size: 30px; font-weight: 800; font-stretch: 78%; line-height: 1; letter-spacing: -0.02em; }
.art.mast figcaption .k { color: var(--yellow); }
.art figcaption .by { font-size: 15px; color: var(--soft); font-weight: 600; }
.art figcaption .by b { color: var(--paper); }
.art figcaption .cap { font-size: 15px; margin-top: 3px; font-style: italic; color: var(--soft); }
.stage .mast { display: none; }
.stage.two .mast { display: block; animation: unveil 0.6s cubic-bezier(.2, .9, .2, 1) both; }
@keyframes unveil { from { clip-path: inset(0 0 100% 0); transform: rotate(-1deg); } to { clip-path: inset(0 0 0 0); } }
.stage.two .orig { position: absolute; z-index: 3; top: 12px; left: 12px; width: 30%; transform: rotate(-5deg); transition: transform 0.4s; cursor: pointer; }
.stage.two .orig .frame { border-width: 3px; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6); }
.stage.two .orig figcaption { display: none; }
.stage.two .orig img { max-height: 24dvh; }
.stage.two.swap .orig { width: auto; position: static; transform: none; }
.stage.two.swap .orig figcaption { display: block; }
.stage.res { grid-template-columns: 1fr 1fr; align-items: start; }
.stage.res .orig { position: static; width: auto; transform: none; }
.stage.res .orig figcaption { display: block; }
.stage.res .art img, .stage.res .art canvas { max-height: 34dvh; }
.stage.res .art figcaption .k { font-size: 21px; }
@media (min-width: 900px) {
  body[data-phase='reveal'] #app { max-width: 1200px; }
  .stage.two { grid-template-columns: 1fr 1fr; }
  .stage.two .orig { position: static; width: auto; transform: none; }
  .stage.two .orig figcaption { display: block; }
  .stage.two .art img, .stage.two .art canvas { max-height: 60dvh; }
}
.drum { display: flex; gap: 7px; justify-content: center; padding: 8px 0; }
.drum i { width: 11px; height: 11px; border-radius: 50%; background: currentColor; animation: drum 0.45s 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 { transform: translateY(0); opacity: 0.3; } to { transform: translateY(-8px); opacity: 1; } }

.panel { min-height: 130px; }
.say { text-align: center; font-size: 24px; font-weight: 800; font-stretch: 85%; min-height: 30px; line-height: 1.1; }
body[data-phase='reveal'] .say { color: var(--yellow); }
.stars { display: flex; gap: 4px; justify-content: center; }
.stars button { background: none; border: 0; cursor: pointer; padding: 2px; width: 60px; height: 60px; transition: transform 0.15s; }
.stars button svg { width: 100%; height: 100%; overflow: visible; }
.stars button path { fill: transparent; stroke: var(--paper); stroke-width: 1.8; stroke-linejoin: round; transition: fill 0.15s; }
.stars button.on path { fill: var(--yellow); stroke: var(--yellow); }
.stars button.pick { animation: boing 0.45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes boing { 40% { transform: scale(1.4) rotate(-12deg); } }
.voted { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--soft); font-size: 15px; font-weight: 600; }
.score { display: flex; align-items: center; justify-content: center; gap: 18px; }
.score .num { font-size: 92px; font-weight: 800; font-stretch: 75%; line-height: 0.8; color: var(--yellow); animation: pop 0.6s cubic-bezier(.3, 1.6, .5, 1) both; letter-spacing: -0.04em; }
.fill-stars { position: relative; width: 170px; height: 32px; }
.fill-stars .on { position: absolute; inset: 0; overflow: hidden; width: 0; transition: width 1.1s cubic-bezier(.2, .9, .2, 1) 0.2s; }
.fill-stars svg { width: 170px; height: 32px; display: block; }
.votes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.votes .v { display: flex; align-items: center; gap: 6px; background: var(--paper); color: var(--ink); border-radius: 99px; padding: 3px 12px 3px 3px; font-size: 14px; font-weight: 700; animation: pop 0.35s both; }
.votes .v b { color: var(--red); letter-spacing: -1px; }
.reacts { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.reacts button { font-size: 25px; background: var(--paper); border: var(--b); border-color: var(--paper); border-radius: 12px; width: 48px; height: 48px; cursor: pointer; transition: transform 0.1s; padding: 0; }
.reacts button:active { transform: scale(0.82) rotate(-8deg); }
.fled { text-align: center; padding: 26px 10px; }

/* ── final ─────────────────────────────────────────────────────────── */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; margin-top: 16px; }
.podium .spot { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.podium .spot .nm { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border: var(--b); border-bottom: 0; border-radius: 12px 12px 0 0; display: grid; place-items: start center; padding-top: 8px; font-size: 40px; font-weight: 800; font-stretch: 75%; animation: grow 0.8s cubic-bezier(.2, .9, .3, 1.15) both; transform-origin: bottom; }
.podium .p1 .block { background: var(--red); height: 140px; animation-delay: 0.5s; }
.podium .p2 .block { background: var(--paper); height: 100px; animation-delay: 0.25s; }
.podium .p3 .block { background: var(--blue); color: var(--paper); height: 72px; }
.podium .pts { font-size: 14px; font-weight: 700; opacity: 0.75; }
@keyframes grow { from { transform: scaleY(0); } }
.rest { display: flex; flex-direction: column; gap: 8px; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.award { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.award:nth-child(odd) { transform: rotate(-1deg); }
.award:nth-child(even) { transform: rotate(1deg); }
.award .t { font-size: 20px; font-weight: 800; font-stretch: 80%; line-height: 1.05; }
.award .n { font-size: 14px; color: rgba(23, 19, 15, 0.65); font-weight: 600; }
.gallery { display: flex; flex-direction: column; gap: 16px; }
.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: 6px; border: 2.5px solid var(--ink); background: #ddd; }
.pair .two img.m { background: #fff; }
.pair .meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 15px; }
.pair .meta .s { margin-left: auto; font-weight: 800; white-space: nowrap; color: var(--red); }

/* ── 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(--paper); color: var(--ink); border: var(--b); padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--sh); animation: in 0.25s 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(--red); color: var(--ink); border: var(--b); font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 10px; 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: 40px; animation: floatup 2.9s cubic-bezier(.2, .7, .3, 1) forwards; }
.float small { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: 12px; font-weight: 800; padding: 1px 6px; border-radius: 6px; border: 2px solid var(--ink); color: var(--ink); white-space: nowrap; font-family: var(--font); }
@keyframes floatup { 0% { transform: translate(0, 0) scale(0.6); opacity: 0; } 12% { opacity: 1; transform: translate(var(--dx), -12vh) scale(1.1); } 100% { transform: translate(calc(var(--dx) * -1), -92vh) scale(0.9) rotate(var(--rot)); opacity: 0; } }
.confetti { position: absolute; top: -20px; width: 10px; height: 14px; border: 2px solid var(--ink); 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: var(--yellow); color: var(--ink); animation: inter 1.9s ease forwards; pointer-events: none; padding: 24px; }
.interstitial h1 { font-size: clamp(64px, 20vw, 130px); font-stretch: 75%; text-align: center; transform: rotate(-3deg); }
.interstitial p { text-align: center; font-weight: 700; font-size: 20px; margin: 10px 0 0; }
@keyframes inter { 0% { clip-path: circle(0 at 50% 50%); } 15%, 80% { clip-path: circle(150% at 50% 50%); opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

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

/* ── the original-vs-masterpiece demo (game home + pgames hub) ───── */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.duo figure { margin: 0; }
.duo .f { border: var(--b); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 4px 4px 0 var(--ink); aspect-ratio: 200 / 170; }
.duo .o { transform: rotate(-2.5deg); }
.duo .m { transform: rotate(2deg); }
.duo svg, .duo canvas { width: 100%; height: 100%; display: block; }
.duo figcaption { font-weight: 800; font-stretch: 85%; font-size: 17px; margin-top: 10px; text-align: center; }
.home .demo { display: none; }

/* ── computers: use the whole screen ──────────────────────────────── */
@media (min-width: 960px) {
  #app { max-width: 1180px; padding: 44px 44px 36px; }
  h1 { font-size: 66px; }
  h2 { font-size: 58px; }
  h3 { font-size: 27px; }
  .card { padding: 24px; }

  .home { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-areas: 'hero who' 'hero act' 'foot foot'; column-gap: 72px; row-gap: 24px; align-content: center; }
  .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 .logo { font-size: 148px; }
  .home .pitch { font-size: 27px; max-width: 24ch; }
  .home .demo { display: block; margin-top: 34px; max-width: 520px; }

  .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: 22px; align-content: start; }
  .lobby .roomhead { grid-area: head; grid-template-columns: 1fr; align-items: start; align-self: start; position: sticky; top: 44px; }
  .lobby .roomhead .qr { width: 300px; height: 300px; padding: 12px; order: 2; }
  .lobby .code { font-size: 168px; }
  .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(190px, 1fr)); }

  .gather { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-areas: 'head head' 'list side' 'adder side' 'foot side'; column-gap: 44px; row-gap: 20px; align-content: start; }
  .gather .a-head { grid-area: head; }
  .gather .a-head .sub { font-size: 20px; max-width: 52ch; }
  .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: 140px 1fr auto; }
  .gather .mypic img { width: 140px; height: 140px; }

  .wait { display: grid; grid-template-columns: 1fr 1.3fr; grid-template-areas: 'head head' 'timer timer' 'thumb side' 'foot side'; column-gap: 44px; row-gap: 24px; 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: 300px; }
  .artists { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  .reveal .panel, .reveal .reacts { width: 100%; max-width: 680px; margin: 0 auto; }
  .stars button { width: 72px; height: 72px; }
  .say { font-size: 30px; }

  .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: 26px; 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: 420px; justify-self: center; width: 100%; }
  .final .a-leave { grid-area: leave; }
  .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .podium .p1 .block { height: 190px; } .podium .p2 .block { height: 140px; } .podium .p3 .block { height: 100px; }
}
