/* Lamplight Crossing on bozcode.com. A light page (the house style) with
   the night-time marsh as the one rich object on it. Fonts come from
   /static/css/fonts.css. */

:root {
  color-scheme: light;
  --page: #e6ecf5;
  --page-hi: #f8fbff;
  --panel: #ffffff;
  --panel-2: #f3f6fb;
  --line: #d6deea;
  --line-strong: #7b8aa0;
  --ink: #12203a;
  --ink-2: #44546c;
  --accent: #2459c4;
  --accent-ink: #1a3f8f;
  --accent-soft: #e1eafb;
  --gold: #b88a2c;
  --sapphire: #2f6fd0;
  --navy: #0f1d38;
  --tide: #2f5fb4;
  --ember: #a8632f;
  --lamp: #ffd88a;
  --warn-bg: #fff3d9;
  --warn-ink: #6e4700;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(16 32 64 / 6%), 0 10px 28px rgb(16 32 64 / 7%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: Syne, Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  background:
    radial-gradient(900px 600px at 28% 18%, var(--page-hi) 0%, transparent 62%),
    radial-gradient(700px 500px at 85% 90%, #dbe5f6 0%, transparent 60%),
    linear-gradient(180deg, #e9eff7 0%, #dfe7f2 100%);
}

.visually-hidden {
  position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

h1, h2, h3, p, ul, ol { margin: 0; }

/* ── top bar ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1260px; margin: 0 auto; padding: 18px 20px 14px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { filter: drop-shadow(0 4px 10px rgb(15 29 56 / 25%)); }
.brand h1 {
  font: 800 clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem)/1.05 var(--display);
  letter-spacing: -0.01em; color: var(--navy);
}
.sub { color: var(--ink-2); font-size: .95rem; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-block-size: 44px; padding: 0 1.05rem; border-radius: 12px;
  border: 1px solid transparent; font: 600 .95rem/1 var(--sans); cursor: pointer;
  color: var(--ink); background: transparent; text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:focus-visible, .seg input:focus-visible + span, .toggle input:focus-visible + span::before, summary:focus-visible {
  outline: 3px solid #f2b631; outline-offset: 2px;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #3b7ae0 0%, #2459c4 55%, #1d4cab 100%);
  border-color: #1a4499;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 30%), 0 2px 6px rgb(36 89 196 / 35%);
  text-shadow: 0 1px 0 rgb(0 0 0 / 20%);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #3470d6 0%, #1f4fb3 60%, #1a4499 100%); }
.btn-secondary { background: var(--panel); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.btn-quiet { color: var(--ink); }
.btn-quiet:hover { background: rgb(255 255 255 / 60%); }
.btn-quiet[aria-pressed="false"] { color: var(--ink-2); }

/* ── layout ──────────────────────────────────────────────────────────── */
.table {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  gap: 28px; align-items: start;
  max-width: 1260px; margin: 0 auto; padding: 4px 20px 28px;
}
.stage {
  width: 100%;
  /* the board plus both player strips fit the window height */
  max-width: min(880px, max(320px, calc((100dvh - 290px) * 1.1)));
  justify-self: center;
  display: flex; flex-direction: column; gap: 12px;
}

/* ── seats (player strips above and below the board) ─────────────────── */
.seat {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "avatar text pill" "tray tray tray";
  align-items: center; column-gap: 12px; row-gap: 6px;
  padding: 10px 14px; border-radius: 14px;
  background: rgb(255 255 255 / 72%); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgb(16 32 64 / 5%);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.avatar {
  grid-area: avatar; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(180deg, #eef3fa, #dfe7f2); border: 1px solid var(--line);
}
.seat-text { grid-area: text; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.seat-name { font-weight: 700; font-size: 1.02rem; }
.seat-detail { color: var(--ink-2); font-size: .85rem; overflow-wrap: anywhere; }
.turn-pill {
  grid-area: pill; justify-self: end;
  font: 700 .78rem/1 var(--sans); letter-spacing: .02em; text-transform: uppercase;
  padding: .45rem .7rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
}
.seat.thinking .turn-pill { background: var(--warn-bg); color: var(--warn-ink); }
.seat.thinking .turn-pill::after { content: ""; display: inline-block; width: 1.1em; text-align: left; animation: dots 1.2s steps(4) infinite; }
.seat.active { background: #fff; border-color: #9db8e8; box-shadow: 0 0 0 3px rgb(47 111 208 / 14%), 0 6px 18px rgb(16 32 64 / 8%); }
.tray { grid-area: tray; display: flex; flex-wrap: wrap; align-items: center; gap: 0; min-height: 0; }
.tray:empty { display: none; }

.avatar .pc-icon { width: 34px; height: 34px; }
.tray { grid-area: tray; display: flex; flex-wrap: wrap; align-items: center; gap: 0; min-height: 0; }
.tray:empty { display: none; }
.pc-icon.mini { width: 24px; height: 24px; margin-right: -4px; }

/* ── the board ───────────────────────────────────────────────────────── */
.board-wrap { position: relative; width: 100%; aspect-ratio: 839 / 760; }
.board {
  position: relative; display: block; width: 100%; height: 100%;
  filter: drop-shadow(0 22px 34px rgb(15 29 56 / 34%)) drop-shadow(0 4px 8px rgb(15 29 56 / 20%));
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.board-glow {
  position: absolute; inset: -6%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(47 95 180 / 30%), transparent 72%);
  transition: background .6s var(--ease), opacity .6s var(--ease); pointer-events: none;
}
.board-wrap[data-turn="north"] .board-glow { background: radial-gradient(closest-side, rgb(168 99 47 / 26%), transparent 72%); }
.board-wrap[data-turn="over"] .board-glow { opacity: .35; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
.confetti.on { display: block; }

.board .zone, .board .marks, .board .targets, .board .tokens, .board .terrain, .board .fog, .board .fx,
.board .focus-ring, .board .night, .board .mire { pointer-events: none; }
.board .cell { outline: none; }
.board-wrap:not(.busy) .cell { cursor: pointer; }
.board-wrap.busy .cell { cursor: progress; }

.mire { fill: rgb(120 160 230 / 6%); }
.cell { fill: rgb(255 255 255 / 3.5%); stroke: rgb(190 210 255 / 13%); stroke-width: 1.5; transition: fill .2s var(--ease); }
.cell.home-s { fill: rgb(80 130 225 / 13%); }
.cell.home-n { fill: rgb(215 135 70 / 10%); }
.cell.pool { fill: url(#ll-water); stroke: rgb(110 150 210 / 24%); }
.cell.lamp { fill: rgb(255 210 130 / 13%); stroke: rgb(255 216 138 / 30%); }
.board-wrap:not(.busy) .cell:not(.pool):hover { fill: rgb(255 255 255 / 10%); }
.ripple { fill: none; stroke: rgb(150 190 255 / 24%); stroke-width: 1.6; }
.glow { animation: flicker 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.terrain .glow:nth-of-type(2n) { animation-delay: -1.3s; }
.post { stroke: #56698c; stroke-width: 3; stroke-linecap: round; }
.lantern { fill: #24324b; stroke: #a9bbd9; stroke-width: 1.5; stroke-linejoin: round; }
.flame { fill: var(--lamp); }

.fog .bank { animation: drift 38s ease-in-out infinite alternate; }
.fog .bank-1 { animation-duration: 46s; animation-delay: -12s; }
.fog .bank-2 { animation-duration: 31s; animation-delay: -20s; }
.fog .bank-3 { animation-duration: 52s; animation-delay: -6s; }
.fog .bank-4 { animation-duration: 40s; animation-delay: -27s; }

.zone-cell { fill: none; stroke: rgb(150 195 255 / 60%); stroke-width: 2; stroke-dasharray: 7 6; }
.last-from { fill: none; stroke: rgb(255 216 138 / 38%); stroke-width: 2.5; stroke-dasharray: 5 5; }
.last-to { fill: rgb(255 216 138 / 7%); stroke: rgb(255 216 138 / 70%); stroke-width: 3; }
.selected { fill: none; stroke: var(--lamp); stroke-width: 4.5; filter: drop-shadow(0 0 6px rgb(255 216 138 / 80%)); }
.dot { fill: rgb(205 225 255 / 72%); }
.ring-attack { fill: none; stroke: #ff8b78; stroke-width: 4.5; }
.ring-attack.both { stroke-dasharray: 14 7; }
.ring-shine { fill: none; stroke: var(--lamp); stroke-width: 3.5; stroke-dasharray: 5 5; }
.sup-tag rect { fill: rgb(8 16 32 / 88%); stroke: rgb(255 139 120 / 70%); stroke-width: 1.5; }
.sup-tag text { fill: #fff; font: 700 13px var(--sans); }
.hint-line { stroke: #2fc6f0; stroke-width: 8; stroke-linecap: round; opacity: .85; }
.hint-ring { fill: none; stroke: #2fc6f0; stroke-width: 5; transform-box: fill-box; transform-origin: center; animation: pulse 1.2s ease-in-out infinite; }
.focus-ring { fill: none; stroke: #7fd6ff; stroke-width: 4; stroke-dasharray: 8 5; opacity: 0; transition: opacity .12s; }
.board.kbd .focus-ring { opacity: 1; }

/* tokens (board.ts + pieces.ts): Tide blue for you, Ember copper for them */
.token { transition: transform .32s var(--ease); }
.token.appear { animation: appear .45s var(--ease) both; }
.token.falling .lift { animation: fall .45s ease-in forwards; transform-box: fill-box; transform-origin: center; }
.disc { stroke: rgb(0 0 0 / 40%); stroke-width: 1.5; }
.rim { fill: none; stroke: rgb(255 255 255 / 30%); stroke-width: 1.5; }
.tok-south .ink { fill: #f6f2e8; }
.tok-south .cut { fill: #2a56a6; }
.tok-north .ink { fill: #fff2df; }
.tok-north .cut { fill: #8f4f23; }
.ink-line { fill: none; stroke-width: 5; }
.tok-south .ink-line { stroke: #f6f2e8; }
.tok-north .ink-line { stroke: #fff2df; }
.cut-line { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.tok-south .cut-line { stroke: #2a56a6; }
.tok-north .cut-line { stroke: #8f4f23; }
.token.hidden .ink, .pc-icon.hidden .ink { opacity: .6; }
.token.unseen .disc { stroke: var(--lamp); stroke-dasharray: 5 4; stroke-width: 2.5; }
.badge { fill: #0b1730; stroke: rgb(255 255 255 / 65%); stroke-width: 1.5; }
.badge-n { fill: #fff; font: 800 13px var(--sans); }
.seen { fill: #0b1730; stroke: var(--lamp); stroke-width: 1.5; }
.seen-eye { fill: var(--lamp); }
.seen-pupil { fill: #0b1730; }
.moved-dot { fill: var(--lamp); stroke: #0b1730; stroke-width: 2; }

.burst { animation: burst .65s ease-out forwards; transform-box: fill-box; transform-origin: center; }
.flare { fill: none; stroke: var(--lamp); stroke-width: 5; animation: flare .85s ease-out forwards; transform-box: fill-box; transform-origin: center; }
.beam { stroke: var(--lamp); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 10 8; animation: beam .85s ease-out forwards; }

/* small icons in the panel */
.pc-icon { display: inline-block; vertical-align: middle; flex: none; }
.pc-icon .disc { stroke: rgb(0 0 0 / 30%); stroke-width: 2; }
.pc-icon.tok-south .disc { fill: var(--tide); }
.pc-icon.tok-north .disc { fill: var(--ember); }
.pc-icon .rim { stroke: rgb(255 255 255 / 35%); stroke-width: 2.5; }
.pc-icon.tiny { width: 22px; height: 22px; }

/* the fight card */
.duel {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: min(420px, 88%);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px 10px;
  padding: 16px 18px 14px; border-radius: 18px; color: #fff;
  background: rgb(8 16 32 / 92%); border: 1px solid rgb(255 216 138 / 45%);
  box-shadow: 0 18px 40px rgb(0 0 0 / 45%);
  transform: translate(-50%, -50%) scale(.92); opacity: 0;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  pointer-events: none;
}
.duel.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.duel-side { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.duel-icon { width: 56px; height: 56px; }
.duel-name { font: 700 .95rem/1.2 var(--sans); }
.duel-sum { font: 600 .95rem/1.2 var(--mono); color: #d7e3f7; }
.duel-vs { font: 800 1.1rem/1 var(--display); color: var(--lamp); }
.duel-result { grid-column: 1 / -1; text-align: center; font: 700 1.05rem/1.3 var(--sans); margin-top: 6px; color: var(--lamp); }

@keyframes pulse { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.03); } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@keyframes flicker { 0%, 100% { opacity: .85; transform: scale(1); } 40% { opacity: 1; transform: scale(1.04); } 70% { opacity: .75; transform: scale(.98); } }
@keyframes drift { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes fall { to { transform: scale(.3); opacity: 0; } }
@keyframes burst { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes flare { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes beam { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

/* the setup card, the intel table, the log */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.go-tag { font: 700 .7rem/1 var(--mono); padding: .35rem .55rem; border-radius: 999px; background: #e7eefb; color: #1a3f8f; white-space: nowrap; }
.setup-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
.legend { list-style: none; padding: 0; margin-top: 14px; display: grid; gap: 10px; }
.legend li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; font-size: .88rem; line-height: 1.4; }
.legend strong { display: block; font-size: .92rem; }
.legend span { color: var(--ink-2); }
.legend-icon { width: 34px; height: 34px; }
.intel { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .88rem; }
.intel caption { text-align: left; font-weight: 700; padding-bottom: 4px; }
.intel th, .intel td { padding: 3px 4px; }
.intel thead th { font: 600 .74rem/1.2 var(--sans); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.intel thead th:first-child { text-align: left; }
.intel tbody th { display: flex; align-items: center; gap: 7px; font-weight: 600; text-align: left; }
.intel td { text-align: center; font: 600 .9rem/1 var(--mono); }
.intel td.zero { color: #9aa6b8; }
.intel tr.gone th { color: var(--ink-2); text-decoration: line-through; }
.intel tbody tr:nth-child(odd) { background: var(--panel-2); }
.k-str { font: 700 .72rem/1 var(--mono); color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px; }
.deduce { margin-top: 10px; padding-left: 1.1rem; display: grid; gap: 4px; font-size: .88rem; color: var(--ink); }
.deduce:empty { display: none; }
.mine-details { margin-top: 12px; }
.mine-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent-ink); }
.log { list-style: none; padding: 0; margin-top: 10px; max-height: 230px; overflow-y: auto; display: grid; gap: 2px; font-size: .88rem; line-height: 1.45; }
.log li { padding: 4px 8px; border-radius: 8px; border-left: 3px solid transparent; }
.log li.mine { border-left-color: var(--tide); background: #eef3fc; }
.log li.theirs { border-left-color: var(--ember); background: #fbf2ea; }
.log:empty::before { content: "No moves yet."; color: var(--ink-2); }
.readout { font: 500 .78rem/1.45 var(--mono); color: var(--ink-2); margin-top: 10px; }
.readout:empty, .record:empty { display: none; }
.record { font-size: .86rem; color: var(--ink-2); margin-top: 8px; }

/* ── panel ───────────────────────────────────────────────────────────── */
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card h2, .settings summary { font: 700 .82rem/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }

.status { font: 700 1.3rem/1.3 var(--sans); color: var(--navy); }
.status-sub { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
.status-sub:empty { display: none; }
.status-card .btn { margin-top: 10px; }


.controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.controls .btn { white-space: nowrap; padding: 0 .6rem; }

.settings summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; border-radius: 8px; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: "▾"; font-size: 1rem; transition: transform .2s var(--ease); }
.settings:not([open]) summary::after { transform: rotate(-90deg); }
.seg { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.seg legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.seg label { position: relative; flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 .7rem; border-radius: 10px; font-size: .88rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
  white-space: nowrap;
}
.seg label:hover span { border-color: var(--accent); background: var(--accent-soft); }
.seg input:checked + span { background: var(--accent); border-color: var(--accent-ink); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%); }
.seg:disabled { opacity: .5; }
.seg:disabled label:hover span { border-color: var(--line-strong); background: var(--panel); }
.seg:disabled input:checked + span { background: var(--ink-2); border-color: var(--ink-2); }
.seg-4 label { flex: 1 1 22%; }

.toggles { display: grid; gap: 4px; margin-top: 14px; }
.toggle { position: relative; display: flex; align-items: center; min-height: 40px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.toggle span::before {
  content: ""; flex: none; width: 40px; height: 24px; border-radius: 999px;
  background: #c3ccd9 radial-gradient(circle at 12px 12px, #fff 8px, transparent 8.5px);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 20%);
  transition: background-color .2s var(--ease), background-position .2s var(--ease);
}
.toggle input:checked + span::before { background: var(--accent) radial-gradient(circle at 28px 12px, #fff 8px, transparent 8.5px); }
.fine { font-size: .82rem; color: var(--ink-2); margin-top: 10px; }

.record { font-size: .86rem; color: var(--ink-2); margin-top: 10px; }
.btn-small { min-block-size: 40px; padding: 0 .85rem; font-size: .88rem; background: var(--panel); border-color: var(--line-strong); }
.btn-small:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }

.foot { max-width: 1260px; margin: 0 auto; padding: 4px 20px 28px; color: var(--ink-2); font-size: .85rem; }

/* ── dialogs and toast ───────────────────────────────────────────────── */
.dlg {
  margin: auto; padding: 0; border: 0; border-radius: 20px; background: transparent;
  max-width: min(560px, calc(100vw - 32px)); color: var(--ink);
}
.dlg::backdrop { background: rgb(10 20 40 / 45%); backdrop-filter: blur(3px); }
.dlg-card { background: var(--panel); border-radius: 20px; padding: 24px 26px; box-shadow: 0 30px 60px rgb(10 20 40 / 35%); }
.dlg h2 { font: 800 1.6rem/1.15 var(--display); color: var(--navy); margin-bottom: 12px; }
.dlg h3 { font-size: 1rem; margin: 18px 0 8px; }
.rules { padding-left: 1.1rem; display: grid; gap: 8px; }
.rules li { line-height: 1.5; }
kbd { font: 600 .82rem var(--mono); padding: .05rem .4rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--panel-2); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.end h2 { font-size: 2rem; }
.end-reason { font-size: 1.05rem; }
.end-record { color: var(--ink-2); margin-top: 8px; }
.end-record:empty { display: none; }
.confirm-text { font-size: 1.05rem; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 10; max-width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, 16px); opacity: 0;
  padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600;
  box-shadow: 0 12px 30px rgb(10 20 40 / 35%);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── smaller screens ─────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .table { grid-template-columns: minmax(0, 1fr); }
  .stage { max-width: min(820px, max(300px, calc((100dvh - 260px) * 1.1))); }
  .panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
  .controls { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .topbar { padding: 12px 16px 10px; }
  .brand img { width: 36px; height: 36px; }
  .sub { font-size: .85rem; }
  .table { padding: 4px 16px 20px; gap: 18px; }
  .stage { max-width: 100%; gap: 8px; }
  .seat { padding: 8px 10px; column-gap: 10px; }
  .avatar { width: 36px; height: 36px; }
  .controls { grid-template-columns: repeat(3, 1fr); }
  .panel { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
