/* Kibitz — base styles. Views add their own rules below the shared components. */
:root {
  --bg: #23211e;
  --bg-2: #2c2a26;
  --panel: #2f2d29;
  --panel-2: #3a3833;
  --line: #45423c;
  --text: #ece9e3;
  --text-2: #b4afa6;
  --text-3: #8a857b;
  --accent: #6fa94a;
  --accent-2: #5c9139;
  --accent-ink: #ffffff;
  --blue: #5b9bd5;
  --warn: #e3a33b;
  --bad: #d9534f;
  --good: #8bc34a;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  /* board theme (overridden by [data-board]) */
  --sq-light: #ecedd1;
  --sq-dark: #739552;
  --coord-light: #739552;
  --coord-dark: #ecedd1;
  /* move classification colours */
  --c-brilliant: #26c2a3;
  --c-great: #5b8bb0;
  --c-best: #81b64c;
  --c-excellent: #96bc4b;
  --c-good: #95af8a;
  --c-book: #a88865;
  --c-inaccuracy: #f7c631;
  --c-mistake: #e58f2a;
  --c-miss: #ee6b55;
  --c-blunder: #ca3431;
  --board-size: min(calc(100vh - 150px), calc(100vw - 640px));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
/* Board themes. [data-board-theme] lets any element (e.g. a theme swatch) show a theme locally. */
:root[data-board="green"], [data-board-theme="green"] { --sq-light: #ecedd1; --sq-dark: #739552; --coord-light: #739552; --coord-dark: #ecedd1; }
:root[data-board="brown"], [data-board-theme="brown"] { --sq-light: #f0d9b5; --sq-dark: #b58863; --coord-light: #b58863; --coord-dark: #f0d9b5; }
:root[data-board="blue"], [data-board-theme="blue"] { --sq-light: #dee3e6; --sq-dark: #8ca2ad; --coord-light: #788a94; --coord-dark: #dee3e6; }
:root[data-board="grey"], [data-board-theme="grey"] { --sq-light: #d9d9d9; --sq-dark: #9a9a9a; --coord-light: #8a8a8a; --coord-dark: #e6e6e6; }
:root[data-board="purple"], [data-board-theme="purple"] { --sq-light: #efeff5; --sq-dark: #8877b7; --coord-light: #8877b7; --coord-dark: #efeff5; }
:root { --focus: #8cc4ff; --sidebar-bg: #1b1a17; --ease: cubic-bezier(0.2, 0.7, 0.2, 1); }

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.2; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 0.88em; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.hidden { display: none !important; }
::selection { background: rgba(111, 169, 74, 0.45); }
input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* thin dark scrollbars */
* { scrollbar-width: thin; scrollbar-color: #57534b transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #57534b; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* visible keyboard focus everywhere (mouse clicks stay clean) */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn:focus-visible, .tab:focus-visible, .nav-link:focus-visible { outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 8px; }
#view:focus-visible, #view:focus { outline: none; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 2000; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 700; text-decoration: none; transition: top 0.15s; }
.skip-link:focus { top: 12px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: 172px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
#sidebar {
  background: var(--sidebar-bg); display: flex; flex-direction: column; gap: 2px; padding: 12px 8px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 30;
  border-right: 1px solid rgba(255, 255, 255, 0.04); overflow-y: auto; overscroll-behavior: contain;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; padding: 6px 10px 18px; border-radius: 8px; }
.brand img { border-radius: 9px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--panel); color: var(--text); }
.nav-link.active { background: var(--panel-2); color: var(--text); }
.nav-link.active::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav-link.active .nav-ico { color: var(--accent); }
.nav-ico { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; text-align: center; font-size: 1.2rem; }
.nav-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-ico svg .fill { fill: currentColor; stroke: none; }
.nav-spacer { flex: 1; }
#view { padding: 20px 24px; min-width: 0; outline: none; }

/* route change: the old page stays until the new one is ready, then fades in (opacity only,
   so nothing shifts and position: fixed children are unaffected) */
.view-page { animation: view-in 0.18s ease-out both; }
@keyframes view-in { from { opacity: 0; } }
#route-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 3000; opacity: 0; pointer-events: none; }
#route-progress.loading { opacity: 1; width: 75%; transition: width 2.5s var(--ease), opacity 0.2s; }
.view-boot { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--panel-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* not found / failed to load */
.not-found { max-width: 560px; margin: 8vh auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.not-found .btn-row { justify-content: center; margin-top: 14px; }
.nf-art { position: relative; width: 132px; height: 132px; margin-bottom: 18px; }
.nf-board {
  position: absolute; inset: 0; border-radius: 14px; transform: rotate(-6deg); opacity: 0.9;
  background: conic-gradient(var(--sq-dark) 0 25%, var(--sq-light) 0 50%, var(--sq-dark) 0 75%, var(--sq-light) 0) 0 0 / 50% 50%;
  box-shadow: var(--shadow);
}
.nf-code {
  position: absolute; inset: auto -14px -12px auto; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-weight: 800; font-size: 1.3rem; padding: 4px 12px; border-radius: 10px; box-shadow: var(--shadow);
}
.error-detail { max-width: 100%; overflow: auto; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 0.8rem; color: var(--text-2); white-space: pre-wrap; }

/* generic empty state: icon/art, a line of text, an action */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px; color: var(--text-2); }
.empty-state .empty-ico { font-size: 2rem; line-height: 1; opacity: 0.9; }
.empty-state h3 { color: var(--text); margin: 0; }
.empty-state p { margin: 0; max-width: 42ch; }
.empty-state .btn-row { justify-content: center; margin-top: 6px; }

/* skeleton shimmer for content that is still loading */
.skeleton { background: linear-gradient(90deg, var(--panel-2) 0%, #43403a 50%, var(--panel-2) 100%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; color: transparent !important; }
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* ---------- generic components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; user-select: none;
  transition: background-color 0.12s, border-color 0.12s, transform 0.08s, box-shadow 0.12s;
}
.btn:hover { background: #46433d; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent-2); color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-2); }
.btn.primary:hover { background: #7cb956; }
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-2); }
.btn.danger { background: var(--bad); border-color: #b23f3b; color: #fff; box-shadow: 0 3px 0 #a53a36; }
.btn.danger:hover { background: #e2615d; }
.btn.small { padding: 6px 11px; font-size: 0.85rem; border-radius: 7px; }
.btn.big { padding: 14px 22px; font-size: 1.1rem; border-radius: 10px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.icon { padding: 8px 10px; min-width: 38px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); font-size: 0.78rem; color: var(--text-2); }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 10px; text-align: center; background: none; border: 0; color: var(--text-2); font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; transition: color 0.12s, border-color 0.12s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 0.9rem; color: var(--text-2); }
select, input[type="text"], input[type="number"], textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
textarea { width: 100%; min-height: 90px; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
/* checkboxes inside .switch render as toggles (still a real checkbox: same events and .checked) */
.switch input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 40px; height: 23px; margin: 0; border-radius: 999px;
  background: #57534b; position: relative; cursor: pointer; transition: background-color 0.15s;
}
.switch input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 0.15s var(--ease);
}
.switch input[type="checkbox"]:checked { background: var(--accent); }
.switch input[type="checkbox"]:checked::after { transform: translateX(17px); }
.switch input[type="checkbox"]:disabled { opacity: 0.5; cursor: default; }

#toasts { position: fixed; bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: #111; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 600; animation: toast-in 0.2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast-update { display: flex; align-items: center; gap: 12px; }
.toast-update .btn { pointer-events: auto; }
/* iPhones zoom into any text box under 16px when it is tapped */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; z-index: 900; animation: fade-in 0.15s ease-out; }
.modal { background: var(--panel); border-radius: 14px; padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow: auto; animation: modal-in 0.18s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal h2 { margin-bottom: 12px; }
.modal .btn-row { margin-top: 18px; justify-content: flex-end; }

/* ---------- board ---------- */
.game-layout { display: grid; grid-template-columns: auto minmax(330px, 440px); gap: 20px; align-items: start; }
.board-col { display: flex; gap: 8px; align-items: stretch; }
.board-stack { display: flex; flex-direction: column; gap: 6px; width: var(--board-size); min-width: 280px; }
.board-host { position: relative; width: 100%; aspect-ratio: 1; }
.board-host > .cg-wrap { width: 100%; height: 100%; }
cg-board {
  background: conic-gradient(var(--sq-dark) 0 25%, var(--sq-light) 0 50%, var(--sq-dark) 0 75%, var(--sq-light) 0) 0 0 / 25% 25%;
  border-radius: 4px;
}
cg-board square.last-move { background-color: rgba(255, 235, 59, 0.42); }
cg-board square.selected { background-color: rgba(255, 235, 59, 0.55); }
cg-board square.move-dest { background: radial-gradient(rgba(0, 0, 0, 0.22) 19%, transparent 20%); }
cg-board square.move-dest:hover { background: rgba(0, 0, 0, 0.12); }
cg-board square.oc.move-dest { background: radial-gradient(transparent 0%, transparent 79%, rgba(0, 0, 0, 0.22) 80%); }
cg-board square.check { background: radial-gradient(ellipse at center, rgba(255, 0, 0, 1) 0%, rgba(231, 0, 0, 1) 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%); }
cg-board square.hint-from { background-color: rgba(91, 155, 213, 0.55); }
cg-board square.bad-sq { background-color: rgba(217, 83, 79, 0.45); }
cg-board square.good-sq { background-color: rgba(129, 182, 76, 0.5); }
cg-board square.star-target { background: radial-gradient(circle, rgba(255, 215, 64, 0.95) 0 22%, transparent 23%); }
/* Coordinates sit inside the edge squares: ranks top-left of the left file, files bottom-right
   of the bottom rank, lowercase, coloured to contrast with the square they are on. */
.cg-wrap coords { font-weight: 700; font-size: clamp(9px, 1.5vw, 13px); font-family: inherit; opacity: 1; line-height: 1; text-transform: lowercase; }
@supports (font-size: 1cqi) {
  .cg-wrap { container-type: inline-size; }
  .cg-wrap coords { font-size: clamp(9px, 2.7cqi, 16px); }
}
.cg-wrap coords coord { flex: 1 1 0; }
.cg-wrap coords.files { left: 0; bottom: 0; width: 100%; height: auto; text-transform: lowercase; text-align: right; }
.cg-wrap coords.files coord { padding: 0 0.32em 0.28em 0; }
.cg-wrap coords.ranks:not(.left) { left: 0; top: 0; width: auto; height: 100%; }
.cg-wrap coords.ranks:not(.left) coord { transform: none; padding: 0.28em 0 0 0.3em; }
.cg-wrap coords.ranks coord:nth-child(odd), .cg-wrap coords.files coord:nth-child(odd) { color: var(--coord-dark); }
.cg-wrap coords.ranks coord:nth-child(even), .cg-wrap coords.files coord:nth-child(even) { color: var(--coord-light); }
.cg-wrap.orientation-black coords.files coord:nth-child(odd), .cg-wrap.orientation-black coords.ranks coord:nth-child(odd) { color: var(--coord-light); }
.cg-wrap.orientation-black coords.files coord:nth-child(even), .cg-wrap.orientation-black coords.ranks coord:nth-child(even) { color: var(--coord-dark); }

.promotion-overlay { position: absolute; inset: 0; background: rgba(20, 20, 20, 0.55); z-index: 50; }
.promo-sq { position: absolute; width: 12.5%; height: 12.5%; background: #f5f5f5; border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.promo-sq:hover { background: #ffd35c; border-radius: 6px; }
.promo-sq piece { position: absolute; inset: 6%; width: 88%; height: 88%; background-size: cover; transform: none !important; pointer-events: none; }

/* evaluation bar */
.eval-bar { position: relative; width: 26px; background: #403d39; border-radius: 4px; overflow: hidden; flex: 0 0 26px; }
.eval-bar .fill { position: absolute; left: 0; right: 0; bottom: 0; background: #f4f4f4; transition: height 0.35s ease; }
.eval-bar.flipped .fill { bottom: auto; top: 0; }
.eval-bar .label { position: absolute; left: 0; right: 0; text-align: center; font-size: 10.5px; font-weight: 700; z-index: 2; }
.eval-bar .label.bottom { bottom: 4px; color: #403d39; }
.eval-bar .label.top { top: 4px; color: #f4f4f4; }

/* player bars */
.player-bar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.avatar { width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; font-size: 22px; background: var(--panel-2); flex: 0 0 40px; overflow: hidden; }
.player-name { font-weight: 700; }
.player-sub { color: var(--text-2); font-size: 0.8rem; }
.captured { display: flex; align-items: center; gap: 0; min-height: 18px; font-size: 0.8rem; color: var(--text-2); }
.captured piece { position: static; display: inline-block; width: 18px; height: 18px; background-size: cover; margin-right: -6px; }
.clock { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 1.3rem; font-weight: 700; padding: 4px 12px; background: var(--panel-2); border-radius: 6px; min-width: 90px; text-align: right; }
.clock.running { background: #e8e6e3; color: #222; }
.clock.low { background: var(--bad); color: #fff; }

/* side panel */
.side-panel { background: var(--panel); border-radius: var(--radius); display: flex; flex-direction: column; height: calc(var(--board-size) + 100px); min-height: 520px; overflow: hidden; }
.side-panel .panel-body { flex: 1; overflow: auto; padding: 12px 14px; }
.side-panel .panel-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* move list */
.moves { display: grid; grid-template-columns: 38px 1fr 1fr; font-size: 0.92rem; }
.moves .num { color: var(--text-3); padding: 3px 6px; text-align: right; }
.moves .mv { padding: 3px 8px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.moves .mv:hover { background: var(--panel-2); }
.moves .mv.current { background: #4a4842; font-weight: 700; }
.moves .row-alt { background: rgba(255, 255, 255, 0.025); }

/* coach bubble */
.coach { display: flex; gap: 10px; align-items: flex-start; }
.coach .avatar { width: 46px; height: 46px; flex-basis: 46px; font-size: 26px; background: #4c7a3d; }
.bubble { position: relative; background: #f4f2ee; color: #222; border-radius: 12px; padding: 10px 12px; font-size: 0.93rem; flex: 1; }
.bubble::before { content: ""; position: absolute; left: -7px; top: 14px; border: 7px solid transparent; border-left: 0; border-right-color: #f4f2ee; }
.bubble b { font-weight: 700; }

/* move classification badges */
.badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-weight: 800; color: #fff; flex: 0 0 18px; }
.badge.brilliant { background: var(--c-brilliant); }
.badge.great { background: var(--c-great); }
.badge.best { background: var(--c-best); }
.badge.excellent { background: var(--c-excellent); }
.badge.good { background: var(--c-good); }
.badge.book { background: var(--c-book); }
.badge.inaccuracy { background: var(--c-inaccuracy); }
.badge.mistake { background: var(--c-mistake); }
.badge.miss { background: var(--c-miss); }
.badge.blunder { background: var(--c-blunder); }
.badge.forced { background: #888; }

@media (max-width: 1100px) {
  :root { --board-size: min(calc(100vw - 260px), calc(100vh - 150px)); }
  .game-layout { grid-template-columns: 1fr; }
  .side-panel { height: auto; min-height: 360px; }
}
/* tablets: the sidebar becomes a narrow rail of icons with small labels */
@media (min-width: 721px) and (max-width: 1000px) {
  #app { grid-template-columns: 84px minmax(0, 1fr); }
  #sidebar { padding: 10px 6px; }
  .brand { justify-content: center; padding: 4px 0 14px; }
  .brand span { display: none; }
  .nav-link { flex-direction: column; gap: 4px; padding: 9px 2px; font-size: 0.72rem; text-align: center; }
  .nav-link.active::before { left: -6px; }
}
/* phones: a compact top bar of icon tabs */
@media (max-width: 720px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  #sidebar {
    position: sticky; top: 0; height: auto; flex-direction: row; overflow-x: auto; z-index: 30; gap: 0;
    padding: 4px 4px 0; padding-top: max(4px, env(safe-area-inset-top)); border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  }
  .brand, .brand span { display: none; }
  .nav-link { flex: 1 1 0; min-width: 44px; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px 8px; font-size: 10.5px; border-radius: 8px 8px 0 0; }
  .nav-link span:last-child, .nav-link .nav-label { display: block; white-space: nowrap; }
  .nav-link.active { background: transparent; }
  .nav-link.active::before { left: 22%; right: 22%; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .nav-spacer { display: none; }
  #view { padding: 12px 16px; }
  #toasts { bottom: calc(env(safe-area-inset-bottom) + 76px); width: max-content; max-width: calc(100vw - 32px); } /* clear of the bottom bars */
  :root { --board-size: calc(100vw - 66px); }
  h1 { font-size: 1.4rem; }
}
@media (max-width: 359px) {
  .nav-link .nav-label { display: none; }
  .nav-link { padding: 10px 2px; }
}
