:root {
  --bg: #0d1220;
  --bg-accent: #16213a;
  --card: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.09);
  --surface: rgba(255, 255, 255, 0.03);
  --input: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.14);
  --text: #e8ecf6;
  --muted: #8d97b0;
  --accent: #5cc8ff;
  --accent-strong: #2fb2f5;
  --ok: #3ddc97;
  --error: #ff6b6b;
  --pending: #f5c451;
  --radius: 18px;
  --radius-small: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, var(--bg-accent), var(--bg) 70%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 1.9rem; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

.muted, .hint, small { color: var(--muted); }
small { display: block; font-size: 0.78rem; margin-top: 4px; }
.subtitle { margin: 0 0 20px; color: var(--muted); }

/* Layout */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.splash { min-height: 100vh; }
.shell { max-width: 960px; margin: 0 auto; padding: 0 16px 40px; }
.content { margin-top: 20px; }
.stack { display: grid; gap: 20px; }

.card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  animation: rise 0.4s ease-out;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.topbar nav a:hover { color: var(--text); background: var(--surface); }
.topbar nav a.active { color: var(--text); background: rgba(92, 200, 255, 0.14); }
.who { display: flex; align-items: center; gap: 10px; }
.who .name { font-weight: 500; }

.conn { width: 9px; height: 9px; border-radius: 50%; background: var(--pending); }
.conn-connected { background: var(--ok); }
.conn-disconnected { background: var(--error); }
.conn-connecting { animation: pulse 1s ease-in-out infinite; }

.badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--bg);
  background: var(--accent);
}

/* Forms */
.login { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.form { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; font-size: 0.9rem; color: var(--muted); }

input, select {
  font: inherit;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select option { background: var(--bg-accent); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.2);
}

.btn {
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--input-border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06121f; font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-small { padding: 6px 10px; font-size: 0.85rem; }

.error, .success { margin: 0; padding: 10px 12px; border-radius: var(--radius-small); font-size: 0.9rem; }
.error { color: var(--error); background: rgba(255, 107, 107, 0.1); }
.success { color: var(--ok); background: rgba(61, 220, 151, 0.1); }

/* Status */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0 0; }
.meta dt { font-size: 0.75rem; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.state-connected { color: var(--ok); }
.state-connecting { color: var(--pending); }
.state-disconnected { color: var(--error); }

/* Admin user list */
.user-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
}
.user-row.is-locked { opacity: 0.6; }
.user-main { flex: 1; min-width: 200px; }
.user-name { font-weight: 600; }
.user-sub { font-size: 0.82rem; color: var(--muted); }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 50% { opacity: 0.3; } }

@media (max-width: 600px) {
  .topbar { gap: 10px; }
  .topbar nav { order: 3; flex: 1 1 100%; }
  .topbar nav a { white-space: nowrap; }
  .guest-badge { font-size: 0.68rem; padding: 1px 6px; }
  .who .name { display: none; }
  .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Arena / lobby                                                          */
/* ---------------------------------------------------------------------- */
:root {
  --danger: #ff5d6c;
  --status-available: var(--ok);
  --status-idle: #8d97b0;
  --status-in_game: #b18cff;
  --status-not_accepting: var(--pending);
}

.arena {
  display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start;
  grid-template-areas: "games players" "chat players";
  /* The last row takes the extra height so the chat sits right under the game choice. */
  grid-template-rows: auto 1fr;
}
.arena-games { grid-area: games; }
.arena-players { grid-area: players; }
.arena-chat { grid-area: chat; min-width: 0; }
@media (max-width: 760px) {
  .arena { grid-template-columns: 1fr; grid-template-areas: "games" "players" "chat"; grid-template-rows: none; }
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }

/* Compact list (user request 2026-09-30, more games coming): only the selected game shows its description. */
.game-grid { display: grid; gap: 6px; }
.game-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  text-align: left;
  font: inherit;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.game-card:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.06); }
.game-card.selected { border-color: var(--accent); background: rgba(92, 200, 255, 0.08); }
.game-card .game-icon { grid-row: span 2; }
.game-name { font-weight: 600; }
.game-desc { font-size: 0.82rem; color: var(--muted); }
.game-card:not(.selected) .game-desc { display: none; }
.game-card .game-icon { width: 30px; height: 30px; transition: width 0.15s, height 0.15s; }
.game-card.selected { padding: 12px; }
.game-card.selected .game-icon { width: 40px; height: 40px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-size: 0.9rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 40px; height: 22px; border-radius: 999px; background: var(--input-border);
  position: relative; transition: background 0.2s; flex: none;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.35); }

.me-status { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 6px 0 14px; font-size: 0.9rem; }
.me-status strong { color: var(--text); }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--status-idle); }
.status-available { background: var(--status-available); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.15); }
.status-idle { background: var(--status-idle); }
.status-in_game { background: var(--status-in_game); }
.status-not_accepting { background: var(--status-not_accepting); }

.start-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 420px) { .start-buttons { grid-template-columns: 1fr; } }

.outgoing {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 12px 14px; margin-bottom: 14px; border-radius: 12px;
  background: rgba(92, 200, 255, 0.08); border: 1px solid rgba(92, 200, 255, 0.25);
}
.outgoing > div { flex: 1; }

.bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 8px; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.25s linear; }
.countdown { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }

.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.player-row {
  display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--surface);
}
.player-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-status { font-size: 0.8rem; color: var(--muted); }
.empty { text-align: center; padding: 18px 0; }
@media (max-width: 420px) { .player-status { display: none; } .player-row { grid-template-columns: auto 1fr auto auto; gap: 6px; } }

/* Toasts & challenge cards */
.toast-layer {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: grid; gap: 10px; width: min(360px, calc(100vw - 32px));
}
.toast {
  padding: 14px 16px; border-radius: 14px; background: #1b2640; border: 1px solid var(--card-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); animation: slide-in 0.3s ease-out; cursor: default;
}
.toast-error { border-color: rgba(255, 107, 107, 0.5); color: var(--error); }
.challenge-card { border-color: rgba(92, 200, 255, 0.5); }
.toast-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 4px; }
.toast-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.toast-actions .countdown { flex: 1; }

/* Dialogs */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 8, 16, 0.65); backdrop-filter: blur(3px); animation: fade-in 0.2s ease-out;
}
.dialog { width: 100%; max-width: 420px; background: #172139; }
.dialog-body p { margin: 0 0 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn-danger:hover { background: #ff4356; }

/* The final position of the game stays visible behind the result (user request 2026-09-29). */
.overlay.overlay-light { background: rgba(5, 8, 16, 0.35); backdrop-filter: none; }
.turn-banner.over { border-color: var(--card-border); }
.turn-banner.over.over-win .turn-text { color: var(--ok); }
.turn-banner.over.over-loss .turn-text { color: var(--danger); }
.result { text-align: center; }
.result .dialog-actions { justify-content: center; }
.result-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.result-win .result-title { color: var(--ok); }
.result-loss .result-title { color: var(--danger); }

.conn-banner {
  margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem;
  background: rgba(255, 107, 107, 0.12); color: var(--error);
}

/* Game (placeholder) */
.versus { margin: 0 0 16px; color: var(--muted); }
.versus strong { color: var(--text); }
.phase { text-align: center; padding: 22px; border-radius: 14px; background: var(--surface); margin-bottom: 14px; }
.phase-title { color: var(--muted); }
.phase-timer { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.phase p { margin: 6px 0 0; }

@keyframes slide-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------------------------------------------------------------------- */
/* Battleship                                                             */
/* ---------------------------------------------------------------------- */
:root {
  --sea: #0f2a4a;
  --sea-line: rgba(140, 190, 255, 0.14);
  --ship: #c9d6e8;
  --ship-deck: #a9b9cf;
  --ship-detail: #5d6f8a;
  --ship-super: #8ea0bb;
  --sunk: #1e3a8a;
  --sunk-deck: #27479f;
  --sunk-detail: #142a66;
  --hit: #e5484d;
  --miss: #7b8494;
  --valid: #3ddc97;
  --invalid: #ff5d6c;
}

.game-view { display: grid; gap: 16px; }
.game-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.game-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.game-head .versus { flex: 1; margin: 0; display: flex; align-items: center; gap: 6px; }

/* Board */
.board { display: grid; gap: 8px; width: 100%; }
.board-title { font-weight: 600; color: var(--muted); font-size: 0.9rem; }
.board-frame {
  display: grid;
  grid-template-columns: 1.6em 1fr;
  grid-template-rows: 1fr 1.5em;
  gap: 4px;
}
.board-rows, .board-cols { display: grid; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.board-rows { grid-template-rows: repeat(10, 1fr); align-items: center; justify-items: end; padding-right: 2px; }
.board-cols { grid-template-columns: repeat(10, 1fr); justify-items: center; align-items: center; }
.board-grid {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  background: radial-gradient(circle at 30% 20%, #16406b, var(--sea) 70%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--sea-line), 0 12px 30px rgba(0, 0, 0, 0.35);
}
.board-placement { touch-action: none; cursor: crosshair; }
.cell { border-right: 1px solid var(--sea-line); border-bottom: 1px solid var(--sea-line); background: none; padding: 0; }
.cell:nth-child(10n) { border-right: none; }
.cell-target { cursor: crosshair; transition: background 0.12s; font: inherit; color: inherit; border-top: none; border-left: none; }
.cell-target:disabled { cursor: default; }
.board-target.active .cell-target:not(:disabled):hover { background: rgba(92, 200, 255, 0.25); }
.cell-target:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.board-layer { position: absolute; inset: 0; pointer-events: none; }
.board-target.active .board-grid { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px rgba(92, 200, 255, 0.15), 0 12px 30px rgba(0, 0, 0, 0.35); }

.forbidden { position: absolute; background: repeating-linear-gradient(45deg, rgba(255, 93, 108, 0.16) 0 4px, transparent 4px 8px); }

/* Ships */
.ship-slot { position: absolute; transition: filter 0.15s; }
.ship { width: 100%; height: 100%; display: block; overflow: visible; }
.ship-body { fill: var(--ship); }
.ship-deck { fill: var(--ship-deck); }
.ship-superstructure { fill: var(--ship-super); }
.ship-detail, .ship-detail rect, .ship-detail circle { fill: var(--ship-detail); }
.ship-slot.own .ship { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.ship-slot.selected .ship-body { fill: #e6f4ff; }
.ship-slot.own.selected .ship { filter: drop-shadow(0 0 6px rgba(92, 200, 255, 0.95)); }
.ship-slot.sunk { animation: sink-in 0.6s ease-out; }
.ship-slot.sunk .ship-body { fill: var(--sunk); stroke: #a9bcff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ship-slot.sunk .ship { filter: drop-shadow(0 0 4px rgba(10, 20, 60, 0.9)); }
.ship-slot.sunk .ship-deck { fill: var(--sunk-deck); }
.ship-slot.sunk .ship-superstructure, .ship-slot.sunk .ship-detail, .ship-slot.sunk .ship-detail rect, .ship-slot.sunk .ship-detail circle { fill: var(--sunk-detail); }
.ship-slot.preview { opacity: 0.85; }
.ship-slot.preview.valid .ship-body { fill: var(--valid); }
.ship-slot.preview.invalid .ship-body { fill: var(--invalid); }

/* Shot markers */
.marker { position: absolute; display: grid; place-items: center; }
.marker-miss { background: rgba(123, 132, 148, 0.55); }
.marker-miss::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: #cfd5df; }
.marker-hit, .marker-sunk { background: rgba(229, 72, 77, 0.55); }
.marker-hit::after, .marker-sunk::after {
  content: ""; width: 44%; height: 44%; border-radius: 50%;
  background: radial-gradient(circle, #fff3c4 0 20%, #ff8a3d 45%, var(--hit) 70%);
  box-shadow: 0 0 10px rgba(255, 120, 60, 0.8);
}
.marker.latest::before {
  content: ""; position: absolute; inset: 10%; border-radius: 50%; border: 2px solid #fff;
  animation: ripple 0.9s ease-out forwards;
}
.marker.latest.marker-hit, .marker.latest.marker-sunk { animation: flash 0.5s ease-out; }

/* Placement */
.placement { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.board-large { max-width: 560px; }
.placement-panel { display: grid; gap: 12px; }
.placement-board { display: grid; gap: 10px; align-content: start; }
.orientation-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; max-width: 560px; }
.orientation-ship { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-height: 40px; }
.orientation-ship .ship { width: 64px; height: 18px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--card-border); }
.segmented button {
  font: inherit; font-weight: 600; color: var(--muted); background: none; border: none; cursor: pointer;
  padding: 10px 16px; border-radius: 9px; min-width: 96px; transition: background 0.15s, color 0.15s;
}
.segmented button.active { color: #06121f; background: var(--accent); }
.placement-panel p { margin: 0; }
.deadline { display: grid; text-align: right; font-variant-numeric: tabular-nums; }
.deadline strong { font-size: 1.4rem; }
.help-touch { display: none; }
@media (pointer: coarse) { .help-mouse { display: none; } .help-touch { display: inline; } }
.dock { display: grid; gap: 10px; }
.dock-row { display: grid; gap: 6px; }
.dock-label { font-size: 0.85rem; }
.dock-ships { display: flex; flex-wrap: wrap; gap: 8px; }
.dock-ship {
  height: 34px; padding: 4px; border-radius: 8px; cursor: pointer;
  background: var(--sea); border: 1px solid var(--sea-line); transition: border-color 0.15s, opacity 0.15s;
}
.dock-ship.size-1 { width: 34px; }
.dock-ship.size-2 { width: 62px; }
.dock-ship.size-3 { width: 90px; }
.dock-ship.size-4 { width: 118px; }
.dock-ship:hover { border-color: var(--accent); }
.dock-ship.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.25); }
.dock-ship.placed { opacity: 0.35; }
.dock-ship .ship { pointer-events: none; }
.placement-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-block { width: 100%; }

.waiting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr); gap: 20px; align-items: center; }
.waiting .board { max-width: 480px; }
.waiting-card { text-align: center; }

/* Match */
.match { display: grid; gap: 14px; }
.turn-banner {
  display: grid; gap: 8px; padding: 14px 18px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--card-border); transition: border-color 0.3s, background 0.3s;
}
.turn-banner.mine { border-color: rgba(92, 200, 255, 0.6); background: rgba(92, 200, 255, 0.1); }
.turn-text { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.1rem; flex-wrap: wrap; }
.last-shot { font-size: 0.9rem; padding: 2px 10px; border-radius: 999px; animation: pop 0.35s ease-out; }
.shot-miss { background: rgba(123, 132, 148, 0.3); color: #d6dbe4; }
.shot-hit { background: rgba(229, 72, 77, 0.25); color: #ff9a9d; }
.shot-sunk { background: rgba(30, 58, 138, 0.6); color: #c7d4ff; }
.turn-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.turn-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pending), var(--accent)); transition: width 0.2s linear; }
.turn-banner.theirs .turn-bar-fill { background: var(--muted); }
.time-bank { color: var(--pending); font-variant-numeric: tabular-nums; }
.time-bank strong { font-size: 1.2rem; }

.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.fleet-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fleet-chip { height: 16px; display: inline-block; }
.fleet-chip.size-1 { width: 16px; }
.fleet-chip.size-2 { width: 32px; }
.fleet-chip.size-3 { width: 48px; }
.fleet-chip.size-4 { width: 64px; }
.fleet-chip.sunk { opacity: 0.35; }
.fleet-chip.sunk .ship-body { fill: var(--hit); }

@media (max-width: 860px) {
  .placement, .waiting { grid-template-columns: 1fr; }
  /* Phones and narrow tablets: the dock moves above the board (user feedback 2026-09-27). */
  .placement .dock-strip.mobile-only { display: flex; }
  .placement button.mobile-only { display: inline-flex; }
  .placement .desktop-only { display: none; }
  .orientation-ship svg { display: none; }
  .orientation-bar { flex-wrap: nowrap; gap: 8px; }
  .orientation-bar .orientation-ship { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .board-large, .waiting .board { max-width: none; }
}
@media (max-width: 700px) {
  /* Mobile: target board first and large, own board smaller below. */
  .boards { grid-template-columns: 1fr; gap: 16px; }
  .board-own { max-width: 70%; justify-self: center; }
  .game-head { gap: 10px; }
  .game-head h2 { font-size: 1.1rem; }
  .shell { padding: 0 10px 30px; }
}

@keyframes ripple { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes flash { 0% { background: rgba(255, 220, 150, 0.9); } }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } }
@keyframes sink-in { from { opacity: 0; transform: scale(1.08); } }

/* Animations (suunnitelma.md section 30): feedback, not decoration */
.marker.latest { animation: drop 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
.marker.latest.marker-hit, .marker.latest.marker-sunk { animation: drop 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2), flash 0.6s ease-out; }
.turn-banner.mine { animation: turn-glow 1.2s ease-out; }
.result .result-title { animation: title-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.3); }
.result-win { box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.4), 0 0 60px rgba(61, 220, 151, 0.25); }
.result-loss { box-shadow: 0 0 0 1px rgba(255, 93, 108, 0.35), 0 0 60px rgba(255, 93, 108, 0.18); }
.btn-icon { padding: 6px; display: inline-grid; place-items: center; }
@keyframes drop { from { transform: scale(1.8); opacity: 0; } }
@keyframes turn-glow { 0% { box-shadow: 0 0 0 0 rgba(92, 200, 255, 0.55); } 100% { box-shadow: 0 0 0 14px rgba(92, 200, 255, 0); } }
@keyframes title-in { from { transform: scale(0.6); opacity: 0; } }

/* Known empty cells around sunk ships */
.known-empty { position: absolute; background: rgba(123, 132, 148, 0.22); }
.known-empty::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14%; height: 14%;
  transform: translate(-50%, -50%); border-radius: 50%; background: rgba(207, 213, 223, 0.45);
}

/* Lobby: experience level */
.player-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.player-level { font-size: 0.75rem; font-weight: 400; color: var(--muted); white-space: nowrap; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  font: inherit; color: var(--muted); background: transparent; border: 1px solid transparent;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { color: var(--text); background: rgba(92, 200, 255, 0.14); border-color: rgba(92, 200, 255, 0.35); }
.toggles { display: grid; gap: 10px; }

/* Statistics */
.level-badge { display: grid; text-align: right; }
.level-badge strong { font-size: 1.2rem; color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.stat { display: grid; padding: 12px; border-radius: 12px; background: var(--surface); text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.78rem; color: var(--muted); }
.next-level { margin: 12px 0 0; }

/* Match chat */
.chat-toggle { position: relative; }
.unread {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.7rem; line-height: 18px;
  animation: pop 0.3s ease-out;
}
.chat-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 45; width: min(360px, calc(100vw - 32px));
  height: min(460px, 70vh); display: grid; grid-template-rows: auto 1fr auto auto; gap: 8px;
  padding: 14px; border-radius: 16px; background: #172139; border: 1px solid var(--card-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); animation: slide-in 0.25s ease-out;
}
.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.chat-empty { font-size: 0.85rem; margin: 0; }
.chat-msg { max-width: 85%; align-self: flex-start; padding: 8px 12px; border-radius: 12px; background: var(--surface); }
.chat-msg.mine { align-self: flex-end; background: rgba(92, 200, 255, 0.16); }
.chat-meta { font-size: 0.72rem; color: var(--muted); }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }
.admin-chat { width: 100%; display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); }
.admin-chat .chat-msg { max-width: none; }
@media (max-width: 600px) {
  .chat-panel { left: 0; right: 0; bottom: 0; width: 100%; height: 60vh; border-radius: 16px 16px 0 0; }
  /* Mobile: the chat button floats so new messages are always noticed. */
  .chat-toggle {
    position: fixed; right: 16px; bottom: 16px; z-index: 44; padding: 12px 16px; border-radius: 999px;
    background: #1b2640; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

/* ---------------------------------------------------------------------- */
/* Logo                                                                   */
/* ---------------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-emblem { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 2px 6px rgba(92, 200, 255, 0.35)); }
.logo-word {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 1.15rem;
  background: linear-gradient(100deg, #7dd8ff 0%, #5cc8ff 35%, #a78bfa 70%, #f0abfc 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-large .logo-emblem { width: 58px; height: 58px; }
.logo-large .logo-word { font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: 0.2em; }
.brand { text-decoration: none; color: inherit; }
.login-logo { justify-content: center; margin-bottom: 4px; }
.login-logo .logo { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
.login-logo .logo-word { font-size: clamp(1.7rem, 8vw, 2.3rem); letter-spacing: 0.14em; }
.login-logo .logo-emblem { width: 46px; height: 46px; }
.login .subtitle { text-align: center; }

/* Animated logo: a light sweep across the word, the spark twinkles, the ring glows. */
.logo-animated .logo-word { animation: word-sweep 6s ease-in-out infinite; }
.logo-animated .logo-spark { transform-origin: 24px 27px; animation: spark 3s ease-in-out infinite; }
.logo-animated .logo-ring { animation: ring-glow 4s ease-in-out infinite; }
@keyframes word-sweep { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes spark { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.35) rotate(36deg); } }
@keyframes ring-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Lobby hero with floating game pieces */
.hero {
  position: relative; overflow: hidden; margin-bottom: 20px; padding: 34px 24px; border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(92, 200, 255, 0.18), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(167, 139, 250, 0.18), transparent 55%),
    var(--card);
  border: 1px solid var(--card-border);
}
.hero-content { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; }
.hero-subtitle { margin: 0; color: var(--muted); }
.hero-pieces { position: absolute; inset: 0; pointer-events: none; }
.hero-pieces .piece { position: absolute; opacity: 0.35; animation: float 9s ease-in-out infinite; }
.hero-pieces .piece.disc { box-shadow: none; }
.hero-pieces .p1 { width: 110px; left: 5%; top: 18%; animation-duration: 11s; }
.hero-pieces .p2 { width: 26px; height: 26px; left: 22%; bottom: 14%; animation-delay: -3s; }
.hero-pieces .p3 { width: 20px; height: 20px; right: 24%; top: 16%; animation-delay: -6s; }
.hero-pieces .p4 { width: 34px; right: 8%; top: 30%; animation-duration: 12s; animation-delay: -2s; }
.hero-pieces .p5 { width: 16px; height: 16px; right: 34%; bottom: 12%; animation-delay: -5s; }
.hero-pieces .p6 { width: 36px; left: 38%; top: 8%; animation-duration: 10s; animation-delay: -7s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -12px) rotate(6deg); }
  66% { transform: translate(-8px, 8px) rotate(-5deg); }
}
@media (max-width: 600px) {
  .hero { padding: 24px 14px; }
  .hero-pieces .p1 { width: 70px; }
  .logo-large .logo-emblem { width: 44px; height: 44px; }
}

/* Shared score panel (Othello, Memory) */
.score-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.score-row + .score-row { margin-top: 8px; }
.score-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-value { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.result-score { font-size: 1.3rem; font-weight: 700; margin: 4px 0; }

/* Admin: per-game timers */
.timer-table { display: grid; grid-template-columns: minmax(110px, 1fr) 1fr 1fr; gap: 8px 12px; align-items: center; font-size: 0.9rem; }
.timer-game { font-weight: 500; }

/* ---------------------------------------------------------------------- */
/* Othello                                                                */
/* ---------------------------------------------------------------------- */
.othello, .memory { display: grid; gap: 14px; }
.othello-layout, .memory-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.othello-board-wrap { display: grid; grid-template-columns: 1.4em 1fr; grid-template-rows: 1fr 1.4em; gap: 4px; max-width: 580px; }
.othello-rows { display: grid; grid-template-rows: repeat(8, 1fr); align-items: center; justify-items: end; color: var(--muted); font-size: 0.75rem; }
.othello-cols { display: grid; grid-template-columns: repeat(8, 1fr); justify-items: center; color: var(--muted); font-size: 0.75rem; }
.othello-board {
  aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  gap: 2px; padding: 6px; border-radius: 14px; background: #0f4a2f;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06), 0 14px 34px rgba(0, 0, 0, 0.4);
}
.othello-board.active { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px rgba(92, 200, 255, 0.15), 0 14px 34px rgba(0, 0, 0, 0.4); }
.o-cell {
  position: relative; display: grid; place-items: center; border: none; padding: 0; border-radius: 6px;
  background: radial-gradient(circle at 35% 30%, #1d7a4f, #16603e); cursor: default; font: inherit;
}
.o-cell.legal { cursor: pointer; }
.o-cell.legal::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: rgba(255, 255, 255, 0.25); transition: transform 0.15s; }
.o-cell.legal:hover::after { transform: scale(1.6); background: rgba(92, 200, 255, 0.45); }
.o-cell:disabled { opacity: 1; }
.o-cell.last { box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.7); }
.disc { display: inline-block; width: 80%; height: 80%; border-radius: 50%; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45); }
.disc-b { background: radial-gradient(circle at 35% 30%, #4b5563, #0b1220 70%); }
.disc-w { background: radial-gradient(circle at 35% 30%, #ffffff, #cbd5e1 75%); }
.disc.flipping { animation: disc-flip 0.45s ease-in-out; }
.disc.placed { animation: disc-drop 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.3); }
.othello-side .disc { width: 22px; height: 22px; }
@keyframes disc-flip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg) scale(1.1); } 100% { transform: rotateY(0); } }
@keyframes disc-drop { from { transform: scale(1.6); opacity: 0; } }

/* ---------------------------------------------------------------------- */
/* Memory                                                                 */
/* ---------------------------------------------------------------------- */
.memory-board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 580px; }
.m-card { aspect-ratio: 1; border: none; padding: 0; background: none; perspective: 600px; cursor: pointer; font: inherit; }
.m-card:disabled { cursor: default; }
.m-card-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.4s ease; transform-style: preserve-3d; }
.m-card.open .m-card-inner { transform: rotateY(180deg); }
.m-card-back, .m-card-front {
  position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; display: grid; place-items: center;
}
.m-card-back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12) 0 18%, transparent 19%),
    repeating-linear-gradient(45deg, #4c1d95 0 6px, #5b21b6 6px 12px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1), 0 6px 14px rgba(0, 0, 0, 0.35);
}
.memory-board.active .m-card:not(:disabled):hover .m-card-back { box-shadow: inset 0 0 0 2px var(--accent), 0 6px 14px rgba(0, 0, 0, 0.35); }
.m-card-front { transform: rotateY(180deg); background: #1b2640; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12); }
.m-card.found-me .m-card-front { box-shadow: inset 0 0 0 3px var(--ok); }
.m-card.found-opponent .m-card-front { box-shadow: inset 0 0 0 3px var(--status-in_game); opacity: 0.85; }
.m-card.peek .m-card-front { box-shadow: inset 0 0 0 3px var(--danger); }
.memory-icon { width: 72%; height: 72%; }
.memory-side .score-row.mine { box-shadow: inset 3px 0 0 var(--ok); }
.memory-side .score-row.theirs { box-shadow: inset 3px 0 0 var(--status-in_game); }

@media (max-width: 760px) {
  .othello-layout, .memory-layout { grid-template-columns: 1fr; }
  .memory-board { gap: 5px; }
  .m-card-back, .m-card-front { border-radius: 8px; }
}

/* ---------------------------------------------------------------------- */
/* Lobby chat and moderation                                              */
/* ---------------------------------------------------------------------- */
.lobby-chat { margin-top: 20px; display: grid; gap: 10px; }
.chat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-tab {
  display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 0.88rem; color: var(--muted);
  background: var(--surface); border: 1px solid transparent; border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.chat-tab.active { color: var(--text); border-color: rgba(92, 200, 255, 0.4); background: rgba(92, 200, 255, 0.12); }
span.chat-tab { padding: 0 4px 0 0; }
.chat-tab-name { font: inherit; color: inherit; background: none; border: none; padding: 5px 4px 5px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chat-tab-close { font: inherit; color: var(--muted); background: none; border: none; cursor: pointer; padding: 2px 6px; border-radius: 50%; }
.chat-tab-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.tab-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 0.7rem; line-height: 18px; text-align: center;
}
.lobby-messages {
  height: 170px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.18); font-size: 0.9rem;
}
.msg-delete {
  margin-left: 6px; font-size: 0.8rem; background: none; border: none; cursor: pointer; opacity: 0.5; padding: 0 2px;
}
.msg-delete:hover { opacity: 1; }
.notice { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 0.88rem; background: rgba(245, 196, 81, 0.12); color: var(--pending); }
.privacy-note { margin: 0; font-size: 0.78rem; }
.char-count { align-self: center; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.char-count.near { color: var(--pending); }
.pm-toast { border-color: rgba(167, 139, 250, 0.5); }
.role-select { width: auto; padding: 6px 10px; font-size: 0.85rem; }
.mod-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.88rem; max-height: 360px; overflow-y: auto; }
@media (max-width: 600px) { .lobby-messages { height: 150px; } }

/* Chat lines: all messages left-aligned, "12:05 Nickname: text"; staff names coloured. */
.chat-line { line-height: 1.4; word-break: break-word; padding: 1px 0; }
.chat-line.mine { background: rgba(92, 200, 255, 0.06); border-radius: 6px; }
.chat-time { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-nick { font-weight: 700; color: #9ecbff; }
.chat-nick.role-moderator { color: #3ddc97; }
.chat-nick.role-admin { color: #f5c451; }
.chat-head-actions { display: flex; align-items: center; gap: 6px; }
.btn-icon.off { opacity: 0.5; }
.lobby-chat { gap: 8px; padding: 18px; }
.lobby-chat h2 { font-size: 1.1rem; }

/* Game instructions */
.rules-btn { margin-top: 12px; width: 100%; }
.dialog.rules { max-width: 640px; max-height: 88vh; display: grid; grid-template-rows: auto 1fr auto; }
.rules-head { display: flex; align-items: center; gap: 12px; }
.rules-head h2 { margin: 0; }
.rules-body { overflow-y: auto; padding-right: 6px; margin-top: 10px; }
.rules-body h3 { font-size: 1rem; margin: 16px 0 6px; color: var(--accent); }
.rules-body ul { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.rules-body li { line-height: 1.45; }
.rules-settings { padding: 10px 12px; border-radius: 10px; background: rgba(92, 200, 255, 0.1); font-size: 0.9rem; }
.rules-common { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--card-border); }

/* Lobby chat in the narrow left column; nicknames open a private message; emojis. */
.arena-chat .lobby-chat { margin-top: 0; }
.arena-chat .lobby-messages { height: 260px; }
@media (max-width: 760px) { .arena-chat .lobby-messages { height: 200px; } }
.chat-form input { min-width: 0; }
/* Lobby chat form: input + send on the first row, emojis and the counter below. */
.lobby-chat .chat-form { display: grid; gap: 6px; }
.chat-input-row { display: flex; gap: 6px; }
.chat-input-row input { flex: 1; }
.chat-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-tools .emoji-grid { left: 0; right: auto; }
.send-btn { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 44px; padding-left: 10px; padding-right: 10px; }
.send-btn.private { background: #a78bfa; border-color: #a78bfa; }
.send-lock { font-size: 0.75rem; }
button.chat-nick {
  font: inherit; font-weight: 700; background: none; border: none; padding: 0; cursor: pointer; color: #9ecbff;
}
button.chat-nick.role-moderator { color: #3ddc97; }
button.chat-nick.role-admin { color: #f5c451; }
button.chat-nick:hover:not(:disabled) { text-decoration: underline; }
button.chat-nick:disabled { cursor: default; opacity: 1; }
.chat-line.pm { background: rgba(167, 139, 250, 0.1); border-radius: 6px; }
.pm-tag { font-size: 0.8rem; cursor: help; }
.pm-toast { cursor: pointer; max-width: 360px; }
.pm-toast-text { color: var(--muted); word-break: break-word; }
.emoji-picker { position: relative; display: flex; }
.emoji-toggle { font-size: 1.1rem; padding: 4px 8px; }
.emoji-grid {
  position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; padding: 8px;
  background: #1b2640; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.emoji {
  width: 34px; height: 34px; font-size: 1.25rem; line-height: 1; background: none; border: none; border-radius: 8px; cursor: pointer;
}
.emoji:hover, .emoji:focus-visible { background: rgba(255, 255, 255, 0.1); }
@media (max-width: 420px) { .emoji-grid { grid-template-columns: repeat(6, 34px); } }

/* Compact placement dock for narrow screens (shown via the max-width: 860px rule). */
.placement .mobile-only { display: none; }
.dock-strip { flex-wrap: wrap; gap: 6px; }
.dock-strip .dock-ship.size-1 { width: 30px; }
.dock-strip .dock-ship.size-2 { width: 52px; }
.dock-strip .dock-ship.size-3 { width: 74px; }
.dock-strip .dock-ship.size-4 { width: 96px; }

/* ---------------------------------------------------------------------- */
/* Lobby in three columns on wide screens: players | games | chat          */
/* (user request 2026-09-27)                                              */
/* ---------------------------------------------------------------------- */
.shell-wide { max-width: 1340px; }
.arena {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "players games chat";
  grid-template-rows: auto;
}
.arena-chat .lobby-messages { height: 340px; }
@media (max-width: 1100px) {
  .arena { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "players games" "chat games"; grid-template-rows: auto 1fr; }
  .arena-chat .lobby-messages { height: 260px; }
}
@media (max-width: 760px) {
  .arena { grid-template-columns: 1fr; grid-template-areas: "games" "players" "chat"; grid-template-rows: none; }
  .arena-chat .lobby-messages { height: 200px; }
}

/* Footer: copyright, service owner, privacy notice */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin-top: 36px; padding: 16px 0 4px;
  border-top: 1px solid var(--card-border); font-size: 0.8rem; color: var(--muted); text-align: center;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--text); }
.page-with-footer { align-content: center; gap: 8px; }
.page-with-footer .site-footer { border-top: none; margin-top: 8px; }

.badge-warn { margin-left: 6px; background: var(--pending); vertical-align: middle; }

/* Closure notices in the top area */
.closure-banner {
  margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem;
  background: rgba(245, 196, 81, 0.12); color: var(--pending); border: 1px solid rgba(245, 196, 81, 0.25);
}
.closure-banner.closed { background: rgba(167, 139, 250, 0.12); color: #c4b5fd; border-color: rgba(167, 139, 250, 0.3); }
.closure-banner a { color: inherit; font-weight: 600; margin-left: 6px; }
/* Countdown before a break: stays visible while scrolling, also during a game. */
.closure-banner.draining {
  position: sticky; top: 8px; z-index: 30; font-weight: 600; color: #fde68a;
  background: rgba(58, 40, 6, 0.94); border-color: rgba(245, 196, 81, 0.55); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: drain-glow 2.4s ease-in-out infinite;
}
@keyframes drain-glow { 50% { border-color: rgba(245, 196, 81, 0.95); } }
.closure-state.draining .closure-dot { background: var(--pending); box-shadow: 0 0 10px var(--pending); animation: pulse 0.9s ease-in-out infinite; }
.closure-state.upcoming .closure-dot { background: var(--pending); box-shadow: 0 0 10px var(--pending); animation: pulse 1.4s ease-in-out infinite; }
.closure-hint { margin: -2px 0 4px 26px; line-height: 1.4; }
.closure-inline { display: flex; align-items: center; gap: 8px; margin-left: 26px; color: var(--text); font-size: 0.9rem; }
.closure-inline input { width: 90px; }
@media (prefers-reduced-motion: reduce) { .closure-banner.draining { animation: none; } }

/* Administration: arena closure */
textarea {
  font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--input-border);
  border-radius: var(--radius-small); padding: 10px 12px; width: 100%; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.2); }
.closure-state { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface); font-weight: 600; }
.closure-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.closure-state.closed .closure-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.closure-state.scheduled .closure-dot { background: var(--pending); box-shadow: 0 0 10px var(--pending); animation: pulse 1.4s ease-in-out infinite; }
.preset-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.preset-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--surface); }
.preset-text { font-size: 0.9rem; }
.closure-when { border: 1px solid var(--card-border); border-radius: 12px; padding: 10px 14px 14px; display: grid; gap: 8px; align-content: start; margin: 0; min-width: 0; }
.closure-when legend { color: var(--muted); font-size: 0.9rem; padding: 0 6px; }
.radio { display: flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.radio input { width: auto; accent-color: var(--accent); }
.closure-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.closure-admin h3 { font-size: 1rem; margin-bottom: 8px; }

/* ---------------------------------------------------------------------- */
/* Maintenance page (arena closed): neon arena floor, turning gears        */
/* ---------------------------------------------------------------------- */
.maint {
  position: relative; min-height: 100vh; overflow: hidden; display: grid; grid-template-rows: 1fr auto;
  padding: 16px; background: linear-gradient(#070a16 0%, #120d2e 45%, #2a1146 70%, #0b0f1f 100%);
}
.maint-sky { position: absolute; inset: 0; pointer-events: none; }
.maint-stars {
  position: absolute; inset: 0 0 45% 0; opacity: 0.8;
  background-image:
    radial-gradient(1px 1px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 28% 62%, #cfe6ff, transparent),
    radial-gradient(1.5px 1.5px at 44% 12%, #fff, transparent), radial-gradient(1px 1px at 63% 40%, #e9d5ff, transparent),
    radial-gradient(1px 1px at 78% 18%, #fff, transparent), radial-gradient(1.5px 1.5px at 90% 55%, #cfe6ff, transparent),
    radial-gradient(1px 1px at 6% 75%, #fff, transparent), radial-gradient(1px 1px at 52% 80%, #fff, transparent),
    radial-gradient(1px 1px at 35% 35%, #fff, transparent), radial-gradient(1px 1px at 85% 85%, #e9d5ff, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}
.maint-sun {
  position: absolute; left: 50%; top: 56%; width: min(58vw, 420px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; opacity: 0.55;
  background: linear-gradient(#facc15 0%, #fb7185 50%, #a855f7 100%);
  -webkit-mask: repeating-linear-gradient(#000 0 14px, transparent 14px 18px);
          mask: repeating-linear-gradient(#000 0 14px, transparent 14px 18px);
}
.maint-grid {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 52%;
  background-image:
    linear-gradient(rgba(92, 200, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.55) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(320px) rotateX(62deg); transform-origin: top;
  animation: grid-run 2.4s linear infinite;
  -webkit-mask: linear-gradient(transparent, #000 30%);
          mask: linear-gradient(transparent, #000 30%);
}
.maint-pieces { position: absolute; inset: 0; pointer-events: none; }
.maint-pieces .mp { position: absolute; opacity: 0.4; animation: float 10s ease-in-out infinite; }
.maint-pieces .disc { box-shadow: none; }
.maint-pieces .mp1 { width: 120px; left: 6%; top: 14%; animation-duration: 12s; }
.maint-pieces .mp2 { width: 28px; height: 28px; left: 18%; top: 60%; animation-delay: -3s; }
.maint-pieces .mp3 { width: 22px; height: 22px; right: 16%; top: 12%; animation-delay: -6s; }
.maint-pieces .mp4 { width: 38px; right: 8%; top: 46%; animation-duration: 13s; animation-delay: -2s; }
.maint-pieces .mp5 { width: 40px; left: 72%; top: 70%; animation-duration: 11s; animation-delay: -7s; }

.maint-content {
  position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 18px;
  text-align: center; padding: 32px 0 12px;
}
.maint-content .logo-word { font-size: clamp(2rem, 9vw, 3.2rem); }
.maint-content .logo-emblem { width: 56px; height: 56px; }
.maint-card {
  position: relative; overflow: hidden; width: min(100%, 520px); padding: 26px 26px 24px; border-radius: 22px;
  background: rgba(13, 18, 32, 0.72); border: 1px solid rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 0 1px rgba(92, 200, 255, 0.08), 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(168, 85, 247, 0.25);
  backdrop-filter: blur(10px); animation: rise 0.6s ease-out;
}
.maint-gears { width: 120px; height: 80px; margin: -4px auto 4px; display: block; }
.maint-gears .gear path, .maint-gears .gear circle { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.maint-gears .gear-big { stroke: #5cc8ff; filter: drop-shadow(0 0 4px rgba(92, 200, 255, 0.8)); transform-box: fill-box; transform-origin: center; animation: spin 9s linear infinite; }
.maint-gears .gear-small { stroke: #f0abfc; filter: drop-shadow(0 0 4px rgba(240, 171, 252, 0.8)); transform-box: fill-box; transform-origin: center; animation: spin 6.2s linear infinite reverse; }
.maint-title {
  justify-content: center; margin: 0 0 10px; font-size: clamp(1.4rem, 5vw, 1.9rem); letter-spacing: 0.04em;
  background: linear-gradient(90deg, #5cc8ff, #f0abfc, #facc15); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.maint-message { margin: 0 0 16px; font-size: 1.1rem; line-height: 1.5; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.maint-eta { display: grid; gap: 4px; justify-items: center; margin: 0; }
.maint-eta-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.maint-countdown {
  font-size: clamp(1.8rem, 8vw, 2.4rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.06em;
  color: #fef9c3; text-shadow: 0 0 12px rgba(250, 204, 21, 0.7), 0 0 28px rgba(251, 113, 133, 0.45);
}
.maint-scan {
  position: absolute; left: 0; right: 0; top: -40%; height: 40%; pointer-events: none;
  background: linear-gradient(transparent, rgba(92, 200, 255, 0.07), transparent); animation: scan 4.5s linear infinite;
}
.maint-hint {
  margin: 0; max-width: 440px; padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; color: #c3c9da;
  background: rgba(7, 10, 22, 0.6); backdrop-filter: blur(4px);
}
.maint-content > .btn-ghost { background: rgba(7, 10, 22, 0.6); color: #c3c9da; }
.login h2.center-text { text-align: center; margin-bottom: 0; }
.maint .site-footer { position: relative; z-index: 1; border-top-color: rgba(255, 255, 255, 0.08); margin-top: 12px; }
.maint .site-footer, .maint .site-footer a { color: #a5adc4; }
.login-compact { max-width: 340px; background: rgba(13, 18, 32, 0.8); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes grid-run { from { background-position: 0 0; } to { background-position: 0 60px; } }
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 0.9; } }
@keyframes scan { to { top: 110%; } }
@media (max-width: 600px) {
  .maint-card { padding: 22px 16px 20px; }
  .maint-pieces .mp1 { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .maint-grid, .maint-stars, .maint-gears .gear-big, .maint-gears .gear-small, .maint-scan, .maint-pieces .mp { animation: none; }
}

/* ---------------------------------------------------------------------- */
/* Game tables and multiplayer games (decision 2026-09-27)                 */
/* ---------------------------------------------------------------------- */
.status-waiting { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 999px; background: #f59e0b; color: #1a1205; font-size: 0.72rem; font-weight: 700; vertical-align: 1px;
}
.small-note { font-size: 0.82rem; margin: 8px 0 0; }
.best-score { margin: 10px 0 0; font-weight: 600; color: #fde68a; }
.range-value { color: var(--text); }
input[type="range"] { padding: 0; accent-color: var(--accent); background: none; border: none; box-shadow: none; }

/* Lobby: starting soon */
.tables-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -6px 0 20px; padding: 10px 14px;
  border-radius: 14px; border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(167, 139, 250, 0.08));
  animation: rise 0.4s ease-out;
}
.tables-strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.tables-strip-label { font-weight: 700; color: #fcd34d; white-space: nowrap; }
.strip-table {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.22); font-size: 0.88rem; max-width: 100%;
}
.strip-table.mine { box-shadow: inset 0 0 0 1px #f59e0b; }
.strip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Tables page */
.table-create { display: grid; gap: 16px; margin-top: 8px; }
.table-games { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.table-create-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.table-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.table-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--card-border);
}
.table-main { min-width: 0; }
.table-name { font-weight: 700; }
.table-seats { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(245, 158, 11, 0.18); color: #fcd34d; font-size: 0.8rem; }
.table-sub, .table-players { font-size: 0.85rem; }
.table-players { color: var(--text); opacity: 0.85; overflow-wrap: anywhere; }
.table-room { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.table-room .table-chat { margin-top: 0; }
.table-room .lobby-messages { height: 300px; }
@media (max-width: 860px) { .table-room { grid-template-columns: 1fr; } .table-room .lobby-messages { height: 200px; } }
.seat-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.seat { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface); animation: rise 0.3s ease-out; }
.seat.mine { box-shadow: inset 3px 0 0 var(--accent); }
.seat.empty { background: none; border: 1px dashed var(--card-border); animation: none; }
.seat-avatar {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 700;
  background: linear-gradient(135deg, #5cc8ff, #a78bfa); color: #0b1020;
}
.seat-avatar.ai { background: linear-gradient(135deg, #64748b, #334155); color: #fff; }
.seat.empty .seat-avatar { background: none; border: 1px dashed var(--card-border); color: var(--muted); }
.seat-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.seat-tag { font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.table-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Nopparalli */
.dice-layout { display: grid; gap: 20px; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr); align-items: start; margin-top: 16px; }
@media (max-width: 900px) { .dice-layout { grid-template-columns: minmax(0, 1fr); } }
.dice-tray {
  display: grid; gap: 14px; justify-items: center; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(31, 122, 77, 0.35), transparent 70%), var(--card);
}
.dice-row { display: flex; gap: 10px; justify-content: center; flex-wrap: nowrap; padding: 8px 0 16px; }
.die {
  position: relative; width: 58px; height: 58px; padding: 0; border: none; background: none; cursor: pointer;
  transition: transform 0.18s ease; -webkit-tap-highlight-color: transparent;
}
.die:disabled { cursor: default; }
.die svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.die-face { fill: #f8fafc; stroke: #cbd5e1; stroke-width: 2; }
.die-pip { fill: #0b1220; }
.die.blank .die-face { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 8 6; }
.die.held { transform: translateY(-8px); }
.die.held .die-face { fill: #fef3c7; stroke: #f59e0b; stroke-width: 6; }
.die-held {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: #fcd34d;
}
.dice-row.mine .die:not(:disabled):hover { transform: translateY(-4px); }
.dice-row.mine .die.held:not(:disabled):hover { transform: translateY(-10px); }
.die.rolling svg { animation: die-roll 0.6s cubic-bezier(0.3, 0.7, 0.4, 1); }
.die:nth-child(2).rolling svg { animation-duration: 0.66s; }
.die:nth-child(3).rolling svg { animation-duration: 0.55s; }
.die:nth-child(4).rolling svg { animation-duration: 0.7s; }
.die:nth-child(5).rolling svg { animation-duration: 0.62s; }
@keyframes die-roll {
  0% { transform: translateY(-26px) rotate(-200deg) scale(0.7); opacity: 0.3; }
  60% { transform: translateY(4px) rotate(20deg) scale(1.05); opacity: 1; }
  80% { transform: translateY(-3px) rotate(-6deg); }
  100% { transform: none; }
}
.roll-btn { display: grid; gap: 2px; min-width: 220px; font-size: 1.05rem; }
.rolls-left { font-size: 0.75rem; font-weight: 500; opacity: 0.8; }
.dice-hint { margin: 0; font-size: 0.85rem; min-height: 1.2em; }
.last-score {
  margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(245, 158, 11, 0.14); color: #fde68a;
  font-size: 0.88rem; animation: pop 0.35s ease-out;
}
@media (max-width: 420px) { .die { width: 50px; height: 50px; } .dice-row { gap: 7px; } .roll-btn { min-width: 0; width: 100%; } }

.score-card { padding: 12px; min-width: 0; }
.score-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.score-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.score-table th, .score-table td { padding: 5px 8px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.06); white-space: nowrap; }
.score-table thead th { font-size: 0.8rem; vertical-align: bottom; border-bottom: 1px solid var(--card-border); }
.score-table .cat-col { text-align: left; font-weight: 500; position: sticky; left: 0; background: #151d33; z-index: 1; }
.score-table thead .cat-col { color: var(--muted); }
.player-col-name { display: block; max-width: 96px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
.col-note { display: block; font-size: 0.66rem; font-weight: 500; color: var(--muted); }
.score-table th.current { color: #fcd34d; box-shadow: inset 0 -3px 0 #f59e0b; }
.score-table th.me .player-col-name { color: var(--accent); }
.score-table th.dropped { opacity: 0.5; text-decoration: line-through; }
.score-table td.filled.zero { color: var(--muted); }
.score-table td.option { padding: 2px 4px; }
.score-option {
  width: 100%; min-width: 38px; padding: 3px 6px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer;
  color: #fde68a; background: rgba(245, 158, 11, 0.16); border: 1px dashed rgba(245, 158, 11, 0.6);
}
.score-option:hover:not(:disabled) { background: rgba(245, 158, 11, 0.32); }
.score-option.zero { color: var(--muted); background: transparent; border-color: rgba(255, 255, 255, 0.18); font-weight: 500; }
/* Own turn (user request 2026-09-29): categories that give points light green, zero categories dim red,
   so that the remaining open rows are easy to see. */
.score-table td.option.gain { background: rgba(61, 220, 151, 0.22); }
.score-table td.option.gain .score-option { color: #d9ffe9; background: rgba(61, 220, 151, 0.28); border: 1px solid rgba(61, 220, 151, 0.75); }
.score-table td.option.gain .score-option:hover:not(:disabled) { background: rgba(61, 220, 151, 0.45); }
.score-table td.option.nil { background: rgba(255, 77, 94, 0.13); }
.score-table td.option.nil .score-option { color: rgba(255, 170, 178, 0.85); border-color: rgba(255, 77, 94, 0.35); }
.score-table .sum-row th, .score-table .sum-row td { color: var(--muted); font-size: 0.8rem; background: rgba(255, 255, 255, 0.02); }
.score-table .sum-row .cat-col { background: #161f36; }
.score-table .total-row th, .score-table .total-row td { font-weight: 800; font-size: 1rem; border-bottom: none; padding-top: 8px; }
@media (max-width: 600px) { .score-table th, .score-table td { padding: 4px 5px; } .player-col-name { max-width: 64px; } }

/* Multiplayer result */
.multi-result .result-title { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.6rem; }
.standings { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.standing {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.04); animation: rise 0.35s ease-out backwards;
}
.standing:nth-child(2) { animation-delay: 0.08s; }
.standing:nth-child(3) { animation-delay: 0.16s; }
.standing:nth-child(n + 4) { animation-delay: 0.24s; }
.standing.me { box-shadow: inset 0 0 0 1px var(--accent); }
.standing.dropped { opacity: 0.6; }
.standing-place { font-size: 1.2rem; text-align: center; }
.standing-score { font-weight: 800; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .die.rolling svg, .standing, .tables-strip, .seat { animation: none; } }

/* ---------------------------------------------------------------------- */
/* Registration: join links, invite codes, printed invite cards            */
/* ---------------------------------------------------------------------- */
.btn-success { background: var(--ok); border-color: var(--ok); color: #06121f; font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-between > p { flex: 1; min-width: 200px; }

.password-rules { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 0.82rem; color: var(--muted); }
.password-rules li::before { content: "○"; display: inline-block; width: 1.3em; }
.password-rules li.ok { color: var(--ok); }
.password-rules li.ok::before { content: "✓"; }

.copy-field { display: flex; flex-wrap: wrap; gap: 8px; }
.copy-field input { flex: 1; min-width: 200px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85rem; }
.copy-field .error { flex-basis: 100%; }
.one-time-link { display: grid; gap: 10px; border-color: rgba(61, 220, 151, 0.45); animation: rise 0.3s ease-out; }
.one-time-link h3, .one-time-link p { margin: 0; }

.code-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.2rem; letter-spacing: 0.18em; text-transform: uppercase; }
.code-input[readonly] { color: var(--accent); border-style: dashed; }
.join a.btn { text-align: center; text-decoration: none; }
.join .hint.center-text { margin: 0; font-size: 0.82rem; }

.batch-row .badge { margin-left: 6px; vertical-align: middle; }
.badge.batch-active { background: var(--ok); }
.badge.batch-paused { background: var(--pending); }
.badge.batch-expired { background: var(--muted); }
.card-format { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 0; }
.card-format legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.code-list {
  list-style: none; margin: 4px 0 0; padding: 0; width: 100%;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; font-size: 0.85rem;
}
.code-list li { display: flex; gap: 10px; align-items: baseline; }
.code-list code { font-size: 0.95rem; letter-spacing: 0.08em; color: var(--accent); }
.code-list span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-list li.used code { color: var(--muted); text-decoration: line-through; }

/* Printed invite cards: 8 per A4 (2 × 4, 95 × 69 mm), dashed cut lines. Only visible when printing. */
.print-sheet { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body.printing { background: #fff; min-height: 0; }
  body.printing > :not(.print-sheet) { display: none !important; }
  body.printing .print-sheet { display: block; }
  .print-sheet, .print-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-page {
    display: grid; grid-template-columns: repeat(2, 95mm); grid-auto-rows: 69mm;
    break-after: page; page-break-after: always;
  }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .invite-card {
    position: relative; overflow: hidden; display: flex; gap: 3mm; padding: 5mm 5mm 4mm 7mm;
    border: 0.3mm dashed #9aa3b5; color: #16213a; background: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; break-inside: avoid;
  }
  .card-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3mm; background: linear-gradient(180deg, #1fa8ea, #7c5cf0 60%, #d946ef); }
  .card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .card-logo { width: 42mm; height: auto; display: block; }
  .card-heading { margin: 1mm 0 0; font-size: 9pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #7c5cf0; }
  .card-slogan { margin: 0.5mm 0 0; font-size: 9.5pt; font-style: italic; color: #34405c; line-height: 1.25; }
  .card-code {
    margin-top: auto; display: inline-flex; flex-direction: column; align-self: flex-start;
    padding: 1.5mm 3mm; border: 0.4mm solid #1fa8ea; border-radius: 2mm; background: #eef8fe;
  }
  .card-code span { font-size: 6.5pt; text-transform: uppercase; letter-spacing: 0.14em; color: #4b5874; }
  .card-code strong { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 17pt; letter-spacing: 0.08em; color: #0d1220; line-height: 1.1; }
  .card-register { margin: 2mm 0 0; font-size: 8pt; line-height: 1.3; }
  .card-register b { color: #1f7fd0; }
  .card-scan { display: block; color: #4b5874; }
  .card-valid { margin: 0.8mm 0 0; font-size: 7.5pt; color: #4b5874; }
  .invite-card.with-qr .card-logo { width: 38mm; }
  .card-qr { align-self: flex-end; width: 27mm; height: 27mm; flex: none; }
}

/* ---------------------------------------------------------------------- */
/* Guests (decision 2026-09-29)                                            */
/* ---------------------------------------------------------------------- */
.guest-badge {
  padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; white-space: nowrap;
  color: #c9b8ff; background: rgba(124, 92, 240, 0.18); border: 1px solid rgba(124, 92, 240, 0.45);
}
.guest-badge.ending { color: var(--pending); border-color: rgba(245, 196, 81, 0.6); background: rgba(245, 196, 81, 0.12); }
.player-level.guest-tag { color: #c9b8ff; }
.badge.batch-guest { background: #7c5cf0; color: #fff; margin-left: 4px; }
.chat-readonly { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); font-style: italic; }
.guest-terms { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* Private messages page and unread notice (decision 2026-09-29)           */
/* ---------------------------------------------------------------------- */
.nav-badge.unread { background: #7c5cf0; color: #fff; }
.status-offline { background: transparent; border: 1.5px solid var(--status-idle); }
.pm-login-notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 0; padding: 12px 16px; border-radius: 14px;
  color: #231a00; background: #f5c451; border: 1px solid #ffd978; box-shadow: 0 6px 18px rgba(245, 196, 81, 0.25);
  animation: rise 0.3s ease-out;
}
.pm-login-icon { font-size: 1.6rem; line-height: 1; }
.pm-login-text { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.pm-login-text span { color: #4a3a08; font-size: 0.88rem; }
.pm-login-notice .btn-primary { background: #231a00; border-color: #231a00; color: #f5c451; }
.pm-login-notice .btn-ghost { color: #231a00; }

.messages-page { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; min-height: 480px; }
.messages-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; border-right: 1px solid var(--card-border); padding-right: 16px; }
.messages-list .hint { margin-top: auto; }
.conversation-list, .recipient-picker ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.conversation, .recipient {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; font: inherit; text-align: left;
  color: inherit; background: var(--surface); border: 1px solid transparent; cursor: pointer;
}
.conversation:hover, .recipient:hover { border-color: var(--card-border); }
.conversation.active { border-color: var(--accent); background: rgba(92, 200, 255, 0.1); }
.conversation.unread .conversation-name { font-weight: 700; }
.conversation-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-time { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.recipient-picker { display: grid; gap: 6px; }
.recipient-picker ul { max-height: 240px; overflow-y: auto; }
.messages-conversation { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.conversation-head { display: flex; align-items: center; gap: 10px; }
.conversation-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.conversation-head .back { display: none; }
.conversation-messages { flex: 1; height: auto; min-height: 260px; max-height: 60vh; }
@media (max-width: 760px) {
  .messages-page { grid-template-columns: 1fr; min-height: 0; }
  .messages-list { border-right: none; padding-right: 0; }
  .messages-page.has-active .messages-list { display: none; }
  .messages-page:not(.has-active) .messages-conversation { display: none; }
  .conversation-head .back { display: inline-flex; }
}

/* "@" name suggestions in the lobby chat (user request 2026-09-29) */
.lobby-chat .chat-form { position: relative; }
.mention-suggest {
  list-style: none; margin: 0 0 6px; padding: 4px; display: grid; gap: 2px; max-height: 220px; overflow-y: auto;
  border-radius: 10px; background: #1b2640; border: 1px solid rgba(124, 92, 240, 0.55); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.mention-suggest button {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: none;
  font: inherit; text-align: left; color: inherit; background: transparent; cursor: pointer;
}
.mention-suggest button.active, .mention-suggest button:hover { background: rgba(124, 92, 240, 0.28); }
.suggest-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-note { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------------------- */
/* Radio player (decision 2026-09-29)                                      */
/* ---------------------------------------------------------------------- */
.arena-chat { display: flex; flex-direction: column; gap: 12px; }
.radio-player { display: grid; gap: 8px; padding: 12px 16px; }
.radio-player.radio-playing { border-color: rgba(61, 220, 151, 0.5); }
.radio-head { display: flex; align-items: center; gap: 10px; }
.radio-icon { font-size: 1.5rem; line-height: 1; }
.radio-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.radio-status { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.radio-playing .radio-status { color: var(--ok); }
.radio-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.4s ease-in-out infinite; flex: none; }
.radio-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.radio-volume { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.radio-volume input { flex: 1; }
.radio-percent { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.radio-popup-btn { justify-self: start; }
/* Radio controls from the top bar (also during a game, user request 2026-09-29). */
.radio-menu { position: relative; display: inline-flex; }
.radio-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: min(320px, calc(100vw - 24px));
  padding: 12px 14px; border-radius: 14px; background: #172139; border: 1px solid var(--card-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); animation: rise 0.15s ease-out;
}
.radio-compact { padding: 0; }
.radio-popup .radio-status { color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.badge.badge-music { background: rgba(61, 220, 151, 0.2); color: var(--ok); margin-left: 6px; }
.btn.btn-music { border-color: rgba(61, 220, 151, 0.6); color: var(--ok); }
.badge.badge-bingo { background: rgba(250, 204, 21, 0.18); color: #facc15; margin-left: 6px; }
.btn.btn-bingo { border-color: rgba(250, 204, 21, 0.6); color: #facc15; }
.switch.is-disabled { opacity: 0.5; cursor: not-allowed; }

/* Snake (decision 2026-09-30): canvas board, retro LCD or neon look, arrow pad for phones. */
.start-buttons > :nth-child(3) { grid-column: 1 / -1; }
.snake { display: grid; gap: 12px; justify-items: center; }
.snake-hud { width: 100%; max-width: 640px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.snake-score { display: flex; align-items: center; gap: 6px; }
.snake-score strong { font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.snake-swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.snake-swatch.mine { background: var(--ok); }
.snake-swatch.theirs { background: #ff5ca8; }
.snake-clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.snake-stage { position: relative; width: 100%; max-width: 640px; touch-action: none; user-select: none; -webkit-user-select: none; }
.snake-screen canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.snake-screen.dim canvas { opacity: 0.55; }
/* Retro LCD inside a dark phone bezel. */
.snake-lcd { padding: 14px; border-radius: 26px; background: linear-gradient(160deg, #3b4454, #1c222c); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 16px 40px rgba(0, 0, 0, 0.45); }
.snake-lcd canvas { border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35); }
.snake-neon { padding: 3px; border-radius: 14px; background: linear-gradient(135deg, rgba(61, 220, 151, 0.7), rgba(92, 200, 255, 0.5), rgba(255, 92, 168, 0.7)); box-shadow: 0 0 26px rgba(92, 200, 255, 0.25); }
.snake-neon canvas { border-radius: 11px; }
.snake-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; font-size: clamp(2rem, 9vw, 4rem); font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); pointer-events: none; }
.snake-menu { pointer-events: auto; font-size: 1rem; font-weight: 400; text-align: center; padding: 20px 24px; inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(90%, 360px); border-radius: var(--radius); background: rgba(13, 18, 32, 0.82); border: 1px solid var(--card-border); text-shadow: none; }
.snake-menu-title { font-size: 1.4rem; font-weight: 700; }
.snake-menu-hint { font-size: 0.85rem; color: #e8ecf6; opacity: 0.85; }
.snake-pad { display: none; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 56px); gap: 8px; }
.snake-pad-btn { border: 1px solid var(--card-border); background: var(--input); color: var(--text); border-radius: 14px; font-size: 1.3rem; touch-action: manipulation; }
.snake-pad-btn:active { background: rgba(92, 200, 255, 0.25); }
.snake-pad-btn:disabled { opacity: 0.4; }
.snake-pad-up { grid-column: 2; grid-row: 1; }
.snake-pad-left { grid-column: 1; grid-row: 2; }
.snake-pad-down { grid-column: 2; grid-row: 2; }
.snake-pad-right { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .snake-pad { display: grid; } }
.snake-theme { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.arena-games .snake-theme { margin-top: 10px; }
@media (max-width: 600px) { .snake-lcd { padding: 8px; border-radius: 16px; } }

/* Tetrax (user request 2026-10-03): falling blocks, computer only (no phone layout). */
.tetrax { display: grid; gap: 12px; justify-items: center; }
.tetrax-hud { width: 100%; max-width: 760px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tetrax-hud strong { font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.tetrax-clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.tetrax-stage { display: flex; gap: 14px; align-items: flex-start; justify-content: center; user-select: none; -webkit-user-select: none; }
.tetrax-side { display: grid; gap: 14px; width: 104px; }
.tetrax-box { display: grid; gap: 6px; justify-items: center; padding: 10px 6px; border-radius: 12px; background: rgba(10, 15, 30, 0.85); border: 1px solid var(--card-border); }
.tetrax-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tetrax-piece { display: block; }
.tetrax-stats { margin: 0; display: grid; gap: 2px; padding: 10px; border-radius: 12px; background: rgba(10, 15, 30, 0.85); border: 1px solid var(--card-border); }
.tetrax-stats dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tetrax-stats dd { margin: 0 0 6px; font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tetrax-well { position: relative; padding: 3px; border-radius: 10px; background: linear-gradient(160deg, rgba(168, 85, 247, 0.75), rgba(34, 211, 238, 0.55)); box-shadow: 0 0 28px rgba(168, 85, 247, 0.25); }
.tetrax-canvas { display: block; border-radius: 7px; }
.tetrax-overlay { position: absolute; inset: 3px; display: grid; place-items: center; border-radius: 7px; pointer-events: none; }
.tetrax-big { font-size: 4rem; font-weight: 900; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); text-align: center; padding: 0 12px; }
.tetrax-big.tetrax-small { font-size: 1.6rem; }
.tetrax-menu { pointer-events: auto; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 20px; margin: 0 14px; border-radius: var(--radius); background: rgba(13, 18, 32, 0.9); border: 1px solid var(--card-border); }
.tetrax-menu-title { font-size: 1.4rem; font-weight: 800; }
.tetrax-menu-hint { font-size: 0.85rem; opacity: 0.85; }
.tetrax-meter { width: 10px; height: 600px; margin-top: 3px; border-radius: 5px; background: rgba(255, 255, 255, 0.06); display: flex; align-items: flex-end; overflow: hidden; }
.tetrax-meter-fill { width: 100%; background: linear-gradient(0deg, #ef4444, #f97316); transition: height 0.2s; }
.tetrax-opponent { display: grid; gap: 6px; justify-items: center; padding-left: 8px; }
.tetrax-opponent .tetrax-canvas { border: 2px solid rgba(255, 92, 168, 0.6); border-radius: 6px; }
.tetrax-waiting { width: 140px; height: 280px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--card-border); border-radius: 6px; font-size: 0.85rem; }
.tetrax-opponent-stats { font-size: 0.85rem; }
.tetrax-keys { font-size: 0.85rem; text-align: center; margin: 0; }

/* Chess (decision 2026-09-30): board in two looks (classic wood / Areena dark), clocks, move list. */
.chess { display: grid; gap: 14px; }
.chess-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.chess-board-wrap { --light: #f0d9b5; --dark: #b58863; --frame: linear-gradient(145deg, #6b4526, #3e2614); --coord-light: #b58863; --coord-dark: #f0d9b5;
  max-width: 600px; width: 100%; padding: 12px; border-radius: 16px; background: var(--frame); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.chess-board-wrap.chess-dark { --light: #a9b8d6; --dark: #5f7299; --frame: linear-gradient(145deg, rgba(92, 200, 255, 0.55), rgba(124, 92, 240, 0.55)); --coord-light: #5f7299; --coord-dark: #c9d4ea; padding: 4px; }
.chess-board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 6px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.chess-sq { position: relative; border: 0; padding: 0; margin: 0; aspect-ratio: 1; display: grid; place-items: center; cursor: default; font: inherit; }
.chess-sq.light { background: var(--light); }
.chess-sq.dark { background: var(--dark); }
.chess-board.active .chess-sq { cursor: pointer; }
.chess-sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(255, 213, 79, 0.38); }
.chess-sq.selected::before { content: ""; position: absolute; inset: 0; background: rgba(92, 200, 255, 0.45); }
.chess-sq.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 60, 60, 0.9) 0%, rgba(255, 60, 60, 0.45) 45%, transparent 75%); }
.chess-sq.target::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(20, 30, 50, 0.35); pointer-events: none; }
.chess-sq.target.capture::after { width: 88%; height: 88%; background: transparent; border: 5px solid rgba(20, 30, 50, 0.35); box-sizing: border-box; }
.chess-dark .chess-sq.target::after { background: rgba(13, 30, 70, 0.45); }
.chess-dark .chess-sq.target.capture::after { background: transparent; border-color: rgba(13, 30, 70, 0.45); }
.chess-sq:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 1; }
.chess-piece { position: relative; width: 90%; height: 90%; display: block; pointer-events: none; }
.chess-sq .chess-piece { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); transition: transform 0.12s; }
.chess-board.active .chess-sq:hover .chess-piece { transform: translateY(-2px); }
.chess-piece.lifted { opacity: 0.35; }
.chess-coord { position: absolute; font-size: clamp(0.55rem, 1.6vw, 0.72rem); font-weight: 700; pointer-events: none; z-index: 1; }
.chess-coord.rank { top: 2px; left: 3px; }
.chess-coord.file { bottom: 1px; right: 4px; }
.chess-sq.light .chess-coord { color: var(--coord-light); }
.chess-sq.dark .chess-coord { color: var(--coord-dark); }
.chess-drag { position: fixed; pointer-events: none; z-index: 50; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45)); }
.chess-drag .chess-piece { width: 100%; height: 100%; }
.chess-side { display: grid; gap: 12px; padding: 16px; }
.chess-player { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid transparent; }
.chess-player.running { border-color: rgba(92, 200, 255, 0.5); box-shadow: 0 0 18px rgba(92, 200, 255, 0.15); }
.chess-player-name { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.chess-player-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chess-player-king { width: 22px; height: 22px; flex: none; }
.chess-clock { font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 700; padding: 2px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); color: var(--muted); }
.chess-clock.running { color: var(--text); background: rgba(92, 200, 255, 0.18); }
.chess-clock.low { color: var(--error); }
.chess-clock.running.low { animation: clock-pulse 1s ease-in-out infinite; }
@keyframes clock-pulse { 50% { background: rgba(255, 107, 107, 0.25); } }
.chess-captured { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; min-height: 18px; }
.chess-captured:empty { display: none; }
.chess-captured .chess-piece { width: 18px; height: 18px; margin-right: -4px; }
.chess-lead { margin-left: 8px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.chess-moves { max-height: 220px; overflow-y: auto; }
.chess-moves-title { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.chess-move-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.chess-move-list li { display: grid; grid-template-columns: 2.4em 1fr 1fr; }
.chess-move-list li:last-child { color: var(--accent); }
.chess-move-no { color: var(--muted); }
.chess-you-play { margin: 0; font-size: 0.85rem; }
.chess-check-note { margin-left: 10px; color: var(--error); font-weight: 700; }
.chess-draw-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(245, 196, 81, 0.15); border: 1px solid rgba(245, 196, 81, 0.5); }
.chess-draw-offer span { flex: 1; min-width: 180px; }
.chess-notice { margin: 0; }
.chess-promotion-choices { display: flex; gap: 10px; justify-content: center; }
.chess-promotion-choices .btn { width: 68px; height: 68px; padding: 6px; background: #f0d9b5; }
.chess-promotion-choices .btn.chess-dark { background: #a9b8d6; }
.chess-promotion-choices .chess-piece { width: 100%; height: 100%; }
.chess-options { display: grid; gap: 10px; margin-top: 12px; }
.chess-options label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 760px) {
  .chess-layout { grid-template-columns: 1fr; }
  .chess-board-wrap { padding: 6px; border-radius: 10px; }
}

/* ---------------------------------------------------------------------------
   Public front page (user request 2026-09-30): professional, animated, login in a dialog.
   --------------------------------------------------------------------------- */
.landing { position: relative; min-height: 100vh; overflow-x: hidden; }
.landing main { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.landing .site-footer { position: relative; z-index: 1; max-width: 1160px; margin: 40px auto 0; }

/* Slowly drifting light behind everything */
.lp-aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.lp-aurora span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.45; will-change: transform; }
.lp-aurora .a1 { width: 520px; height: 520px; left: -120px; top: -140px; background: #2fb2f5; animation: drift1 22s ease-in-out infinite alternate; }
.lp-aurora .a2 { width: 460px; height: 460px; right: -140px; top: 120px; background: #7c5cf0; animation: drift2 26s ease-in-out infinite alternate; }
.lp-aurora .a3 { width: 420px; height: 420px; left: 30%; bottom: -220px; background: #1fb981; opacity: 0.25; animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(180px, 120px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-160px, 180px) scale(0.9); } }
@keyframes drift3 { to { transform: translate(-120px, -140px) scale(1.2); } }
.landing::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 20%, transparent 75%); }

/* Top bar */
.lp-nav { position: sticky; top: 0; z-index: 10; transition: background 0.25s, box-shadow 0.25s; }
.lp-nav.scrolled { background: rgba(13, 18, 32, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.25); }
.lp-nav-inner { max-width: 1160px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.lp-brand { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
.lp-links { display: flex; gap: 6px; margin-left: auto; }
.lp-links button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 500; padding: 8px 12px; border-radius: 10px; cursor: pointer; transition: color 0.15s, background 0.15s; }
.lp-links button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.lp-login-btn { box-shadow: 0 6px 24px rgba(92, 200, 255, 0.35); }

.lp-notice { margin: 8px auto 0; max-width: 640px; text-align: center; padding: 10px 16px; border-radius: 12px; background: rgba(61, 220, 151, 0.12); border: 1px solid rgba(61, 220, 151, 0.4); color: var(--ok); }

/* Hero */
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 56px 0 40px; }
.lp-hero-text > * { animation: lp-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lp-hero-text > :nth-child(2) { animation-delay: 0.08s; }
.lp-hero-text > :nth-child(3) { animation-delay: 0.16s; }
.lp-hero-text > :nth-child(4) { animation-delay: 0.24s; }
.lp-hero-text > :nth-child(5) { animation-delay: 0.32s; }
@keyframes lp-in { from { opacity: 0; transform: translateY(18px); } }
.lp-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  color: #bfe9ff; background: rgba(92, 200, 255, 0.1); border: 1px solid rgba(92, 200, 255, 0.3); }
.lp-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.lp-title { display: block; margin: 18px 0 16px; font-size: clamp(2.3rem, 5.4vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; font-weight: 800; }
.lp-accent { background: linear-gradient(90deg, #5cc8ff, #a78bfa, #3ddc97, #5cc8ff); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lp-shine 6s linear infinite; }
@keyframes lp-shine { to { background-position: 300% 0; } }
.lp-lead { font-size: 1.1rem; color: #b8c2d9; max-width: 560px; margin: 0 0 28px; line-height: 1.6; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-cta .btn { padding: 13px 22px; font-size: 1rem; border-radius: 14px; }
.lp-cta-main { box-shadow: 0 10px 30px rgba(92, 200, 255, 0.35); transition: transform 0.15s, box-shadow 0.15s; }
.lp-cta-main:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(92, 200, 255, 0.45); }
.lp-cta-ghost { background: rgba(255, 255, 255, 0.04); text-decoration: none; }
.lp-stats { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 36px; }
.lp-stat { display: grid; }
.lp-stat strong { display: flex; align-items: center; gap: 8px; font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.lp-stat > span:last-child { color: var(--muted); font-size: 0.85rem; }
.lp-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); animation: lp-pulse 2s infinite; }
@keyframes lp-pulse { 70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

/* Showcase: small living game tiles */
.lp-showcase { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr); aspect-ratio: 1; gap: 14px; animation: lp-in 1s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.lp-tile { position: relative; border-radius: 18px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08); overflow: hidden; animation: lp-float 7s ease-in-out infinite; }
@keyframes lp-float { 50% { transform: translateY(-8px); } }
.lp-chess { grid-column: 1 / 5; grid-row: 1 / 5; padding: 12px; animation-delay: -1s; background: linear-gradient(145deg, #6b4526, #3e2614); }
.lp-othello { grid-column: 5 / 7; grid-row: 1 / 3; padding: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: linear-gradient(160deg, #1f7a4d, #145c39); animation-delay: -3s; }
.lp-snake { grid-column: 5 / 7; grid-row: 3 / 5; background: #070b16; animation-delay: -5s; }
.lp-dice { grid-column: 1 / 3; grid-row: 5 / 7; display: flex; align-items: center; justify-content: center; gap: 14px; animation-delay: -2s; }
.lp-radar { grid-column: 3 / 7; grid-row: 5 / 7; background: radial-gradient(circle at 50% 50%, rgba(92, 200, 255, 0.12), rgba(8, 20, 40, 0.9) 70%); animation-delay: -4s; }
.lp-chess-board { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); height: 100%; border-radius: 6px; overflow: hidden; }
.lp-sq { display: grid; place-items: center; }
.lp-sq.l { background: #f0d9b5; }
.lp-sq.d { background: #b58863; }
.lp-piece { width: 88%; height: 88%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
.lp-chess-mover { position: absolute; width: 12.5%; height: 12.5%; display: grid; place-items: center; animation: lp-knight 6s ease-in-out infinite; left: 75%; top: 87.5%; }
@keyframes lp-knight { 0%, 20% { left: 75%; top: 87.5%; } 35%, 60% { left: 62.5%; top: 62.5%; } 75%, 100% { left: 75%; top: 87.5%; } }
.lp-o-cell { background: rgba(0, 0, 0, 0.18); border-radius: 4px; display: grid; place-items: center; }
.lp-disc { width: 76%; height: 76%; border-radius: 50%; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
.lp-disc.w { background: radial-gradient(circle at 35% 30%, #fff, #cfd6e4); }
.lp-disc.b { background: radial-gradient(circle at 35% 30%, #4b5563, #0b1220); }
.lp-disc.flip { animation: lp-flip 4s ease-in-out infinite; }
@keyframes lp-flip { 0%, 40% { transform: rotateY(0); background: radial-gradient(circle at 35% 30%, #fff, #cfd6e4); } 50%, 90% { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #4b5563, #0b1220); } 100% { transform: rotateY(360deg); } }
.lp-snake svg { width: 100%; height: 100%; display: block; }
.lp-snake-body { fill: none; stroke: #3ddc97; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60 400; animation: lp-snake 5s linear infinite; filter: drop-shadow(0 0 4px rgba(61, 220, 151, 0.8)); }
@keyframes lp-snake { from { stroke-dashoffset: 460; } to { stroke-dashoffset: 0; } }
.lp-apple { fill: #ffd166; filter: drop-shadow(0 0 5px #ffd166); animation: lp-blink 1.4s ease-in-out infinite; }
@keyframes lp-blink { 50% { opacity: 0.45; } }
.lp-die { position: relative; width: 44px; height: 44px; border-radius: 10px; background: #f8fafc; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.35); animation: lp-roll 3.2s cubic-bezier(0.3, 0.6, 0.3, 1) infinite; }
.lp-die.d2 { background: #e5484d; animation-delay: 0.25s; }
@keyframes lp-roll { 0% { transform: rotate(0) translateY(0); } 15% { transform: rotate(200deg) translateY(-14px); } 30%, 100% { transform: rotate(360deg) translateY(0); } }
.pip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #0b1220; }
.d2 .pip { background: #fff; }
.pip.p0 { left: 8px; top: 8px; } .pip.p1 { right: 8px; top: 8px; } .pip.p2 { left: 18px; top: 18px; } .pip.p3 { left: 8px; bottom: 8px; } .pip.p4 { right: 8px; bottom: 8px; }
.pip.q0 { left: 8px; top: 8px; } .pip.q1 { left: 18px; top: 18px; } .pip.q2 { right: 8px; bottom: 8px; }
.lp-radar::before { content: ""; position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 1px solid rgba(92, 200, 255, 0.3); box-shadow: 0 0 0 28px rgba(92, 200, 255, 0.04); }
.lp-radar-sweep { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(92, 200, 255, 0.45), transparent 60deg); animation: lp-sweep 4s linear infinite; }
@keyframes lp-sweep { to { transform: rotate(360deg); } }
.lp-blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ff6b6b; box-shadow: 0 0 10px #ff6b6b; animation: lp-blink 2s ease-in-out infinite; }
.lp-blip.b1 { left: 42%; top: 32%; } .lp-blip.b2 { left: 60%; top: 62%; animation-delay: 1s; }

/* Sections */
.lp-section { padding: 48px 0; }
.lp-bingo { padding: 0; }
.lp-bingo:empty { display: none; }
.lp-section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.lp-section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -0.01em; margin-bottom: 10px; }
.lp-section-head p { color: #b8c2d9; margin: 0; }
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-reveal].in { opacity: 1; transform: none; }
.lp-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-game { position: relative; padding: 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--card-border); overflow: hidden; }
.lp-game::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(92, 200, 255, 0.6), transparent 40%, rgba(167, 139, 250, 0.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.lp-game:hover::after { opacity: 1; }
.lp-game[data-reveal].in { transition: opacity 0.7s ease, transform 0.25s ease; }
.lp-game[data-reveal].in:hover { transform: translateY(-4px); }
.lp-game h3 { margin: 14px 0 6px; font-size: 1.15rem; }
.lp-game p { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.lp-game .game-icon { transition: transform 0.3s; }
.lp-game:hover .game-icon { transform: scale(1.08) rotate(-4deg); }
.lp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-badge { font-size: 0.74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: #c9d2e6; border: 1px solid rgba(255, 255, 255, 0.08); }
.lp-badge.computer { color: #bfe9ff; border-color: rgba(92, 200, 255, 0.35); }
.lp-badge.solo, .lp-badge.realtime { color: #b5f5d8; border-color: rgba(61, 220, 151, 0.35); }
.lp-badge.clock { color: #f5dfa6; border-color: rgba(245, 196, 81, 0.35); }
.lp-badge.bluff { color: #ffc2c2; border-color: rgba(255, 107, 107, 0.35); }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-feature { padding: 24px; border-radius: 20px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)); border: 1px solid var(--card-border); }
.lp-feature h3 { margin: 12px 0 6px; font-size: 1.05rem; }
.lp-feature p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.lp-feature-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 1.4rem; background: rgba(92, 200, 255, 0.1); border: 1px solid rgba(92, 200, 255, 0.25); }
.lp-radio { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 16px 20px; border-radius: 18px; background: rgba(167, 139, 250, 0.08); border: 1px solid rgba(167, 139, 250, 0.3); color: var(--text); text-decoration: none; }
.lp-radio:hover { background: rgba(167, 139, 250, 0.14); }
.lp-radio-link { margin-left: auto; color: #d4c7ff; font-weight: 600; white-space: nowrap; }
.lp-eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.lp-eq i { width: 4px; background: #a78bfa; border-radius: 2px; animation: lp-eq 1s ease-in-out infinite alternate; }
.lp-eq i:nth-child(2) { animation-delay: 0.2s; } .lp-eq i:nth-child(3) { animation-delay: 0.4s; } .lp-eq i:nth-child(4) { animation-delay: 0.1s; }
@keyframes lp-eq { from { height: 4px; } to { height: 22px; } }
.lp-join-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.lp-join-card { display: grid; gap: 8px; align-content: start; text-align: left; padding: 26px; border-radius: 20px; background: var(--card); border: 1px solid var(--card-border); color: var(--text); text-decoration: none; font: inherit; cursor: pointer;
  transition: opacity 0.7s ease, transform 0.25s, border-color 0.2s, background 0.2s; }
.lp-join-card:hover { border-color: rgba(92, 200, 255, 0.5); background: rgba(92, 200, 255, 0.06); }
.lp-join-card[data-reveal].in:hover { transform: translateY(-3px); }
.lp-join-card h3 { margin: 4px 0 0; }
.lp-join-card p { margin: 0; color: var(--muted); }
.lp-join-icon { font-size: 1.8rem; }
.lp-join-go { color: var(--accent); font-weight: 600; margin-top: 6px; }

/* Login dialog */
.lp-login-overlay { z-index: 40; animation: lp-fade 0.2s ease-out; }
@keyframes lp-fade { from { opacity: 0; } }
.lp-login-dialog { position: relative; width: 100%; max-width: 400px; animation: lp-pop 0.25s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes lp-pop { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.lp-login-dialog .login { max-width: none; background: #172139; }
.lp-login-dialog .login h2 { margin: 0 0 4px; }
.lp-login-close { position: absolute; right: 12px; top: 10px; z-index: 1; width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.lp-login-close:hover { background: rgba(255, 255, 255, 0.12); }

@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; gap: 36px; padding-top: 28px; }
  .lp-showcase { max-width: 520px; width: 100%; margin: 0 auto; }
  .lp-games, .lp-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .lp-links { display: none; }
  .lp-login-btn { margin-left: auto; }
  .lp-nav-inner { padding: 12px 16px; }
  .landing main { padding: 0 16px; }
  .lp-games, .lp-features { grid-template-columns: 1fr; }
  .lp-showcase { gap: 10px; }
  .lp-stats { gap: 20px; }
  .lp-radio { flex-wrap: wrap; }
  .lp-radio-link { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-aurora span, .lp-tile, .lp-accent, .lp-chess-mover, .lp-disc.flip, .lp-snake-body, .lp-apple, .lp-die, .lp-radar-sweep, .lp-blip, .lp-eq i, .lp-live-dot { animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .lp-hero-text > *, .lp-showcase { animation: none; }
}

/* Valepaskahousu (decision 2026-09-30): playing cards drawn with CSS, the table and the reveal. */
.vale { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pcard { --w: 62px; position: relative; display: inline-block; width: var(--w); height: calc(var(--w) * 1.42); border-radius: 8px; background: #fdfdfb; color: #111827;
  border: 1px solid #cbd5e1; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); font: inherit; padding: 0; flex: none; user-select: none; }
.pcard.small { --w: 22px; border-radius: 4px; }
.pcard.red { color: #c81e1e; }
.pc-corner { position: absolute; font-size: calc(var(--w) * 0.2); font-weight: 800; line-height: 1; text-align: center; }
.pc-corner.tl { left: 5px; top: 5px; }
.pc-corner.br { right: 5px; bottom: 5px; transform: rotate(180deg); }
.pc-center { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * 0.5); }
.pcard.back { background: repeating-linear-gradient(45deg, #2d4fb8 0 6px, #3b5bdb 6px 12px); border: 3px solid #f8fafc; }
.pcard.small.back { border-width: 1.5px; }
.pcard.empty { background: transparent; border: 2px dashed rgba(255, 255, 255, 0.18); box-shadow: none; }
button.pcard { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
button.pcard:hover { transform: translateY(-6px); }
button.pcard.selected { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--accent), 0 10px 20px rgba(0, 0, 0, 0.4); }

.vale-seats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.vale-seat { min-width: 120px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--card-border); text-align: center; transition: border-color 0.2s, box-shadow 0.2s; }
.vale-seat.turn { border-color: var(--accent); box-shadow: 0 0 18px rgba(92, 200, 255, 0.25); }
.vale-seat.out, .vale-seat.dropped { opacity: 0.55; }
.vale-seat-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.vale-seat-cards { position: relative; display: flex; justify-content: center; align-items: center; height: 40px; margin-top: 4px; }
.vale-seat-cards .pcard { margin-left: -12px; }
.vale-count { margin-left: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.vale-seat-out { font-size: 1.6rem; margin-top: 4px; }

.vale-table { position: relative; display: grid; grid-template-columns: auto auto 1fr; gap: 22px; align-items: center; padding: 24px; border-radius: 22px; min-height: 180px;
  background: radial-gradient(ellipse at 50% 40%, #1f7a4d, #0f4a2e 75%); box-shadow: inset 0 0 0 8px #3b2414, inset 0 0 0 10px #6b4526, 0 18px 40px rgba(0, 0, 0, 0.4); }
.vale-table.burning { animation: vale-heat 1.2s ease-in-out infinite alternate; }
@keyframes vale-heat { to { box-shadow: inset 0 0 0 8px #3b2414, inset 0 0 0 10px #c2410c, inset 0 0 40px rgba(249, 115, 22, 0.45), 0 18px 40px rgba(0, 0, 0, 0.4); } }
.vale-deck, .vale-pile { position: relative; display: grid; justify-items: center; gap: 6px; }
.vale-pile { min-width: 90px; min-height: 110px; }
.vale-pile .pcard.back { position: absolute; top: 0; }
.vale-pile .vale-label { position: absolute; bottom: -8px; }
.vale-label { font-size: 0.8rem; color: #d1fae5; font-weight: 600; }
.vale-claim { color: #ecfdf5; }
.vale-claim-who { font-size: 0.85rem; opacity: 0.8; }
.vale-claim-what { font-size: 2rem; font-weight: 800; letter-spacing: 0.02em; }
.vale-burn-note { margin-top: 4px; color: #fed7aa; font-weight: 700; }
.vale-liar { font-size: 1.05rem; padding: 14px 20px; border-radius: 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.vale-liar:not(:disabled) { animation: vale-ready 1.6s ease-in-out infinite; }
@keyframes vale-ready { 50% { transform: scale(1.04); } }

.vale-event { position: absolute; inset: 10px; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 16px; border-radius: 16px; text-align: center;
  background: rgba(8, 14, 28, 0.88); animation: lp-fade 0.2s ease-out; }
.vale-event.burn { background: rgba(124, 45, 18, 0.85); }
.vale-reveal { display: flex; gap: 8px; perspective: 600px; }
.vale-flip { display: inline-block; animation: vale-flip 0.6s ease-out both; }
@keyframes vale-flip { from { transform: rotateY(90deg) scale(0.8); opacity: 0; } }
.vale-verdict { font-size: 1.8rem; font-weight: 900; letter-spacing: 0.08em; animation: vale-stamp 0.4s 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.vale-event.truth .vale-verdict { color: var(--ok); }
.vale-event.lie .vale-verdict { color: var(--error); }
@keyframes vale-stamp { from { transform: scale(2.2); opacity: 0; } }
.vale-event-text { max-width: 520px; color: var(--text); }

.vale-hand-area { display: grid; gap: 14px; justify-items: center; }
.vale-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 18px 8px 4px; }
.vale-controls { display: grid; gap: 10px; justify-items: center; }
.vale-claims { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.vale-claims .btn { min-width: 40px; }
.vale-play { min-width: 240px; }
.vale-out-note { text-align: center; color: var(--ok); font-weight: 600; }
@media (max-width: 700px) {
  .vale-table { grid-template-columns: auto auto 1fr; padding: 16px; gap: 14px; }
  .vale-liar { grid-column: 1 / -1; }
  .pcard { --w: 52px; }
  .vale-claim-what { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .vale-liar:not(:disabled), .vale-table.burning, .vale-flip, .vale-verdict { animation: none; }
}

/* Valepaskahousu doubt bar and suspense (user request 2026-09-30). */
.vale-doubt-bar { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 18px; background: linear-gradient(135deg, rgba(229, 72, 77, 0.28), rgba(229, 72, 77, 0.12));
  border: 2px solid #e5484d; box-shadow: 0 0 30px rgba(229, 72, 77, 0.35); animation: vale-bar-in 0.25s ease-out; }
@keyframes vale-bar-in { from { opacity: 0; transform: translateY(8px); } }
.vale-doubt-info { flex: 1; display: grid; gap: 4px; min-width: 0; }
.vale-doubt-info strong { font-size: 1.15rem; }
.vale-doubt-info span { color: #fecaca; font-size: 0.9rem; }
.vale-doubt-timer { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.vale-doubt-timer-fill { height: 100%; background: #fca5a5; transition: width 0.2s linear; }
.vale-doubt-btn { flex: none; min-width: 170px; padding: 18px 26px; border: 0; border-radius: 16px; background: #e5484d; color: #fff; font: inherit; font-size: 1.45rem; font-weight: 900; letter-spacing: 0.06em;
  cursor: pointer; box-shadow: 0 8px 0 #9b1c1f, 0 14px 26px rgba(0, 0, 0, 0.4); transition: transform 0.08s, box-shadow 0.08s; animation: vale-ready 1.2s ease-in-out infinite; }
.vale-doubt-btn:hover { background: #f05257; }
.vale-doubt-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #9b1c1f, 0 6px 12px rgba(0, 0, 0, 0.4); }
.vale-event.suspense { background: rgba(8, 14, 28, 0.92); }
.vale-suspense-title { font-size: 1.9rem; font-weight: 900; color: #fca5a5; animation: vale-stamp 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.vale-shake { display: inline-block; animation: vale-shake 0.5s ease-in-out infinite; }
.vale-shake:nth-child(2) { animation-delay: 0.1s; } .vale-shake:nth-child(3) { animation-delay: 0.2s; }
@keyframes vale-shake { 25% { transform: rotate(-4deg) translateY(-2px); } 75% { transform: rotate(4deg) translateY(-2px); } }
@media (max-width: 600px) {
  .vale-doubt-bar { flex-direction: column; align-items: stretch; }
  .vale-doubt-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .vale-doubt-btn, .vale-shake { animation: none; } }

/* Valepaskahousu result: the paskahousu is announced (user request 2026-09-30). */
.paskahousu-banner { display: flex; align-items: center; justify-content: center; gap: 12px; margin: -4px 0 14px; padding: 12px 16px; border-radius: 14px;
  font-size: 1.25rem; font-weight: 800; color: #3b2414; background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
  animation: pasku-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.paskahousu-banner.me { background: linear-gradient(135deg, #fecaca, #f87171); color: #450a0a; }
.paskahousu-pants { font-size: 2rem; display: inline-block; animation: pasku-wiggle 0.9s ease-in-out infinite; }
@keyframes pasku-in { from { transform: scale(0.4) rotate(-6deg); opacity: 0; } }
@keyframes pasku-wiggle { 25% { transform: rotate(-14deg) translateY(-3px); } 75% { transform: rotate(14deg) translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .paskahousu-banner, .paskahousu-pants { animation: none; } }

/* AreCoin (2026-10-01) */
.coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.coin-icon { flex: none; filter: drop-shadow(0 1px 3px rgba(250, 204, 21, 0.35)); }
.coin-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: rgba(250, 204, 21, 0.1); border: 1px solid rgba(250, 204, 21, 0.35); color: #fde68a; text-decoration: none; font-size: 0.9rem; }
.coin-badge:hover { background: rgba(250, 204, 21, 0.18); }
.coin-badge.can-refill { box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.5); animation: coin-pulse 2.4s ease-in-out infinite; }
@keyframes coin-pulse { 50% { box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.15); } }
@media (prefers-reduced-motion: reduce) { .coin-badge.can-refill { animation: none; } }
.coins-card { display: grid; gap: 12px; }
.coins-balance { display: flex; align-items: center; gap: 16px; }
.coins-amount { font-size: 2.2rem; font-weight: 900; color: #fde68a; font-variant-numeric: tabular-nums; line-height: 1.1; }
.coins-history { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin-top: 8px; }
.coins-history td, .coins-history th { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); text-align: left; }
.coins-history .plus { color: #4ade80; font-weight: 700; }
.coins-history .minus { color: #f87171; font-weight: 700; }
h2 .coin-icon { vertical-align: -4px; margin-right: 4px; }

/* Blackjack (2026-10-01): green felt, the dealer in Areena's jersey, seats on the arc */
.bj-lobby-list { display: grid; gap: 8px; margin: 10px 0; }
.bj-lobby-table { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(15, 81, 50, 0.35); border: 1px solid rgba(233, 207, 122, 0.25); }
@media (max-width: 640px) { .bj-lobby-table { grid-template-columns: 1fr auto; } .bj-lobby-table .muted { grid-column: 1 / -1; } }
.bj-page { display: grid; gap: 12px; }
.bj-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bj-top .pill { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.85rem; color: #aab3c8; font: inherit; font-size: 0.85rem; cursor: default; }
.bj-top button.pill { cursor: pointer; }
.bj-top .pill.on { color: #e8ecf6; }
.bj-top .pill.warn { color: #fde68a; border-color: rgba(250, 204, 21, 0.4); }
.bj-spacer { flex: 1; }
.bj-balance { padding: 4px 12px; border-radius: 999px; background: rgba(250, 204, 21, 0.1); border: 1px solid rgba(250, 204, 21, 0.35); color: #fde68a; }
.bj-main { display: grid; grid-template-columns: 1fr 290px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .bj-main { grid-template-columns: 1fr; } }
.bj-stage { display: grid; gap: 10px; }
.bj-felt {
  position: relative; min-height: 500px; border-radius: 0 0 46% 46% / 0 0 20% 20%;
  background: radial-gradient(ellipse at 50% 18%, #1f7a4d, #0f5132 55%, #0a3b25 100%);
  box-shadow: inset 0 0 0 10px #5b3a1e, inset 0 0 0 14px #c8a24a, inset 0 -30px 60px rgba(0, 0, 0, 0.35), 0 20px 40px rgba(0, 0, 0, 0.45);
  padding: 6px 5% 34px; display: grid; justify-items: center; align-content: start; gap: 4px; overflow: hidden;
  isolation: isolate;
}
/* The logo printed faintly into the felt, behind everything on the table. */
.bj-mark { position: absolute; z-index: -1; left: 8%; right: 8%; top: 50%; width: 84%; height: auto; transform: translateY(-50%); color: #f3e9c6; opacity: 0.08; pointer-events: none; }
.bj-dealer { width: 170px; height: auto; display: block; margin-top: 2px; }
.bj-shoe { position: absolute; right: 9%; top: 34px; width: 64px; height: 48px; border-radius: 8px; background: linear-gradient(#3b2a1a, #22170d); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4); }
.bj-shoe::after { content: ""; position: absolute; left: 9px; top: 8px; width: 42px; height: 28px; border-radius: 4px; background: repeating-linear-gradient(45deg, #7f1d1d 0 4px, #991b1b 4px 8px); }
.bj-dealer-hand { display: grid; justify-items: center; gap: 4px; min-height: 124px; }
.bj-cards { display: flex; justify-content: center; }
.bj-cards .pcard { --w: 74px; margin-left: -18px; animation: bj-deal 0.35s ease-out; }
.bj-cards .pcard:first-child { margin-left: 0; }
.bj-cards.small .pcard { --w: 62px; margin-left: -24px; }
.bj-cards.small .pcard:first-child { margin-left: 0; }
/* A seat's card row keeps a card's height before the deal, so the bet chips sit below it from the start. */
.bj-cards.small { min-height: calc(62px * 1.42); }
.bj-badge.placeholder { visibility: hidden; }
@keyframes bj-deal { from { transform: translateY(-40px) rotate(-8deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bj-cards .pcard { animation: none; } }
.bj-arc { text-align: center; color: #e9cf7a; font-weight: 800; letter-spacing: 0.2em; font-size: 0.85rem; opacity: 0.9; margin: 2px 0 6px; }
.bj-arc small { display: block; font-size: 0.62rem; letter-spacing: 0.24em; opacity: 0.8; margin-top: 3px; font-weight: 700; }
.bj-seats { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: start; }
.bj-seat { position: relative; display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border-radius: 14px; min-height: 190px; align-content: start; min-width: 0; }
/* The card box printed faintly into the felt, where the seat's cards are dealt (user request 2026-10-01). */
.bj-seat::before { content: ""; position: absolute; top: 4px; left: 50%; width: 74px; height: 100px; transform: translateX(-50%); border: 1.5px solid rgba(233, 207, 122, 0.24); border-radius: 9px; background: rgba(255, 255, 255, 0.02); pointer-events: none; }
.bj-seat > * { position: relative; }
.bj-seat.empty, .bj-seat.idle { padding-top: 114px; }
.bj-seat.s0, .bj-seat.s4 { margin-top: 0; }
.bj-seat.s1, .bj-seat.s3 { margin-top: 22px; }
.bj-seat.s2 { margin-top: 34px; }
.bj-seat.active { background: rgba(250, 204, 21, 0.1); box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.6), 0 0 22px rgba(250, 204, 21, 0.25); }
.bj-seat.mine .bj-name { color: #5cc8ff; }
.bj-seat.active .bj-name { color: #facc15; }
.bj-name { font-weight: 700; font-size: 0.9rem; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A seated player's name: a black plate with a thin line, like the free seats' frame. */
.bj-seat:not(.empty) .bj-name { background: #0a0c10; border: 1px solid rgba(233, 207, 122, 0.6); border-radius: 999px; padding: 2px 10px; color: #e8ecf6; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.bj-seat.mine:not(.empty) .bj-name { border-color: rgba(92, 200, 255, 0.75); }
.bj-seat.active:not(.empty) .bj-name { border-color: #facc15; }
.bj-spot { width: 64px; height: 64px; border-radius: 50%; border: 2px dashed rgba(233, 207, 122, 0.5); display: grid; place-items: center; color: rgba(233, 207, 122, 0.65); font-size: 0.75rem; }
.bj-spot.small { width: auto; height: auto; border: 0; font-size: 0.75rem; }
.bj-hand { display: grid; justify-items: center; gap: 4px; padding: 4px; border-radius: 10px; }
.bj-hand.active { background: rgba(250, 204, 21, 0.12); }
.bj-badge { padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); font-weight: 800; font-size: 0.82rem; white-space: nowrap; }
.bj-badge.r-blackjack { background: #ca8a04; color: #111; }
.bj-badge.r-win { background: #16a34a; }
.bj-badge.r-push { background: #64748b; }
.bj-badge.r-lose, .bj-badge.r-bust { background: #991b1b; }
.bj-badge.ins { background: rgba(92, 200, 255, 0.25); font-size: 0.72rem; }
.bj-chips { display: flex; gap: 4px; align-items: center; }
.bj-chip { width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; font-weight: 900; font-size: 0.95rem; color: #fff; cursor: pointer;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.85), inset 0 0 0 7px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.4); background: #334155; }
.bj-chip:active { transform: translateY(1px); }
.bj-chip.c5 { background: #dc2626; } .bj-chip.c10 { background: #2563eb; } .bj-chip.c25 { background: #16a34a; } .bj-chip.c100 { background: #111827; }
.bj-chip.mini { width: 32px; height: 32px; font-size: 0.72rem; cursor: default; background: #b45309; }
.bj-tag { font-size: 0.75rem; font-weight: 800; color: #fde68a; }
.bj-net { font-weight: 800; font-size: 0.85rem; }
.bj-net.plus { color: #4ade80; } .bj-net.minus { color: #f87171; }
.bj-controls { display: grid; justify-items: center; gap: 8px; min-height: 60px; }
.bj-timer { color: #fde68a; font-size: 0.9rem; }
.bj-bet, .bj-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.bj-stake { font-size: 1rem; } .bj-stake b { color: #fde68a; font-size: 1.2rem; }
.bj-side { display: grid; gap: 12px; }
.bj-box { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 12px 14px; }
.bj-box h3 { margin: 0 0 8px; font-size: 0.9rem; color: #aab3c8; }
.bj-captions p { margin: 5px 0; font-size: 0.95rem; } .bj-captions p.new { color: #fde68a; font-weight: 700; }
.bj-chat-lines { max-height: 240px; overflow-y: auto; display: grid; gap: 4px; font-size: 0.85rem; }
.bj-chat-lines p { margin: 0; } .bj-chat-lines b { color: #5cc8ff; }
.bj-chat-form input { width: 100%; margin-top: 8px; }
@media (max-width: 760px) {
  .bj-felt { border-radius: 24px; padding: 8px 8px 20px; min-height: 0; }
  .bj-seats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
  .bj-seat.s1, .bj-seat.s2, .bj-seat.s3 { margin-top: 0; }
  .bj-dealer { width: 140px; }
}
.bj-pick { color: #fde68a; font-weight: 700; }
.bj-badge { font-size: 0.9rem; }
@media (max-width: 760px) {
  .bj-cards .pcard { --w: 56px; } .bj-cards.small .pcard { --w: 46px; margin-left: -18px; } .bj-cards.small { min-height: calc(46px * 1.42); }
  .bj-seat { min-height: 160px; } .bj-seat::before { width: 58px; height: 80px; } .bj-seat.empty, .bj-seat.idle { padding-top: 92px; }
}
.bj-hint { font-size: 0.75rem; color: #8c95ab; }
.bj-lobby.embedded { display: grid; gap: 10px; margin-top: 8px; padding: 14px; border-radius: 14px; background: rgba(15, 81, 50, 0.22); border: 1px solid rgba(233, 207, 122, 0.25); }

/* Bingo codes: at once / by hand, and the folded phone and mailbox settings (2026-10-03). */
/* A choice of a few options in a frame (the source of the waiting music). */
.send-mode { border: 1px solid var(--border, rgba(255, 255, 255, 0.12)); border-radius: 10px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.send-mode legend { padding: 0 6px; font-weight: 700; }
.send-mode label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
/* The settings of handing out the codes, switches one under another (2026-10-07). */
.signup-switches { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border: 1px solid var(--border, rgba(255, 255, 255, 0.12)); border-radius: 10px; }
.signup-switch { display: flex; flex-direction: column; gap: 3px; }
.signup-switch small { padding-left: 50px; line-height: 1.35; }
.signup-switches .error, .signup-switches > .muted { margin: 0 0 0 50px; }
.signup-texts summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.signup-texts[open] { display: flex; flex-direction: column; gap: 10px; }
.sms-connections > summary { cursor: pointer; padding: 4px 0; }
.sms-connections[open] > summary { margin-bottom: 12px; }
.sms-connections > .card { box-shadow: none; }

/* The waiting music list (2026-10-03). */
.music-list { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.music-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.music-name { font-weight: 600; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.music-actions { display: inline-flex; gap: 6px; }

/* Pokeriautomaatti (user request 2026-10-03): the 80s machine – deep blue cabinet, yellow trim, LED numbers.
   Phones too (user request): the cards scale with the screen, the buttons are big. */
.poker { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.pk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pk-head h2 { margin: 0; }
.pk-machine { display: grid; gap: 14px; padding: 18px; border-radius: 22px; background: linear-gradient(180deg, #13246b, #0a1442 60%, #070d2c); border: 3px solid #facc15;
  box-shadow: 0 0 0 4px #0a1442, 0 0 34px rgba(250, 204, 21, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.12); }
.pk-paytable { width: 100%; max-width: 420px; margin: 0 auto; border-collapse: collapse; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.95rem; }
.pk-paytable th { text-align: left; color: #fde68a; padding: 2px 8px; font-weight: 800; }
.pk-paytable td { text-align: right; color: #fde047; padding: 2px 8px; font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; }
.pk-paytable tr.pk-made th, .pk-paytable tr.pk-made td { color: #fff; background: rgba(250, 204, 21, 0.18); }
.pk-paytable tr.pk-won th, .pk-paytable tr.pk-won td { color: #111827; background: #facc15; animation: pk-blink 0.5s steps(2) infinite; }
@keyframes pk-blink { 50% { background: #fde68a; } }
.pk-leds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pk-leds div { display: grid; justify-items: center; padding: 6px 4px; border-radius: 10px; background: #050816; border: 1px solid rgba(250, 204, 21, 0.35); }
.pk-leds span { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #fde68a; }
.pk-leds strong { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; color: #f87171; text-shadow: 0 0 8px rgba(248, 113, 113, 0.7); font-variant-numeric: tabular-nums; }
.pk-leds .pk-led-win strong { color: #4ade80; text-shadow: 0 0 8px rgba(74, 222, 128, 0.7); }
.pk-cards { display: flex; justify-content: center; gap: clamp(4px, 1.5vw, 14px); }
.pk-cards.pk-dim { opacity: 0.45; }
.poker .pcard { --w: clamp(54px, 16vw, 112px); }
.pk-slot { display: grid; justify-items: center; gap: 6px; background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.pk-slot:disabled { cursor: default; }
.pk-slot.pk-held .pcard { box-shadow: 0 0 0 3px #facc15, 0 6px 16px rgba(0, 0, 0, 0.45); }
.pk-held-label { min-height: 1.3em; font-size: clamp(0.65rem, 2.6vw, 0.85rem); font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #facc15; }
.pk-in { display: inline-block; animation: pk-flip 0.28s ease-out both; }
@keyframes pk-flip { from { transform: rotateY(90deg) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.pk-joker { display: grid; place-items: center; align-content: center; background: linear-gradient(160deg, #fff7ed, #fde68a); color: #b91c1c; }
.pk-joker-star { font-size: calc(var(--w) * 0.5); line-height: 1; }
.pk-joker-text { font-size: calc(var(--w) * 0.14); font-weight: 900; letter-spacing: 0.05em; }
.pk-double { display: grid; justify-items: center; gap: 6px; }
.pk-double .pcard { --w: clamp(70px, 20vw, 120px); }
.pk-double-info { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fde68a; }
.pk-shake { animation: pk-shake 0.12s linear infinite; }
@keyframes pk-shake { 25% { transform: translateX(-3px) rotate(-2deg); } 75% { transform: translateX(3px) rotate(2deg); } }
.pk-hint { margin: 0; min-height: 1.5em; text-align: center; font-weight: 700; color: #e0e7ff; }
.pk-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pk-btn { padding: 16px 10px; border-radius: 14px; border: 2px solid #0a1442; font: inherit; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
  color: #111827; background: linear-gradient(180deg, #f1f5f9, #cbd5e1); box-shadow: 0 4px 0 #475569; touch-action: manipulation; }
.pk-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #475569; }
.pk-btn:disabled { opacity: 0.4; cursor: default; }
.pk-deal { background: linear-gradient(180deg, #4ade80, #16a34a); box-shadow: 0 4px 0 #14532d; }
.pk-double-btn { background: linear-gradient(180deg, #fde047, #eab308); box-shadow: 0 4px 0 #854d0e; }
.pk-collect { background: linear-gradient(180deg, #93c5fd, #3b82f6); box-shadow: 0 4px 0 #1e3a8a; color: #fff; }
.pk-small, .pk-big { background: linear-gradient(180deg, #fca5a5, #dc2626); box-shadow: 0 4px 0 #7f1d1d; color: #fff; }
.pk-keys { font-size: 0.8rem; text-align: center; margin: 0; }
.pk-rules ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
@media (pointer: coarse) { .pk-keys { display: none; } }
@media (max-width: 560px) {
  .pk-machine { padding: 12px 8px; border-radius: 16px; }
  .pk-paytable { font-size: 0.8rem; }
  .pk-paytable td { font-size: 0.9rem; }
  .pk-leds strong { font-size: 1.25rem; }
  .pk-buttons { grid-template-columns: 1fr 1fr; }
  .pk-btn { padding: 14px 6px; font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) { .pk-in, .pk-shake, .pk-paytable tr.pk-won th, .pk-paytable tr.pk-won td { animation: none; } }
