/* ============================================================
   Block Blast Highscore — styling
   Stage 800×600, schaalt met transform: scale().
   Donkere glossy puzzle-look, eigen kleuren-palet.
   ============================================================ */

:root {
  /* Palet */
  --bg-1: #0a0e22;
  --bg-2: #161b3f;
  --bg-3: #1f1244;
  --panel: #0e122c;
  --panel-soft: #18204b;
  --board-cell: #2d3676;
  --board-cell-empty: #2a3270;
  --board-line: #3a4699;
  --text: #f1f4ff;
  --text-soft: #adb5d8;
  --accent: #ffd23a;
  --accent-dk: #b78c00;
  --good: #66ff99;
  --bad: #ff6688;

  /* Blok-kleuren — eigen palet met heldere highlights */
  --c-yellow-lo: #ffe66a;  --c-yellow-hi: #ffb800;
  --c-cyan-lo:   #7be4ff;  --c-cyan-hi:   #0a9fd9;
  --c-blue-lo:   #7da6ff;  --c-blue-hi:   #2a4fcc;
  --c-orange-lo: #ffba6e;  --c-orange-hi: #d6620a;
  --c-red-lo:    #ff8a8a;  --c-red-hi:    #d32030;
  --c-green-lo:  #8be58b;  --c-green-hi:  #229a35;
  --c-purple-lo: #d18cff;  --c-purple-hi: #7b1ed1;
  --c-teal-lo:   #7ce8d8;  --c-teal-hi:   #129a87;
  --c-pink-lo:   #ff9cd1;  --c-pink-hi:   #c81b8a;
  --c-magenta-lo:#ff89b8;  --c-magenta-hi:#b81860;
  --c-lime-lo:   #d4f76e;  --c-lime-hi:   #5fa600;
  --c-aqua-lo:   #82ffd9;  --c-aqua-hi:   #18b89a;
  --c-salmon-lo: #ffa691;  --c-salmon-hi: #cf4a36;
  --c-gold-lo:   #ffe28a;  --c-gold-hi:   #d49a00;

  --scale: 1;
  --cell: 44px;            /* board cel-formaat */
  --tray-cell: 22px;       /* tray cel-formaat (preview) */
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Rubik', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

.app {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 600px at 50% 0%, #1c2266 0%, transparent 65%),
    radial-gradient(900px 700px at 50% 110%, #2a1860 0%, transparent 60%),
    linear-gradient(180deg, #07091f 0%, #0c0f2c 60%, #11103a 100%);
}

/* ── Stage 800×600 (scaled to fit window) ─────────────────── */
.stage {
  position: relative;
  width: 800px; height: 600px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 26px 70px rgba(0,0,0,0.55),
    0 0 0 1px rgba(122,139,255,0.10),
    inset 0 1px 0 rgba(255,255,255,0.05);
  transform-origin: center;
  transform: scale(var(--scale));
  background:
    radial-gradient(700px 400px at 50% -5%, #232a72 0%, transparent 60%),
    linear-gradient(180deg, #131838 0%, #0a0c24 100%);
}

/* Sterren-decoratie */
.stars {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 10%, rgba(255,255,255,0.6) 100%, transparent),
    radial-gradient(1px 1px at 25% 30%, rgba(255,255,255,0.4) 100%, transparent),
    radial-gradient(1.5px 1.5px at 40% 8%, rgba(255,255,255,0.7) 100%, transparent),
    radial-gradient(1px 1px at 60% 22%, rgba(255,255,255,0.5) 100%, transparent),
    radial-gradient(1px 1px at 75% 12%, rgba(255,255,255,0.55) 100%, transparent),
    radial-gradient(1.5px 1.5px at 90% 18%, rgba(255,255,255,0.5) 100%, transparent),
    radial-gradient(1px 1px at 10% 50%, rgba(255,255,255,0.3) 100%, transparent),
    radial-gradient(1px 1px at 88% 60%, rgba(255,255,255,0.35) 100%, transparent);
  opacity: 0.55;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px;
  z-index: 5;
  height: 44px;
}
.topbar__left  { display: flex; align-items: center; min-width: 140px; }
.topbar__center{
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.topbar__right { display: flex; align-items: center; gap: 6px; min-width: 140px; justify-content: flex-end; }

.brand--logo {
  display: block;
  height: 38px;
  width: auto;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.40));
}

.pill {
  background: linear-gradient(180deg, #1b2156 0%, #11163a 100%);
  border: 1px solid rgba(130,150,255,0.18);
  border-radius: 18px;
  padding: 4px 14px 5px;
  display: flex; flex-direction: column; align-items: center;
  min-width: 96px;
  line-height: 1;
  box-shadow:
    0 6px 14px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
.pill__label {
  font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase;
  font-weight: 800; color: rgba(205,212,255,0.72);
}
.pill__value {
  font-size: 20px; font-weight: 900; color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  margin-top: 3px;
}
.pill--record .pill__value { color: var(--accent); }
.pill.bump .pill__value {
  animation: scoreBump 0.45s ease-out;
  display: inline-block;
}
@keyframes scoreBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.32); color: var(--good); }
  100% { transform: scale(1); }
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1b2156 0%, #11163a 100%);
  border: 1px solid rgba(130,150,255,0.20);
  color: var(--text);
  font-size: 16px;
  display: grid; place-items: center;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.07);
  transition: filter .15s, transform .08s;
}
.icon-btn:hover  { filter: brightness(1.15); }
.icon-btn:active { transform: translateY(1px); }

/* ── Combo banner ────────────────────────────────────────── */
.combo-banner {
  position: absolute;
  top: 66px; left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 5px 16px 6px;
  border-radius: 14px;
  background: rgba(255, 210, 58, 0.12);
  border: 1px solid rgba(255, 210, 58, 0.55);
  color: var(--accent);
  font-size: 13px; font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0,0,0,0.30);
}
.combo-banner.show {
  opacity: 1;
  animation: comboPop .35s ease-out;
}
@keyframes comboPop {
  0%   { transform: translateX(-50%) scale(.7); }
  60%  { transform: translateX(-50%) scale(1.15); }
  100% { transform: translateX(-50%) scale(1); }
}

/* ── Board ───────────────────────────────────────────────── */
.board-wrap {
  position: absolute;
  left: 0; right: 0;
  top: 100px;
  display: flex; justify-content: center;
}
.board {
  display: grid;
  grid-template-columns: repeat(8, var(--cell));
  grid-template-rows: repeat(8, var(--cell));
  gap: 3px;
  padding: 10px;
  background: rgba(6, 8, 22, 0.92);
  border: 2px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.55),
    0 12px 30px rgba(0,0,0,0.45);
}
.cell {
  width: var(--cell); height: var(--cell);
  border-radius: 7px;
  background: var(--board-cell-empty);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.45);
  transition: background-color .15s;
}
.cell.filled {
  background:
    linear-gradient(160deg, var(--c-hi) 0%, var(--c-lo) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.50),
    inset 0 -3px 0 rgba(0,0,0,0.30),
    0 2px 4px rgba(0,0,0,0.35);
}
.cell.ghost {
  background:
    linear-gradient(160deg, var(--c-hi) 0%, var(--c-lo) 100%);
  opacity: 0.45;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.55),
    0 0 14px rgba(255,255,255,0.20);
}
.cell.placed {
  animation: cellPop .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cellPop {
  0%   { transform: scale(.4); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.cell.clearing {
  animation: cellClear .45s ease-out forwards;
}
@keyframes cellClear {
  0%   {
    transform: scale(1);
    filter: brightness(1);
    box-shadow:
      inset 0 2px 0 rgba(255,255,255,0.5),
      inset 0 -3px 0 rgba(0,0,0,0.3),
      0 2px 4px rgba(0,0,0,0.35);
  }
  30%  {
    transform: scale(1.18);
    filter: brightness(1.6);
    box-shadow: 0 0 22px rgba(255,255,255,0.85);
  }
  100% {
    transform: scale(.3);
    filter: brightness(2);
    opacity: 0;
  }
}

/* ── Tray ────────────────────────────────────────────────── */
.tray {
  position: absolute;
  left: 0; right: 0;
  bottom: 8px;
  height: 110px;
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  z-index: 4;
}
.slot {
  flex: 1;
  position: relative;
  background: linear-gradient(180deg, rgba(18,22,55,0.65), rgba(12,15,40,0.65));
  border: 1px solid rgba(130,150,255,0.16);
  border-radius: 14px;
  min-height: 90px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.slot.empty {
  opacity: 0.45;
}
.slot.shake { animation: slotShake .35s ease-out; }
@keyframes slotShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.slot__piece {
  position: absolute;
  cursor: grab;
  transform-origin: center center;
  transition: transform .15s ease-out;
}
.slot__piece:hover {
  transform: scale(1.06);
}
.slot__piece.dragging {
  opacity: 0.25;
  pointer-events: none;
}
.slot__cell {
  position: absolute;
  border-radius: 5px;
  background: linear-gradient(160deg, var(--c-hi) 0%, var(--c-lo) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.30);
}

.slot__appear { animation: slotAppear .35s ease-out; }
@keyframes slotAppear {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Float-laag (drijvend stuk tijdens drag) ──────────────── */
.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}
.float-piece {
  position: absolute;
  display: grid;
  gap: 2px;
  pointer-events: none;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.55));
  will-change: transform;
}
.float-piece .float-cell {
  width: var(--cell);
  height: var(--cell);
  border-radius: 7px;
  background: linear-gradient(160deg, var(--c-hi) 0%, var(--c-lo) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.50),
    inset 0 -3px 0 rgba(0,0,0,0.30);
}

/* ── Score-pop laag ──────────────────────────────────────── */
.popup-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 31;
  overflow: hidden;
}
.score-pop {
  position: absolute;
  font-size: 22px; font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--accent);
  text-shadow:
    0 2px 0 rgba(0,0,0,0.55),
    0 6px 14px rgba(0,0,0,0.35);
  pointer-events: none;
  transform: translate(-50%, 0);
  animation: scorePop 1.0s ease-out forwards;
}
.score-pop--good  { color: var(--good); }
.score-pop--combo { color: #ff66cc; font-size: 26px; }
@keyframes scorePop {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(0.5); }
  20%  { transform: translate(-50%, -8px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1); }
}

/* ── Overlays ────────────────────────────────────────────── */
.overlay {
  position: absolute; inset: 0;
  z-index: 50;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(600px 400px at 50% 50%, rgba(48,40,140,0.30) 0%, transparent 65%),
    rgba(5, 7, 22, 0.86);
}
.overlay--visible { display: flex; }

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(37,45,105,0.96) 0%, rgba(20,26,72,0.98) 100%);
  color: var(--text);
  border-radius: 24px;
  padding: 26px 32px 22px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  box-shadow:
    0 28px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(122,139,255,0.10),
    inset 0 1px 0 rgba(255,255,255,0.08);
  border: 1.5px solid rgba(122,139,255,0.28);
  animation: panelIn .35s ease-out;
}
@keyframes panelIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.panel__title {
  margin: 0 0 6px 0;
  font-size: 40px; font-weight: 900;
  color: var(--text);
  text-shadow:
    0 3px 0 rgba(0,0,0,0.28),
    0 10px 24px rgba(0,0,0,0.35);
  letter-spacing: -1px;
  line-height: 1.05;
}
.panel__logo {
  display: block;
  margin: 0 auto 10px;
  width: 100%;
  max-width: 380px;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.38));
}
.panel__title span { color: var(--accent); margin-left: 4px; }
.panel__title--small {
  font-size: 28px;
  color: var(--accent);
  text-shadow:
    0 3px 0 rgba(0,0,0,0.28),
    0 8px 20px rgba(255,200,40,0.18);
}

.panel__intro {
  margin: 0 0 14px 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(220,225,255,0.76);
}

.hero-preview {
  display: grid;
  grid-template-columns: repeat(8, 22px);
  grid-auto-rows: 22px;
  gap: 3px;
  justify-content: center;
  padding: 8px;
  background: rgba(8,10,28,0.55);
  border: 1px solid rgba(122,139,255,0.14);
  border-radius: 14px;
  margin: 8px auto 14px;
  width: max-content;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.hero-cell {
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}
.hero-cell.c-cyan   { --c-hi: var(--c-cyan-hi);   --c-lo: var(--c-cyan-lo);   background: linear-gradient(160deg, var(--c-hi), var(--c-lo)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.hero-cell.c-orange { --c-hi: var(--c-orange-hi); --c-lo: var(--c-orange-lo); background: linear-gradient(160deg, var(--c-hi), var(--c-lo)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.hero-cell.c-yellow { --c-hi: var(--c-yellow-hi); --c-lo: var(--c-yellow-lo); background: linear-gradient(160deg, var(--c-hi), var(--c-lo)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.hero-cell.c-purple { --c-hi: var(--c-purple-hi); --c-lo: var(--c-purple-lo); background: linear-gradient(160deg, var(--c-hi), var(--c-lo)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.hero-cell.c-green  { --c-hi: var(--c-green-hi);  --c-lo: var(--c-green-lo);  background: linear-gradient(160deg, var(--c-hi), var(--c-lo)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.hero-cell.c-pink   { --c-hi: var(--c-pink-hi);   --c-lo: var(--c-pink-lo);   background: linear-gradient(160deg, var(--c-hi), var(--c-lo)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }

.record-line {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(205,212,255,0.72);
  margin: 8px 0 4px;
}
.record-line b { color: var(--accent); font-weight: 800; }

.panel__stats {
  display: flex; gap: 14px; justify-content: center;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}
.stat {
  background: linear-gradient(180deg, rgba(25,31,78,0.96), rgba(17,22,60,0.98));
  border: 1px solid rgba(130,150,255,0.20);
  border-radius: 16px;
  padding: 10px 20px;
  min-width: 110px;
  box-shadow:
    0 10px 24px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
.stat__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: rgba(205,212,255,0.72);
}
.stat__value {
  font-size: 30px; font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  margin-top: 3px;
}
.stat--record .stat__value { color: var(--accent); }

.panel__actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 4px;
}

/* Game-over modal iets breder zodat de twee actie-knoppen comfortabel
   naast elkaar passen zonder over te lopen. */
#overOverlay .panel {
  max-width: 580px;
  padding: 26px 24px 22px;
}

/* Game-over: rij met 2 knoppen naast elkaar + Score insturen eronder. */
.panel__actions--gameover {
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
  align-items: center;
}
.gameover-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: stretch;
}
.gameover-row .btn {
  width: 250px;
  height: 70px;
  padding: 0 14px;
  font-size: 22px;
  letter-spacing: 0.3px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.panel__actions--gameover .btn--submit {
  width: 420px;
  height: 62px;
  padding: 0 14px;
  font-size: 22px;
  letter-spacing: 0.3px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Startscherm Start-knop: zelfde 2D premium-game stijl als game-over. */
#startOverlay .btn--primary {
  background: linear-gradient(180deg, #ffdc55 0%, #ffc72d 52%, #f4a90f 100%);
  color: #1f1705;
  border: 2px solid rgba(255,255,255,0.28);
  border-radius: 18px;
  font-weight: 900;
  letter-spacing: 0.4px;
  box-shadow:
    0 10px 24px rgba(0,0,0,0.26),
    inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
#startOverlay .btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow:
    0 12px 26px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.25);
}
#startOverlay .btn--primary:active {
  transform: translateY(1px);
  filter: brightness(0.98);
  box-shadow:
    0 7px 18px rgba(0,0,0,0.24),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

/* Game-over buttons: één 2D premium-game stijl voor alle drie de varianten.
   Geen dikke 3D bottom-shadow — subtiele drop-shadow + inset gloss. */
.panel__actions--gameover .btn {
  border: 2px solid rgba(255,255,255,0.16);
  border-radius: 18px;
  font-weight: 900;
  letter-spacing: 0.4px;
  box-shadow:
    0 10px 24px rgba(0,0,0,0.26),
    inset 0 1px 0 rgba(255,255,255,0.22);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.panel__actions--gameover .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow:
    0 12px 26px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.25);
}
.panel__actions--gameover .btn:active {
  transform: translateY(1px);
  filter: brightness(0.98);
  box-shadow:
    0 7px 18px rgba(0,0,0,0.24),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

/* Variant-specifieke gradient + border-tint (geen 3D bruine onderrand meer). */
.panel__actions--gameover .btn--primary {
  background: linear-gradient(180deg, #ffdc55 0%, #ffc72d 52%, #f4a90f 100%);
  color: #1f1705;
  border-color: rgba(255,255,255,0.28);
}
.panel__actions--gameover .btn--ghost {
  background: linear-gradient(180deg, rgba(75,88,157,0.95) 0%, rgba(46,56,116,0.98) 100%);
  color: #f5f6ff;
  border-color: rgba(176,188,255,0.26);
}
.panel__actions--gameover .btn--submit {
  background: linear-gradient(180deg, #6376ff 0%, #4658df 55%, #3545bf 100%);
  color: #ffffff;
  border-color: rgba(190,200,255,0.38);
}

.btn {
  background: linear-gradient(180deg, #5d6fe5 0%, #2a3b9c 100%);
  color: white;
  border: 0;
  border-radius: 18px;
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    0 6px 0 #1a2370,
    0 14px 26px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.18);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  transition: transform .08s, box-shadow .12s, filter .15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #1a2370,
    0 6px 12px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.16);
}
.btn--primary {
  background: linear-gradient(180deg, #ffd84d 0%, #ffb91f 100%);
  color: #201707;
  font-weight: 900;
  letter-spacing: 0.4px;
  box-shadow:
    0 8px 0 #b47700,
    0 16px 28px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.45);
}
.btn--primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn--primary:active {
  transform: translateY(5px);
  box-shadow:
    0 3px 0 #b47700,
    0 10px 18px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn--ghost {
  background: linear-gradient(180deg, rgba(64,72,130,0.82), rgba(37,43,91,0.92));
  color: #f3f5ff;
  border: 1.5px solid rgba(165,178,255,0.25);
  box-shadow:
    0 6px 0 rgba(8,12,34,0.7),
    0 12px 24px rgba(0,0,0,0.30),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn--ghost:hover { transform: translateY(-1px); filter: brightness(1.10); }
.btn--ghost:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 rgba(8,12,34,0.7),
    0 6px 12px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn--submit {
  background: linear-gradient(180deg, rgba(94,111,255,0.98) 0%, rgba(58,71,185,0.98) 100%);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.4px;
  border: 1.5px solid rgba(180,190,255,0.35);
  box-shadow:
    0 8px 0 rgba(24,30,110,0.85),
    0 16px 28px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn--submit:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn--submit:active {
  transform: translateY(5px);
  box-shadow:
    0 3px 0 rgba(24,30,110,0.85),
    0 10px 18px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

/* ============================================================
   Mobiel portrait — vol-scherm layout, viewport-based cell-size.
   800×600 wordt losgelaten; alle posities passen zich aan.
   ============================================================ */
@media (orientation: portrait) and (max-width: 700px) {
  :root {
    /* Cel-grootte schaalt mee met breedte van het scherm */
    --cell: clamp(34px, 11vw, 56px);
    --tray-cell: clamp(15px, 5.2vw, 26px);
  }
  body {
    background: var(--bg-1);
  }
  .app {
    align-items: stretch;
    justify-content: stretch;
    background: none;
  }
  .stage {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    transform: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* Topbar: brand verbergen, score+record blijven gecentreerd */
  .topbar {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 8px; right: 8px;
    height: 42px;
    gap: 6px;
  }
  .topbar__left  { display: none; }
  .topbar__right { min-width: auto; }
  .pill          { min-width: 80px; padding: 3px 11px 4px; }
  .pill__value   { font-size: 18px; }
  .icon-btn      { width: 38px; height: 38px; }

  .combo-banner { top: 62px; font-size: 13px; }

  /* Board: net onder topbar gecentreerd */
  .board-wrap {
    top: calc(env(safe-area-inset-top, 0px) + 64px);
  }
  .board {
    padding: 8px;
    gap: 2px;
    border-radius: 12px;
  }

  /* Tray onderaan, met safe-area */
  .tray {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    height: 132px;
    padding: 6px 10px;
    gap: 6px;
  }
  .slot {
    min-height: 100px;
    border-radius: 12px;
  }

  /* Overlay-panels smaller + scrollable als nodig */
  .overlay { padding: 14px; }
  .panel {
    padding: 20px 20px 18px;
    border-radius: 20px;
    max-width: 360px;
  }
  .panel__title { font-size: 32px; letter-spacing: -0.8px; }
  .panel__title--small { font-size: 24px; }
  .panel__logo { max-width: 280px; margin-bottom: 8px; }
  .panel__intro { font-size: 13px; margin-bottom: 10px; }
  .hero-preview {
    grid-template-columns: repeat(8, 18px);
    grid-auto-rows: 18px;
    gap: 2px;
    padding: 6px;
    border-radius: 12px;
  }
  .stat { padding: 9px 16px; min-width: 96px; border-radius: 14px; }
  .stat__value { font-size: 26px; }
  .btn { padding: 12px 20px; font-size: 13px; border-radius: 16px; }

  /* Game-over: twee knoppen stapelen op echt smalle viewports. */
  #overOverlay .panel { max-width: 360px; padding: 20px 18px 18px; }
  .gameover-row { flex-direction: column; gap: 10px; width: 100%; }
  .gameover-row .btn,
  .panel__actions--gameover .btn--submit {
    width: min(100%, 320px);
    height: 56px;
    font-size: 16px;
    padding: 0 14px;
  }
}

/* Landscape op kleine schermen — geen extra override nodig,
   de standaard scale-via-transform doet zijn werk. */

