/* Tabliczka: grube kontury, ciepłe kolory, duże cyfry. Fonty lokalnie (SIL OFL), bez zewnętrznych zapytań. */

@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Patrick Hand"; font-display: swap;
  src: url("fonts/patrick-hand-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: "Patrick Hand"; font-display: swap;
  src: url("fonts/patrick-hand-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #fff6e5;
  --card: #fffdf8;
  --ink: #2b2148;
  --ink-soft: #6b6385;
  --orange: #ff7a45;
  --blue: #3d8bff;
  --green: #2fbf71;
  --yellow: #ffc93c;
  --red: #ff5d5d;
  --purple: #8a5cf6;
  --b0: #ebe4d5;
  --b1: #ff8a80;
  --b2: #ffd166;
  --b3: #7ed99a;
  --b4: linear-gradient(135deg, #ffe17a 0%, #f4b400 55%, #ffd34d 100%);
  --line: 3px solid var(--ink);
  --shadow: 0 5px 0 var(--ink);
  --radius: 18px;
  --hand: "Patrick Hand", "Comic Sans MS", system-ui, sans-serif;
  --sans: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 18px/1.45 var(--sans);
  background-color: var(--bg);
  /* Delikatny wzór z małych znaków mnożenia. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M24 24l8 8M32 24l-8 8' stroke='%232b2148' stroke-opacity='.07' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}
h1, h2, h3 { font-family: var(--hand); font-weight: 400; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 6vw, 2.8rem); }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 .6em; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
.center { text-align: center; }

/* --- nagłówek --- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 980px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0;
  font: 1.7rem var(--hand);
}
.logo {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--orange); color: #fff; border: var(--line); border-radius: 12px;
  font: 700 1.6rem/1 var(--sans); box-shadow: 0 3px 0 var(--ink); transform: rotate(-6deg);
}
.top-right { display: flex; align-items: center; gap: 10px; }
.who { font-weight: 700; color: var(--ink-soft); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--card); border: var(--line); border-radius: 12px; box-shadow: 0 3px 0 var(--ink);
}
.icon-btn svg { width: 24px; height: 24px; }

main { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
.screen { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

/* --- przyciski --- */
.btn {
  border: var(--line); border-radius: 14px; background: var(--card);
  padding: 12px 22px; font-weight: 700; box-shadow: var(--shadow);
  transition: transform .06s, box-shadow .06s; touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.big { font-size: 1.25rem; padding: 16px 30px; }
.btn.small { padding: 8px 14px; font-size: .95rem; box-shadow: 0 3px 0 var(--ink); }
.btn.orange { background: var(--orange); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn.ghost:active { transform: none; }
:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.row.center { justify-content: center; }

.card {
  background: var(--card); border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}

/* --- powitanie --- */
.hero { position: relative; padding: 28px 0 10px; text-align: center; overflow: hidden; }
.hero h1 { font-size: clamp(2.4rem, 9vw, 3.8rem); position: relative; }
.hero em { font-style: normal; background: var(--yellow); padding: 0 .2em; border-radius: 10px; box-shadow: 0 4px 0 var(--ink); display: inline-block; transform: rotate(-3deg); }
.lead { color: var(--ink-soft); font-size: 1.1rem; position: relative; }
.hero-grid {
  position: absolute; inset: 10px 10% auto; height: 160px; opacity: .5;
  background-image: linear-gradient(var(--b2) 2px, transparent 2px), linear-gradient(90deg, var(--b2) 2px, transparent 2px);
  background-size: 22px 22px; mask-image: radial-gradient(closest-side, #000, transparent);
}
.choice { display: grid; gap: 14px; max-width: 360px; margin: 20px auto; }
.form { max-width: 380px; margin: 20px auto; display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-weight: 700; }
.form input {
  border: var(--line); border-radius: 12px; padding: 12px 14px; font-size: 1.3rem; background: #fff;
}
#auth-pin { letter-spacing: .6em; font-weight: 700; }
.hint { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.error { color: #c22; font-weight: 700; margin: 0; min-height: 1.2em; }
.kicker { font: 1.2rem var(--hand); color: var(--ink-soft); margin: 0; }
.code { font-family: var(--sans); font-weight: 700; letter-spacing: .12em; background: var(--yellow); padding: 0 .3em; border-radius: 8px; border: 2px solid var(--ink); }

/* --- menu --- */
.greet { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-soft); }
.streak svg { width: 26px; height: 26px; }
.guest-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff1c9; margin-bottom: 16px; }
.guest-banner p { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile {
  position: relative; overflow: hidden; text-align: left; min-height: 150px;
  border: var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px; color: #fff;
  transition: transform .1s;
}
.tile:hover { transform: translateY(-2px) rotate(-.5deg); }
.tile:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.tile.orange { background: var(--orange); }
.tile.blue { background: var(--blue); }
.tile.green { background: var(--green); }
.tile.purple { background: var(--purple); }
.tile-cards { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 6px; }
.tile-cards i {
  font: 700 1.05rem/1 var(--sans); font-style: normal; color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: 8px; padding: 12px 8px; transform: rotate(-8deg);
}
.tile-cards i + i { background: var(--yellow); transform: rotate(7deg) translateY(-6px); }
.tile-title { font: 2.2rem/1 var(--hand); }
.tile-sub { font-weight: 700; opacity: .92; position: relative; z-index: 1; }
.tile-art { position: absolute; right: -6px; bottom: -14px; font: 700 4.4rem/1 var(--sans); opacity: .25; transform: rotate(-8deg); }
.tile-rocket { position: absolute; right: 12px; bottom: 14px; width: 96px; height: 48px; color: #fff; transform: rotate(-12deg); animation: hover 2.4s ease-in-out infinite; }
@keyframes hover { 50% { transform: rotate(-12deg) translate(4px, -6px); } }
.meter { margin-top: auto; height: 16px; background: rgba(255, 255, 255, .35); border: 2px solid var(--ink); border-radius: 99px; display: flex; overflow: hidden; }
.meter span:first-child { background: var(--b3); }
.meter span:last-child { background: var(--b4); order: -1; }
.shelf { margin-top: 20px; }
.cups { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; color: var(--ink-soft); }
.cup { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.cup svg { width: 36px; height: 36px; }
.cup.gold { color: #f4b400; } .cup.silver { color: #c9ced8; } .cup.bronze { color: #d58a4a; }
.cup b { color: var(--ink); }
#logout { margin-top: 18px; }

/* --- ekran gry --- */
.play { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 520px; }
.dots i { width: 16px; height: 16px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); }
.dots i.now { background: var(--yellow); transform: scale(1.25); }
.dots i.fast { background: var(--green); }
.dots i.slow { background: var(--b2); }
.dots i.wrong { background: var(--red); }
.q-card {
  position: relative; width: min(100%, 520px); text-align: center;
  background: var(--card); border: var(--line); border-radius: 26px; box-shadow: var(--shadow);
  padding: 22px 16px 16px;
}
.q { font: 700 clamp(3.2rem, 15vw, 5rem)/1 var(--sans); margin: 0; letter-spacing: .02em; }
.q .x { color: var(--orange); margin: 0 .12em; }
.answer {
  min-height: 1.3em; font: 700 clamp(2.6rem, 12vw, 3.8rem)/1.2 var(--sans); margin: 10px auto 0;
  width: 3.4em; border-bottom: 5px solid var(--ink); color: var(--blue);
}
.answer.empty::after { content: "?"; color: var(--b0); }
.flash { min-height: 1.6em; margin: 8px 0 0; font: 1.5rem var(--hand); }
.flash.good { color: var(--green); }
.flash.bad { color: #d33; }
.q-card.good { animation: pop .3s; border-color: var(--green); }
.q-card.bad { animation: shake .35s; }
@keyframes pop { 50% { transform: scale(1.04); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.speed { display: flex; align-items: center; gap: 6px; width: 60%; margin: 12px auto 0; }
.speed span { flex: 1; height: 8px; border-radius: 99px; background: var(--yellow); border: 2px solid var(--ink); transform-origin: left; }
.speed svg { width: 24px; height: 24px; color: var(--yellow); transition: color .2s, opacity .2s; }
.speed.gone span { background: var(--b0); }
.speed.gone svg { color: var(--b0); opacity: .6; }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 360px); }
.numpad button {
  height: 64px; border: var(--line); border-radius: 16px; background: var(--card);
  font: 700 1.8rem var(--sans); box-shadow: 0 4px 0 var(--ink); touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.numpad button:active, .numpad button.hit { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.numpad .ok { background: var(--green); color: #fff; }
.numpad .del { background: #fde3dc; }

/* --- wizualizacja pomyłki --- */
.viz { width: min(100%, 560px); text-align: center; animation: enter .3s; }
.viz-title { font: 1.7rem var(--hand); margin-bottom: 4px; }
.viz-stage { display: flex; justify-content: center; overflow-x: auto; padding: 6px 0; }
.viz-stage svg { max-width: 100%; height: auto; }
.viz-text { font-weight: 700; font-size: 1.25rem; }
.viz-ask { font: 1.5rem var(--hand); margin: 10px 0 0; color: var(--blue); }
.dot { transform-box: fill-box; transform-origin: center; animation: dot-in .25s backwards; }
@keyframes dot-in { from { transform: scale(0); } }
.seg-label { font: 700 17px var(--sans); fill: var(--ink); animation: dot-in .3s backwards; }
.skip-num { font: 700 14px var(--sans); fill: var(--ink-soft); animation: dot-in .3s backwards; }

/* --- podsumowanie --- */
.stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.stat { border: var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 18px; min-width: 110px; text-align: center; background: var(--card); }
.stat b { display: block; font-size: 2.6rem; line-height: 1; }
.stat.green b { color: var(--green); } .stat.yellow b { color: #d9a400; } .stat.red b { color: var(--red); }
.sum-line { text-align: center; font-size: 1.15rem; }

/* --- mapa --- */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .map-wrap { grid-template-columns: 1fr; } }
.map {
  display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px;
  background: var(--card); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px;
}
.map .h { display: grid; place-items: center; font-weight: 700; color: var(--orange); aspect-ratio: 1; font-size: clamp(.75rem, 2.6vw, 1rem); }
.map .c {
  aspect-ratio: 1; border-radius: 7px; border: 2px solid var(--ink); display: grid; place-items: center;
  font: 700 clamp(.62rem, 2.4vw, .95rem) var(--sans); background: var(--b0); color: var(--ink);
}
.b0 { background: var(--b0) !important; } .b1 { background: var(--b1) !important; } .b2 { background: var(--b2) !important; }
.b3 { background: var(--b3) !important; } .b4 { background: var(--b4) !important; }
.map .c.b4 { box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.legend { list-style: none; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.legend li { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--ink-soft); }
.legend i { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--ink); display: inline-block; }
.picture { text-align: center; }
.pic { position: relative; aspect-ratio: 1; border: var(--line); border-radius: 14px; overflow: hidden; }
.pic svg.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.pic .cover { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, 1fr); }
.pic .cover i { background: #d9cfbb; border: 1px solid rgba(43, 33, 72, .15); transition: opacity .6s; }
.pic .cover i.open { opacity: 0; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.badge { background: var(--b4); border: var(--line); border-radius: 99px; padding: 6px 14px; font-weight: 700; box-shadow: 0 3px 0 var(--ink); }

/* --- memory --- */
.mem-setup { max-width: 520px; margin: 0 auto; }
.mem-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mem-names label { display: grid; gap: 4px; font-weight: 700; }
.mem-names input { border: var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; min-width: 0; }
.mem-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mem-players { display: flex; gap: 10px; flex-wrap: wrap; }
.mem-player { display: inline-flex; align-items: center; gap: 8px; border: var(--line); border-radius: 14px; padding: 6px 12px; background: var(--card); font-weight: 700; opacity: .55; transition: opacity .2s, transform .2s; }
.mem-player b { font-size: 1.3rem; }
.mem-player.turn { opacity: 1; background: var(--yellow); box-shadow: 0 3px 0 var(--ink); transform: translateY(-2px); }
.mem-info { font-weight: 700; color: var(--ink-soft); margin: 0; }
.mem-board { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 10px; max-width: 640px; margin: 0 auto; perspective: 900px; }
.mcard { aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; position: relative; transform-style: preserve-3d; transition: transform .35s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.mcard.up, .mcard.done { transform: rotateY(180deg); }
.mcard > span {
  position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
}
.mcard .back {
  background-color: var(--orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M10 10l8 8M18 10l-8 8' stroke='%23fff' stroke-opacity='.45' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.mcard .face { transform: rotateY(180deg); background: var(--card); font: 700 clamp(1.1rem, 5vw, 1.9rem)/1 var(--sans); }
.mcard.num .face { background: #fff1c2; }
.mcard.done .face { border-color: var(--green); background: #dcf7e6; box-shadow: 0 4px 0 var(--green); }
.mcard.done { animation: matched .5s; }
.mcard.miss .face { background: #ffe0dc; }
@keyframes matched { 50% { transform: rotateY(180deg) scale(1.08); } }
.mem-end { max-width: 460px; margin: 18px auto 0; text-align: center; animation: enter .3s; }

/* --- poczekalnia --- */
.lobby-head { display: grid; gap: 12px; }
.invite p { margin: 0 0 8px; font-weight: 700; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; border: var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; font-size: .95rem; }
.lobby-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.players { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.players li { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; padding: 6px 10px; border-radius: 12px; background: #f7f1e3; }
.players li svg { width: 26px; height: 26px; }
.players .tag { margin-left: auto; font-size: .8rem; color: var(--ink-soft); font-weight: 700; }
.players .me { background: #e5f0ff; }
.label { font-weight: 700; margin: 10px 0 6px; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: var(--line); border-radius: 12px; background: var(--card); padding: 6px 12px; font-weight: 700; min-width: 48px; }
.chip.on { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.readonly { font-size: 1.1rem; font-weight: 700; }
.wait { color: var(--ink-soft); font-weight: 700; margin: 0; }

/* --- wyścig --- */
.tracks { width: min(100%, 640px); display: grid; gap: 6px; }
.track { position: relative; height: 40px; background: #f2ead8; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.track::after { content: ""; position: absolute; right: 6px; top: 4px; bottom: 4px; width: 10px; background: repeating-linear-gradient(var(--ink) 0 6px, #fff 6px 12px); border-radius: 3px; }
.track .ship { position: absolute; top: 3px; left: 0; display: flex; align-items: center; gap: 4px; transition: left .45s cubic-bezier(.3, 1.4, .6, 1); white-space: nowrap; }
.track .ship svg { width: 56px; height: 30px; flex: none; }
.track .name { font-weight: 700; font-size: .85rem; background: rgba(255, 255, 255, .8); padding: 0 6px; border-radius: 6px; }
.track .score { position: absolute; right: 22px; top: 6px; font-weight: 700; }
.track.me { background: #e5f0ff; }
.race-timer { width: min(100%, 520px); height: 12px; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--card); }
.race-timer span { display: block; height: 100%; width: 100%; background: var(--blue); transform-origin: left; }

.countdown { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(255, 246, 229, .85); z-index: 20; }
.countdown span { font: 700 9rem/1 var(--sans); color: var(--orange); -webkit-text-stroke: 4px var(--ink); animation: count .9s ease-out; }
@keyframes count { from { transform: scale(2); opacity: 0; } 30% { opacity: 1; } }

/* --- wyniki --- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 26px 0 10px; min-height: 230px; }
.step { width: min(30vw, 150px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.step .nick { font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .block { width: 100%; border: var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; display: grid; place-items: center; font: 700 2.4rem var(--sans); color: #fff; animation: rise .7s cubic-bezier(.3, 1.3, .6, 1) backwards; transform-origin: bottom; }
.step.p1 .block { height: 150px; background: var(--b4); color: var(--ink); animation-delay: .5s; }
.step.p2 .block { height: 110px; background: #c9ced8; animation-delay: .25s; }
.step.p3 .block { height: 80px; background: #d58a4a; }
.step .crown { width: 56px; height: 56px; animation: crown 1s .9s backwards; }
@keyframes rise { from { transform: scaleY(0); } }
@keyframes crown { from { transform: translateY(-60px) rotate(-30deg); opacity: 0; } 60% { transform: translateY(6px); opacity: 1; } }
.ranking { max-width: 520px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 8px; }
.ranking li { display: flex; gap: 10px; align-items: center; background: var(--card); border: var(--line); border-radius: 14px; padding: 8px 14px; flex-wrap: wrap; }
.ranking .pl { font-weight: 700; font-size: 1.3rem; width: 1.6em; }
.ranking .nick { font-weight: 700; flex: 1; }
.ranking .pts { font-weight: 700; }
.ranking .me { background: #e5f0ff; }
.ranking .rec { background: var(--yellow); border: 2px solid var(--ink); border-radius: 99px; padding: 0 10px; font-size: .85rem; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; z-index: 30; max-width: calc(100% - 32px); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

@media (max-width: 420px) {
  body { font-size: 17px; }
  .numpad button { height: 58px; }
  .q-card { padding: 16px 10px 10px; }
  .tile { min-height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
