/* Letterlaan – avondlaan met lantaarnlicht, houten letterstenen op een papieren bord */
:root {
  --ink: #fdf6e8;
  --muted: #b9b2d6;
  --bg1: #171433;
  --bg2: #2a2260;
  --panel: rgba(255, 255, 255, .07);
  --panel-2: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .14);
  --lamp: #ffc35c;
  --lamp-2: #ff8f4d;
  --teal: #3fd1c1;
  --danger: #ff6b6b;
  --paper: #f3e7cc;
  --cell: #ecdcb8;
  --grid: #d8c493;
  --tw: #e4573f; --dw: #f2a39b; --tl: #3871c9; --dl: #93c3ea;
  --wood-1: #fbe3ae; --wood-2: #e7b965; --wood-ink: #4a2c12;
  --cell-size: 44px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg1);
  background-image:
    radial-gradient(ellipse 60% 45% at 12% -5%, rgba(255, 195, 92, .28), transparent 70%),
    radial-gradient(ellipse 50% 40% at 95% 0%, rgba(255, 143, 77, .18), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 120%, rgba(63, 209, 193, .14), transparent 70%),
    linear-gradient(180deg, var(--bg2), var(--bg1) 70%);
  background-attachment: fixed;
  display: flex; flex-direction: column; min-height: 100dvh; overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
small { color: var(--muted); font-weight: 400; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.01em; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(10, 8, 30, .45); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-tiles { display: flex; }
.logo-tiles b {
  width: 26px; height: 28px; display: grid; place-items: center; font-weight: 900; font-size: 17px;
  background: linear-gradient(160deg, var(--wood-1), var(--wood-2)); color: var(--wood-ink); border-radius: 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 2px 4px rgba(0, 0, 0, .4);
}
.logo-tiles b:last-child { transform: translate(-6px, 6px) rotate(8deg); background: linear-gradient(160deg, #ffd88a, var(--lamp-2)); }
.logo-word { font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.logo-word em { font-style: normal; color: var(--lamp); }
.top-info { display: flex; gap: 8px; margin-left: auto; }
.top-actions { display: flex; gap: 6px; margin-left: auto; }
.top-info + .top-actions { margin-left: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); font-size: 14px; cursor: default;
}
button.chip { cursor: pointer; }
.chip span { color: var(--muted); }
.chip strong { letter-spacing: .08em; }
.bag-ico { width: 14px; height: 15px; background: var(--lamp); border-radius: 3px 3px 7px 7px; position: relative; }
.bag-ico::before { content: ""; position: absolute; left: 3px; right: 3px; top: -3px; height: 4px; border: 2px solid var(--lamp); border-bottom: 0; border-radius: 4px 4px 0 0; }

/* ---------- knoppen ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); padding: 10px 16px; border-radius: 12px;
  font-weight: 700; cursor: pointer; transition: transform .08s, background .15s, opacity .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ffd27a, var(--lamp-2)); color: #3a1d05; border-color: transparent; box-shadow: 0 4px 14px rgba(255, 143, 77, .35); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffdd94, #ff9d61); }
.btn.ghost { background: transparent; }
.btn.warn { background: rgba(255, 107, 107, .18); border-color: rgba(255, 107, 107, .45); }
.btn.on { background: var(--teal); color: #062b28; border-color: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); position: relative;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.accent { background: var(--lamp); color: #3a1d05; border-color: transparent; }
.dot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg1); }
.tab .dot { position: static; display: inline-block; margin-left: 4px; vertical-align: middle; }

/* ---------- start ---------- */
.screen { flex: 1; width: 100%; }
#startScreen, #lobbyScreen { display: grid; gap: 22px; max-width: 1050px; margin: 0 auto; padding: 28px 16px 40px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 900; }
.lead { color: var(--muted); font-size: 17px; max-width: 34em; }
.hero-tiles { display: flex; gap: min(6px, 1vw); margin-bottom: 18px; max-width: 100%; }
.hero-tiles .tile { --tile: min(40px, calc((100vw - 32px - 9 * min(6px, 1vw)) / 10)); --t: 0deg; transform: rotate(var(--t)); animation: drop .6s cubic-bezier(.2, 1.4, .4, 1) backwards; }
@keyframes drop { from { transform: translateY(-40px) rotate(var(--t)); opacity: 0; } }
.form { display: grid; gap: 12px; margin-top: 18px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
input {
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; font-size: 16px; outline: none; width: 100%;
}
input:focus { border-color: var(--lamp); box-shadow: 0 0 0 3px rgba(255, 195, 92, .25); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.join input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .3em; font-weight: 800; text-align: center; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err { color: var(--danger); min-height: 1.2em; margin: 0; font-weight: 600; }
.rules ol { padding-left: 20px; display: grid; gap: 8px; color: #e9e3ff; margin: 0 0 18px; }
.lb { --hg-accent: var(--lamp); --hg-bg: rgba(0, 0, 0, .2); --hg-fg: var(--ink); --hg-border: var(--line); --hg-input: rgba(0, 0, 0, .3); }
.lb:empty { display: none; }

/* ---------- lobby ---------- */
.share { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.big-code { font-size: clamp(28px, 9vw, 38px); font-weight: 900; letter-spacing: .2em; color: var(--lamp); text-shadow: 0 0 24px rgba(255, 195, 92, .45); }
.chat-card { min-height: 300px; }
.chat { --hg-accent: var(--teal); --hg-bg: rgba(0, 0, 0, .18); --hg-fg: var(--ink); --hg-border: var(--line); --hg-input: rgba(0, 0, 0, .3); min-height: 240px; }
.chat:empty::before { content: "Chat is niet beschikbaar."; color: var(--muted); font-size: 14px; }

/* ---------- spelerslijst ---------- */
.players { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.players li {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 12px; background: rgba(0, 0, 0, .18); border: 1px solid transparent; transition: border-color .2s, background .2s;
}
.players li.turn { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 20%, transparent); }
.players li.left { opacity: .45; }
.pawn {
  width: 30px; height: 30px; border-radius: 50%; background: var(--pc); position: relative; display: grid; place-items: center;
  font-weight: 900; color: #fff; font-size: 14px; text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), 0 2px 6px rgba(0, 0, 0, .35);
}
.pawn.off::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #777; box-shadow: 0 0 0 2px var(--bg1); }
.pname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname small { display: block; font-size: 12px; }
.pscore { font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; }
.players li.turn .pname::after { content: " · aan zet"; color: var(--lamp); font-weight: 600; font-size: 12px; }

/* ---------- spelscherm ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
body.in-game { height: 100dvh; overflow: hidden; }
body.in-game .game { flex: 1; min-height: 0; }
.play { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.turnbar { padding: 10px 14px 6px; display: grid; gap: 8px; }
.turn { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.turn .pawn { width: 22px; height: 22px; font-size: 11px; }
.turn.mine { color: var(--lamp); }
.turn .timer { font-weight: 600; color: var(--muted); font-size: 13px; }
.banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 195, 92, .22), rgba(255, 143, 77, .14)); border: 1px solid rgba(255, 195, 92, .45);
}
.banner .grow { flex: 1; min-width: 180px; }
.banner .word { font-weight: 900; letter-spacing: .05em; }

.viewport {
  position: relative; flex: 1; min-height: 220px; overflow: hidden; touch-action: none; cursor: grab;
  margin: 0 10px; border-radius: 18px;
  background: radial-gradient(ellipse at center, rgba(255, 195, 92, .1), transparent 70%), rgba(0, 0, 0, .22);
  border: 1px solid var(--line);
}
.viewport.dragging { cursor: grabbing; }
.board-wrap { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.viewport.animate .board-wrap { transition: transform .45s cubic-bezier(.25, .8, .25, 1); }
.board {
  display: grid; gap: 2px; padding: 10px; border-radius: 16px;
  grid-template-columns: repeat(var(--n), var(--cell-size)); grid-auto-rows: var(--cell-size);
  background: linear-gradient(145deg, #7a4b2a, #4e2d17); box-shadow: 0 20px 50px rgba(0, 0, 0, .55), inset 0 0 0 3px rgba(255, 255, 255, .08);
}
.cell {
  position: relative; border-radius: 5px; background: var(--cell); display: grid; place-items: center;
  font-size: 8px; font-weight: 800; line-height: 1.05; text-align: center; color: rgba(255, 255, 255, .95);
  text-transform: uppercase; letter-spacing: .02em; user-select: none;
}
.cell.T { background: var(--tw); }
.cell.D, .cell.s { background: var(--dw); color: #7a1f17; }
.cell.t { background: var(--tl); }
.cell.d { background: var(--dl); color: #183f66; }
.cell.s::before { content: "★"; font-size: 24px; color: #b8382d; }
.cell.cursor { outline: 3px solid var(--teal); outline-offset: -1px; z-index: 2; }
.cell.cursor::after {
  content: "→"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: #0c6e64;
  animation: blink 1s steps(2) infinite;
}
.cell.cursor.down::after { content: "↓"; }
@keyframes blink { 50% { opacity: .2; } }
.cell.drop { outline: 3px dashed var(--teal); outline-offset: -2px; }

.tile {
  --tile: 40px; width: var(--tile); height: var(--tile); border-radius: 7px; position: relative; display: grid; place-items: center;
  background: linear-gradient(155deg, var(--wood-1), var(--wood-2)); color: var(--wood-ink);
  box-shadow: inset 0 -3px 0 rgba(90, 50, 10, .25), inset 0 2px 0 rgba(255, 255, 255, .55), 0 2px 3px rgba(0, 0, 0, .35);
  font-weight: 900; font-size: calc(var(--tile) * .55); line-height: 1; user-select: none; text-transform: uppercase;
}
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .2; pointer-events: none;
  background: repeating-linear-gradient(100deg, transparent 0 6px, rgba(120, 70, 20, .45) 6px 7px);
}
.tile .v { position: absolute; right: 3px; bottom: 2px; font-size: calc(var(--tile) * .24); font-weight: 800; }
.tile.blank { color: #8a5a2b; font-style: italic; }
.cell .tile { --tile: calc(var(--cell-size) - 2px); }
.cell .tile.pending { background: linear-gradient(155deg, #d9fff9, #8de5da); color: #0b4a44; transform: translateY(-2px); box-shadow: 0 0 0 2px var(--teal), 0 6px 10px rgba(0, 0, 0, .4); }
.cell.last .tile { box-shadow: 0 0 0 3px var(--pc), 0 0 14px 2px var(--pc), inset 0 -3px 0 rgba(90, 50, 10, .25); z-index: 1; }
.cell.last .tile::after { content: ""; position: absolute; inset: -3px; border-radius: 9px; border: 3px solid var(--pc); animation: glow 2.2s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .25; transform: scale(1.08); } }
.cell.flash .tile { animation: flash .5s ease-in-out 4 alternate; z-index: 3; }
@keyframes flash { to { transform: scale(1.18) rotate(-4deg); box-shadow: 0 0 0 4px var(--lamp), 0 0 24px 6px var(--lamp); } }
.cell.fresh .tile { animation: land .45s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes land { from { transform: translateY(-26px) scale(1.25); opacity: 0; } }

.zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; z-index: 5; }
.zoom .icon-btn { background: rgba(23, 20, 51, .78); backdrop-filter: blur(4px); }
.zoom .icon-btn.accent { background: var(--lamp); }
.hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 12px; color: var(--muted);
  background: rgba(23, 20, 51, .8); padding: 5px 10px; border-radius: 999px; pointer-events: none; transition: opacity .6s; white-space: nowrap;
}
.hint.gone { opacity: 0; }

.dock { padding: 8px 10px max(10px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.preview { min-height: 22px; text-align: center; font-weight: 700; font-size: 14px; color: var(--muted); }
.preview .pts { color: var(--lamp); font-size: 17px; }
.preview .bad { color: #ffb0b0; font-weight: 600; }
.rack {
  display: flex; justify-content: center; gap: 6px; padding: 10px; min-height: 66px; border-radius: 14px; margin: 0 auto; width: min(100%, 470px);
  background: linear-gradient(180deg, #6b4124, #45260f); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .45), 0 6px 14px rgba(0, 0, 0, .35);
}
.rack .tile { --tile: min(50px, calc((100vw - 90px) / 7)); cursor: grab; touch-action: none; transition: transform .12s; }
.rack .tile.sel { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--teal), 0 8px 14px rgba(0, 0, 0, .45); }
.rack .tile.swap { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--danger), 0 8px 14px rgba(0, 0, 0, .45); }
.rack .empty { color: var(--muted); align-self: center; font-size: 14px; }
.ghost-tile { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -60%) rotate(-6deg) scale(1.1); }
.actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.actions .btn { padding: 9px 13px; }

/* ---------- zijpaneel ---------- */
.side { border-left: 1px solid var(--line); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: rgba(10, 8, 30, .3); min-height: 0; }
.side-head { display: none; }
.last { padding: 14px; background: linear-gradient(160deg, rgba(255, 195, 92, .14), rgba(255, 255, 255, .05)); }
.last-title { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--lamp); font-weight: 800; margin-bottom: 8px; }
.last-who { display: flex; align-items: center; gap: 10px; }
.last-who .pawn { width: 34px; height: 34px; }
.last-who .pts { margin-left: auto; font-size: 26px; font-weight: 900; color: var(--lamp); }
.last-who .pts.neg { color: var(--danger); }
.words { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.word-chip { display: inline-flex; gap: 2px; align-items: center; padding: 3px 4px 3px 3px; border-radius: 8px; background: rgba(0, 0, 0, .25); }
.word-chip .mini { --tile: 20px; font-size: 12px; border-radius: 4px; }
.word-chip .mini .v { display: none; }
.word-chip b { margin-left: 4px; font-size: 13px; color: var(--lamp); }
.last .row { margin-top: 10px; }
.bingo { display: inline-block; background: var(--teal); color: #052a26; font-weight: 900; font-size: 11px; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: rgba(0, 0, 0, .25); padding: 4px; border-radius: 12px; }
.tab { border: 0; background: transparent; padding: 8px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--panel-2); color: var(--ink); }
.tabpane { flex: 1; min-height: 0; }
.moves { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.moves li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(0, 0, 0, .16); font-size: 14px; }
.moves li.click { cursor: pointer; }
.moves li.click:hover { background: rgba(255, 195, 92, .15); }
.moves .bar { width: 6px; height: 100%; min-height: 22px; border-radius: 3px; background: var(--pc, #666); }
.moves .w { font-weight: 800; letter-spacing: .03em; }
.moves .s { font-weight: 900; color: var(--lamp); }
.moves .s.neg { color: var(--danger); }
.moves .sys { color: var(--muted); }

/* ---------- dialogen ---------- */
.dlg {
  border: 1px solid var(--line); border-radius: 18px; padding: 22px; color: var(--ink); max-width: min(520px, 92vw);
  background: linear-gradient(170deg, #2e2668, #1b1740); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.dlg::backdrop { background: rgba(8, 6, 25, .65); backdrop-filter: blur(3px); }
.letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 14px 0; }
.letters button { border: 0; background: none; padding: 0; cursor: pointer; }
.letters .tile { --tile: 42px; margin: auto; }
.podium { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.podium li { display: grid; grid-template-columns: 34px 32px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); }
.podium li.me { outline: 2px solid var(--lamp); }
.podium .rank { font-weight: 900; font-size: 20px; text-align: center; }
.podium li:first-child { background: linear-gradient(90deg, rgba(255, 195, 92, .3), rgba(0, 0, 0, .2)); }
.podium li:first-child .rank::before { content: "🏆"; }
.podium li:first-child .rank span { display: none; }
.podium .sub { font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 200;
  background: #fff4dc; color: #3a1d05; padding: 11px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow);
  transition: opacity .25s, transform .25s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #ffd6d6; color: #5c0b0b; }

/* ---------- smal scherm ---------- */
@media (max-width: 900px) {
  #startScreen, #lobbyScreen { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
  .game { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 0 0 auto; width: min(380px, 92vw); z-index: 40; transform: translateX(105%); transition: transform .25s;
    background: linear-gradient(170deg, #2a2360, #17142f); box-shadow: -20px 0 50px rgba(0, 0, 0, .5); padding-top: max(12px, env(safe-area-inset-top));
  }
  .side.open { transform: none; }
  .side-head { display: flex; justify-content: flex-end; }
  .viewport { margin: 0 6px; }
  .logo-word { font-size: 18px; }
  .top { gap: 8px; padding: 6px 10px; }
  .chip span { display: none; }
  .actions .btn { padding: 8px 10px; font-size: 14px; }
}
@media (min-width: 901px) { .side-toggle { display: none !important; } }

/* smalle telefoons */
@media (max-width: 420px) {
  .logo-word { display: none; }
  .top-info { margin-left: auto; }
  .chip { padding: 4px 9px; }
  .icon-btn { width: 36px; height: 36px; }
  .actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .actions .btn { padding: 9px 2px; font-size: 13px; }
  .actions #skipBtn { grid-column: 1 / -1; }
  .turn { font-size: 15px; }
  .preview { font-size: 13px; }
}

/* telefoon of tablet liggend met weinig hoogte: rek en knoppen naast het bord */
@media (orientation: landscape) and (max-height: 560px) {
  .top { padding-top: 4px; padding-bottom: 4px; }
  .top .icon-btn { width: 34px; height: 34px; }
  .logo-tiles b { width: 22px; height: 24px; font-size: 15px; }
  .play {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr);
    padding-left: env(safe-area-inset-left);
  }
  .turnbar { grid-column: 1 / -1; padding: 4px 10px; gap: 4px; }
  .turnbar .turn { font-size: 14px; }
  .banner { padding: 6px 10px; font-size: 14px; }
  .viewport { margin: 0 4px 6px 8px; min-height: 0; }
  .dock { width: 236px; align-content: center; padding: 0 max(10px, env(safe-area-inset-right)) 6px 4px; overflow-y: auto; }
  .rack { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; padding: 8px; min-height: 0; justify-items: center; }
  .rack .tile { --tile: 44px; }
  .rack .empty { grid-column: 1 / -1; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .actions #playBtn { grid-column: 1 / -1; }
  .actions .btn { padding: 8px 4px; font-size: 13px; }
  .preview { font-size: 12px; min-height: 0; }
  .hint { display: none; }
  .zoom { top: 6px; right: 6px; gap: 4px; }
  .zoom .icon-btn { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
