/* Krabbel — stijl in de lijn van frocky.nl */

@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #12233c;
  --bg-deep: #0d1a2e;
  --panel: #28456a;
  --panel-2: #1e3756;
  --panel-3: #335781;
  --accent: #63b3ff;
  --accent-strong: #8ac7ff;
  --on-accent: #0b1a2c;
  --good: #8ed081;
  --warn: #ff7a5c;
  --text: #eef4ff;
  --muted: #b3c6df;
  --line: rgba(255, 255, 255, 0.09);
  --grid: rgba(99, 179, 255, 0.07);
  --shadow: 0 6px 0 rgba(5, 12, 24, 0.35), 0 12px 28px rgba(5, 12, 24, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --gap: 16px;
  --touch: 44px;
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --topbar-h: 60px;
  --app-h: 100dvh;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Geen zoom bij dubbeltikken op mobiel (knijpen om te zoomen blijft wel mogelijk). */
  touch-action: manipulation;
}
button, a, input, select, textarea, label { touch-action: manipulation; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 900; }

a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Tegels en knoppen ---------- */

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: var(--touch);
  padding: 0.5em 1.1em;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  color: var(--text);
  background: var(--panel-3);
  transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #3d6597; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 0 #2f7fd0; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { box-shadow: 0 2px 0 #2f7fd0; }

.btn-secondary { background: var(--panel-3); box-shadow: 0 4px 0 #1a3150; }
.btn-warn { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); }
.btn-warn:hover { background: rgba(255, 122, 92, 0.14); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); }

.btn-lg { min-height: 52px; font-size: 1.08rem; padding: 0.6em 1.4em; }
.btn-sm { min-height: 40px; padding: 0.35em 0.95em; font-size: 0.95rem; }

/* ---------- Topbalk ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.topbar .back { min-height: 40px; padding: 0.3em 0.9em; font-size: 0.95rem; }
.logo {
  font-weight: 1000;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--accent);
}
.topbar-right { margin-left: auto; display: flex; gap: 8px; }

.banner {
  margin: 0 16px 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 122, 92, 0.16);
  border: 1px solid rgba(255, 122, 92, 0.5);
  color: #ffd6cc;
  font-weight: 700;
  text-align: center;
}

/* ---------- Startscherm ---------- */

.view-start {
  display: grid;
  place-items: start center;
  padding: 4vh 16px 48px;
}

.start-card {
  width: 100%;
  max-width: 440px;
  padding: 28px 24px 24px;
}

.hero-title {
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  color: var(--accent);
  text-align: center;
  transform: rotate(-2deg);
}
.hero-sub { margin: 6px 0 22px; text-align: center; color: var(--muted); font-weight: 700; }

.invite {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  text-align: center;
  font-weight: 700;
}

.start-form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 0.85rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

input[type='text'] {
  width: 100%;
  min-height: var(--touch);
  padding: 0.55em 0.9em;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  font-weight: 700;
}
input[type='text']::placeholder { color: #7f93b0; font-weight: 600; }
input[type='text']:focus { border-color: var(--accent); outline: none; }
input[type='text']:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.field-code input { text-transform: uppercase; letter-spacing: 0.18em; font-weight: 900; }

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-weight: 800; font-size: 0.9rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }

.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }

.form-error { min-height: 1.4em; margin: 14px 0 0; color: var(--warn); font-weight: 800; text-align: center; }

/* ---------- Kamer ---------- */

.view-room {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 310px;
  grid-template-areas: 'players stage chat';
  gap: var(--gap);
  height: calc(var(--app-h) - var(--topbar-h));
  padding: 0 16px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.panel-players { grid-area: players; }
.stage { grid-area: stage; }
.panel-chat { grid-area: chat; }

.panel-players, .panel-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
}

.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { font-size: 1.1rem; }
.count { color: var(--muted); font-weight: 800; font-size: 0.9rem; }

.player-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid; gap: 8px;
  overflow-y: auto;
  align-content: start;
  flex: 1;
  min-height: 0;
}

.player {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.player.is-you { box-shadow: inset 0 0 0 2px rgba(99, 179, 255, 0.55); }
.player.is-offline { opacity: 0.5; filter: grayscale(0.7); }
.avatar {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 900;
  color: var(--on-accent);
  font-size: 1rem;
}
.player-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-meta { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.player-score { font-weight: 900; font-variant-numeric: tabular-nums; }
.badge { margin-left: 4px; }

.invite-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--line);
}
.invite-code { margin: 4px 0 2px; font-weight: 700; }
.invite-code strong { letter-spacing: 0.14em; color: var(--accent); }
.invite-link { margin: 0; font-size: 0.82rem; color: var(--muted); word-break: break-all; user-select: all; }

.stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  align-items: center;
}

.statusbar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 56px;
}
.status-left { font-weight: 800; color: var(--muted); font-size: 0.95rem; }
.status-word { font-weight: 900; font-size: 1.25rem; letter-spacing: 0.12em; text-align: center; }
.status-right { justify-self: end; display: flex; gap: 8px; align-items: center; }

/* Canvas schaalt mee maar houdt 4:3 en past in de hoogte. */
.canvas-wrap {
  position: relative;
  width: min(100%, calc((var(--app-h) - var(--topbar-h) - 220px) * 4 / 3));
  min-width: 280px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
}
#board {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.canvas-wrap.can-draw #board { cursor: crosshair; }
.canvas-wrap.can-draw[data-mode='fill'] #board { cursor: cell; }
.canvas-wrap.can-draw[data-mode='eraser'] #board { cursor: cell; }

.toolbar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
}
.palette { display: grid; grid-template-columns: repeat(8, 30px); gap: 6px; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  padding: 0;
  cursor: pointer;
}
.swatch[aria-checked='true'] { outline: 3px solid var(--text); outline-offset: 2px; }
.sizes { display: flex; gap: 6px; }
.size {
  width: var(--touch); height: var(--touch);
  display: grid; place-items: center;
  border-radius: 12px;
  border: 0;
  background: var(--panel-2);
  cursor: pointer;
}
.size span { display: block; border-radius: 50%; background: var(--text); }
.size[aria-checked='true'] { background: var(--accent); }
.size[aria-checked='true'] span { background: var(--on-accent); }
.tools, .actions { display: flex; gap: 6px; }
.tool {
  width: var(--touch);
  height: var(--touch);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.tool:hover { background: var(--panel-3); }
.tool[aria-checked='true'] { background: var(--accent); box-shadow: 0 3px 0 #2f7fd0; }
.tool-warn { box-shadow: inset 0 0 0 2px var(--warn); }
.tool-warn:hover { background: rgba(255, 122, 92, 0.16); }
.style-panel { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: center; }
.style-btn { display: none; }
.style-dot { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--text); }

.btn-icon { width: 40px; min-height: 40px; padding: 0; font-size: 1.15rem; }
.copy-btn { margin-top: 8px; }
.copy-btn.is-done { background: var(--good); color: var(--on-accent); box-shadow: none; }

/* Avatars */
.avatar { font-size: 1.15rem; line-height: 1; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.8rem; flex: none; }
.avatar-picker { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.avatar-picker legend { margin-bottom: 6px; }
.avatar-row { display: flex; align-items: center; gap: 12px; }
.avatar-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-colors button {
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.avatar-colors button[aria-checked='true'] { outline: 3px solid var(--text); outline-offset: 2px; }
.avatar-emojis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.avatar-emojis button {
  aspect-ratio: 1;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--bg-deep);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.avatar-emojis button[aria-checked='true'] { background: var(--accent); }

/* Spelerslijst: verwijderknop voor de host */
.player { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
.kick-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.kick-btn:hover, .kick-btn:focus-visible { background: rgba(255, 122, 92, 0.18); color: var(--warn); }

/* Eigen woorden */
.custom { grid-column: 1 / -1; display: grid; gap: 6px; text-align: left; }
.custom-guest { grid-column: 1 / -1; }
textarea {
  width: 100%;
  min-height: 64px;
  padding: 0.5em 0.8em;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* voorkomt automatisch inzoomen op iOS */
  font-weight: 700;
  resize: vertical;
}
textarea:focus { border-color: var(--accent); outline: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; min-height: 36px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Timer en status */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 64px;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  font-weight: 900;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.timer.is-low { background: rgba(255, 122, 92, 0.18); color: var(--warn); }
.status-word .hint { white-space: pre; font-family: var(--font); letter-spacing: 0.08em; }
.status-word .letters { margin-left: 0.4em; font-size: 0.8em; color: var(--muted); letter-spacing: 0; }
.status-word .secret { color: var(--accent); }
.status-word .done { color: var(--good); }

/* Lobby en eindscherm: meegroeien met de inhoud in plaats van in het 4:3-vak te passen. */
.canvas-wrap.is-panel {
  aspect-ratio: auto;
  min-height: min(420px, calc(var(--app-h) - var(--topbar-h) - 100px));
  max-height: calc(var(--app-h) - var(--topbar-h) - 100px);
  overflow-y: auto;
  background: var(--panel-2);
  overscroll-behavior: contain;
}
.canvas-wrap.is-panel #board { display: none; }
.canvas-wrap.is-panel .overlay { position: relative; inset: auto; min-height: inherit; background: transparent; backdrop-filter: none; }

/* Overlay over het canvas: lobby, woordkeuze, tussenscherm, eindscherm */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(13, 26, 46, 0.86);
  backdrop-filter: blur(2px);
  overscroll-behavior: contain;
}
.ov-card {
  width: 100%;
  max-width: 560px;
  margin: auto;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.ov-card h2 { font-size: 1.5rem; }
.muted { color: var(--muted); font-weight: 700; margin: 0; }
.small { font-size: 0.9rem; }

.settings {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: left;
}
select {
  width: 100%;
  min-height: var(--touch);
  padding: 0.4em 0.7em;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  font-weight: 800;
}
select:focus { border-color: var(--accent); outline: none; }
select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
select:disabled, .cat-grid input:disabled + span { opacity: 0.75; cursor: default; }
.cats { grid-column: 1 / -1; border: 0; margin: 0; padding: 0; min-width: 0; }
.cats legend { margin-bottom: 6px; }
.cat-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-grid label { position: relative; cursor: pointer; }
.cat-grid input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cat-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: inset 0 0 0 2px var(--line);
}
.cat-grid input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.cat-grid input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 2px; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.choice {
  display: grid;
  gap: 2px;
  min-width: 140px;
  padding: 12px 18px;
  border-radius: var(--radius);
}
.choice .word { font-size: 1.2rem; font-weight: 900; }
.choice .level { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }
.level-makkelijk { color: var(--good); }
.level-gemiddeld { color: var(--accent); }
.level-moeilijk { color: var(--warn); }
.choice .level { color: inherit; }

.big-word {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 1000;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 6px;
}
.result-list li {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  font-weight: 800;
  text-align: left;
}
.result-list .place { color: var(--muted); }
.result-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-list .pts { font-variant-numeric: tabular-nums; }
.result-list .plus { color: var(--good); }
.result-list .none { grid-template-columns: 1fr; text-align: center; color: var(--muted); }

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}
.podium .step {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
}
.podium .step .name { font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .step .score { color: var(--muted); font-weight: 800; font-size: 0.9rem; }
.podium .block {
  width: 100%;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 4px 4px;
  font-size: 1.6rem;
  font-weight: 1000;
  color: var(--on-accent);
}
.podium .p1 .block { height: 96px; background: #ffd23f; }
.podium .p2 .block { height: 72px; background: #c1c7d0; }
.podium .p3 .block { height: 54px; background: #e0a26b; }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.player.is-guessed { background: rgba(142, 208, 129, 0.2); box-shadow: inset 0 0 0 2px rgba(142, 208, 129, 0.6); }
.player.is-drawing { box-shadow: inset 0 0 0 2px var(--accent); }

/* Chat */
.chat-log {
  list-style: none;
  margin: 0; padding: 0 2px 0 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overscroll-behavior: contain;
}
.chat-log li {
  padding: 4px 8px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.chat-log li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.chat-log .who { font-weight: 900; margin-right: 0.35em; }
.chat-log .system { color: var(--muted); font-style: italic; font-weight: 700; }
.chat-log .good { color: var(--good); font-weight: 900; }
.chat-log .warn { color: var(--warn); font-weight: 800; }
.chat-log .close {
  color: var(--warn);
  font-weight: 900;
  background: rgba(255, 122, 92, 0.14) !important;
  box-shadow: inset 3px 0 0 var(--warn);
}
.chat-log .from-guessed { background: rgba(142, 208, 129, 0.14) !important; }
.chat-log .from-guessed .who::after { content: ' ✓'; color: var(--good); }

.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; min-width: 0; }

.mobile-tabs { display: none; }

/* ---------- Mobiel ---------- */

@media (max-width: 900px) {
  :root { --topbar-h: 52px; --gap: 10px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar .back { font-size: 0.85rem; padding: 0.25em 0.75em; }
  .logo { font-size: 1.15rem; }

  .view-room {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .stage { gap: 8px; flex: none; }
  .statusbar { min-height: 46px; padding: 6px 10px; grid-template-columns: auto 1fr auto; }
  .status-word { font-size: 1.05rem; }
  .canvas-wrap {
    min-width: 0;
    width: min(100%, calc((var(--app-h) - var(--topbar-h)) * 0.55 * 4 / 3));
    border-radius: var(--radius-sm);
  }
  .toolbar { gap: 8px 12px; padding: 8px; }
  .overlay { padding: 10px; place-items: start center; }
  .canvas-wrap.is-panel { max-height: calc((var(--app-h) - var(--topbar-h)) * 0.62); }
  .ov-card { gap: 8px; }
  .ov-card h2 { font-size: 1.15rem; }
  .settings { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .settings .field-label { font-size: 0.7rem; letter-spacing: 0.02em; }
  .cat-grid span { min-height: 32px; padding: 2px 10px; font-size: 0.82rem; }
  .choice { min-width: 0; padding: 8px 12px; }
  .podium .p1 .block { height: 64px; }
  .podium .p2 .block { height: 48px; }
  .podium .p3 .block { height: 36px; }
  .timer { min-width: 54px; padding: 4px 10px; font-size: 1rem; }
  /* Gereedschap compact: kleur en dikte achter één knop. */
  .toolbar { justify-content: space-between; gap: 6px; padding: 6px 8px; }
  .style-btn { display: grid; }
  .style-panel { display: none; width: 100%; order: 5; gap: 8px; }
  .toolbar.show-style .style-panel { display: flex; }
  .palette { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; width: 100%; }
  .swatch { width: 100%; height: auto; aspect-ratio: 1; }
  .avatar-emojis button { min-height: 34px; font-size: 1.2rem; }

  .mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    order: 2;
  }
  .mobile-tabs button {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    color: var(--muted);
    background: var(--panel-2);
    cursor: pointer;
  }
  .mobile-tabs button[aria-selected='true'] { background: var(--panel-3); color: var(--text); }

  .panel-players, .panel-chat { order: 3; flex: 1; min-height: 140px; padding: 10px; }
  .panel-head { display: none; }
  .view-room[data-tab='chat'] .panel-players { display: none; }
  .view-room[data-tab='players'] .panel-chat { display: none; }
}

@media (max-width: 420px) {
  .topbar .back span[aria-hidden] { display: none; }
  .tool { width: 42px; height: 42px; font-size: 1.15rem; }
  .back-long { display: none; }
  .status-word .me-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .hero-title { transform: none; }
}
