@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-opsz.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  /* Mindzeed-designsystem (kort, knapper, tekst) */
  --mz-strong: #1a1a1a; --mz-text: #333; --mz-body: #4d4d4d; --mz-muted: #666;
  --mz-border: #e5e5e5; --mz-border-strong: #cccccc; --mz-soft: #f1f4f1;
  --mz-mint-50: #e6faf6; --mz-mint-600: #25a99d; --mz-mint-800: #146b64;
  --mz-yellow: #f2db5a; --mz-red-tint: #fdeeed; --mz-dark-red: #b84944;
  /* Plads i bunden, som LMS'ets "Tilbage til kurset" og mobilbrowserens værktøjslinje kan dække */
  --safe-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  --ink: #333;
  --red: #f05f5a;
  --red-dark: #c9443f;
  --gold: #f6c445;
  --snow: #f7faf8;
  --face: #e7ece7;
  --sky-top: #0d1733;
  --sky-bottom: #2a4170;
  --roof: #2b3654;
  --roof-dark: #222b44;
  --green: #2f8f6b;
  --outline: max(2px, calc(var(--cell) * 0.016));
  /* Én "celle" pr. skorsten. Skalerer efter skærmen. */
  --cell: min(calc((100vw - 24px) / 3), calc((100vh - 84px - var(--safe-bottom)) / 3.45), 230px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@supports (height: 100dvh) {
  :root { --cell: min(calc((100vw - 24px) / 3), calc((100dvh - 84px - var(--safe-bottom)) / 3.45), 230px); }
}
@media (max-width: 700px) {
  :root { --safe-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--sky-top);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
img { -webkit-user-drag: none; user-select: none; }
button { font: inherit; }

#app { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---------- Himmel og sne ---------- */
.sky { position: absolute; inset: 0; background: linear-gradient(var(--sky-top), var(--sky-bottom) 70%, #3c5a8f); }
.stars { position: absolute; left: 0; top: 0; width: 2px; height: 2px; border-radius: 50%; background: transparent; }
.moon {
  position: absolute; right: 7%; top: 9%; width: clamp(44px, 9vmin, 90px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbea, #f3e8bf 60%, #e6d59c);
  box-shadow: 0 0 40px 8px rgba(255, 246, 210, .25);
}
#snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

/* ---------- HUD ---------- */
.hud {
  position: absolute; z-index: 50; top: 0; left: 0; right: 0; height: 64px; pointer-events: none;
  display: flex; align-items: center; gap: 12px; padding: 10px max(12px, env(safe-area-inset-left)) 0;
  color: #fff; opacity: 0; transition: opacity .3s;
}
body.playing .hud, body.counting .hud { opacity: 1; }
.hud-score { display: flex; flex-direction: column; line-height: 1; min-width: 86px; }
.hud-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
#score { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
#score.bump { animation: bump .25s; }
.hud-timer { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 520px; margin: 0 auto; }
.timer-track { flex: 1; height: 18px; border-radius: 10px; background: rgba(255,255,255,.15); border: 2px solid var(--ink); overflow: hidden; }
#timer-bar {
  height: 100%; width: 100%; transform-origin: left center;
  background: repeating-linear-gradient(-45deg, var(--red) 0 10px, #fff 10px 20px);
}
.hud-timer.low #timer-bar { animation: pulse .5s infinite alternate; }
#timer-text { font-weight: 800; font-size: 20px; min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.hud-right { display: flex; align-items: center; gap: 10px; }
.combo {
  font-weight: 900; font-size: 20px; padding: 4px 10px; border-radius: 12px; border: 2px solid var(--ink);
  background: #fff; color: var(--ink); opacity: .35; transition: opacity .2s, background .2s; min-width: 48px; text-align: center;
}
.combo.x2 { opacity: 1; background: var(--gold); }
.combo.x3 { opacity: 1; background: var(--red); color: #fff; animation: pulse .6s infinite alternate; }
.combo.bump { animation: bump .3s; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--mz-border-strong); background: #fff; cursor: pointer;
  display: grid; place-items: center; padding: 0; color: var(--mz-text); transition: background .1s;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .spk { fill: var(--ink); }
.icon-btn .cross { display: none; }
.icon-btn.muted .wave { display: none; }
.icon-btn.muted .cross { display: inline; }
.icon-btn:hover { background: var(--mz-soft); }
.hud .icon-btn { pointer-events: auto; }
.tools { display: flex; align-items: center; gap: 8px; }
/* På start- og slutskærmen flyttes lyd- og sprogknappen ind i kortets øverste hjørne (game.js). */
.card > .tools { position: absolute; top: 12px; right: 12px; z-index: 2; }
.card > .tools .icon-btn { width: 36px; height: 36px; }

/* ---------- Spillepladen ---------- */
#field {
  position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; top: 64px; padding-bottom: var(--safe-bottom);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  touch-action: none;
}
.row { position: relative; z-index: 0; width: 100%; height: calc(var(--cell) * 0.95); display: flex; justify-content: center; }
.row:last-child { height: calc(var(--cell) * 1.05); }
.roof {
  position: absolute; left: -2%; right: -2%; bottom: 0; height: calc(var(--cell) * 0.34);
  background:
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--cell) * 0.075), rgba(0,0,0,.2) calc(var(--cell) * 0.075) calc(var(--cell) * 0.085)),
    linear-gradient(var(--roof-top), var(--roof-bottom));
  border-top: var(--outline) solid var(--ink);
}
.roof::before { /* snelag med bølget, optegnet kant */
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--cell) * -0.02); height: calc(var(--cell) * 0.13);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 26' preserveAspectRatio='none'%3E%3Cpath d='M0 0H180V10C170 10 166 20 152 20C138 20 136 12 122 12C108 12 104 24 88 24C72 24 70 13 56 13C42 13 38 21 24 21C12 21 10 10 0 10Z' fill='%23f7faf8'/%3E%3Cpath d='M0 10C10 10 12 21 24 21C38 21 42 13 56 13C70 13 72 24 88 24C104 24 108 12 122 12C136 12 138 20 152 20C166 20 170 10 180 10' fill='none' stroke='%23333' stroke-width='2.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 0 0 / calc(var(--cell) * 0.9) 100% repeat-x;
}
.row { --roof-top: #3a4875; --roof-bottom: #27304f; }
.row:nth-child(1) { --roof-top: #2a3459; --roof-bottom: #1d2440; }
.row:nth-child(2) { --roof-top: #313d67; --roof-bottom: #222a47; }
.row:last-child .roof { height: calc(var(--cell) * 0.42 + var(--safe-bottom)); bottom: calc(-1 * var(--safe-bottom)); }

.hole { position: relative; width: var(--cell); height: 100%; }
.chimney {
  position: absolute; left: 50%; bottom: calc(var(--cell) * 0.16); transform: translateX(-50%);
  width: calc(var(--cell) * 0.56); height: calc(var(--cell) * 0.34);
  border: var(--outline) solid var(--ink); border-top: 0;
  background: #a65242 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24'%3E%3Crect width='40' height='24' fill='%23a65242'/%3E%3Cpath d='M0 1H40M0 13H40M20 1V13M2 13V24M38 13V24' stroke='%23823c31' stroke-width='2.2'/%3E%3C/svg%3E") 0 0 / calc(var(--cell) * 0.2) auto;
  z-index: 3;
}
.cap {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 4;
  bottom: calc(var(--cell) * 0.48); width: calc(var(--cell) * 0.68); height: calc(var(--cell) * 0.09);
  background: #8a4336; border: var(--outline) solid var(--ink); border-radius: 4px;
}
.cap::before { /* sne på kanten */
  content: ""; position: absolute; left: -6%; right: -4%; top: calc(var(--cell) * -0.055); height: calc(var(--cell) * 0.085);
  background: var(--snow); border: var(--outline) solid var(--ink);
  border-radius: 40% 55% 35% 50% / 80% 90% 40% 50%;
}
.pop {
  position: absolute; left: 0; right: 0; z-index: 2;
  bottom: calc(var(--cell) * 0.55); height: calc(var(--cell) * 1.1);
  clip-path: inset(-200% -200% 0 -200%); /* klip kun i bunden: figuren kommer op af skorstenen */
  pointer-events: none;
}
.mover {
  position: absolute; left: 50%; bottom: calc(var(--cell) * -0.1);
  width: calc(var(--cell) * 1.13); aspect-ratio: 2780 / 2310;
  transform: translate(-32.27%, 105%);
  transition: transform .16s ease-in;
}
.hole.up .mover { transform: translate(-32.27%, 0); transition: transform .16s cubic-bezier(.2,1.4,.5,1); }
.char { width: 100%; height: 100%; display: block; }
.hitbox {
  position: absolute; left: 13%; top: 8%; width: 42%; height: 84%; border-radius: 45%;
  pointer-events: auto; cursor: pointer;
}
.hole:not(.up) .hitbox, .hole.hit .hitbox { pointer-events: none; }
.hole.hit .char { animation: squash .3s ease-out; transform-origin: 32% 90%; }
.hole.type-guld .char { filter: drop-shadow(0 0 calc(var(--cell) * 0.05) rgba(255, 214, 90, .95)); }
.hole.wrong .char { animation: shake .35s; }

/* ---------- Hammer ---------- */
#mallet {
  position: absolute; z-index: 30; left: 0; top: 0; width: calc(var(--cell) * 0.5); height: calc(var(--cell) * 0.5);
  pointer-events: none; opacity: 0; will-change: transform;
}
#mallet svg { width: 100%; height: 100%; transform-origin: 50% 96%; transform: rotate(28deg); transition: transform .12s ease-out; display: block; }
#mallet.swing svg { transform: rotate(-38deg); transition: transform .06s ease-in; }
body.playing #mallet.show { opacity: 1; }
@media (pointer: fine) {
  body.playing #field, body.playing #field * { cursor: none; }
}

/* ---------- Effekter ---------- */
#fx { position: absolute; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.float {
  position: absolute; transform: translate(-50%, -50%); font-weight: 900; white-space: nowrap; text-align: center;
  font-size: clamp(18px, calc(var(--cell) * 0.16), 34px); color: #fff; line-height: 1.05;
  -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink);
  animation: floatUp .9s ease-out forwards;
}
.float small { display: block; font-size: .55em; -webkit-text-stroke: 1px var(--ink); }
.float.good { color: #fff; }
.float.gold { color: var(--gold); }
.float.reveal { color: #9fe3c4; }
.float.bad { color: #ff8a85; }
.float.miss { color: #cdd6e6; font-size: clamp(13px, calc(var(--cell) * 0.1), 20px); text-shadow: none; }
.spark {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 2px; background: #fff;
  animation: spark .55s ease-out forwards;
}
.spark.gold { background: var(--gold); }
.spark.red { background: var(--red); }

/* ---------- Skærme (Mindzeed-designsystem) ---------- */
.screen {
  position: absolute; inset: 0; z-index: 40; display: none; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px calc(16px + var(--safe-bottom)); background: rgba(9, 16, 38, .55);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.screen.is-active { display: flex; }
.card {
  position: relative; width: min(560px, 100%); margin: auto; /* margin:auto centrerer uden at klippe, når kortet er højere end skærmen */
  background: #fff; border: 1px solid var(--mz-border); border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.45), 0 4px 8px -4px rgba(0,0,0,.25);
  padding: 28px 24px 22px; text-align: center; color: var(--mz-text); user-select: text; -webkit-user-select: text;
}
#screen-start .card { padding-top: 64px; }
#screen-start { padding-top: 60px; }
#screen-end .card { padding-top: 56px; } /* plads til lyd- og sprogknappen over overskriften */
.card-hero { position: absolute; left: 50%; top: -62px; width: 150px; transform: translateX(-32.27%); animation: peek 2.4s ease-in-out infinite; }
.eyebrow { margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: .05em; color: var(--mz-mint-800); }
h1 { margin: 0 0 8px; font-size: clamp(30px, 7vw, 42px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; color: var(--mz-strong); }
h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: .05em; color: var(--mz-mint-800); }
.lead { margin: 0 auto 16px; max-width: 42ch; font-size: 16px; line-height: 1.6; color: var(--mz-body); }
.hint { margin: 10px 0 16px; font-size: 14px; color: var(--mz-muted); }

.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend li {
  display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px;
  text-align: left; background: var(--mz-soft); border-radius: 12px; padding: 6px 10px 6px 4px;
}
.legend img { grid-row: 1 / 3; width: 66px; margin-left: -6px; }
.legend b { font-size: 14px; font-weight: 600; color: var(--mz-strong); align-self: end; }
.legend span { font-size: 12.5px; color: var(--mz-muted); align-self: start; }
.legend li.bad { background: var(--mz-red-tint); }
.legend li.wide { grid-column: 1 / -1; grid-template-columns: auto 1fr; }
.legend-imgs { grid-row: 1 / 3; display: flex; margin-left: -4px; }
.legend-imgs img { width: 54px; margin: 0 -8px 0 0; }

.name-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 0 0 12px; font-weight: 600; }
.name-row[hidden] { display: none; }
input[type="text"] {
  font: inherit; font-weight: 500; color: var(--mz-text); padding: 9px 12px; background: #fff;
  border: 1px solid var(--mz-border-strong); border-radius: 8px; transition: border-color .1s, box-shadow .1s;
}
input[type="text"]:focus { outline: none; border-color: var(--mz-mint-600); box-shadow: 0 0 0 3px rgba(37,169,157,.25); }
.name-row input { width: 200px; max-width: 60vw; }
.player-info { display: flex; justify-content: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.player-info div { background: var(--mz-soft); border-radius: 12px; padding: 8px 12px; min-width: 96px; }
.player-info span { display: block; font-size: 12px; font-weight: 500; color: var(--mz-muted); }
.player-info b { font-size: 17px; font-weight: 600; color: var(--mz-strong); font-variant-numeric: tabular-nums; }

.board { margin: 0 0 16px; }
.board ol { list-style: none; margin: 0; padding: 0; text-align: left; }
.board li {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; white-space: nowrap;
  padding: 7px 12px; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.board li:nth-child(odd) { background: var(--mz-soft); }
.board li.me { background: var(--mz-mint-50); box-shadow: inset 0 0 0 1px var(--mz-mint-600); font-weight: 600; }
.board li.gap { background: none; box-shadow: none; text-align: center; display: block; color: var(--mz-muted); padding: 0; line-height: 1; }
.rank { font-weight: 600; color: var(--mz-muted); }
li:nth-child(1) .rank::before { content: "★ "; color: #e0a800; }
.who small { color: var(--mz-muted); font-weight: 500; margin-left: 6px; font-size: 11.5px; }
.pts { font-weight: 600; color: var(--mz-strong); }

.btn {
  display: inline-block; min-width: 220px; padding: 14px 28px; font-size: 18px; font-weight: 600; color: #fff;
  background: var(--mz-text); border: 0; border-radius: 8px; cursor: pointer; transition: background .1s;
}
.btn:hover { background: #0d0d0d; }
.btn:disabled { background: var(--mz-border); color: #8c8c8c; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .tabs button:focus-visible, .link-btn:focus-visible {
  outline: 3px solid rgba(37,169,157,.55); outline-offset: 2px;
}
.msg { margin: 12px 0 0; font-size: 14px; color: var(--mz-muted); }
.mode-badge { margin: 12px auto 0; display: inline-block; font-size: 12px; background: var(--mz-soft); color: var(--mz-muted); padding: 4px 10px; border-radius: 99px; }
.mode-badge[hidden], .msg[hidden] { display: none; }
.btn.btn-ghost { background: #fff; color: var(--mz-strong); box-shadow: inset 0 0 0 1px var(--mz-border-strong, #ccc); text-decoration: none; }
.btn.btn-ghost:hover { background: var(--mz-soft); }

/* Kun online-versionen */
.brand { margin: 14px 0 0; font-size: 13px; color: var(--mz-muted); }
.brand a { color: var(--mz-mint-800); font-weight: 600; text-decoration: none; }
.brand a:hover { text-decoration: underline; }
.brand[hidden], .cta[hidden] { display: none; }
.cta { margin: 20px 0 0; padding: 16px; border-radius: 12px; border: 1px solid var(--mz-border); text-align: center; }
.cta-title { margin: 0 0 4px; font-weight: 700; color: var(--mz-strong); }
.cta-text { margin: 0 0 12px; font-size: 14px; color: var(--mz-muted); line-height: 1.5; }
.cta .btn { min-width: 0; padding: 11px 22px; font-size: 16px; }

.final { display: flex; flex-direction: column; align-items: center; margin: 4px 0 14px; position: relative; }
.final-label { font-size: 14px; font-weight: 600; letter-spacing: .05em; color: var(--mz-mint-800); }
.final-score { font-size: 64px; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; color: var(--mz-strong); font-variant-numeric: tabular-nums; }
.ribbon {
  margin-top: 8px; background: var(--mz-yellow); color: var(--mz-strong); border-radius: 99px; padding: 4px 14px;
  font-weight: 600; font-size: 14px; animation: fadeIn .3s .2s both;
}
.ribbon[hidden] { display: none; }
.stats { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.stats li { background: var(--mz-soft); border-radius: 12px; padding: 8px 10px; min-width: 84px; }
.stats li.bad { background: var(--mz-red-tint); }
.stats b { display: block; font-size: 20px; font-weight: 700; color: var(--mz-strong); }
.stats span { font-size: 12px; color: var(--mz-muted); }
.tip { background: var(--mz-mint-50); border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; text-align: left; }
.tip h2 { margin-bottom: 4px; }
.tip p { margin: 0; line-height: 1.55; color: var(--mz-text); }

.screen-count { background: rgba(9, 16, 38, .25); backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.count-num {
  margin: auto;
  font-size: clamp(80px, 22vmin, 180px); font-weight: 900; color: #fff;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink);
}
.count-num.go { color: var(--gold); }
.count-num.tick { animation: countIn .5s ease-out; }

/* ---------- Faner, fælles liste, sprog ---------- */
.tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 0 0 10px; }
.tabs[hidden] { display: none; }
.tabs button {
  font: inherit; font-weight: 600; font-size: 14px; padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--mz-border-strong); background: #fff; color: var(--mz-text); cursor: pointer; transition: background .1s;
}
.tabs button:hover { background: var(--mz-soft); }
.tabs button.active { background: var(--mz-text); border-color: var(--mz-text); color: #fff; }
.who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.who .sub { display: block; font-size: 12px; line-height: 1.25; color: var(--mz-muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.board li.empty { display: block; text-align: center; color: var(--mz-muted); background: none; padding: 10px; white-space: normal; }
.nick-line { margin: -4px auto 12px; font-size: 14px; color: var(--mz-body); max-width: 46ch; }
.nick-line b { color: var(--mz-strong); font-weight: 600; }
.nick-line[hidden] { display: none; }
.notice {
  margin: 10px auto 0; font-size: 13px; line-height: 1.45; color: #7a4300; background: #fdf3e0;
  border-radius: 8px; padding: 8px 12px; max-width: 46ch;
}
.notice[hidden] { display: none; }
.lang-btn { font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.lang-btn[hidden] { display: none; }
body.playing .lang-btn, body.counting .lang-btn { display: none; }

/* ---------- Arbejdsplads ---------- */
.wp-form { margin: 0 auto 14px; max-width: 420px; text-align: left; background: var(--mz-soft); border-radius: 12px; padding: 14px 16px; }
.wp-form[hidden] { display: none; }
.wp-form label { display: block; font-weight: 600; color: var(--mz-strong); margin-bottom: 8px; }
.wp-row { display: flex; gap: 8px; }
.wp-row input { flex: 1; min-width: 0; }
.btn.btn-small { min-width: 0; width: auto; padding: 9px 18px; font-size: 16px; }
.wp-help { margin: 8px 0 0; font-size: 12.5px; color: var(--mz-muted); }
.wp-error { margin: 8px 0 0; font-size: 13px; color: var(--mz-dark-red); font-weight: 600; }
.wp-error[hidden] { display: none; }
.link-btn {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--mz-body); background: none; border: 0; padding: 0 0 0 6px;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:hover { color: #0d0d0d; }
.link-btn[hidden] { display: none; }

/* ---------- Animationer ---------- */
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.35); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
@keyframes spark { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(200deg); opacity: 0; } }
@keyframes squash { 0% { transform: scale(1, 1); } 30% { transform: scale(1.12, .82); } 60% { transform: scale(.95, 1.05); } 100% { transform: scale(1, 1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6%); } 40% { transform: translateX(6%); } 60% { transform: translateX(-4%); } 80% { transform: translateX(3%); } }
@keyframes peek { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes countIn { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .card-hero, .combo.x3, .hud-timer.low #timer-bar { animation: none; }
}
@media (max-width: 420px) {
  .legend li { grid-template-columns: 40px 1fr; padding: 5px 6px 5px 2px; column-gap: 6px; }
  .legend img { width: 50px; margin-left: -4px; }
  .legend b { font-size: 13px; }
  .legend span { font-size: 11.5px; }
  .player-info { flex-wrap: nowrap; }
  .player-info div { min-width: 0; flex: 1; padding: 6px 6px; }
  .player-info b { font-size: 15px; }
  .lead { font-size: 15px; }
  .card { padding: 22px 14px 18px; }
  #screen-start .card { padding-top: 60px; }
  .hud { gap: 8px; }
  .hud-score { min-width: 64px; }
  #score { font-size: 24px; }
  .btn { min-width: 0; width: 100%; }
}
