/* ============================================================
   PRISMANIA — neon prisma dark theme
   ============================================================ */
:root {
  --bg-0: #05060f;
  --bg-1: #0a0d1f;
  --bg-2: #101530;
  --panel: rgba(16, 21, 48, 0.82);
  --panel-border: rgba(120, 140, 255, 0.18);
  --text: #e8eaf6;
  --text-dim: #8a91b4;
  --red: #e63946;
  --yellow: #f1c40f;
  --green: #27ae60;
  --blue: #2d6cdf;
  --neon: #7c5cff;
  --neon-2: #21d4fd;
  --danger: #ff4d6d;
  --rainbow: linear-gradient(135deg, #e63946, #f1c40f, #27ae60, #2d6cdf, #7c5cff);
  --card-w: 92px;
  --card-h: 134px;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(124, 92, 255, 0.20), transparent 60%),
    radial-gradient(1000px 600px at 90% 110%, rgba(33, 212, 253, 0.14), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0) 70%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* v1.4: de table-asset is nu de textuur van het tafelblad (--felt-img),
   niet meer de paginabodem; de body houdt de neon-gradient. */

.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}

/* ---------- Panels & buttons ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--neon), #4a35c9);
  border-color: rgba(160, 140, 255, 0.5);
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.45);
}
.btn-secondary {
  background: linear-gradient(135deg, #14406e, #0e2b4c);
  border-color: rgba(33, 212, 253, 0.35);
}
.btn-danger {
  background: linear-gradient(135deg, #8c1d33, #5b0f22);
  border-color: rgba(255, 77, 109, 0.4);
}
.btn-ghost { background: transparent; }
.btn-big { font-size: 18px; padding: 14px 26px; width: 100%; }
.btn-small { font-size: 13px; padding: 6px 12px; }

.hint { color: var(--text-dim); font-size: 13px; text-align: center; }

/* ---------- Logo ---------- */
.logo { display: flex; justify-content: center; align-items: center; }
.logo img { width: min(540px, 92vw); max-width: none; height: auto; }
.logo.small img { max-width: 150px; width: auto; max-height: 44px; }
.logo-text {
  font-size: clamp(44px, 10vw, 84px);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(124, 92, 255, 0.55));
}
.logo.small .logo-text { font-size: 24px; }

/* ---------- Home ---------- */
.home-inner {
  width: 100%;
  max-width: 920px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px 0;
}
/* Twee kolommen: links inloggen/spelen, rechts het leaderboard. */
.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 400px);
  gap: 16px;
  justify-content: center;
  align-items: start;
}
@media (max-width: 880px) {
  .home-columns { grid-template-columns: minmax(0, 460px); }
}
.tagline { text-align: center; color: var(--text-dim); margin-top: -6px; }
.home-panel { display: flex; flex-direction: column; gap: 12px; }

.field-label { font-size: 13px; color: var(--text-dim); font-weight: 600; }

input[type="text"], input[type="password"] {
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  width: 100%;
}
input[type="text"]:focus, input[type="password"]:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22); }

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 15 avatars = 3 rijen van 5 */
  gap: 8px;
}
.avatar-option {
  font-size: 26px;
  padding: 8px 0;
  text-align: center;
  background: rgba(5, 8, 20, 0.6);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.avatar-option:hover { transform: scale(1.1); }
.avatar-option.selected {
  border-color: var(--neon);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.5);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  margin: 4px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--panel-border); }

.join-row { display: flex; gap: 10px; }
.code-input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  font-weight: 800;
  font-size: 20px;
  text-align: center;
}

/* ---------- Lobby ---------- */
.lobby-inner { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 16px; }
.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.lobby-code-wrap { display: flex; align-items: center; gap: 12px; }
.lobby-code-label { color: var(--text-dim); font-size: 13px; }
.lobby-code {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.35em;
  padding-left: 0.2em;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(33, 212, 253, 0.4));
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: start;
}
.lobby-grid h2 { font-size: 16px; margin-bottom: 12px; letter-spacing: 0.04em; }
.lobby-grid h3 { font-size: 13px; margin: 10px 0 4px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }

.lobby-players { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lobby-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(5, 8, 20, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px 12px;
}
.lobby-player .avatar { font-size: 24px; }
.lobby-player .p-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-player .crown { font-size: 16px; }
.conn-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #38e07b;
  box-shadow: 0 0 8px rgba(56, 224, 123, 0.8);
  flex: none;
}
.conn-dot.off { background: #5b607e; box-shadow: none; }
.kick-btn {
  background: none; border: none; color: var(--danger);
  font-size: 15px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.kick-btn:hover { background: rgba(255, 77, 109, 0.15); }

/* Bots (v1.3): host-rij om een bot toe te voegen + badge in de spelerslijst */
.bot-row { margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.bot-row select {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 8px;
}
.bot-badge {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 8px;
  background: rgba(124, 92, 255, 0.18);
  color: #c9bfff;
  border: 1px solid rgba(124, 92, 255, 0.5);
  white-space: nowrap;
}

.lobby-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.settings-form { display: flex; flex-direction: column; gap: 8px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}
.setting-row select {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 150px;
}
.setting-row input[type="checkbox"] {
  appearance: none;
  width: 42px; height: 24px;
  border-radius: 12px;
  background: #2a2f52;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  flex: none;
}
.setting-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #cdd2f0;
  transition: transform 0.15s ease;
}
.setting-row input[type="checkbox"]:checked { background: var(--neon); box-shadow: 0 0 10px rgba(124, 92, 255, 0.5); }
.setting-row input[type="checkbox"]:checked::after { transform: translateX(18px); }
.settings-form.readonly select, .settings-form.readonly input { pointer-events: none; opacity: 0.65; }

.lobby-chat-panel { display: flex; flex-direction: column; max-height: 480px; }
.chat-log {
  flex: 1;
  min-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 2px;
  font-size: 14px;
}
.chat-msg .chat-from { font-weight: 700; color: var(--neon-2); margin-right: 6px; }
.chat-msg.system { color: var(--text-dim); font-style: italic; }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Game layout: ovale 3D-speeltafel (v1.4) ---------- */
:root { --table-tilt: 54deg; --dir-r: 190px; --seat-w: 104px; }

#screen-game { padding: 8px; }
.game-inner {
  width: 100%;
  max-width: 1280px;
  min-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Tafelscene: gekanteld tafelblad + center-overlay + stoelen rondom */
.table-scene {
  position: relative;
  flex: 1;
  min-height: 320px;
  width: 100%;
}
.table-tilt {
  position: absolute;
  inset: 0;
  perspective: 1600px;
  pointer-events: none;
}
.table-felt {
  position: absolute;
  left: 50%; top: 50%;
  width: min(84%, 880px);
  height: min(148%, 840px);
  transform: translate(-50%, -50%) rotateX(var(--table-tilt));
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 32%, rgba(124, 92, 255, 0.18), transparent 62%),
    var(--felt-img, radial-gradient(ellipse at center, #15214b 0%, #0b1230 55%, #060a1c 100%));
  background-size: cover;
  background-position: center;
  border: 12px solid #191330;
  box-shadow:
    0 0 0 3px rgba(124, 92, 255, 0.35),
    0 34px 70px rgba(0, 0, 0, 0.65),
    inset 0 0 90px rgba(0, 0, 0, 0.55);
}

/* currentColor-aura op het tafelblad */
.table-aura {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--aura-color, rgba(124, 92, 255, 0.3)), transparent 68%);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* Richting-indicator: pijlenring om het tafelmidden, draait met direction mee */
.direction-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  animation: dirSpin 16s linear infinite;
}
.direction-ring.reversed { animation-direction: reverse; }
@keyframes dirSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.dir-arrow {
  position: absolute;
  left: 0; top: 0;
  font-size: 22px;
  line-height: 1;
  color: rgba(33, 212, 253, 0.5);
  text-shadow: 0 0 12px rgba(33, 212, 253, 0.75);
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 45deg)) translateX(var(--dir-r)) rotate(90deg);
  user-select: none;
}
.direction-ring.reversed .dir-arrow {
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 45deg)) translateX(var(--dir-r)) rotate(-90deg);
}

/* Center-overlay: HUD, stapels, chaos, lastAction (niet gekanteld, klikbaar) */
.table-center {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.table-center > * { pointer-events: auto; }
.round-hud {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(5, 8, 20, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 2px 12px;
  min-height: 20px;
}
.pile-area { display: flex; align-items: center; gap: clamp(14px, 4vw, 44px); }

.deck-pile { position: relative; cursor: pointer; }
.deck-pile.disabled { cursor: default; }
.deck-pile:not(.disabled):hover .card-back { transform: translateY(-4px); }
.deck-count {
  position: absolute;
  bottom: -8px; right: -8px;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
}

.discard-pile { position: relative; }
.top-card-slot { position: relative; border-radius: 12px; }
.top-card-slot .card { box-shadow: 0 0 26px 6px var(--glow-color, rgba(124, 92, 255, 0.55)); }
/* 3D-plof: extra slagschaduw terwijl de topkaart landt (transform doet WAAPI) */
.top-card-slot .card.plof {
  box-shadow: 0 26px 46px rgba(0, 0, 0, 0.7), 0 0 26px 6px var(--glow-color, rgba(124, 92, 255, 0.55));
}

.pending-draw {
  font-size: 18px;
  font-weight: 800;
  color: #ffd166;
  background: rgba(90, 55, 0, 0.5);
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: 12px;
  padding: 6px 16px;
  animation: badgeGlow 1s ease-in-out infinite;
}

.chaos-wrap { display: flex; align-items: center; gap: 8px; width: min(360px, 80vw); }
.chaos-bolt { font-size: 18px; filter: drop-shadow(0 0 6px rgba(241, 196, 15, 0.8)); }
.chaos-bar {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid var(--panel-border);
  overflow: hidden;
}
.chaos-fill {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1c40f, #ff8c42, var(--danger));
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.6);
  transition: transform 0.4s cubic-bezier(0.3, 1.2, 0.4, 1);
}
.chaos-wrap.high .chaos-fill { animation: chaosFlicker 0.5s linear infinite; }
@keyframes chaosFlicker { 50% { opacity: 0.6; } }
.chaos-value { font-size: 12px; color: var(--text-dim); min-width: 36px; }

.last-action {
  min-height: 22px;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  padding: 0 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ---------- Stoelen rondom de tafel (v1.4 §1) ---------- */
.seats { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.seat {
  position: absolute;
  left: 0; top: 0;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.3, 1.15, 0.45, 1);
  pointer-events: none;
}
/* Eerste plaatsing: geen transitie (anders schuift de stoel vanaf (0,0) in) */
.seat.seat-new { transition: none; }
.seat-body {
  pointer-events: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: var(--seat-w);
}
.seat.disconnected .seat-body { opacity: 0.55; }

.seat-avatar-wrap {
  position: relative;
  width: 66px; height: 66px;
  display: flex; align-items: center; justify-content: center;
}
.seat-avatar {
  font-size: 36px;
  width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.seat.is-turn .seat-avatar {
  border-color: var(--neon-2);
  box-shadow: 0 0 22px rgba(33, 212, 253, 0.8);
}
.seat-avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33, 212, 253, 0.5), transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.seat.is-turn .seat-avatar-wrap::before { animation: haloPulse 1.4s ease-in-out infinite; }
@keyframes haloPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.12); }
}

.seat .conn-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  z-index: 3;
  width: 12px; height: 12px;
  border: 2px solid #0a0d1f;
}
.seat .crown-mini { position: absolute; top: -10px; left: 0; font-size: 15px; z-index: 3; }

.seat-name {
  font-size: 12px;
  font-weight: 600;
  max-width: var(--seat-w);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

/* Waaier van kaartruggen (handaantal) + altijd leesbare teller */
.seat-fan {
  position: relative;
  width: 92px; height: 32px;
  display: flex; align-items: flex-start; justify-content: center;
}
.mini-back {
  position: absolute;
  left: 50%; top: 0;
  width: 17px; height: 25px;
  margin-left: -8.5px;
  border-radius: 3px;
  border: 1px solid rgba(124, 92, 255, 0.65);
  background-image: var(--back-img, linear-gradient(150deg, #171b36, #070912));
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 95%;
}
.seat-count {
  position: relative;
  z-index: 2;
  margin-top: 13px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  background: rgba(5, 8, 20, 0.88);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  padding: 0 7px;
  line-height: 16px;
}

/* Timer-ring om de beurtspeler-avatar (kleur via JS: groen→geel→rood) */
.timer-ring {
  position: absolute;
  inset: -4px;
  transform: rotate(-90deg);
  pointer-events: none;
  z-index: 2;
}
.timer-ring circle { fill: none; stroke-width: 3.5; }
.timer-ring .ring-bg { stroke: rgba(255, 255, 255, 0.1); }
.timer-ring .ring-fg { stroke: #38e07b; stroke-linecap: round; }
.timer-ring.urgent { animation: urgentPulse 0.5s ease-in-out infinite; }

/* Groot secondengetal bij de stoel van de beurtspeler */
.seat-seconds {
  position: absolute;
  top: -12px; right: -24px;
  z-index: 4;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.9);
}
.seat-seconds.urgent, .my-countdown.urgent { animation: urgentPulse 0.55s ease-in-out infinite; }
@keyframes urgentPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* Rood pulserende "1!"-alert (1 kaart, nog niet geroepen) */
.seat-alert {
  position: absolute;
  top: -8px; left: -12px;
  z-index: 4;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #b3123a);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(255, 45, 77, 0.9);
  animation: alertPulse 0.8s ease-in-out infinite;
}
@keyframes alertPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.seat .badges { display: flex; gap: 4px; min-height: 16px; justify-content: center; flex-wrap: wrap; }
.badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.03em;
}
.badge-frozen { background: rgba(33, 212, 253, 0.2); color: #9be8ff; border: 1px solid rgba(33, 212, 253, 0.5); }
.badge-bot { background: rgba(124, 92, 255, 0.18); color: #c9bfff; border: 1px solid rgba(124, 92, 255, 0.5); }
.badge-prismania {
  background: var(--rainbow);
  color: #0a0d1f;
  animation: badgeGlow 1.2s ease-in-out infinite;
}
@keyframes badgeGlow {
  0%, 100% { opacity: 0.82; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.07); }
}
.catch-btn {
  position: absolute;
  top: -8px; right: -14px;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--danger), #b3123a);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 3px 8px;
  cursor: pointer;
  z-index: 5;
  animation: badgeGlow 1s ease-in-out infinite;
}

/* Emote-ballon boven de stoel */
.seat-balloons {
  position: absolute;
  left: 50%; bottom: calc(100% + 2px);
  width: 0; height: 0;
  pointer-events: none;
  z-index: 7;
}
.emote-balloon {
  position: absolute;
  left: 0; bottom: 0;
  transform: translateX(-50%);
  font-size: 32px;
  line-height: 1;
  background: rgba(16, 21, 48, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 16px 16px 16px 4px;
  padding: 8px 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  animation: emotePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  will-change: transform, opacity;
}
.emote-balloon.leaving { animation: emoteOut 0.32s ease both; }
@keyframes emotePop {
  0% { opacity: 0; transform: translateX(-50%) translateY(16px) scale(0.2); }
  60% { opacity: 1; transform: translateX(-50%) translateY(-6px) scale(1.12); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes emoteOut { to { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(0.6); } }

/* ---------- Mijn zone (hand, knoppen, emotes) ---------- */
.my-area {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
}
.my-buttons { display: flex; gap: 12px; min-height: 44px; align-items: center; }
.my-countdown {
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.85);
  min-width: 74px;
  text-align: center;
}
.btn-prismania {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #0a0d1f;
  background: var(--rainbow);
  border: none;
  animation: prismaniaPulse 0.9s ease-in-out infinite;
}
@keyframes prismaniaPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(255, 255, 255, 0.35); }
  50% { transform: scale(1.08); box-shadow: 0 0 30px rgba(255, 255, 255, 0.75); }
}

/* v1.7 §6: hand is een horizontale scroller (wiel/drag/touch); auto-margins op
   de randen centreren de waaier zolang hij past. */
.my-hand {
  display: flex;
  justify-content: flex-start;
  padding: 34px 10px 6px;
  max-width: 100%;
  min-height: calc(var(--card-h) + 42px);
  perspective: 900px;
  overflow-x: auto;
  /* Verticaal nooit scrollen: een kaart die oplicht of omhoog komt vergroot de
     scroll-overflow en liet anders héél kort een scrollbalk verschijnen. */
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  /* Scrollbalk verbergen (scrollen blijft werken met wiel, slepen en touch) —
     zo kan hij ook horizontaal niet in en uit beeld flitsen tijdens animaties. */
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.my-hand::-webkit-scrollbar { width: 0; height: 0; }
.my-hand.dragging { cursor: grabbing; user-select: none; }
.my-hand .card { margin-left: calc(var(--card-w) * -0.45); flex: none; }
.my-hand .card:first-child { margin-left: auto; }
.my-hand .card:last-child { margin-right: auto; }
/* Grotere hit-areas op speelbare kaarten (overflow moet daarvoor zichtbaar zijn) */
.my-hand .card { overflow: visible; }
.my-hand .card.playable::before,
.my-hand .card.jumpable::before {
  content: "";
  position: absolute;
  inset: -14px -10px -8px;
}
/* Touch: eerste tik selecteert (omhoog + gloed + naamlabel), tweede tik speelt */
.my-hand .card.tap-selected {
  transform: translateY(-24px) scale(1.04);
  z-index: 7;
  box-shadow: 0 0 22px rgba(33, 212, 253, 0.85), 0 18px 26px rgba(0, 0, 0, 0.6);
}
.card-tap-label {
  position: absolute;
  left: 50%; top: -30px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--text);
  background: rgba(5, 8, 20, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 2px 8px;
  pointer-events: none;
  z-index: 8;
}
/* Toetsenbordfocus op de hand (←/→ + Enter) */
.my-hand .card.kb-focus {
  outline: 3px solid var(--neon-2);
  outline-offset: 2px;
}
.my-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.my-info { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.my-name { font-weight: 700; }
.my-turn-hint { color: var(--neon-2); font-weight: 700; min-height: 18px; }

/* Stoppen (v2.6): bewust rustig — hij staat naast de eigen naam, niet bij de
   speelknoppen, zodat je er midden in een beurt niet per ongeluk op drukt. */
.btn-quit {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--panel-border);
  opacity: 0.65;
  box-shadow: none;
  transform: none;
}
.btn-quit:hover:not(:disabled) {
  opacity: 1;
  color: #ffd9de;
  border-color: rgba(255, 90, 120, 0.65);
  background: rgba(255, 60, 90, 0.12);
  transform: none;
}

/* Emote-balk (v1.4 §3) */
.emote-bar { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.emote-btn {
  font-size: 19px;
  line-height: 1;
  background: rgba(16, 21, 48, 0.75);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  width: 36px; height: 36px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.emote-btn:hover { transform: translateY(-3px) scale(1.12); box-shadow: 0 0 12px rgba(124, 92, 255, 0.5); }
.emote-btn:active { transform: scale(0.9); }

/* ---------- Cards ---------- */
.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 12px;
  position: relative;
  background: var(--card-bg, #223);
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  color: #fff;
  overflow: hidden;
}
.card[data-color="red"] { --card-bg: linear-gradient(150deg, #f0525f, #b31f2c); }
.card[data-color="yellow"] { --card-bg: linear-gradient(150deg, #f7d34a, #c99b06); }
.card[data-color="green"] { --card-bg: linear-gradient(150deg, #34c974, #17813f); }
.card[data-color="blue"] { --card-bg: linear-gradient(150deg, #4d86ec, #1c4bb0); }
.card[data-color="wild"] {
  --card-bg: linear-gradient(150deg, #1b1e33, #05060f);
  border-color: transparent;
  background:
    linear-gradient(150deg, #1b1e33, #05060f) padding-box,
    var(--rainbow) border-box;
}
.card .corner {
  position: absolute;
  font-size: 15px;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  line-height: 1;
}
.card .corner.tl { top: 6px; left: 8px; }
.card .corner.br { bottom: 6px; right: 8px; transform: rotate(180deg); }
.card .center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .center .big-num {
  font-size: 52px;
  font-weight: 900;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}
.card .center svg { width: 58%; height: 58%; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.card .center img { width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6)); }

/* Kaart-artwork (v1.3): kleur-frame als achtergrond (cover), overlays leesbaar houden */
.card.has-frame {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.card.has-frame .corner {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 8px rgba(0, 0, 0, 0.45);
}
.card.has-frame .center .big-num {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 0, 0, 0.45);
}
/* "+2"/"+4"-overlay op tekstloze actie-iconen (draw2/wild4) */
.card .center .icon-overlay {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.card-back {
  --card-bg: linear-gradient(150deg, #171b36, #070912);
  border-color: rgba(124, 92, 255, 0.6);
  display: flex; align-items: center; justify-content: center;
}
.card-back::after {
  content: "P";
  font-size: 44px;
  font-weight: 900;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card-back.has-img::after { content: none; }
.card-back img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }

/* Hand interactivity — speelbare kaarten liften omhoog met slagschaduw (v1.4) */
.my-hand .card.playable {
  cursor: pointer;
  filter: brightness(1.08);
  transform: translateY(-10px);
  box-shadow: 0 0 16px rgba(33, 212, 253, 0.55), 0 16px 24px rgba(0, 0, 0, 0.55);
}
.my-hand .card.playable:hover { transform: translateY(-18px) scale(1.05); z-index: 5; }
.my-hand .card:not(.playable):not(.jumpable) { filter: brightness(0.6) saturate(0.7); }
.my-hand .card.jumpable {
  cursor: pointer;
  box-shadow: 0 0 18px rgba(241, 196, 15, 0.8), 0 4px 14px rgba(0, 0, 0, 0.5);
}
.my-hand .card.jumpable:hover { transform: translateY(-18px) scale(1.05); z-index: 5; }
/* v2.4 §1: kaart die alléén door een verborgen regel geblokkeerd is (huisregel
   "laatste kaart = cijfer" of "alleen de zojuist getrokken kaart"). Kleur en
   soort kloppen wél, dus dat verdient een eigen, zichtbare markering: licht
   doorschijnend met een slotje-cursor — vóórdat je erop klikt. */
.my-hand .card.blocked-rule {
  cursor: not-allowed;
  opacity: 0.55;
}
.my-hand .card.blocked-rule::after {
  content: "🔒";
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
  pointer-events: none;
  z-index: 2;
}
.jump-flash {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 18px;
  filter: drop-shadow(0 0 5px rgba(241, 196, 15, 1));
  z-index: 2;
}

/* Fly animation (WAAPI stuurt transform/opacity aan) */
.fly-card {
  position: fixed;
  z-index: 90;
  margin: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.shake { animation: shake 0.4s ease; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 12, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.overlay-box {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px;
  width: min(420px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6);
}
.overlay-box.overlay-wide { width: min(640px, 96vw); }
.overlay-box h2 { font-size: 20px; }
.overlay-buttons { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }

.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}
.color-swatch {
  height: 90px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.color-swatch:hover { transform: scale(1.06); }
.color-swatch[data-color="red"] { background: var(--red); box-shadow: 0 0 18px rgba(230, 57, 70, 0.6); }
.color-swatch[data-color="yellow"] { background: var(--yellow); box-shadow: 0 0 18px rgba(241, 196, 15, 0.6); }
.color-swatch[data-color="green"] { background: var(--green); box-shadow: 0 0 18px rgba(39, 174, 96, 0.6); }
.color-swatch[data-color="blue"] { background: var(--blue); box-shadow: 0 0 18px rgba(45, 108, 223, 0.6); }

.target-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.target-option {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: rgba(5, 8, 20, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.target-option:hover { border-color: var(--neon-2); transform: translateX(4px); }
.target-option .avatar { font-size: 24px; }
.target-option .t-count { margin-left: auto; color: var(--text-dim); font-size: 13px; }

.extra-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-height: 46vh;
  overflow-y: auto;
}
.extra-list .card { cursor: pointer; }
.extra-list .card:hover { transform: translateY(-8px) scale(1.05); }

/* Scores */
.scores-subtitle { color: var(--text-dim); }
.scores-table { width: 100%; border-collapse: collapse; }
.scores-table th, .scores-table td { padding: 8px 12px; text-align: left; }
.scores-table th { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.scores-table tbody tr { border-top: 1px solid var(--panel-border); }
.scores-table tr.winner td { color: #ffd166; font-weight: 800; }
.scores-table td.score-cell { text-align: right; font-variant-numeric: tabular-nums; }

/* Storm flash */
.storm-flash {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(124, 92, 255, 0.5), rgba(3, 4, 12, 0.92));
  animation: stormIn 0.25s ease;
}
@keyframes stormIn { from { opacity: 0; } to { opacity: 1; } }
.storm-flash.leaving { animation: stormOut 0.4s ease forwards; }
@keyframes stormOut { to { opacity: 0; } }
.storm-inner { text-align: center; animation: stormZoom 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes stormZoom { from { transform: scale(0.4); } to { transform: scale(1); } }
.storm-icon { font-size: 80px; filter: drop-shadow(0 0 30px rgba(241, 196, 15, 0.9)); }
.storm-name {
  font-size: clamp(34px, 8vw, 64px);
  font-weight: 900;
  letter-spacing: 0.12em;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.storm-desc { font-size: 18px; color: var(--text); margin-top: 8px; }

/* Toasts */
.toasts {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(420px, 92vw);
}
.toast {
  background: rgba(16, 21, 48, 0.95);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--neon-2);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 100%;
}
.toast.error { border-left-color: var(--danger); }
.toast.leaving { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-24px) scale(0.85); }
  60% { opacity: 1; transform: translateY(3px) scale(1.02); }
  100% { opacity: 1; transform: none; }
}
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(0.9); } }

.confetti-canvas { position: fixed; inset: 0; z-index: 150; pointer-events: none; width: 100vw; height: 100vh; }

.btn-mute {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 210;
  font-size: 18px;
  background: rgba(16, 21, 48, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr 1fr; }
  .lobby-chat-panel { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  /* Mobiel (v1.4): tafel minder gekanteld, stoelen compacter, alles klikbaar */
  :root {
    --card-w: 68px; --card-h: 100px;
    --table-tilt: 38deg; --dir-r: 116px; --seat-w: 78px;
  }
  .lobby-grid { grid-template-columns: 1fr; }
  .table-scene { min-height: 300px; }
  .table-felt { width: min(97%, 560px); height: min(160%, 680px); border-width: 8px; }
  .seat-avatar-wrap { width: 50px; height: 50px; }
  .seat-avatar { width: 46px; height: 46px; font-size: 26px; }
  .seat-name { font-size: 10px; }
  .seat-fan { width: 66px; height: 26px; }
  .mini-back { width: 13px; height: 19px; margin-left: -6.5px; }
  .seat-count { margin-top: 9px; font-size: 10px; }
  .seat-seconds { font-size: 17px; top: -8px; right: -15px; }
  .seat-alert { width: 22px; height: 22px; font-size: 11px; }
  .dir-arrow { font-size: 16px; }
  .round-hud { font-size: 10px; }
  .my-countdown { font-size: 24px; min-width: 60px; }
  .emote-btn { width: 32px; height: 32px; font-size: 16px; }
  .my-hand {
    padding: 28px 14px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .my-hand .card { margin-left: calc(var(--card-w) * -0.35); }
  .card .center .big-num { font-size: 38px; }
  .lobby-code { font-size: 26px; }
}

/* ============================================================
   FX-laag (addendum v1.1) — alleen transform/opacity animaties
   ============================================================ */

/* Ambient canvas achter alles */
.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
/* Alleen .screen: .btn-mute en .toasts zijn position:fixed en moeten dat blijven. */
.screen { position: relative; z-index: 1; }

/* Vaste effectlaag boven het spel, onder toasts */
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 140;
  pointer-events: none;
  overflow: hidden;
}

/* Spotlight bij beurtwissel */
.turn-spotlight {
  position: fixed;
  left: 0; top: 0;
  width: 240px; height: 240px;
  z-index: 2;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(33, 212, 253, 0.22), rgba(124, 92, 255, 0.10) 55%, transparent 72%);
  pointer-events: none;
  will-change: transform, opacity;
}

/* Logo-prismagloed (v2.7 §3) — vervangt de oude rechthoekige ::after-sweep.
   Alleen filter: geen extra box, geen layout-shift. De vrije lichtstralen
   zelf tekent fx.js op de ambient-canvas achter het logo. */
.logo { position: relative; }
.logo-text,
.logo img { animation: logoPrismGlow 16s ease-in-out infinite; }
.logo.small .logo-text,
.logo.small img { animation-name: logoPrismGlowSmall; }
@keyframes logoPrismGlow {
  0%, 100% {
    filter: drop-shadow(0 0 14px rgba(230, 57, 70, 0.34)) drop-shadow(0 0 30px rgba(124, 92, 255, 0.46));
  }
  25% {
    filter: drop-shadow(0 0 15px rgba(241, 196, 15, 0.34)) drop-shadow(0 0 32px rgba(33, 212, 253, 0.44));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(39, 174, 96, 0.32)) drop-shadow(0 0 30px rgba(45, 108, 223, 0.46));
  }
  75% {
    filter: drop-shadow(0 0 16px rgba(33, 212, 253, 0.36)) drop-shadow(0 0 32px rgba(124, 92, 255, 0.48));
  }
}
@keyframes logoPrismGlowSmall {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(230, 57, 70, 0.30)) drop-shadow(0 0 11px rgba(124, 92, 255, 0.42)); }
  25% { filter: drop-shadow(0 0 6px rgba(241, 196, 15, 0.30)) drop-shadow(0 0 12px rgba(33, 212, 253, 0.40)); }
  50% { filter: drop-shadow(0 0 5px rgba(39, 174, 96, 0.28)) drop-shadow(0 0 11px rgba(45, 108, 223, 0.42)); }
  75% { filter: drop-shadow(0 0 6px rgba(33, 212, 253, 0.32)) drop-shadow(0 0 12px rgba(124, 92, 255, 0.44)); }
}

/* Home entrance */
.home-panel { animation: panelRise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.15s; }
.tagline { animation: fadeSlide 0.6s ease both 0.35s; }
@keyframes panelRise {
  from { opacity: 0; transform: translateY(46px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Avatar-selectie: bounce + gloedring */
.avatar-option { position: relative; }
.avatar-option.selected { animation: avatarBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes avatarBounce {
  0% { transform: scale(0.8); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.avatar-option.selected::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  border: 2px solid var(--neon-2);
  opacity: 0;
  animation: ringOut 0.55s ease forwards;
  pointer-events: none;
}
@keyframes ringOut {
  0% { opacity: 0.9; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.35); }
}

/* Press-squash op knoppen */
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.96); }

/* Roomcode letter-reveal */
.lobby-code { perspective: 300px; display: inline-flex; gap: 0.08em; }
.code-letter { display: inline-block; will-change: transform, opacity; }

/* Spelers pop-in / vertrek gebeurt via WAAPI; chat schuift in */
.chat-msg { animation: chatIn 0.32s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
@keyframes chatIn {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}

/* Settings-flash bij wijziging (niet-host) */
.setting-row.flash::after {
  content: "";
  position: absolute;
  inset: -3px -6px;
  border-radius: 8px;
  background: rgba(33, 212, 253, 0.18);
  animation: settingFlash 0.9s ease forwards;
  pointer-events: none;
}
.setting-row { position: relative; }
@keyframes settingFlash {
  0% { opacity: 0; transform: scale(0.98); }
  25% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* Host-kroon glinstert */
.crown, .crown-mini { position: relative; display: inline-block; animation: crownGlint 4.5s ease-in-out infinite; }
@keyframes crownGlint {
  0%, 88%, 100% { transform: none; opacity: 1; }
  92% { transform: rotate(-8deg) scale(1.18); opacity: 1; }
  96% { transform: rotate(6deg) scale(1.08); opacity: 0.9; }
}
.seat .crown-mini { position: absolute; }

/* Startknop prismatische shimmer zodra klaar */
#btn-start { position: relative; overflow: hidden; }
#btn-start.ready::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 40%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), rgba(33, 212, 253, 0.3), transparent);
  transform: translateX(-140%) skewX(-16deg);
  animation: btnShimmer 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnShimmer {
  0% { transform: translateX(-140%) skewX(-16deg); }
  60%, 100% { transform: translateX(360%) skewX(-16deg); }
}

/* Overlays: schalen met backdrop-blur in/uit */
.overlay { animation: overlayIn 0.22s ease both; }
.overlay .overlay-box { animation: overlayBoxIn 0.34s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayBoxIn {
  from { opacity: 0; transform: scale(0.82) translateY(14px); }
  to { opacity: 1; transform: none; }
}
.overlay.closing { animation: overlayOut 0.2s ease both; }
.overlay.closing .overlay-box { animation: overlayBoxOut 0.2s ease both; }
@keyframes overlayOut { to { opacity: 0; } }
@keyframes overlayBoxOut { to { opacity: 0; transform: scale(0.9); } }

/* Aflegstapel: laatste 3 kaarten licht geroteerd */
.top-card-slot { min-width: var(--card-w); min-height: var(--card-h); }
.top-card-slot .card { position: relative; z-index: 3; }
.top-card-slot .card.under {
  position: absolute;
  inset: 0;
  z-index: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}
.top-card-slot .card.under.u2 { z-index: 2; }

/* Pulserende kleur-gloed achter topkaart */
.glow-halo {
  position: absolute;
  inset: -26px;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-color, rgba(124, 92, 255, 0.6)), transparent 70%);
  animation: glowPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* pendingDraw-badge bonkt bij verhoging */
.pending-draw.bump { animation: pendingBump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pendingBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Stempels (⊘ skip / BETRAPT!) */
.fx-stamp {
  position: fixed;
  font-size: 54px;
  font-weight: 900;
  color: var(--neon-2);
  text-shadow: 0 0 18px rgba(33, 212, 253, 0.8);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  z-index: 145;
}
.fx-stamp.stamp-caught {
  font-size: 30px;
  letter-spacing: 0.1em;
  color: #ff2d4d;
  text-shadow: 0 0 14px rgba(255, 45, 77, 0.9);
  border: 4px solid #ff2d4d;
  border-radius: 8px;
  padding: 4px 12px;
  background: rgba(30, 0, 8, 0.55);
}
.fx-stamp.stamp-skip { font-size: 64px; color: #ffd166; text-shadow: 0 0 18px rgba(255, 209, 102, 0.9); }

/* Regenboog-schokgolf (prisma) */
.fx-shockwave {
  position: fixed;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 6px solid transparent;
  background:
    radial-gradient(circle, transparent 58%, rgba(255,255,255,0.25) 62%, transparent 70%) padding-box,
    conic-gradient(#e63946, #f1c40f, #27ae60, #2d6cdf, #7c5cff, #e63946) border-box;
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 58%);
  mask: radial-gradient(circle, transparent 55%, #000 58%);
  will-change: transform, opacity;
}

/* Bliksemflits */
.fx-lightning {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.9) 49%, rgba(190, 225, 255, 0.95) 51%, transparent 58%),
    rgba(200, 225, 255, 0.28);
  will-change: opacity;
}

/* IJsgroei bij freeze */
.fx-ice {
  position: fixed;
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 15%, rgba(155, 232, 255, 0.5), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(155, 232, 255, 0.45), transparent 45%),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.3), transparent 35%),
    rgba(33, 212, 253, 0.16);
  border: 2px solid rgba(155, 232, 255, 0.65);
  will-change: transform, opacity;
}
.fx-ice span { position: absolute; font-size: 20px; color: #cdf3ff; text-shadow: 0 0 8px rgba(155, 232, 255, 0.9); }
.fx-ice .i1 { top: -8px; left: -6px; }
.fx-ice .i2 { bottom: -8px; right: -4px; font-size: 26px; }
.fx-ice .i3 { top: 30%; right: -10px; font-size: 15px; }
.fx-ice .i4 { bottom: 20%; left: -10px; font-size: 17px; }

/* Bevroren spelersvak (state-gedreven blijvende look) */
.seat.frozen .seat-avatar { border-color: rgba(155, 232, 255, 0.85); box-shadow: 0 0 18px rgba(33, 212, 253, 0.6); }

/* Schermvullende roep (PRISMANIA!) */
.fx-shout {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle at center, rgba(10, 13, 31, 0.55), rgba(3, 4, 12, 0.75));
  will-change: transform, opacity;
  z-index: 146;
}
.fx-shout-text {
  font-size: clamp(44px, 12vw, 120px);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 30px rgba(124, 92, 255, 0.8));
  text-align: center;
  padding: 0 12px;
}
.fx-shout-sub { font-size: clamp(16px, 3vw, 26px); font-weight: 700; color: var(--text); }

/* Reverse-swoosh pijl */
.fx-reverse {
  position: fixed;
  left: 50%; top: 45%;
  font-size: clamp(80px, 18vw, 160px);
  color: var(--neon-2);
  text-shadow: 0 0 34px rgba(33, 212, 253, 0.9);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

/* Scorebord: rijen tellen rij voor rij in */
.scores-table tbody tr { will-change: transform, opacity; }

/* Storm: banner zoomt binnen (bestond al) + extra schud op icoon */
.storm-icon { animation: stormIconJolt 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes stormIconJolt {
  0% { transform: scale(0.2) rotate(-20deg); }
  60% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Mijn hand: kaarten die net gerenderd zijn poppen via WAAPI (client) */
.my-hand .card { will-change: transform; }

/* ============================================================
   Addendum v1.2 — account, leaderboard, rematch, automatisch pakken
   ============================================================ */

/* Account-blok (home) */
.account-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--panel-border);
}
.account-logged-out { display: flex; flex-direction: column; gap: 10px; }
.account-inputs { display: flex; gap: 8px; }
.account-inputs input { flex: 1; min-width: 0; }
.account-hint, .account-stats { text-align: left; }
.account-logged-in { display: flex; flex-direction: column; gap: 6px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.account-buttons { display: flex; gap: 6px; flex: none; }
/* Korte aandacht-puls wanneer de 🏆-knop het paneel aanwijst */
.leaderboard-panel.attention {
  animation: lbAttention 0.9s ease;
}
@keyframes lbAttention {
  0% { transform: scale(1); box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45); }
  35% { transform: scale(1.025); box-shadow: 0 0 30px rgba(255, 209, 102, 0.45); }
  100% { transform: scale(1); box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45); }
}
.account-label strong {
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}
.name-field { display: flex; flex-direction: column; gap: 12px; }

/* ★ bij accountspelers (lobby, game, leaderboard) */
.account-star {
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.8);
  font-size: 0.9em;
  margin-left: 4px;
  flex: none;
}

/* Leaderboard-paneel (home) */
.leaderboard-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: panelRise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.3s;
}
.leaderboard-title { font-size: 16px; letter-spacing: 0.04em; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.leaderboard-table th, .leaderboard-table td { padding: 6px 8px; text-align: left; }
.leaderboard-table th {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.leaderboard-table tbody tr { border-top: 1px solid var(--panel-border); will-change: transform, opacity; }
.leaderboard-table tbody tr:first-child td { color: #ffd166; font-weight: 800; }
.leaderboard-table td.lb-rank { width: 36px; }
.leaderboard-table td.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.leaderboard-table td.lb-num { text-align: right; font-variant-numeric: tabular-nums; }
.leaderboard-empty { padding: 2px 0; }

/* Auto-pak-hint: subtiel i.p.v. de felle beurt-tekst */
.my-turn-hint.autodraw {
  color: var(--text-dim);
  font-weight: 600;
  animation: autoDrawPulse 1.6s ease-in-out infinite;
}
@keyframes autoDrawPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ============================================================
   Addendum v1.4 — 3D-tilt, audio-popover, tafel-effecten
   ============================================================ */

/* 3D-kaart-tilt: alleen op fine-pointer devices; hoeken via JS (--tiltX/--tiltY) */
@media (pointer: fine) {
  .my-hand .card:hover {
    transform: rotateX(var(--tiltX, 0deg)) rotateY(var(--tiltY, 0deg));
    z-index: 6;
  }
  .my-hand .card.playable:hover,
  .my-hand .card.jumpable:hover {
    transform: translateY(-20px) scale(1.06) rotateX(var(--tiltX, 0deg)) rotateY(var(--tiltY, 0deg));
    z-index: 6;
  }
}

/* Bliksem geclipt op het tafelblad (FX.lightning(el)) */
.fx-lightning.clipped {
  inset: auto;
  border-radius: 50%;
  overflow: hidden;
}

/* Audio-popover (mute-knop): master aan/uit + sliders Muziek/Effecten */
.audio-popover {
  position: fixed;
  right: 12px;
  bottom: 64px;
  z-index: 215;
  width: 224px;
  background: rgba(16, 21, 48, 0.97);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: overlayBoxIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.audio-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.audio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}
.audio-row input[type="range"] {
  width: 116px;
  accent-color: var(--neon);
}
.audio-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--neon);
}
.audio-row input:disabled { opacity: 0.4; }
.audio-unavailable { text-align: left; }

/* ============================================================
   Addendum v1.6 — dobbel-opening, 6 nieuwe actiekaarten
   ============================================================ */

/* ---------- Dobbelstenen (3D-CSS-kubus met pips) ---------- */
.fx-dice {
  position: fixed;
  width: 46px; height: 46px;
  z-index: 148;
  perspective: 430px;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}
.dice-cube {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.dice-face {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: linear-gradient(145deg, #fdfdff, #ccd2ee);
  border: 1px solid rgba(90, 100, 160, 0.6);
  box-shadow: inset 0 0 9px rgba(30, 30, 80, 0.25);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 6px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.dice-face.f-front  { transform: translateZ(23px); }
.dice-face.f-back   { transform: rotateY(180deg) translateZ(23px); }
.dice-face.f-right  { transform: rotateY(90deg) translateZ(23px); }
.dice-face.f-left   { transform: rotateY(-90deg) translateZ(23px); }
.dice-face.f-top    { transform: rotateX(90deg) translateZ(23px); }
.dice-face.f-bottom { transform: rotateX(-90deg) translateZ(23px); }
.pip-cell { display: flex; align-items: center; justify-content: center; }
.pip {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #232848;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.55);
}
/* Gouden winnaar-flits op de winnende steen */
.fx-dice.winner { animation: diceWinner 0.8s ease-in-out infinite; }
.fx-dice.winner .dice-face {
  border-color: rgba(255, 209, 102, 0.95);
  box-shadow: inset 0 0 9px rgba(30, 30, 80, 0.25), 0 0 18px rgba(255, 209, 102, 0.9);
}
@keyframes diceWinner {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

/* "X mag beginnen!"-banner */
.dice-banner {
  position: fixed;
  left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  z-index: 149;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 26px;
  background: rgba(16, 21, 48, 0.94);
  border: 2px solid rgba(255, 209, 102, 0.75);
  border-radius: 16px;
  box-shadow: 0 0 34px rgba(255, 209, 102, 0.45), 0 16px 50px rgba(0, 0, 0, 0.6);
  will-change: transform, opacity;
  pointer-events: none;
}
.dice-banner img { width: 44px; height: 44px; object-fit: contain; }
.dice-banner-emoji { font-size: 34px; line-height: 1; }
.dice-banner-text {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 900;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #fff3b0, #ffd166, #f1c40f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.dice-banner-sub { font-size: 13px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }

/* ---------- Tijdbom-indicator op de aflegstapel ---------- */
.bomb-indicator {
  position: absolute;
  top: -18px; right: -22px;
  z-index: 6;
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 8, 8, 0.9);
  border: 2px solid rgba(255, 140, 66, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 140, 66, 0.55);
}
.bomb-indicator.critical {
  border-color: var(--danger);
  box-shadow: 0 0 22px rgba(255, 45, 77, 0.85);
  animation: alertPulse 0.6s ease-in-out infinite;
}
.bomb-indicator.tick { animation: bombTickPulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes bombTickPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-6deg); }
  100% { transform: scale(1); }
}
.bomb-icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.bomb-icon img, .bomb-icon svg { width: 100%; height: 100%; object-fit: contain; }
.bomb-count {
  position: absolute;
  top: -8px; right: -6px;
  min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #b3123a);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 45, 77, 0.8);
}
.bomb-amount {
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  color: #ffd166;
  background: rgba(5, 8, 20, 0.92);
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: 8px;
  padding: 0 6px;
  line-height: 14px;
  white-space: nowrap;
}
/* Pulserende lont */
.bomb-fuse {
  position: absolute;
  top: -5px; left: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 1);
  animation: fusePulse 0.7s ease-in-out infinite;
}
@keyframes fusePulse {
  0%, 100% { opacity: 0.5; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ---------- Röntgen-scanpaneel (alleen bij de kijker) ---------- */
.xray-panel {
  position: fixed;
  left: 12px; bottom: 76px;
  z-index: 96;
  width: min(320px, calc(100vw - 24px));
  background: rgba(4, 18, 26, 0.94);
  border: 1px solid rgba(33, 212, 253, 0.6);
  border-radius: 12px;
  padding: 12px;
  overflow: hidden;
  box-shadow: 0 0 26px rgba(33, 212, 253, 0.35), 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: overlayBoxIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.xray-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.xray-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-2);
  text-shadow: 0 0 8px rgba(33, 212, 253, 0.7);
}
.xray-target { font-size: 12px; color: var(--text-dim); }
.xray-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
/* Mini-kaartjes in het scanpaneel */
.xray-cards .card {
  width: 52px; height: 76px;
  border-width: 2px;
  border-radius: 8px;
}
.xray-cards .card .big-num { font-size: 28px; }
.xray-cards .card .corner { font-size: 9px; }
.xray-cards .card .corner.tl { top: 3px; left: 4px; }
.xray-cards .card .corner.br { bottom: 3px; right: 4px; }
.xray-cards .card .icon-overlay { font-size: 15px; }
/* Scanlijn-effect over het paneel */
.xray-scanline {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 26px;
  background: linear-gradient(180deg, transparent, rgba(33, 212, 253, 0.28), transparent);
  animation: xrayScan 1.6s linear infinite;
  pointer-events: none;
}
@keyframes xrayScan {
  from { transform: translateY(-30px); }
  to { transform: translateY(240px); }
}

/* ---------- PANIEK-modus (Pech) ---------- */
.panic-vignette {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  box-shadow: inset 0 0 150px 46px rgba(255, 45, 77, 0.55);
  animation: panicPulse 0.9s ease-in-out infinite;
}
@keyframes panicPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.panic-banner {
  position: fixed;
  top: 58px; left: 50%;
  transform: translateX(-50%);
  z-index: 96;
  font-size: clamp(15px, 3vw, 20px);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(135deg, rgba(179, 18, 58, 0.95), rgba(120, 8, 34, 0.95));
  border: 2px solid rgba(255, 77, 109, 0.85);
  border-radius: 12px;
  padding: 6px 18px;
  box-shadow: 0 0 26px rgba(255, 45, 77, 0.7);
  animation: panicBannerPulse 1s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes panicBannerPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.06); }
}

/* ---------- Cadeau: multi-select-overlay + strik-vlucht ---------- */
.gift-list .card { cursor: pointer; }
.gift-list .card:hover { transform: translateY(-8px) scale(1.05); }
.gift-list .card.selected {
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 0 0 3px #ffd166, 0 0 22px rgba(255, 209, 102, 0.75);
}
.gift-list .card.selected::after {
  content: "🎀";
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  z-index: 3;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
}
.gift-hint { min-height: 16px; }
.gift-bow {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  z-index: 3;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
}

/* ---------- Wervelwind-chips (FX.spiral) ---------- */
.fx-whirl-chip {
  position: fixed;
  width: 20px; height: 29px;
  margin: -15px 0 0 -10px;
  border-radius: 4px;
  border: 1px solid rgba(124, 92, 255, 0.7);
  background-image: var(--back-img, linear-gradient(150deg, #171b36, #070912));
  background-size: cover;
  background-position: center;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.6);
  z-index: 147;
  will-change: transform, opacity;
  pointer-events: none;
}

@media (max-width: 640px) {
  .xray-panel { bottom: 64px; width: min(272px, calc(100vw - 24px)); }
  .bomb-indicator { width: 38px; height: 38px; top: -14px; right: -14px; }
  .bomb-icon { width: 24px; height: 24px; }
  .panic-banner { top: 50px; }
}

/* Reduced motion: alles instant */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .ambient-canvas { display: none; }
  .turn-spotlight { display: none; }
  /* v2.7 §3: geen tintwisseling; wel een statische gloed. */
  .logo-text, .logo img { animation: none !important; }
  .logo img { filter: drop-shadow(0 0 16px rgba(124, 92, 255, 0.45)); }
}

/* ============================================================
   Addendum v1.7 — kleurenblind, avatars, ambiance, help, open lobby's
   ============================================================ */

/* ---------- §2 Kleurenblind-modus ---------- */
/* Veilig palet via CSS-variabelen (Okabe-Ito): alles wat var(--red) e.d.
   gebruikt (kleur-kiezer, SVG-fallback-kaarten) kleurt automatisch mee. */
body.colorblind {
  --red: #d55e00;
  --yellow: #f0e442;
  --green: #009e73;
  --blue: #0072b2;
}
/* Kaart-achtergronden (SVG/CSS-fallback; frame-jpg's schaduwen dit — daar
   zijn de vorm-symbolen het onderscheid). */
body.colorblind .card[data-color="red"]    { --card-bg: linear-gradient(150deg, #e77b3a, #a34700); }
body.colorblind .card[data-color="yellow"] { --card-bg: linear-gradient(150deg, #f5ec70, #bfb414); }
body.colorblind .card[data-color="green"]  { --card-bg: linear-gradient(150deg, #14bd90, #006c50); }
body.colorblind .card[data-color="blue"]   { --card-bg: linear-gradient(150deg, #2f8fd4, #005180); }

/* Vorm-symbolen (▲●■◆) in de kaarthoeken — alleen zichtbaar in kleurenblind-modus */
.card .cb-shape { display: none; }
body.colorblind .card .cb-shape {
  display: block;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  margin-top: 2px;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9);
}
body.colorblind .xray-cards .card .cb-shape { font-size: 10px; margin-top: 1px; }

/* Grote kleurbadge rechtsboven — hét kleuronderscheid op actiekaarten,
   waar het centrale icoon kleurneutraal is. Alleen in kleurenblind-modus. */
.card .cb-badge { display: none; }
body.colorblind .card .cb-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(6, 9, 20, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.92);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 3;
}
/* Alleen de grote actie-iconen wijken iets uit voor de badge; het cijfer op een
   cijferkaart blijft exact gecentreerd staan. */
body.colorblind .card:not([data-kind="num"]) .center { transform: translateY(7px) scale(0.87); }
body.colorblind .xray-cards .card .center { transform: none; }

/* Kleinere varianten waar kaarten klein worden getoond */
body.colorblind .xray-cards .card .cb-badge,
body.colorblind .extra-list .card .cb-badge,
body.colorblind .gift-list .card .cb-badge {
  width: 18px; height: 18px; font-size: 11px; border-width: 1px; top: 3px; right: 3px;
}
/* Vorm-symbolen op de kleur-kiezer-knoppen */
.color-swatch { display: flex; align-items: center; justify-content: center; }
body.colorblind .color-swatch::after {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}
body.colorblind .color-swatch[data-color="red"]::after    { content: "▲"; }
body.colorblind .color-swatch[data-color="yellow"]::after { content: "●"; }
body.colorblind .color-swatch[data-color="green"]::after  { content: "■"; }
body.colorblind .color-swatch[data-color="blue"]::after   { content: "◆"; }

/* Huidige-kleur-indicator als tekstlabel in de HUD (alleen kleurenblind-modus) */
.current-color-label {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--text);
  background: rgba(5, 8, 20, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 4px 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
body:not(.colorblind) .current-color-label { display: none; }

/* Toggle in het ingelogde accountblok */
.account-pref-row { font-size: 13px; margin-top: 2px; }

/* ---------- §7 Ambiance: room-asset als in-game achtergrond ---------- */
/* Alleen actief als het room-asset bestaat (body.has-room via JS); anders
   blijft de bestaande gradient exact zoals hij was. Dim + vignette in laag 1. */
body.in-game.has-room {
  background-image:
    radial-gradient(ellipse at 50% 42%, rgba(4, 5, 14, 0.30), rgba(2, 3, 9, 0.82) 82%),
    var(--room-img);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

/* ---------- §8 Avatar-afbeeldingen (manifest.avatars) ---------- */
.avatar-img { display: inline-block; vertical-align: middle; }
.avatar-emoji { display: inline-block; }
.avatar .avatar-img { width: 28px; height: 28px; object-fit: contain; }
.avatar-option { height: 54px; display: flex; align-items: center; justify-content: center; padding: 4px 0; }
.avatar-option .avatar-img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.seat-avatar { overflow: hidden; }
.seat-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.my-name .avatar-img { width: 24px; height: 24px; object-fit: contain; vertical-align: -6px; margin-right: 2px; }
.scores-table .avatar-img { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; margin-right: 4px; }
.scores-subtitle .avatar-img { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; margin-right: 4px; }
.target-option .avatar .avatar-img { width: 26px; height: 26px; }

/* ---------- §5 Sessiescore-tally ---------- */
.session-tally {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: #ffd166;
  background: rgba(90, 55, 0, 0.35);
  border: 1px solid rgba(255, 209, 102, 0.4);
  border-radius: 8px;
  padding: 1px 7px;
  white-space: nowrap;
}
.scores-table td.session-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
}

/* ---------- §9 Help-knop + handleiding-overlay ---------- */
.btn-help {
  position: fixed;
  bottom: 12px;
  right: 64px;
  z-index: 210;
  font-size: 17px;
  color: var(--text);
  background: rgba(16, 21, 48, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-help:hover { transform: translateY(-2px); box-shadow: 0 0 14px rgba(124, 92, 255, 0.5); }

.help-box { width: min(720px, 96vw); gap: 12px; text-align: left; align-items: stretch; }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.help-tab {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(5, 8, 20, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.help-tab:hover { color: var(--text); }
.help-tab.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(33, 212, 253, 0.18));
  border-color: var(--neon);
}
.help-body {
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding-right: 6px;
  font-size: 14px;
  line-height: 1.5;
}
.help-pane { display: none; flex-direction: column; gap: 8px; }
.help-pane.active { display: flex; }
.help-pane h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--neon-2);
  margin-top: 8px;
}
.help-pane p { color: var(--text); }
.help-pane .hint { text-align: left; }
.help-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.help-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(5, 8, 20, 0.45);
  border: 1px solid rgba(120, 140, 255, 0.1);
}
.help-icon {
  flex: none;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.help-icon img, .help-icon svg { width: 100%; height: 100%; object-fit: contain; }
.help-num {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(150deg, var(--neon), #4a35c9);
  border-radius: 8px;
  width: 32px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ---------- §10 Open lobby's-paneel (home) ---------- */
.home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lobbies-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: panelRise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.4s;
}
.lobbies-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lobby-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(5, 8, 20, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px 12px;
}
.lobby-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lobby-row-host { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-row-meta { font-size: 12px; color: var(--text-dim); }
.lobby-row-status {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  padding: 2px 8px;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}
.lobby-row-status.open { color: #38e07b; border-color: rgba(56, 224, 123, 0.5); }
.lobby-row-status.busy { color: #ffd166; border-color: rgba(255, 209, 102, 0.45); }
.lobbies-empty { padding: 2px 0; }

/* ---------- v1.8 Instellingen-presets (lobby, host) ---------- */
.preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-border);
}
.preset-select {
  flex: 1;
  min-width: 130px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 8px;
}
.preset-select optgroup { color: var(--text-dim); font-style: normal; }
.preset-select option { color: var(--text); background: #0a0e20; }
.preset-row .btn { flex: none; }
.preset-row .btn:disabled { opacity: 0.5; cursor: default; }
.preset-delete { color: #ff6b81; padding-left: 10px; padding-right: 10px; }
.preset-hint { text-align: left; margin: -4px 0 10px; }
.preset-overlay-text { text-align: center; }
#preset-name-input { text-align: center; }

/* v1.9: sub-instelling onder een hoofdtoggle (bv. "+2 mag ook op +4") */
.setting-row.sub-row { padding-left: 10px; opacity: 0.9; }
.setting-row.sub-row span { font-size: 13px; color: var(--text-dim); }

/* Uitleg onder een instelling (speciale kaarten + spelregels in de lobby) */
.special-row,
.desc-row { align-items: flex-start; }
.special-row > span,
.desc-row > span { display: flex; flex-direction: column; gap: 2px; }
.setting-desc {
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-dim);
  opacity: 0.85;
  max-width: 34ch;
}

/* ============================================================
   Addendum v2.0 §4 — Uitgebreide statistieken
   (paneel "Mijn statistieken", leaderboard-popover, sessieregel)
   ============================================================ */

/* Knop in het ingelogde accountblok */
.btn-my-stats { align-self: flex-start; }

/* ---------- Persoonlijk paneel ---------- */
.stats-box { text-align: left; align-items: stretch; gap: 14px; }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stats-who { text-align: left; margin-top: -8px; }
.stats-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-height: min(60vh, 560px);
  overflow-y: auto;
}
.stats-group {
  background: rgba(5, 8, 20, 0.45);
  border: 1px solid rgba(120, 140, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  will-change: transform, opacity;
}
.stats-group-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-2);
  margin-bottom: 8px;
}
.stats-list {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
}
.stats-list dt { color: var(--text-dim); }
.stats-list dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Leaderboard-popover (hover / focus / tik) ---------- */
.leaderboard-hint { text-align: left; font-size: 11.5px; opacity: 0.75; }
.leaderboard-table tbody tr.lb-row { cursor: help; }
.leaderboard-table tbody tr.lb-row:hover,
.leaderboard-table tbody tr.lb-row:focus,
.leaderboard-table tbody tr.lb-row:focus-visible {
  background: rgba(124, 92, 255, 0.14);
  outline: none;
}
.lb-popover {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 220;
  width: min(268px, calc(100vw - 24px));
  background: rgba(16, 21, 48, 0.97);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
  pointer-events: none; /* de popover vangt nooit muis/tik-events af */
  animation: overlayBoxIn 0.18s ease both;
}
.lb-pop-name {
  font-weight: 800;
  font-size: 13px;
  color: #ffd166;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-popover .stats-groups {
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: none;
  overflow: visible;
}
/* In de popover zijn de groepen tekstblokjes i.p.v. kaartjes: compacter. */
.lb-popover .stats-group { background: none; border: none; padding: 0; }
.lb-popover .stats-group + .stats-group {
  border-top: 1px solid var(--panel-border);
  padding-top: 6px;
}
.lb-popover .stats-group-title { font-size: 10px; margin-bottom: 3px; }
.lb-popover .stats-list { font-size: 11.5px; gap: 0 8px; line-height: 1.35; }

/* ---------- Sessieregel onder de scoretabel ---------- */
.scores-session {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: -6px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
  text-align: left;
  max-height: 22vh; /* veel spelers: de overlay mag niet buiten beeld groeien */
  overflow-y: auto;
}
.scores-session-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.scores-session-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}
.scores-session-line .ss-name {
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scores-session-line .ss-nums { font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 640px) {
  .stats-groups { grid-template-columns: 1fr; }
  .btn-my-stats { align-self: stretch; }
}

/* v2.3: bevestiging dat de avatarkeuze bij het account is bewaard */
.avatar-saved-hint {
  text-align: left;
  color: #38e07b;
  font-size: 12px;
  margin-top: -4px;
  animation: fadeSlide 0.3s ease both;
}

/* ============================================================
   Addendum v2.2 §1 — Zetvergrendeling tijdens een keuze
   ============================================================ */

/* Zolang er een zet loopt (of een kiezer openstaat) doet de rest van de tafel
   even niet mee: hand, trekstapel, actieknoppen en stoelen zijn niet klikbaar.
   De overlays zelf, de emotebalk en de mute/help-knop blijven wél werken. */
body.choosing #my-hand,
body.choosing #deck-pile,
body.choosing .my-buttons,
body.choosing #seats {
  pointer-events: none;
}
body.choosing #my-hand,
body.choosing #deck-pile {
  filter: saturate(0.8) brightness(0.82);
  transition: filter 0.18s ease;
}
body.choosing #my-hand .card.playable,
body.choosing #my-hand .card.jumpable {
  animation: none; /* geen "speel mij"-puls terwijl het toch niet kan */
}
/* Uitzonderingen: deze blijven gewoon bedienbaar. */
body.choosing .overlay,
body.choosing #emote-bar,
body.choosing .btn-mute,
body.choosing .btn-help,
body.choosing .btn-lang,
body.choosing #audio-popover,
body.choosing #lang-popover,
body.choosing #log-panel {
  pointer-events: auto;
}

/* ============================================================
   Addendum v2.1 §3 — Live lobbylijst (pop-in van nieuwe rijen)
   ============================================================ */
.lobby-row-new {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.2), 0 6px 20px rgba(124, 92, 255, 0.12);
}
@media (prefers-reduced-motion: reduce) {
  .lobby-row-new { box-shadow: none; }
}

/* ============================================================
   Addendum v2.2 §3 — Taalkiezer (hulpvenster)
   v2.7 §1: de balk rechtsboven op home is vervallen; de kiezer in het
   hulpvenster blijft als secundaire ingang bestaan (bewust ingetogen).
   ============================================================ */
.lang-select {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: rgba(5, 8, 20, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  max-width: 170px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.lang-select:hover,
.lang-select:focus-visible {
  border-color: var(--neon);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.35);
  outline: none;
}
.lang-select option { background: #0b1024; color: var(--text); }
/* In het hulpvenster staat de kiezer naast de sluitknop — visueel secundair
   (v2.7 §1): de hoofdingang is het ronde 🌐-knopje rechtsonder. */
.help-head .lang-select {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.75;
}
.help-head .lang-select:hover,
.help-head .lang-select:focus-visible { opacity: 1; color: var(--text); }
@media (max-width: 520px) {
  .lang-select { font-size: 12px; padding: 4px 8px; max-width: 140px; }
}

/* ============================================================
   Addendum v2.7 §1 — Taalknop als derde rond knopje rechtsonder
   Zelfde vormgeving als 🔊 (right: 12px) en ❓ (right: 64px).
   ============================================================ */
.btn-lang {
  position: fixed;
  bottom: 12px;
  right: 116px;
  z-index: 210;
  font-size: 17px;
  line-height: 1;
  color: var(--text);
  background: rgba(16, 21, 48, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-lang:hover { transform: translateY(-2px); box-shadow: 0 0 14px rgba(124, 92, 255, 0.5); }
#btn-lang-flag { font-size: 19px; line-height: 1; }

/* Popover ómhoog, zelfde patroon/positie als de audio-popover */
.lang-popover {
  position: fixed;
  right: 12px;
  bottom: 64px;
  z-index: 215;
  width: 208px;
  background: rgba(16, 21, 48, 0.97);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: overlayBoxIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.lang-options { display: flex; flex-direction: column; gap: 4px; }
.lang-option {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.lang-option:hover { background: rgba(124, 92, 255, 0.16); }
.lang-option.active {
  border-color: rgba(33, 212, 253, 0.55);
  background: rgba(33, 212, 253, 0.12);
  color: var(--neon-2);
}
.lang-option-flag { font-size: 18px; line-height: 1; }
.lang-option-name { flex: 1; }

/* ============================================================
   Addendum v2.7 §2 — Actielogboek (📜-knop + schuivend paneel)
   ============================================================ */
.btn-log {
  position: relative;
  padding: 5px 12px;
  font-size: 15px;
  line-height: 1.2;
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  opacity: 0.8;
  box-shadow: none;
  transform: none;
}
.btn-log:hover:not(:disabled) {
  opacity: 1;
  color: var(--text);
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(124, 92, 255, 0.12);
  transform: none;
}
.log-btn-icon { font-size: 16px; }
.log-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--neon), #4a35c9);
  border: 1px solid rgba(160, 140, 255, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.6);
}

.log-panel {
  position: fixed;
  top: 8px;
  right: 8px;
  bottom: 64px;              /* blijft boven de drie ronde knopjes */
  width: min(360px, 92vw);
  z-index: 99;               /* onder de keuze-overlays (100) en toasts (200) */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px 10px;
  background: rgba(10, 14, 34, 0.96);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: -14px 0 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}
/* Schuiven i.p.v. verdwijnen: de globale .hidden-regel wordt hier bewust
   overschreven zodat het paneel netjes in en uit beeld glijdt. */
.log-panel.hidden {
  display: flex !important;
  transform: translateX(calc(100% + 16px));
  opacity: 0;
  pointer-events: none;
}
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.log-title { font-size: 15px; letter-spacing: 0.02em; }
.log-empty { text-align: left; }
.log-list {
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-gutter: stable;
}
.log-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}
.log-time {
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  opacity: 0.85;
}
.log-icon { flex: none; font-size: 13px; }
.log-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Eigen acties licht geaccentueerd */
.log-row.log-mine {
  background: rgba(33, 212, 253, 0.10);
  box-shadow: inset 0 0 0 1px rgba(33, 212, 253, 0.18);
}
.log-row.log-mine .log-text { font-weight: 700; }

/* Kleurtje per soort */
.log-play { border-left-color: rgba(33, 212, 253, 0.7); }
.log-draw { border-left-color: rgba(138, 145, 180, 0.6); }
.log-draw .log-text { color: var(--text-dim); }
.log-penalty { border-left-color: rgba(255, 77, 109, 0.8); }
.log-penalty .log-text { color: #ffc2cd; }
.log-storm { border-left-color: rgba(241, 196, 15, 0.85); }
.log-storm .log-text { color: #ffe79a; }
.log-special { border-left-color: rgba(124, 92, 255, 0.8); }
.log-call { border-left-color: rgba(39, 174, 96, 0.85); }
.log-call .log-text { font-weight: 700; }
.log-win { border-left-color: rgba(255, 215, 0, 0.9); }
.log-win .log-text { color: #ffe9a3; font-weight: 700; }
.log-info { border-left-color: rgba(138, 145, 180, 0.45); }
.log-info .log-text { color: var(--text-dim); }

/* Scheidingsregel bij een nieuwe ronde */
.log-row.log-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 2px;
  padding: 0;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.log-row.log-sep::before,
.log-row.log-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--panel-border), transparent);
}
.log-row.log-sep:first-child { margin-top: 0; }

/* Desktop: het spelscherm schuift op zodat het paneel de kaarten niet dekt. */
#screen-game { transition: padding-right 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
@media (min-width: 760px) {
  body.log-open #screen-game { padding-right: calc(min(360px, 92vw) + 24px); }
}

/* Mobiel: van onderaf, max 70% hoogte; onderin ruimte voor de ronde knopjes. */
@media (max-width: 759px) {
  .log-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 0;
    width: auto;
    height: 70vh;
    max-height: 70%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: 62px;
    box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.6);
  }
  .log-panel.hidden { transform: translateY(calc(100% + 16px)); }
}

/* Smalle schermen: drie ronde knopjes van 40×40 met 8px tussenruimte. */
@media (max-width: 520px) {
  .btn-mute { width: 40px; height: 40px; right: 12px; }
  .btn-help { width: 40px; height: 40px; right: 60px; }
  .btn-lang { width: 40px; height: 40px; right: 108px; }
  #btn-lang-flag { font-size: 17px; }
  .audio-popover, .lang-popover { bottom: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .log-panel, #screen-game { transition: none; }
  .lang-popover { animation: none; }
}

/* Geen layout-sprong wanneer een scrollbaar paneel net wel/niet hoog genoeg is:
   ruimte voor de scrollbalk blijft altijd gereserveerd. Dit voorkomt de korte
   "scroll-flits" bij o.a. de statistieken-overlay en de chat. */
.overlay-box,
.stats-groups,
.lb-popover,
.chat-log,
.lobby-settings-panel,
.help-body {
  scrollbar-gutter: stable;
}

/* ============================================================
   Addendum v3.0 — Tussenspellen (cirkel-tegels + rekenduel)
   Twee fullscreen-overlays die het spel 10 seconden lang overnemen.
   ============================================================ */
.overlay-mini { z-index: 160; padding: 12px; }
.mini-box {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.65);
  padding: 18px clamp(14px, 3vw, 26px);
  width: min(980px, 96vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  text-align: center;
  animation: miniPop 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes miniPop {
  from { transform: scale(0.92) translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.mini-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.mini-title { font-size: clamp(19px, 3vw, 26px); font-weight: 900; letter-spacing: 0.01em; }
.mini-clock {
  min-width: 56px;
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--neon-2);
  text-shadow: 0 0 18px rgba(33, 212, 253, 0.55);
}
.mini-clock.urgent {
  color: var(--danger);
  text-shadow: 0 0 22px rgba(255, 77, 109, 0.75);
  animation: miniClockPulse 0.5s ease-in-out infinite alternate;
}
@keyframes miniClockPulse { from { transform: scale(1); } to { transform: scale(1.14); } }
.mini-hint { margin: 0; }
.mini-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mini-status { margin: 0; min-height: 20px; }

/* ---------- §1: tegelraster met één tekenvak per speler ---------- */
.circle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-gutter: stable;
}
.circle-tile {
  --ink: var(--neon);
  background: rgba(6, 9, 24, 0.72);
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.circle-tile.mine { border-color: color-mix(in srgb, var(--ink) 70%, transparent); }
.circle-tile.done { opacity: 0.92; }
.circle-tile.best {
  border-color: var(--yellow);
  box-shadow: 0 0 26px rgba(241, 196, 15, 0.45);
  transform: scale(1.03);
}
.circle-tile.worst {
  border-color: var(--danger);
  box-shadow: 0 0 22px rgba(255, 77, 109, 0.4);
}
.circle-tile-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  font-size: 13px;
  font-weight: 700;
}
.circle-tile-head .avatar { font-size: 17px; line-height: 1; display: inline-flex; }
.circle-tile-head .avatar-img { width: 20px; height: 20px; border-radius: 50%; }
.circle-tile-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.circle-tile-mark { font-size: 15px; }
.circle-tile.done .circle-tile-mark { color: var(--green); }
.circle-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 50%, rgba(124, 92, 255, 0.10), transparent 70%),
    rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.circle-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.circle-tile.mine .circle-canvas { cursor: crosshair; touch-action: none; }
.circle-tile-score {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3px 0 4px;
  font-size: clamp(15px, 2.4vw, 21px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: rgba(3, 4, 12, 0.72);
  animation: miniPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.circle-tile.best .circle-tile-score { color: var(--yellow); }
.circle-tile.worst .circle-tile-score { color: var(--danger); }

/* ---------- §2: rekenduel ---------- */
.duel-box { width: min(560px, 96vw); }
.duel-question {
  font-size: clamp(38px, 11vw, 78px);
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 6px 0;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(124, 92, 255, 0.55));
}
.duel-answer-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.duel-answer {
  width: min(200px, 54vw);
  font-family: inherit;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  background: var(--bg-2);
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px 10px;
}
.duel-answer:focus { outline: none; border-color: var(--neon-2); box-shadow: 0 0 16px rgba(33, 212, 253, 0.35); }
.duel-answer:disabled { opacity: 0.55; }
/* Spinner-pijltjes weg: het is één getal, geen teller. */
.duel-answer::-webkit-outer-spin-button,
.duel-answer::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.duel-answer { -moz-appearance: textfield; appearance: textfield; }
.duel-outcome {
  font-size: clamp(15px, 2.6vw, 19px);
  font-weight: 700;
  min-height: 24px;
  margin: 0;
  padding: 0 8px;
}
.duel-outcome.good { color: var(--green); }
.duel-outcome.bad { color: var(--danger); }

/* ---------- v3.2: magneet — kies uit drie dichte kaarten ---------- */
.magnet-box { width: min(620px, 96vw); }
.mini-sub { margin: 0; font-size: clamp(15px, 2.6vw, 20px); font-weight: 800; }
.magnet-cards {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 3vw, 22px);
  padding: 6px 0 2px;
  perspective: 1000px;
}
.magnet-slot {
  --card-w: clamp(78px, 19vw, 116px);
  --card-h: calc(var(--card-w) * 1.45);
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: default;
}
.magnet-slot.pickable { cursor: pointer; }
.magnet-flip {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 12px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0.05, 0.2, 1), box-shadow 0.2s ease;
}
.magnet-slot.pickable:hover .magnet-flip,
.magnet-slot.pickable:focus-visible .magnet-flip {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 0 26px rgba(33, 212, 253, 0.6);
}
.magnet-slot.chosen .magnet-flip { box-shadow: 0 0 30px rgba(33, 212, 253, 0.75); }
.magnet-slot.revealed .magnet-flip { transform: rotateY(180deg); }
.magnet-slot.revealed.taken .magnet-flip {
  transform: rotateY(180deg) scale(1.06);
  box-shadow: 0 0 30px rgba(39, 174, 96, 0.65);
}
.magnet-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.magnet-face .card { width: 100%; height: 100%; }
.magnet-back { transform: rotateY(180deg); }
.magnet-label {
  font-size: 12px;
  font-weight: 800;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.25s ease 0.3s;
}
.magnet-slot.revealed .magnet-label { opacity: 1; }
.magnet-slot.taken .magnet-label { color: var(--green); }
.magnet-slot.left { filter: grayscale(0.75); opacity: 0.7; }
.magnet-outcome {
  font-size: clamp(15px, 2.6vw, 19px);
  font-weight: 700;
  min-height: 24px;
  margin: 0;
  padding: 0 8px;
}
.magnet-outcome.good { color: var(--green); }

@media (max-width: 520px) {
  .circle-grid { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; }
  .circle-tile-head { font-size: 11px; }
  .mini-box { padding: 14px 10px; gap: 10px; }
  .magnet-slot { --card-w: clamp(66px, 24vw, 94px); }
}

@media (prefers-reduced-motion: reduce) {
  .mini-box, .circle-tile-score { animation: none; }
  .mini-clock.urgent { animation: none; }
  .magnet-flip, .magnet-label { transition: none; }
}
