/* =============================================================================
 * CHESSWOOD — style.css
 * Base look: deep pine/teal lacquer panels, brass accents, cream text, and
 * chunky "wooden token" buttons that press down when tapped.
 * Layout for each screen size lives in responsive.css.
 *
 * Edit the colour tokens below to re-skin the whole interface.
 * ===========================================================================*/
:root {
  --pine-950: #071a1e;
  --pine-900: #0d272d;
  --pine-800: #133740;
  --teal-600: #1e5a66;
  --teal-500: #2a7180;
  --teal-300: #8cc4c6;
  --cream-50: #fcf6e9;
  --cream-100: #f4e8d0;
  --cream-300: #dcc8a2;
  --brass-200: #f6d68f;
  --brass-400: #d8a64c;
  --brass-600: #9f7329;
  --walnut-900: #2c180c;
  --walnut-700: #4c2c18;
  --mint: #7fe3c4;
  --rose: #ff6170;
  --rose-700: #b8303e;

  --surface: rgba(11, 36, 42, 0.8);
  --surface-strong: rgba(9, 30, 35, 0.96);
  --line: rgba(244, 232, 208, 0.13);
  --line-strong: rgba(244, 232, 208, 0.26);
  --text: var(--cream-100);
  --text-dim: rgba(244, 232, 208, 0.7);

  --font-display: "Fredoka", "Poppins", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius-panel: 22px;
  --radius-btn: 14px;
  --shadow-panel: 0 18px 50px rgba(0, 0, 0, 0.35);
  --blur: blur(14px) saturate(1.15);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--pine-950);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--brass-200); }
h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- 3D canvas */
.scene {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; outline: none; cursor: grab;
}
.scene:active { cursor: grabbing; }
.scene:focus-visible { box-shadow: inset 0 0 0 3px var(--brass-200); }
.vignette {
  position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
  transition: opacity 0.8s ease;
}
.vignette.is-defeat { opacity: 1; background: radial-gradient(ellipse at center, transparent 40%, rgba(60, 4, 12, 0.6) 100%); }
.vignette.is-victory { opacity: 1; background: radial-gradient(ellipse at center, transparent 50%, rgba(214, 166, 80, 0.22) 100%); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0.6em 1.25em;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: 0.01em;
  color: var(--cream-50);
  background: linear-gradient(180deg, #2c7684 0%, var(--teal-600) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-btn);
  box-shadow: 0 3px 0 #0c3139, 0 8px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer; user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0c3139, 0 3px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); transform: none; }
.btn:focus-visible, .icon-btn:focus-visible, .name-chip:focus-visible, .link-btn:focus-visible, .tab:focus-visible, .promo-btn:focus-visible {
  outline: 3px solid var(--brass-200); outline-offset: 3px;
}
.btn-primary {
  color: var(--walnut-900);
  background: linear-gradient(180deg, var(--brass-200) 0%, var(--brass-400) 100%);
  border-color: rgba(255, 246, 220, 0.6);
  box-shadow: 0 3px 0 var(--brass-600), 0 10px 22px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-primary:active { box-shadow: 0 1px 0 var(--brass-600), 0 3px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--line-strong); box-shadow: none; }
.btn-quiet { background: rgba(244, 232, 208, 0.06); border-color: var(--line); box-shadow: none; color: var(--cream-100); }
.btn-quiet:active { transform: translateY(1px); box-shadow: none; }
.btn-danger {
  background: linear-gradient(180deg, #e35361 0%, var(--rose-700) 100%);
  box-shadow: 0 3px 0 #7c1d28, 0 8px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-lg { min-height: 56px; font-size: 1.15rem; padding: 0.7em 1.5em; }
.btn-small { min-height: 40px; padding: 0.4em 0.9em; font-size: 0.95rem; }

.icon-btn {
  width: 46px; height: 46px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  color: var(--cream-100);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.icon-btn:hover { background: rgba(30, 90, 102, 0.85); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn-sm { width: 38px; height: 38px; }
.link-btn { background: none; border: none; padding: 6px 4px; color: var(--brass-200); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 0.95rem; }

/* ---------------------------------------------------------------- splash */
.splash {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: var(--pine-950);
  transition: opacity 0.5s ease, transform 0.6s ease;
}
.splash.is-leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-art, .splash-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash-art img { object-fit: cover; }
.splash::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 26, 30, 0) 40%, rgba(7, 26, 30, 0.75) 100%);
}
.splash-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  height: 100%; width: 100%;
  padding: calc(6vh + var(--safe-t)) 24px calc(7vh + var(--safe-b));
}
.splash-title {
  width: min(78vw, 820px); height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.45));
  animation: title-in 1.1s cubic-bezier(.2, .9, .25, 1.15) both;
}
@keyframes title-in { from { opacity: 0; transform: translateY(-24px) scale(0.92); } to { opacity: 1; transform: none; } }
.loader { width: min(360px, 80vw); text-align: center; }
.loader-track { height: 10px; border-radius: 99px; background: rgba(244, 232, 208, 0.16); overflow: hidden; border: 1px solid var(--line); }
.loader-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brass-400), var(--brass-200)); transition: width 0.3s ease; }
.loader-text { margin: 10px 0 0; font-family: var(--font-display); font-weight: 500; color: var(--cream-100); letter-spacing: 0.02em; }
#btn-start { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-3px); box-shadow: 0 6px 0 var(--brass-600), 0 18px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55); } }

/* ---------------------------------------------------------------- menu */
.menu { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.menu-card {
  pointer-events: auto;
  position: absolute;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 26px;
}
.menu-title { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35)); }
.menu-actions { display: flex; flex-direction: column; gap: 12px; }
.menu-actions .btn { width: 100%; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 16px; }
.name-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0;
  padding: 6px 14px 6px 14px; border-radius: 99px;
  background: rgba(244, 232, 208, 0.07); border: 1px solid var(--line);
  cursor: pointer; text-align: left;
}
.name-label { color: var(--text-dim); font-size: 0.9rem; white-space: nowrap; }
.name-value { font-family: var(--font-display); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14ch; }

/* ---------------------------------------------------------------- HUD */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }
.topbar {
  position: absolute; display: flex; align-items: center; gap: 12px;
}
.topbar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.topbar-game { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--brass-200); }
.topbar-match { font-size: 0.88rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.timer {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 16px; border-radius: 99px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem;
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
}
.timer .ico { color: var(--brass-200); }

.player-bar {
  position: absolute;
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 7px 14px 7px 8px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: 18px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.player-bar.is-turn { border-color: rgba(246, 214, 143, 0.75); box-shadow: 0 0 0 3px rgba(216, 166, 76, 0.18), 0 8px 24px rgba(0, 0, 0, 0.25); }
.pb-piece {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.6rem; line-height: 1;
}
.player-bar[data-color="w"] .pb-piece { background: linear-gradient(180deg, #fff8ea, #e8d8b8); color: #3b2a1a; }
.player-bar[data-color="b"] .pb-piece { background: linear-gradient(180deg, #2d7280, #17454f); color: #e9f6f4; }
.pb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.pb-name { font-family: var(--font-display); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-status { font-size: 0.85rem; color: var(--text-dim); min-height: 1.1em; }
.player-bar.is-turn .pb-status { color: var(--brass-200); }
.pb-captured { font-size: 1.15rem; letter-spacing: -0.12em; line-height: 1; color: var(--cream-100); white-space: nowrap; overflow: hidden; max-width: 40%; }
.pb-adv { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; color: var(--mint); min-width: 1.5em; text-align: right; }

.panel {
  position: absolute; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-title { font-size: 1.15rem; }
.turn-status { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(244, 232, 208, 0.06); font-weight: 700; }
.move-list {
  list-style: none; margin: 0; padding: 0 4px 0 0;
  flex: 1; min-height: 60px; overflow-y: auto;
  font-variant-numeric: tabular-nums;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.move-list li { display: grid; grid-template-columns: 2.8em 1fr 1fr; align-items: center; padding: 3px 6px; border-radius: 8px; }
.move-list li:nth-child(odd) { background: rgba(244, 232, 208, 0.04); }
.mv-no { color: var(--text-dim); font-size: 0.9rem; }
.mv { font-family: var(--font-display); font-weight: 500; padding: 1px 6px; border-radius: 6px; }
.mv.is-last { background: rgba(216, 166, 76, 0.25); color: var(--brass-200); }
.move-empty { margin: 0; color: var(--text-dim); font-size: 0.95rem; }
.panel-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.panel-actions .btn { padding: 0.4em 0.4em; font-size: 0.9rem; line-height: 1.15; }

.board-tools { position: absolute; display: flex; gap: 10px; }
.thinking, .banner {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 99px;
  background: var(--surface-strong); border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-weight: 700; white-space: nowrap; z-index: 2;
}
.banner { border-radius: 18px; flex-wrap: wrap; justify-content: center; white-space: normal; max-width: calc(100vw - 24px); }
.banner-actions { display: inline-flex; gap: 8px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--brass-200); animation: dot 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.45; } 40% { transform: translateY(-4px); opacity: 1; } }
.show-results { position: absolute; left: 50%; transform: translateX(-50%); }

/* ---------------------------------------------------------------- dialogs */
.modal-layer {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  background: rgba(4, 16, 19, 0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal {
  width: min(460px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 26px;
  animation: modal-in 0.28s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-wide { width: min(620px, 100%); }
.modal-compact { width: min(400px, 100%); }
.modal h2 { font-size: 1.6rem; margin-bottom: 8px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-head h2 { margin: 0; }
.modal-lead { margin: 0 0 18px; color: var(--text-dim); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal-actions-stack { flex-direction: column; }
.modal-actions-stack .btn { width: 100%; }

.field-label { display: block; font-weight: 700; margin: 14px 0 6px; }
.fieldset { border: 0; padding: 0; margin: 0 0 6px; }
.fieldset legend { padding: 0; }
.input {
  width: 100%; min-height: 50px; padding: 0 14px;
  background: rgba(244, 232, 208, 0.07); border: 1.5px solid var(--line-strong); border-radius: 14px;
  font-size: 1.05rem; color: var(--cream-50);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input:focus { outline: none; border-color: var(--brass-200); background: rgba(244, 232, 208, 0.1); }
.input-code { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.field-hint { margin: 6px 0 0; font-size: 0.9rem; color: var(--text-dim); }
.field-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 97, 112, 0.14); border: 1px solid rgba(255, 97, 112, 0.4); color: #ffd3d7; font-weight: 700; }
.privacy { margin-top: 18px; padding: 14px; border-radius: 14px; background: rgba(244, 232, 208, 0.05); border: 1px solid var(--line); font-size: 0.93rem; }
.privacy p { margin: 0 0 10px; }

.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brass-400); flex: none; }
.range, .select { display: grid; grid-template-columns: 6.5em 1fr; align-items: center; gap: 12px; padding: 8px 0; }
.range input { width: 100%; accent-color: var(--brass-400); height: 30px; }
.select select {
  min-height: 44px; padding: 0 12px; border-radius: 12px;
  background: rgba(244, 232, 208, 0.07); border: 1.5px solid var(--line-strong); color: var(--cream-50);
}
.select select option { background: var(--pine-900); }
.settings-group { padding: 12px 0; border-top: 1px solid var(--line); }
.settings-group:first-of-type { border-top: 0; }
.settings-group h3 { font-size: 1.05rem; color: var(--brass-200); margin-bottom: 4px; }

/* segmented choice (radio pills) */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 16px; background: rgba(244, 232, 208, 0.06); border: 1px solid var(--line); }
.seg-2 { grid-template-columns: 1fr 1fr; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; text-align: center; min-height: 44px; padding: 6px 8px; border-radius: 12px;
  font-family: var(--font-display); font-weight: 600; line-height: 1.15; color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
}
.seg input:checked + span { background: linear-gradient(180deg, var(--brass-200), var(--brass-400)); color: var(--walnut-900); box-shadow: 0 2px 0 var(--brass-600); }
.seg input:focus-visible + span { outline: 3px solid var(--brass-200); outline-offset: 2px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px; background: rgba(244, 232, 208, 0.06); margin-bottom: 6px; }
.tab { min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-family: var(--font-display); font-weight: 600; color: var(--text-dim); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--teal-600); color: var(--cream-50); }

.room-code {
  margin: 4px 0 14px; padding: 18px; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; letter-spacing: 0.08em;
  color: var(--brass-200); border-radius: 18px;
  background: rgba(244, 232, 208, 0.06); border: 1.5px dashed var(--line-strong);
  user-select: all;
}
.lobby-share { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lobby-wait { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px 0 0; color: var(--text-dim); }

.howto h3 { font-size: 1.1rem; color: var(--brass-200); margin: 18px 0 4px; }
.howto h3:first-child { margin-top: 4px; }
.howto p { margin: 0; max-width: 62ch; }

.promo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.promo-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px;
  border-radius: 16px; border: 1.5px solid var(--line-strong); background: rgba(244, 232, 208, 0.06);
  cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.promo-btn:hover { border-color: var(--brass-200); background: rgba(216, 166, 76, 0.16); transform: translateY(-2px); }
.promo-glyph { font-size: 2.5rem; line-height: 1; }
.promo-w .promo-glyph { color: var(--cream-50); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.promo-b .promo-glyph { color: var(--teal-300); }

.results-kicker { margin: 0; color: var(--text-dim); font-family: var(--font-display); font-weight: 500; }
.results-title { font-size: 2.6rem !important; margin: 0 0 16px !important; }
.modal[data-tone="win"] .results-title { color: var(--brass-200); }
.modal[data-tone="loss"] .results-title { color: #ff9aa4; }
.modal[data-tone="draw"] .results-title { color: var(--teal-300); }
.results-table { margin: 0; display: grid; gap: 2px; }
.results-table div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.results-table div:nth-child(odd) { background: rgba(244, 232, 208, 0.05); }
.results-table dt { color: var(--text-dim); }
.results-table dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.results-extra { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------------------------------------------------------- toasts & fatal */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 35;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  padding: 10px 18px; border-radius: 14px;
  background: var(--cream-100); color: var(--walnut-900); font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.25s ease both; text-align: center;
}
.toast-error { background: #ffd9dc; color: #5c0f18; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all 0.3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.fatal {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px; text-align: center; background: var(--pine-950);
}
.fatal h2 { font-size: 1.8rem; color: var(--brass-200); margin-bottom: 12px; }
.fatal p { max-width: 52ch; color: var(--text-dim); }

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