:root {
  --bg: #140f24;
  --ink: #fff7ec;
  --ink-dim: #b9add6;
  --hot: #ff3b3b;
  --hot-dark: #a3121a;
  --primary: #ffd60a;
  --primary-dark: #b08d00;
  --panel: #2a1f4a;
  --panel-edge: #3f2f6d;
  --ok: #4ade80;
  --bad: #ff5d5d;
  --meme: Impact, "Anton", "Arial Black", "Haettenschweiler", sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #3b2470 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 110%, #4a1238 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

button { font: inherit; color: inherit; }

#app {
  position: relative;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}
.brand-mini {
  font-family: var(--meme);
  letter-spacing: 1px;
  font-size: 18px;
  color: var(--ink-dim);
  opacity: 0;
  transition: opacity .2s;
}
#homeBtn:not([hidden]) ~ .brand-mini { opacity: 1; }
.icon-btn {
  width: 44px; height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  font-size: 20px;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn[hidden] { display: block; visibility: hidden; }

/* ---------- screens ---------- */
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; align-items: center; }
.screen.active { display: flex; animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
#screen-title, #screen-board, #screen-shop { overflow-y: auto; overscroll-behavior: contain; }

/* ---------- title ---------- */
.title-hero { margin-top: auto; display: flex; flex-direction: column; align-items: center; }
.title-menu { width: 100%; margin-bottom: auto; padding-bottom: 4px; }
.logo {
  margin-top: 2vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .86;
  font-family: var(--meme);
  text-transform: uppercase;
  transform: rotate(-4deg);
}
.logo-1, .logo-2 {
  display: block;
  font-size: clamp(68px, 22vw, 120px);
  color: #fff;
  -webkit-text-stroke: 4px #000;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #000, 0 0 40px rgba(255, 59, 59, .55);
}
.logo-2 { color: var(--primary); transform: translateX(18px); }
.logo-1 { animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(2deg) scale(1.03); } }

.tagline { margin: 18px 0 10px; text-align: center; font-size: 17px; color: var(--ink-dim); }
.tagline b { color: var(--ink); }

.banner, .saver {
  width: 100%;
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
}
.banner { background: linear-gradient(135deg, #5b1027, #3a1050); border: 2px solid var(--hot); }
.banner b { font-size: 20px; color: var(--primary); }
.saver { background: linear-gradient(135deg, #4a2a00, #3a1050); border: 2px solid #ff9f1c; }
.saver .action-row { margin-top: 8px; }
.banner[hidden], .saver[hidden] { display: none; }

.menu { width: 100%; display: grid; gap: 12px; margin-top: 8px; }
.menu-row, .action-row { display: flex; gap: 10px; }
.menu-row > .btn, .action-row > .btn { flex: 1 1 0; min-width: 0; }

body.booting .menu .btn { opacity: .55; pointer-events: none; }

/* ---------- buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 10px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 5px 0 #120b22;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #120b22; }
.btn:focus-visible, .icon-btn:focus-visible, .pad:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn small { font-weight: 700; opacity: .75; font-size: 14px; }
.btn-primary { background: var(--primary); color: #1a1300; box-shadow: 0 5px 0 var(--primary-dark); }
.btn-primary:active { box-shadow: 0 1px 0 var(--primary-dark); }
.btn-hot { background: var(--hot); color: #fff; box-shadow: 0 5px 0 var(--hot-dark); }
.btn-hot:active { box-shadow: 0 1px 0 var(--hot-dark); }
.btn-big { min-height: 66px; font-family: var(--meme); font-size: 30px; letter-spacing: 2px; font-weight: 400; }
.btn-ghost { background: transparent; box-shadow: none; border: 2px solid var(--panel-edge); min-height: 46px; font-size: 16px; }
.btn-ghost:active { transform: translateY(2px); box-shadow: none; }
.btn-small { min-height: 40px; font-size: 15px; padding: 6px 12px; border-radius: 12px; box-shadow: 0 3px 0 #120b22; }
.btn-small.btn-primary { box-shadow: 0 3px 0 var(--primary-dark); }
.btn-small.btn-hot { box-shadow: 0 3px 0 var(--hot-dark); }
.btn-small.btn-ghost { box-shadow: none; }
.btn:disabled { cursor: default; filter: none; transform: none; opacity: .7; }
.btn.is-equipped { background: transparent; border: 2px solid var(--ok); color: var(--ok); box-shadow: none; opacity: 1; }
.btn.is-locked { opacity: .6; }
.btn[hidden] { display: none; }

.stats { margin: 14px 0 6px; color: var(--ink-dim); font-size: 14px; text-align: center; }

.howto {
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink-dim);
  font-size: 15px;
}
.howto summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.howto ol { padding-left: 20px; line-height: 1.55; }
.howto .hint { font-size: 13px; }
kbd { display: inline-block; padding: 0 6px; border-radius: 5px; background: rgba(255, 255, 255, .12); font-family: var(--ui); font-size: 12px; }

/* ---------- game ---------- */
.game-info { width: 100%; }
.hud { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 4px; }
.hud-side { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--ink-dim); }
.hud-side.right { text-align: right; }
.hud-score { display: flex; flex-direction: column; align-items: center; line-height: 1; }
#scoreNum { font-family: var(--meme); font-size: 56px; -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 0 4px 0 #000; }
.hud-unit { font-size: 12px; font-weight: 700; color: var(--ink-dim); letter-spacing: 1px; text-transform: uppercase; }

.status { margin: 10px 0 8px; min-height: 30px; font-size: 22px; font-weight: 900; text-align: center; transition: color .15s; }
.status.go { color: var(--primary); }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); font-family: var(--meme); font-size: 30px; letter-spacing: 1px; }

.progress { position: relative; width: 100%; height: 8px; margin-bottom: 22px; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.progress-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--hot)); transition: width .12s; }
.progress-text { position: absolute; right: 0; top: 12px; font-size: 12px; font-weight: 700; color: var(--ink-dim); }

.grid {
  width: 100%;
  max-width: 440px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 3.5vw, 18px);
  touch-action: manipulation;
}
#screen-game .grid { margin-bottom: auto; }
@media (min-height: 700px) and (max-aspect-ratio: 5/4) {
  #screen-game .grid { margin-top: auto; }
}
.grid.board { max-width: none; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px; padding: 4px 2px 12px; }

/* the instant-button (Classic skin) */
.pad {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  background: radial-gradient(circle at 34% 28%, var(--c-light) 0%, var(--c) 42%, var(--c-dark) 100%);
  box-shadow:
    0 7px 0 var(--c-deep),
    0 12px 18px rgba(0, 0, 0, .45),
    inset 0 -6px 12px rgba(0, 0, 0, .25),
    inset 0 4px 8px rgba(255, 255, 255, .25);
  filter: saturate(.75) brightness(.78);
  transform: translateY(0);
  transition: transform .07s, box-shadow .07s, filter .1s, background .1s;
}
.pad::after {
  content: "";
  position: absolute;
  top: 9%; left: 20%;
  width: 42%; height: 24%;
  border-radius: 50%;
  background: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.pad-emoji { font-size: clamp(26px, 9vw, 44px); line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.pad-label {
  font-family: var(--meme);
  font-size: clamp(10px, 3.2vw, 15px);
  letter-spacing: .6px;
  color: #fff;
  -webkit-text-stroke: 1px rgba(0, 0, 0, .7);
  paint-order: stroke fill;
  white-space: nowrap;
}
.board .pad-emoji { font-size: 28px; }
.board .pad-label { font-size: 11px; }

.pad.lit {
  filter: saturate(1.25) brightness(1.2);
  transform: translateY(5px);
  box-shadow: 0 2px 0 var(--c-deep), 0 0 0 5px rgba(255, 255, 255, .9), 0 0 40px 12px var(--c), inset 0 -4px 10px rgba(0, 0, 0, .2);
}
.pad.wrong {
  filter: grayscale(.6) brightness(.9);
  box-shadow: 0 0 0 5px var(--bad), 0 0 30px 8px var(--bad);
  animation: buzz .09s linear 5;
}
@keyframes buzz { 50% { transform: translateX(-4px) rotate(-3deg); } }
.grid.locked .pad { cursor: default; }
.grid.board .pad { filter: saturate(.95) brightness(.95); }
.grid.board .pad.lit { filter: saturate(1.25) brightness(1.2); }

/* ---------- skins (applied with data-skin on the grid) ---------- */
[data-skin="neon"] > .pad {
  background: radial-gradient(circle at 50% 40%, #241538, #0b0614);
  box-shadow: 0 0 0 3px var(--c), 0 0 16px 1px var(--c), inset 0 0 20px var(--c-dark);
  filter: none;
}
[data-skin="neon"] > .pad::after { display: none; }
[data-skin="neon"] > .pad .pad-label { color: var(--c-light); -webkit-text-stroke: 0; }
[data-skin="neon"] > .pad.lit {
  background: radial-gradient(circle, var(--c-light), var(--c));
  box-shadow: 0 0 0 4px #fff, 0 0 46px 14px var(--c);
  transform: scale(1.05);
}
[data-skin="neon"] > .pad.lit .pad-label { color: #fff; }

[data-skin="candy"] > .pad {
  border-radius: 30%;
  background: linear-gradient(180deg, var(--c-pastel), var(--c-light) 55%, var(--c));
  box-shadow: 0 7px 0 var(--c-dark), 0 10px 16px rgba(0, 0, 0, .35), inset 0 3px 0 rgba(255, 255, 255, .6);
  filter: saturate(.8) brightness(.85);
}
[data-skin="candy"] > .pad::after { top: 7%; left: 14%; width: 50%; height: 18%; border-radius: 40%; }
[data-skin="candy"] > .pad.lit {
  filter: saturate(1.3) brightness(1.15);
  transform: translateY(5px) scale(1.04);
  box-shadow: 0 2px 0 var(--c-dark), 0 0 0 5px #fff, 0 0 36px 10px var(--c-light);
}

[data-skin="gold"] > .pad {
  background: radial-gradient(circle at 34% 28%, #fff6c8 0%, #ffd34d 40%, #a8790a 100%);
  box-shadow: 0 7px 0 #6b4f05, 0 12px 18px rgba(0, 0, 0, .45), inset 0 0 0 5px var(--c), inset 0 -6px 12px rgba(0, 0, 0, .25);
  filter: brightness(.82);
}
[data-skin="gold"] > .pad .pad-label { color: #3a2a00; -webkit-text-stroke: 0; }
[data-skin="gold"] > .pad.lit {
  filter: brightness(1.2) saturate(1.2);
  transform: translateY(5px);
  box-shadow: 0 2px 0 #6b4f05, 0 0 0 5px #fff, 0 0 44px 14px #ffd34d, inset 0 0 0 5px var(--c);
}

/* ---------- soundboard & shop ---------- */
.screen-title { font-family: var(--meme); font-size: 38px; letter-spacing: 1px; margin: 4px 0 0; font-weight: 400; }
.screen-sub { margin: 4px 0 14px; color: var(--ink-dim); }
.scroll-area { width: 100%; }
.board-more { margin: 4px 0 12px; }

.wallet { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.wallet-coins { font-size: 24px; font-weight: 900; }
.wallet .btn { width: auto; }
.shop-head { margin: 16px 0 8px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-dim); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.shop-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  text-align: center;
}
.shop-name { font-weight: 800; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 4px 8px; }
.mini-grid > .pad { cursor: default; }
.mini-grid .pad-emoji { font-size: 20px; }
.pack-emojis { min-height: 66px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; font-size: 20px; letter-spacing: 3px; line-height: 1.5; }
.shop-note { margin: 16px 0 10px; font-size: 13px; color: var(--ink-dim); text-align: center; }

/* ---------- footer & site content (website build only) ---------- */
.foot { flex: none; margin-top: 10px; text-align: center; font-size: 12px; color: #7d70a3; }
.foot a { color: inherit; }
body[data-screen="game"] .foot { visibility: hidden; }
.site-content {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 24px 16px 48px;
  color: var(--ink-dim);
  line-height: 1.65;
  -webkit-user-select: text;
  user-select: text;
  border-top: 1px solid var(--panel-edge);
}
.site-content h2, .site-content h3 { color: var(--ink); line-height: 1.25; }
.site-content b { color: var(--ink); }
.ad-slot { margin: 0 auto 24px; min-height: 100px; text-align: center; }

/* ---------- hype, shake ---------- */
.hype {
  position: fixed;
  left: 50%; top: 45%;
  transform: translate(-50%, -50%) scale(.3) rotate(-8deg);
  font-family: var(--meme);
  font-size: clamp(40px, 12vmin, 76px);
  white-space: nowrap;
  color: var(--primary);
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #000;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}
.hype.show { animation: hype 1.1s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes hype {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-8deg); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(-4deg); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1) rotate(-4deg); }
}
#app.shake { animation: shake .45s; }
@keyframes shake {
  10%, 90% { transform: translateX(-3px); }
  20%, 80% { transform: translateX(6px); }
  30%, 50%, 70% { transform: translateX(-10px); }
  40%, 60% { transform: translateX(10px); }
}

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(8, 4, 18, .72);
  backdrop-filter: blur(4px);
  animation: fade .2s;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, #33245c, #241a42);
  border: 2px solid var(--panel-edge);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  text-align: center;
  animation: pop .3s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.go-title {
  font-family: var(--meme);
  font-size: 60px;
  line-height: 1;
  color: var(--hot);
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 #000;
  transform: rotate(-3deg);
}
.go-title.small { font-size: 36px; color: var(--primary); }
.go-roast { margin-top: 6px; color: var(--ink-dim); font-size: 16px; }
.go-score { margin: 12px 0 4px; display: flex; flex-direction: column; align-items: center; }
.go-score .num { font-family: var(--meme); font-size: 80px; line-height: 1; color: #fff; text-shadow: 0 5px 0 #000; }
.go-score .lbl { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-dim); }
.go-rank { display: inline-block; margin-top: 8px; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-weight: 800; font-size: 17px; }
.go-best { margin-top: 10px; color: var(--primary); font-weight: 900; letter-spacing: .5px; }
.go-coins { margin-top: 8px; min-height: 1px; font-weight: 900; font-size: 18px; color: var(--primary); }
.go-target { margin-top: 8px; font-weight: 800; }
.go-sub { margin-top: 8px; font-size: 13px; color: var(--ink-dim); }
.modal-actions { display: grid; gap: 10px; margin-top: 16px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: #fff;
  color: #1a1030;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  animation: fade .2s;
}
.toast[hidden] { display: none; }

/* ---------- ads: loading blocker + local test ad ---------- */
.ad-wait { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(8, 4, 18, .55); }
.ad-wait[hidden] { display: none; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ad-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: #000; }
.ad-overlay[hidden] { display: none; }
.ad-box { text-align: center; color: #ddd; }
.ad-kind { font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.ad-count { font-family: var(--meme); font-size: 96px; color: #fff; }
.ad-note { font-size: 13px; color: #888; }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 35; }

/* =====================================================================
   LANDSCAPE (desktop, and the 16:9 portal iframes: 640×360 … 1920×1080)
   ===================================================================== */
@media (min-aspect-ratio: 5/4) {
  #app { max-width: 1100px; padding: 8px 16px; }
  .topbar { position: absolute; top: 8px; left: 12px; right: 12px; height: 44px; z-index: 6; pointer-events: none; }
  .topbar .icon-btn { pointer-events: auto; }
  .brand-mini { display: none; }
  .foot { position: absolute; left: 0; right: 0; bottom: 4px; margin: 0; font-size: 11px; }
  body:not([data-screen="title"]) .foot { display: none; }

  .btn { min-height: clamp(38px, 8.5vh, 54px); font-size: clamp(14px, 2.8vh, 18px); padding: 6px 14px; }
  .btn-big { min-height: clamp(46px, 11vh, 70px); font-size: clamp(22px, 5.2vh, 32px); }
  .btn-small { min-height: 36px; font-size: 14px; }

  /* title: logo left, menu right */
  #screen-title.active { flex-direction: row; justify-content: center; align-items: center; gap: clamp(20px, 6vw, 80px); padding: 8px 0 18px; }
  .title-hero { margin: 0; }
  .title-menu { width: min(380px, 44vw); margin: 0; max-height: 100%; }
  .logo { margin-top: 0; }
  .logo-1, .logo-2 { font-size: clamp(44px, 17vh, 140px); -webkit-text-stroke-width: clamp(2px, .7vh, 4px); }
  .tagline { margin: 2.5vh 0 0; font-size: clamp(13px, 2.6vh, 18px); }
  .menu { gap: clamp(6px, 1.6vh, 12px); margin-top: 0; }
  .menu-row { gap: clamp(6px, 1.6vh, 12px); }
  .stats { margin: 1.6vh 0 .6vh; font-size: clamp(12px, 2.2vh, 14px); }
  .banner, .saver { margin: 0 0 1.4vh; padding: 6px 10px; font-size: clamp(12px, 2.3vh, 15px); }
  .banner b { font-size: clamp(14px, 2.8vh, 20px); }
  .howto { padding: 6px 12px; font-size: 14px; }

  /* game: info left, buttons right */
  #screen-game.active { flex-direction: row; justify-content: center; align-items: center; gap: clamp(16px, 5vw, 64px); }
  .game-info { width: clamp(170px, 26vw, 300px); }
  .hud { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; }
  .hud-side, .hud-side.right { text-align: center; font-size: clamp(11px, 2.2vh, 13px); }
  .hud-score { order: -1; }
  #scoreNum { font-size: clamp(40px, 12vh, 72px); }
  .status { font-size: clamp(16px, 3.6vh, 24px); margin: 1.5vh 0; }
  .status.bad { font-size: clamp(22px, 5vh, 32px); }
  .progress { margin-bottom: 0; }
  #screen-game .grid { width: min(440px, calc(100vh - 28px)); width: min(440px, calc(100dvh - 28px)); margin: 0; gap: clamp(8px, 2.6vh, 18px); flex: none; }
  .pad-emoji { font-size: clamp(20px, 7.5vh, 44px); }
  .pad-label { font-size: clamp(9px, 2.6vh, 15px); }

  /* soundboard + shop: header then a scrolling area */
  #screen-board, #screen-shop { overflow: hidden; padding-top: 4px; }
  .scroll-area { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 18px; }
  .screen-title { font-size: clamp(26px, 6vh, 38px); }
  .screen-sub { margin: 2px 0 8px; font-size: 14px; }
  .grid.board { grid-template-columns: repeat(auto-fill, minmax(clamp(70px, 15vh, 96px), 1fr)); gap: 12px; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  /* modal: results left, actions right */
  .modal-card { max-width: 720px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; padding: 16px; }
  .modal-actions { margin-top: 0; gap: clamp(6px, 1.5vh, 10px); }
  .go-title { font-size: clamp(36px, 9vh, 60px); }
  .go-score .num { font-size: clamp(48px, 13vh, 80px); }
  .go-score { margin: 1vh 0 2px; }
  .go-roast, .go-rank { font-size: clamp(13px, 2.6vh, 17px); }
  .go-best, .go-coins, .go-target, .go-sub { margin-top: .8vh; font-size: clamp(12px, 2.4vh, 16px); }
}

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