/* ============================================================
   DBOG CALC — XynMacro visual alignment
   Charcoal surfaces and a restrained silver accent, from the Xyn style kit.
   Sidebar tool rail + slim topbar + full-width work surfaces.
   Old multi-theme stylesheet lives in DbogCalc_backup_2026-07-05.
   ============================================================ */

/* ---------- Fonts (local, no CDN) ---------- */
@font-face {
  font-family: "Chakra Petch";
  src: url("assets/fonts/ChakraPetch-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("assets/fonts/ChakraPetch-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("assets/fonts/DMMono-300.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("assets/fonts/DMMono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("assets/fonts/DMMono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-300-800.woff2") format("woff2");
  font-weight: 300 800; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg0: #0d0d10;          /* page */
  --bg1: #15151a;          /* sidebar, drawers */
  --bg2: #191920;          /* cards / surfaces */
  --bg3: #22222a;          /* raised / hover */
  --line: rgba(180, 187, 200, .14);
  --line-soft: rgba(180, 187, 200, .08);
  --ink: #e2e3e7;
  --ink-dim: #9a9da4;
  --ink-faint: #858893;
  --acc: #b4bbc8;          /* Xyn silver */
  --acc-hot: #cbd0da;
  --acc-soft: rgba(180, 187, 200, .13);
  --acc-line: rgba(180, 187, 200, .38);
  --ok: #6bc98e;
  --bad: #e56a7b;
  --ki: #6cb1ef;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-disp: "Inter", system-ui, sans-serif;
  --font-mono: "DM Mono", Consolas, "SFMono-Regular", monospace;
  --r-card: 10px;
  --r-ctl: 10px;
  --sidebar-w: 232px;
  --topbar-h: 54px;
  --pad-card: 18px;
  --shadow-pop: 0 18px 44px rgba(3, 5, 10, .55), 0 0 0 1px var(--line);
}
body.compact-mode { --pad-card: 12px; }

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* faint horizon glow — the one ambient flourish */
body::before {
  content: "";
  position: fixed; inset: auto 0 0 0; height: 42vh;
  background: radial-gradient(58% 100% at 50% 100%, rgba(180, 187, 200, .05), transparent 70%);
  pointer-events: none; z-index: 0;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-disp); font-weight: 600; letter-spacing: .01em; }
p { margin: 0 0 8px; }
a { color: var(--acc-hot); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--ink); font-weight: 600; }
::selection { background: var(--acc-soft); color: var(--acc-hot); }
:focus-visible { outline: 2px solid var(--acc-line); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232a3e; border-radius: 6px; border: 2px solid var(--bg0); }
::-webkit-scrollbar-thumb:hover { background: #2e374f; }

.u-hidden { display: none !important; }
html.theme-switching * { transition: none !important; }

/* ---------- App shell ---------- */
/* NOTE: no z-index here — a stacking context would trap the sidebar
   (z-60) under .nav-overlay (z-55), making drawer clicks hit the overlay */
.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
body.booting .app-shell { opacity: 0; }

/* ---------- Sidebar ---------- */
#main-nav {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg1);
  border-right: 1px solid var(--line-soft);
  z-index: 60;
}

.nav-title-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 16px;
  background: none; border: none; cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.brand-mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, var(--acc-hot), var(--acc) 55%, #b35c1a);
  box-shadow: 0 0 10px rgba(180, 187, 200, .5);
  flex: none;
}
.brand-text {
  font-family: var(--font-disp); font-weight: 700; font-size: 15px;
  letter-spacing: .14em; color: var(--ink);
}
.brand-text em { font-style: normal; color: var(--acc); }
.nav-title-btn:hover .brand-text { color: #fff; }

.nav-tabs {
  flex: 1; overflow-y: auto;
  padding: 12px 10px 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 8px 5px;
}
.tab-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none; border: none; border-radius: var(--r-ctl);
  color: var(--ink-dim);
  font-family: var(--font-body); font-size: 13.5px; font-weight: 500;
  text-align: left; cursor: pointer;
  position: relative;
  transition: background .13s ease, color .13s ease;
}
.tab-btn svg { width: 16px; height: 16px; flex: none; opacity: .75; }
.tab-btn:hover { background: var(--bg3); color: var(--ink); }
.tab-btn.active { background: var(--acc-soft); color: var(--acc-hot); }
.tab-btn.active svg { opacity: 1; }
/* capsule indicator */
.tab-btn.active::before {
  content: "";
  position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--acc); border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(180, 187, 200, .55);
}

.nav-foot {
  border-top: 1px solid var(--line-soft);
  padding: 10px 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.nav-foot-btns { display: flex; align-items: center; gap: 6px; }
.settings-toggle, .audio-toggle, .theme-toggle {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink-dim); font-size: 13px; cursor: pointer;
}
.settings-toggle:hover, .audio-toggle:hover, .theme-toggle:hover {
  color: var(--acc-hot); border-color: var(--acc-line); background: var(--bg3);
}

/* ---------- Main column / topbar ---------- */
.app-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg0) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-spacer { flex: 1; }

.nav-hamburger, .compact-hamburger {
  display: none;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink-dim); cursor: pointer;
}
.nav-hamburger:hover, .compact-hamburger:hover { color: var(--acc-hot); border-color: var(--acc-line); }
.compact-hamburger { position: fixed; top: 10px; left: 10px; z-index: 80; }
body.compact-mode .compact-hamburger { display: inline-flex; }
body.compact-mode .nav-hamburger { display: none; }

.gk-counter {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim);
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 12px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
}
.gk-label { color: var(--acc); font-weight: 500; letter-spacing: .08em; }
#gk-value { color: var(--ink); font-weight: 500; }
.gk-timer { font-size: 11px; color: var(--ink-faint); }

.raw-toggle {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-dim); cursor: pointer;
  user-select: none;
}
.raw-toggle:hover { color: var(--ink); }
.raw-toggle input { accent-color: var(--acc); }

/* ---------- Saves (Builds) dropdown ---------- */
.saves-wrap { position: relative; }
.saves-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: linear-gradient(180deg, var(--acc-hot), var(--acc));
  border: none; border-radius: var(--r-ctl);
  color: #14100a; font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(180, 187, 200, .25);
}
.saves-toggle:hover { background: linear-gradient(180deg, var(--acc-hot), var(--acc)); }
.saves-caret { width: 11px; height: 11px; opacity: .7; flex: none; }
.saves-dropdown {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 0;
  width: 340px; max-width: calc(100vw - 72px); max-height: 62vh; overflow-y: auto;
  background: var(--bg1); border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
  padding: 12px;
  z-index: 70;
}
.saves-dropdown.open, .saves-wrap.open .saves-dropdown { display: block; }
.saves-input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.saves-name-field {
  flex: 1; min-width: 0;
  background: var(--bg0); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); padding: 7px 10px; font-family: var(--font-body); font-size: 13px;
}
.saves-name-field:focus { border-color: var(--acc-line); outline: none; }
.saves-save-btn {
  padding: 7px 14px;
  background: var(--acc); border: none; border-radius: var(--r-ctl);
  color: #14100a; font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.saves-save-btn:hover { background: var(--acc-hot); }
.saves-actions-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.saves-action-btn {
  padding: 5px 10px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink-dim); font-size: 12px; cursor: pointer;
}
.saves-action-btn:hover:not(:disabled) { color: var(--acc-hot); border-color: var(--acc-line); }
.saves-action-btn:disabled { opacity: .4; cursor: default; }
.saves-import-wrap { margin-bottom: 8px; }
.saves-import-field {
  width: 100%; resize: vertical;
  background: var(--bg0); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); padding: 8px 10px; font-family: var(--font-mono); font-size: 12px;
  margin-bottom: 6px;
}
#saves-list { display: flex; flex-direction: column; gap: 6px; }
.saves-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px;
  background: var(--bg2); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
}
.saves-item:hover { border-color: var(--line); }
.saves-item-info { min-width: 0; }
.saves-name { display: block; font-weight: 600; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saves-preview { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.saves-item-actions { display: flex; gap: 4px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.saves-load-btn, .saves-load-b-btn, .saves-load-c-btn, .saves-export-btn, .saves-rename-btn, .saves-del {
  padding: 3px 8px;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 5px;
  color: var(--ink-dim); font-size: 11px; cursor: pointer;
}
.saves-load-btn:hover, .saves-load-b-btn:hover, .saves-load-c-btn:hover,
.saves-export-btn:hover, .saves-rename-btn:hover { color: var(--acc-hot); border-color: var(--acc-line); }
.saves-del:hover { color: var(--bad); border-color: rgba(229, 106, 123, .5); }
.saves-empty { color: var(--ink-faint); font-size: 12.5px; text-align: center; padding: 10px 0; }

/* ---------- Content / pages ---------- */
.content {
  flex: 1;
  width: 100%; margin: 0 auto;
  padding: 26px 26px 40px;
  container-type: inline-size;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panel-in .16s cubic-bezier(.22, .61, .36, 1); }
.tab-panel.tab-leave { animation: panel-out .12s ease forwards; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes panel-out { to { opacity: 0; transform: translateY(-4px); } }

.page-head { margin-bottom: 20px; max-width: 860px; }
.page-eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 4px;
}
.page-head h2 { font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.page-sub { margin-bottom: 0; }

.info-text { color: var(--ink-dim); font-size: 12.5px; line-height: 1.55; }
.subhead {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); margin: 12px 0 6px;
}
.mt-sm { margin-top: 10px; }
.mt-section { margin-top: 22px; }
.mb-md { margin-bottom: 14px; }

footer {
  padding: 26px 0 6px;
  text-align: center;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--ink-faint);
}

/* ---------- Surfaces ---------- */
.center-card, .game-panel, .results-panel {
  background: var(--bg2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: var(--pad-card);
}
.center-card { position: relative; }

/* ---------- Controls (shared) ---------- */
.btn-sm {
  padding: 6px 13px;
  background: var(--bg3); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); font-family: var(--font-body); font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease, transform .14s ease;
}
.btn-sm:hover { border-color: var(--acc-line); color: var(--acc-hot); }
.btn-sm:active, .max-btn:active, .settings-toggle:active, .audio-toggle:active, .settings-close:active { transform: translateY(1px); }
.max-btn {
  padding: 1px 7px; margin-left: 4px;
  background: var(--acc-soft); border: 1px solid var(--acc-line); border-radius: 5px;
  color: var(--acc-hot); font-family: var(--font-mono); font-size: 10px; cursor: pointer;
}
.max-btn:hover { background: var(--acc); color: #14100a; }

.input-full, .inline-input, .select-full, .select-sm,
.race-select, .path-select, .transform-select, .buff-select, .theme-select,
.dcbas-grade-select, .dcbas-mp-goal-select {
  background: var(--bg0);
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink);
  font-family: var(--font-body); font-size: 13px;
  padding: 7px 10px;
  transition: border-color .13s;
}
.input-full { width: 100%; }
.inline-input { width: 84px; padding: 4px 8px; }
input[type="number"] { font-family: var(--font-mono); font-size: 12.5px; }
.input-full:focus, .inline-input:focus, .select-full:focus, .select-sm:focus,
.race-select:focus, .path-select:focus, .transform-select:focus, .buff-select:focus {
  border-color: var(--acc-line); outline: none;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'><path d='M1 1l3.5 3.5L8 1' stroke='%2398a1b6' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
  cursor: pointer;
}
.select-full { width: 100%; }
.select-sm { padding: 5px 26px 5px 9px; font-size: 12.5px; }
input[type="checkbox"] { accent-color: var(--acc); cursor: pointer; }
.field-label { display: block; font-size: 12px; color: var(--ink-dim); margin-bottom: 5px; }
.field-label-inline { font-size: 12.5px; color: var(--ink-dim); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.field-label-stack { margin-top: 4px; display: block; }

/* Slim filled track, small round thumb, 20px pointer/touch height. */
.audio-row { display: flex; align-items: center; gap: 8px; }
.audio-row .audio-slider { flex: 1; min-width: 0; }
.audio-value {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint);
  min-width: 34px; text-align: right; font-variant-numeric: tabular-nums;
}
.audio-slider {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 20px;
  background: none; border: none;
  cursor: pointer;
  --slider-fill: 40%;
}
.audio-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--acc) 0 var(--slider-fill), var(--bg3) var(--slider-fill) 100%);
}
.audio-slider::-moz-range-track {
  height: 4px; border-radius: 2px; background: var(--bg3);
}
.audio-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--acc); }
.audio-slider::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 12px; height: 12px; margin-top: -4px; border-radius: 50%;
  background: var(--ink); border: none;
  box-shadow: 0 1px 3px rgba(3, 5, 10, .55);
  transition: transform .14s ease, background .14s ease;
}
.audio-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ink); border: none;
  box-shadow: 0 1px 3px rgba(3, 5, 10, .55);
  transition: transform .14s ease, background .14s ease;
}
.audio-slider:hover::-webkit-slider-thumb, .audio-slider:active::-webkit-slider-thumb { transform: scale(1.12); }
.audio-slider:hover::-moz-range-thumb, .audio-slider:active::-moz-range-thumb { transform: scale(1.12); }
.audio-slider:focus { outline: none; }
.audio-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--acc-soft), 0 1px 3px rgba(3, 5, 10, .55); }
.audio-slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--acc-soft), 0 1px 3px rgba(3, 5, 10, .55); }
.settings-slider { height: 20px; }

/* Stroked mute / unmute icons swap on state; only one is ever shown. */
.audio-toggle svg { width: 15px; height: 15px; }
.audio-toggle .icon-sound-off, .audio-toggle.is-muted .icon-sound-on { display: none; }
.audio-toggle.is-muted .icon-sound-off { display: block; }
.audio-toggle.is-muted { color: var(--ink-faint); }

/* ---------- Result boxes / big numerals ---------- */
.result-box {
  margin-top: 16px;
  padding: 18px;
  background: var(--bg1);
  border: 1px solid var(--line-soft); border-radius: var(--r-card);
  text-align: center;
  position: relative; overflow: hidden;
}
.result-box::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc-line), transparent);
}
.result-big {
  font-family: var(--font-disp); font-size: 36px; font-weight: 700;
  color: var(--acc-hot); line-height: 1.1;
  text-shadow: 0 0 22px rgba(180, 187, 200, .25);
}
.result-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-faint);
  margin-top: 4px;
}
.result-sub { font-size: 12.5px; color: var(--ink-dim); margin-top: 6px; }

/* ---------- Mini sections ---------- */
.mini-section { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 14px; }
.mini-section-flat { border-top: none; padding-top: 0; }
.mini-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 8px;
}
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 8px; }
.mini-right strong { font-family: var(--font-mono); }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-grid-2 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.mini-field label { display: block; font-size: 12px; color: var(--ink-dim); margin-bottom: 4px; }
.mini-field-end { display: flex; align-items: flex-end; }
.mini-help { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }
.mini-breakdown { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }
.mentor-count { color: var(--ink-faint); font-size: 11px; }

/* ---------- Distribution grids ---------- */
.dist-wrap { margin-top: 12px; }
.dist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.dist-item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-dim); }
.dist-item input {
  background: var(--bg0); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); padding: 6px 8px; font-family: var(--font-mono); font-size: 12.5px; width: 100%;
}
.dist-item input:focus { border-color: var(--acc-line); outline: none; }
.dist-sum { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); margin-top: 8px; }

/* ============================================================
   STATS TAB
   ============================================================ */
.stats-layout { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.game-panel { flex: 0 1 420px; min-width: 340px; }
.results-panel { flex: 1 1 460px; min-width: 320px; }

#tab-stats .compare-panel { display: none; }
#tab-stats.compare-on .compare-panel { display: block; }
.single-wrap { display: block; }
.compare-wrap { display: none; }
#tab-stats.compare-on .single-wrap { display: none; }
#tab-stats.compare-on .compare-wrap { display: block; }
.only-compare { display: none; }
#tab-stats.compare-on .only-compare { display: block; }

.game-panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-disp); font-weight: 700; font-size: 15px;
  color: #fff;
}
.power-level {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink-dim);
}
.power-level span, #pl-a, #pl-b { color: var(--acc-hot); font-weight: 500; }
.panel-level-display { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); display: flex; align-items: center; gap: 5px; }
.level-input { width: 70px; }
.pl-detail { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); margin-bottom: 10px; }

.game-panel-subheader {
  display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.stat-rows { display: flex; flex-direction: column; }
.stat-row {
  display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 8px; align-items: center;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .2s;
}
.stat-row.flash { background: var(--acc-soft); }
.stat-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.stat-sp input, .sp-input {
  width: 100%;
  background: var(--bg0); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); padding: 5px 8px; font-family: var(--font-mono); font-size: 12.5px;
}
.sp-input:focus { border-color: var(--acc-line); outline: none; }
.stat-output {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--acc-hot); text-align: right;
  transition: color .2s;
}
.stat-output.changed { color: #fff; }

.game-panel-footer { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.footer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-dim); }
.footer-row label { flex: none; }
.footer-row select { flex: 1; min-width: 110px; }
.race-passive-info, .path-info { font-size: 11.5px; color: var(--ink-faint); }
.path-buff-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-dim); }
.max-label { font-size: 12px; color: var(--ink-dim); display: inline-flex; align-items: center; gap: 5px; }
.buff-section {
  margin-top: 6px; padding: 10px;
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  display: flex; flex-direction: column; gap: 7px;
}
.buff-desc { font-size: 11px; color: var(--ink-faint); }
.stat-cap-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim);
  padding: 8px 10px;
  background: var(--bg1); border-radius: var(--r-ctl);
}
.stat-cap-row strong { color: var(--acc-hot); font-weight: 500; }
.sp-lock-label { font-family: var(--font-body); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.dr-row { font-size: 12.5px; color: var(--ink-dim); display: flex; gap: 10px; flex-wrap: wrap; }
.dr-sources { font-size: 11px; color: var(--ink-faint); }
.rounding-note { font-size: 11px; color: var(--ink-faint); margin: 2px 0 0; }

.traits-section { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 14px; }
.traits-header { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--acc); margin-bottom: 8px; }
.traits-sub { text-transform: none; letter-spacing: 0; color: var(--ink-faint); font-size: 11px; }
.trait-rows { display: flex; flex-direction: column; gap: 4px; }
.trait-row { display: flex; align-items: center; gap: 8px; }
.trait-name { flex: 1; font-size: 12.5px; color: var(--ink-dim); }
.trait-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--bg0);
  cursor: pointer;
  transition: all .13s;
}
.trait-dot:hover { border-color: var(--acc-line); }
.trait-dot.filled {
  background: radial-gradient(circle at 35% 32%, var(--acc-hot), var(--acc) 60%, #b35c1a);
  border-color: var(--acc);
  box-shadow: 0 0 6px rgba(180, 187, 200, .5);
}
.trait-bonus { font-family: var(--font-mono); font-size: 12px; color: var(--acc-hot); min-width: 52px; text-align: right; }
.traits-total { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); margin-top: 8px; }
.traits-total strong { color: var(--acc-hot); }

.move-result { font-size: 13.5px; color: var(--ink-dim); margin-top: 10px; }
.move-result strong { font-family: var(--font-mono); color: var(--acc-hot); font-size: 15px; }

/* ---------- Results panel ---------- */
.results-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.results-header h3 { font-size: 16px; color: #fff; }
.compare-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
#tab-stats.compare-on .compare-cols { grid-template-columns: 1fr 1fr; }

.breakdown-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.breakdown-card {
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  padding: 10px 12px;
}
.bc-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.bc-value { font-family: var(--font-disp); font-size: 19px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.bc-sub { font-size: 11px; color: var(--ink-faint); }
.bc-mult { font-family: var(--font-mono); font-size: 11px; color: var(--acc-hot); }
.bc-mult-detail { font-size: 10.5px; color: var(--ink-faint); }
.bc-full { font-family: var(--font-mono); font-size: 12px; color: var(--acc-hot); margin-top: 2px; }

.diff-grid { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.diff-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 5px 10px;
  background: var(--bg1); border-radius: 6px;
}
.d-label { color: var(--ink-dim); font-family: var(--font-body); }
.d-val { color: var(--ink); }
.d-val.pos, .d-val[data-sign="pos"] { color: var(--ok); }
.d-val.neg, .d-val[data-sign="neg"] { color: var(--bad); }
.d-sub { font-size: 11px; color: var(--ink-faint); }

.internals-grid { display: flex; flex-direction: column; gap: 3px; }
.internal-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-mono); font-size: 12px;
  padding: 4px 10px;
  background: var(--bg1); border-radius: 6px;
  color: var(--ink-dim);
}
.race-info { font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; }

.fusion-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.fusion-inline .select-full { max-width: 260px; }
.fusion-results { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.fusion-result-row, .fusion-pl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 5px 10px;
  background: var(--bg1); border-radius: 6px;
}
.fusion-pl-row { border: 1px solid var(--acc-line); }
.fr-label { color: var(--ink-dim); font-family: var(--font-body); }
.fr-value { color: var(--acc-hot); }
.fusion-result-sub { font-size: 11.5px; color: var(--ink-faint); padding: 2px 10px; }
.fpe-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  padding: 1px 6px; border-radius: 4px;
  background: var(--acc-soft); color: var(--acc-hot);
}

/* ============================================================
   TRAITS TAB
   ============================================================ */
.trait-preset-row { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 14px; }
.trait-wildcard-group { margin-top: 10px; }
.trait-wildcard-checks { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--ink-dim); }
.trait-wildcard-checks label { display: inline-flex; align-items: center; gap: 5px; }
.trait-time-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.trait-time-stat {
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  padding: 12px; text-align: center;
  display: flex; flex-direction: column; gap: 3px;
}
.trait-time-stat span { font-family: var(--font-disp); font-size: 19px; font-weight: 700; color: var(--acc-hot); }
.trait-time-stat small { font-size: 11px; color: var(--ink-faint); }

/* ============================================================
   BOSS TAB
   ============================================================ */
.boss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.boss-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.boss-stat {
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  padding: 14px; text-align: center;
  display: flex; flex-direction: column; gap: 3px;
  position: relative; overflow: hidden;
}
.boss-stat::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc-line), transparent);
}
.boss-stat span { font-family: var(--font-disp); font-size: 22px; font-weight: 700; color: var(--acc-hot); }
.boss-stat small { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.boss-duration-section { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 14px; }
.boss-duration-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.boss-duration-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.boss-dur-stat label { display: block; font-size: 12px; color: var(--ink-dim); margin-bottom: 4px; }
.boss-dur-input {
  width: 100%;
  background: var(--bg0); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--acc-hot); padding: 7px 10px; font-family: var(--font-mono); font-size: 13px;
}
.boss-dur-input:focus { border-color: var(--acc-line); outline: none; }

/* ============================================================
   MOVES TAB
   ============================================================ */
.move-search-row { margin-bottom: 10px; }
.move-filters-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.move-cat-dropdown-wrap { position: relative; }
.move-cat-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 170px;
  background: var(--bg1); border-radius: var(--r-ctl);
  box-shadow: var(--shadow-pop);
  padding: 10px 12px;
  z-index: 40;
}
.move-cat-menu.open { display: flex; flex-direction: column; gap: 6px; }
.cat-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-dim); cursor: pointer; }
.cat-check:hover { color: var(--ink); }
.move-dmgtype-filter { display: flex; align-items: center; gap: 7px; }
.filter-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.move-status { text-align: center; padding: 20px; }
.move-browser { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.move-accordion { display: flex; flex-direction: column; gap: 6px; max-height: 64vh; overflow-y: auto; padding-right: 4px; }
.move-item {
  flex: none; /* overflow:hidden zeroes min-height; without this the column flex squeezes all items into the viewport */
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  overflow: hidden;
  transition: border-color .13s;
}
.move-item:hover { border-color: var(--line); }
.move-item.open { border-color: var(--acc-line); }
.move-item-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 9px 12px; cursor: pointer;
  background: none; border: none;
  font-family: var(--font-body);
  text-align: left;
}
.move-item-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.move-item.open .move-item-name { color: var(--acc-hot); }
.move-item-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.move-item-tags span {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg3); color: var(--ink-dim);
}
.move-item-stats { display: flex; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.move-item-stats strong { color: var(--acc-hot); font-weight: 500; }
.move-item-body { display: none; padding: 0 12px 10px; font-size: 12.5px; color: var(--ink-dim); }
.move-item.open .move-item-body { display: block; }
.move-empty { text-align: center; color: var(--ink-faint); padding: 18px; font-size: 12.5px; }
.move-preview {
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--r-card);
  padding: 14px;
  position: sticky; top: calc(var(--topbar-h) + 16px);
}
.move-preview-empty { color: var(--ink-faint); font-size: 12.5px; text-align: center; padding: 24px 6px; }
.move-preview h3 { font-size: 15px; color: #fff; margin-bottom: 6px; }
.move-preview-media { margin-top: 10px; }
.move-use-quick { margin-top: 10px; }
.move-use-note { margin-top: 10px; }
.move-preview-media img, .move-preview-media video { max-width: 100%; border-radius: var(--r-ctl); display: block; }
.move-preview-media iframe {
  width: 100%; aspect-ratio: 16 / 9; border: none;
  border-radius: var(--r-ctl); display: block; background: var(--bg0);
}
.move-preview-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.move-preview-meta span {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg3); color: var(--ink-dim);
}
.move-preview-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0 10px; }
.move-preview-stats > div {
  background: var(--bg2); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
  padding: 7px 9px;
  display: flex; flex-direction: column; gap: 1px;
}
.move-preview-stats strong { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--acc-hot); }
.move-preview-stats small { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.move-preview-desc { font-size: 12.5px; color: var(--ink-dim); }
.move-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); text-align: right; margin-top: 8px; }

/* ============================================================
   DCBAS TAB
   ============================================================ */
.dcbas-grid { display: flex; flex-direction: column; gap: 6px; }
.dcbas-row, .dcbas-mp-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg1); border: 1px solid var(--line-soft); border-radius: var(--r-ctl);
}
.dcbas-name { flex: 1; min-width: 110px; font-weight: 600; font-size: 13px; color: var(--ink); }
.dcbas-grade-select, .dcbas-mp-goal-select { width: 130px; }
.dcbas-effect { font-family: var(--font-mono); font-size: 11.5px; color: var(--acc-hot); }
.dcbas-mp-perf { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); }
.dcbas-mp-goal { font-size: 12px; color: var(--ink-dim); }
.dcbas-mp-cost { font-family: var(--font-mono); font-size: 12px; color: var(--acc-hot); margin-left: auto; }
.dcbas-mp-result { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-dim); }
.dcbas-mp-result strong { color: var(--acc-hot); font-size: 16px; }
.dcbas-methods { display: flex; flex-direction: column; gap: 4px; }
.dcbas-method-row {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 12.5px; color: var(--ink-dim);
  padding: 5px 10px;
  background: var(--bg1); border-radius: 6px;
}

/* ============================================================
   TRAINING TAB
   ============================================================ */
.trait-calc-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.trait-calc-grid-2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ============================================================
   METEOR TAB
   ============================================================ */
.meteor-card { max-width: 760px; }
.meteor-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.meteor-player-count { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-dim); margin-left: auto; }
.meteor-player-count strong { color: var(--acc-hot); }
.meteor-players { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.meteor-player-row { display: flex; align-items: center; gap: 10px; }
.meteor-player-label { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); min-width: 74px; }
.meteor-results { margin-top: 14px; display: flex; flex-direction: column; gap: 3px; }
.meteor-result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--ink-dim);
  padding: 7px 12px;
  background: var(--bg1); border-radius: var(--r-ctl);
}
.meteor-result-row strong { font-family: var(--font-mono); color: var(--ink); }
.meteor-final { border: 1px solid var(--acc-line); }
.meteor-final strong { color: var(--acc-hot); font-size: 16px; }
.meteor-breakdown { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); }
.meteor-bd-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 12px; }

/* ============================================================
   FAQ TAB
   ============================================================ */
.faq-card { max-width: 900px; }
.guide-note { margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg1); }
.guide-note summary { padding: 12px 16px; cursor: pointer; font-size: 13px; font-weight: 600; }
.guide-note summary span { margin-left: 12px; color: var(--ink-dim); font-weight: 400; }
.guide-note[open] summary { border-bottom: 1px solid var(--line); }
.guide-note-body { max-width: 850px; padding: 4px 16px 16px; color: var(--ink-dim); font-size: 13px; }
.guide-note-body strong { color: var(--ink); }
.guide-library { max-width: 1100px; margin-bottom: 28px; }
.guide-library-head { padding: 22px 0; border-top: 1px solid var(--line); }
.source-tag, .guide-index { color: var(--ink-dim); font: 11px var(--font-mono); letter-spacing: .04em; }
.guide-library-head h3 { font-size: 23px; font-weight: 600; margin: 10px 0 8px; letter-spacing: -.03em; }
.guide-library-head p { max-width: 760px; color: var(--ink-dim); font-size: 13px; margin: 0; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.guide-card { min-width: 0; padding: 22px; background: var(--bg1); border: 1px solid var(--line); border-radius: var(--r-card); }
.guide-card h3 { font-size: 17px; margin: 12px 0; }
.guide-card p { color: var(--ink-dim); font-size: 13px; line-height: 1.65; }
.guide-card a, .guide-note a { font-size: 12px; text-underline-offset: 4px; }
.guide-links { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 20px; }
.ratio-list { margin: 16px 0; }
.ratio-list > div { display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line-soft); padding: 7px 0; font-size: 12px; }
.ratio-list code { color: var(--ink); font: 13px var(--font-mono); }
.ratio-list span { color: var(--ink-dim); }
.guide-card .guide-caption { font-size: 12px; }
.guide-status { border-left: 2px solid var(--acc-line); padding: 4px 16px; margin-top: 22px; }
.guide-status p { margin: 6px 0; color: var(--ink-dim); font-size: 12px; }
.formula-faq-title { margin: 0 0 10px; font-size: 16px; }
@media (max-width: 700px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { padding: 18px; }
  .guide-note summary span { display: block; margin: 5px 0 0 17px; }
}
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-q {
  padding: 12px 4px;
  font-weight: 600; font-size: 13.5px; color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: color .13s;
}
.faq-q::after {
  content: "+";
  font-family: var(--font-mono); font-size: 15px; color: var(--ink-faint);
  transition: transform .18s ease, color .13s;
}
.faq-q:hover { color: var(--acc-hot); }
.faq-item.open .faq-q { color: var(--acc-hot); }
.faq-item.open .faq-q::after { transform: rotate(45deg); color: var(--acc); }
.faq-a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .22s ease;
}
.faq-a > span { overflow: hidden; font-size: 13px; color: var(--ink-dim); line-height: 1.65; }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-item.open .faq-a > span { padding-bottom: 14px; }
.resources-title { margin-top: 26px; font-size: 18px; color: #fff; }
.resource-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.resource-links a {
  padding: 7px 14px;
  background: var(--bg1); border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-dim); font-size: 12.5px; font-weight: 500;
  transition: color .13s, border-color .13s;
}
.resource-links a:hover { color: var(--acc-hot); border-color: var(--acc-line); text-decoration: none; }

/* ============================================================
   HOME SCREEN (launcher)
   ============================================================ */
.home-screen {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg0);
  overflow-y: auto;
  opacity: 1; visibility: visible;
  transition: opacity .3s ease, visibility .3s;
}
.home-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.home-ambient {
  position: absolute; inset: 0;
  background:
    radial-gradient(46% 38% at 72% 10%, rgba(180, 187, 200, .09), transparent 70%),
    radial-gradient(52% 44% at 18% 88%, rgba(108, 177, 239, .05), transparent 70%);
  pointer-events: none;
}
.home-content {
  position: relative;
  max-width: 880px; margin: 0 auto;
  padding: 11vh 28px 60px;
}
.home-kicker {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 14px;
}
.home-title {
  font-family: var(--font-disp);
  font-size: clamp(30px, 5vw, 46px); font-weight: 700; line-height: 1.12;
  color: #fff;
  margin: 0 0 14px;
}
.home-subtitle { font-size: 15.5px; color: var(--ink-dim); max-width: 560px; margin-bottom: 26px; }
.home-actions { display: flex; gap: 10px; margin-bottom: 40px; }
.home-btn {
  padding: 11px 22px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink); font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color .13s, color .13s, background .13s;
}
.home-btn:hover { border-color: var(--acc-line); color: var(--acc-hot); }
.home-btn-primary {
  background: linear-gradient(180deg, var(--acc-hot), var(--acc));
  border: none; color: #14100a;
  box-shadow: 0 4px 18px rgba(180, 187, 200, .3);
}
.home-btn-primary:hover { background: linear-gradient(180deg, var(--acc-hot), var(--acc)); color: #14100a; }
.home-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 26px; }
.home-preview-card {
  background: var(--bg2); border: 1px solid var(--line-soft); border-radius: var(--r-card);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.home-preview-card:hover { border-color: var(--acc-line); transform: translateY(-2px); }
.home-preview-card h3 { font-size: 14.5px; color: var(--ink); margin: 10px 0 4px; }
.home-preview-card p { font-size: 12.5px; color: var(--ink-dim); margin: 0; }
.home-preview-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg0);
  border-radius: var(--r-ctl);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.home-preview-img { width: 100%; height: 100%; object-fit: cover; display: none; }
.home-preview-img.loaded { display: block; }
.home-preview-img.loaded + .home-preview-fallback { display: none; }
.home-preview-fallback {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em;
  color: var(--ink-faint);
}
.home-note { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

/* ============================================================
   LOADING SHELL
   ============================================================ */
.loading-shell {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg0);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; visibility: visible;
  transition: opacity .28s ease, visibility .28s;
}
.loading-shell.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-core { text-align: center; width: 240px; }
.loading-logo {
  font-family: var(--font-disp); font-weight: 700; font-size: 22px;
  letter-spacing: .16em; color: #fff;
  margin-bottom: 18px;
}
.loading-logo span { color: var(--acc); }
.loading-bar {
  height: 3px; border-radius: 2px;
  background: var(--bg3);
  overflow: hidden;
  margin-bottom: 12px;
}
.loading-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--acc), var(--acc-hot));
  border-radius: 2px;
  transition: width .2s ease;
}
.loading-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-faint); }

/* ============================================================
   SETTINGS DRAWER
   ============================================================ */
.settings-overlay, .nav-overlay, .tour-overlay {
  position: fixed; inset: 0; z-index: 75;
  background: rgba(4, 6, 11, .6);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, visibility .2s;
}
.settings-overlay.open, .nav-overlay.open, .tour-overlay.open {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.nav-overlay { z-index: 55; }

.settings-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 85;
  width: min(360px, 92vw);
  background: var(--bg1);
  border-left: 1px solid var(--line-soft);
  box-shadow: -18px 0 44px rgba(3, 5, 10, .5);
  transform: translateX(102%);
  transition: transform .18s cubic-bezier(.22, .61, .36, 1);
  overflow-y: auto;
  padding: 18px 20px 26px;
}
.settings-drawer.open { transform: none; }
.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.settings-head h3 { font-size: 16px; color: #fff; }
.settings-close {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink-dim); font-size: 12px; cursor: pointer;
}
.settings-close:hover { color: var(--bad); border-color: rgba(229, 106, 123, .5); }
.settings-grid { display: flex; flex-direction: column; gap: 8px; }
.settings-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--acc);
  margin-top: 12px;
}
.settings-label:first-child { margin-top: 0; }
.settings-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-dim); cursor: pointer; }
.settings-preset-actions { display: flex; gap: 8px; }
.settings-preset-field { resize: vertical; font-family: var(--font-mono); font-size: 11.5px; }

/* ============================================================
   TOUR MODAL
   ============================================================ */
.tour-modal {
  position: fixed; right: 20px; bottom: 20px; z-index: 86;
  width: min(380px, calc(100vw - 40px));
  background: var(--bg1);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
  padding: 16px 18px;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.tour-modal.open { opacity: 1; visibility: visible; transform: none; }
.tour-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tour-head h3 { font-size: 15px; color: #fff; }
.tour-body { font-size: 13px; color: var(--ink-dim); line-height: 1.6; min-height: 44px; }
.tour-progress { display: flex; gap: 5px; margin: 10px 0; }
.tour-progress span, .tour-progress .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg3);
}
.tour-progress .active, .tour-progress span.on { background: var(--acc); box-shadow: 0 0 6px rgba(180, 187, 200, .5); }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; }
[data-tour-highlight] {
  outline: 2px solid var(--acc-line);
  outline-offset: 3px;
  border-radius: var(--r-ctl);
}

/* ============================================================
   DEV HUD
   ============================================================ */
.dev-panel {
  position: fixed; right: 14px; bottom: 14px; z-index: 95;
  width: 280px;
  background: var(--bg1);
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  box-shadow: var(--shadow-pop);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-dim);
}
.dev-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--acc); letter-spacing: .12em; text-transform: uppercase; font-size: 10px;
}
.dev-body { padding: 8px 10px; max-height: 260px; overflow-y: auto; white-space: pre-wrap; }
.dev-actions { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line-soft); }
.dev-actions button {
  flex: 1; padding: 4px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 5px;
  color: var(--ink-dim); font-family: var(--font-mono); font-size: 10.5px; cursor: pointer;
}
.dev-actions button:hover { color: var(--acc-hot); border-color: var(--acc-line); }
.dev-hint { padding: 4px 10px 8px; font-size: 10px; color: var(--ink-faint); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  #main-nav {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    transform: translateX(-103%);
    transition: transform .22s ease;
    box-shadow: 18px 0 44px rgba(3, 5, 10, .5);
  }
  #main-nav:has(.nav-tabs.open), #main-nav.sidebar-open { transform: none; }
  .nav-hamburger { display: inline-flex; }
}

@media (max-width: 900px) {
  .content { padding: 18px 14px 32px; }
  .stats-layout { flex-direction: column; }
  .game-panel, .results-panel { flex: 1 1 auto; width: 100%; min-width: 0; }
  .move-browser { grid-template-columns: 1fr; }
  .move-preview { position: static; }
  #tab-stats.compare-on .compare-cols { grid-template-columns: 1fr; }
  .trait-preset-row { grid-template-columns: auto 1fr; }
  .topbar { padding: 0 14px; gap: 10px; }
  .gk-timer { display: none; }
}

@media (max-width: 560px) {
  .saves-dropdown { width: calc(100vw - 28px); }
  .home-actions { flex-direction: column; }
  .boss-duration-row { grid-template-columns: 1fr; }
}

/* compact mode: sidebar becomes toggled overlay at every width */
body.compact-mode .app-shell { grid-template-columns: 1fr; }
body.compact-mode #main-nav {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  transform: translateX(-103%);
  transition: transform .22s ease;
  box-shadow: 18px 0 44px rgba(3, 5, 10, .5);
}
body.compact-mode #main-nav.sidebar-open,
body.compact-mode #main-nav:has(.nav-tabs.open) { transform: none; }
body.compact-mode .topbar { padding-left: 54px; }
body.compact-mode .content { padding: 14px 12px 28px; }

/* ---------- Motion ---------- */
/* Respond to usable workspace width, including compact navigation and zoom. */
body { --workspace-max: 1560px; --workspace-padding: 26px; --workspace-gap: 18px; }
body[data-workspace="compact"] { --workspace-max: 1280px; --workspace-padding: 18px; --workspace-gap: 14px; }
body[data-workspace="spacious"] { --workspace-max: none; --workspace-padding: 30px; --workspace-gap: 22px; }
body .content, body.compact-mode .content { max-width: var(--workspace-max); margin-inline: auto; padding: var(--workspace-padding) var(--workspace-padding) 40px; }
.stats-layout { gap: var(--workspace-gap); }
.gk-counter { white-space: nowrap; }
@media (max-width: 900px) {
  body .content, body.compact-mode .content { padding: 18px 12px 28px; }
}
.build-core, .build-extras, .stats-layout > * { min-width: 0; }
.guide-note-body p, .race-info, .move-preview-desc, .faq-card p { max-width: 75ch; }
.guide-library { max-width: none; }
.source-review { max-width: 1100px; }
#move-transfer-status:empty { display: none; }
.move-item-name { overflow-wrap: anywhere; }
.move-status { overflow-wrap: anywhere; }
.results-header { flex-wrap: wrap; gap: 10px; }
@container (min-width: 860px) {
  .stats-layout { display: grid; grid-template-columns: minmax(340px, 560px) minmax(0, 1fr); }
  #tab-stats.compare-on .stats-layout { grid-template-columns: minmax(0, 1fr); }
  .game-panel, .results-panel { width: auto; }
}
@container (min-width: 1120px) {
  #tab-stats.compare-on .stats-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); }
  .move-browser { grid-template-columns: minmax(0, 1fr) minmax(300px, .42fr); }
}
@container (min-width: 1120px) {
  body[data-stats-layout="side-by-side"] #tab-stats:not(.compare-on) .stats-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  body[data-stats-layout="side-by-side"] #tab-stats:not(.compare-on) #panel-a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
  body[data-stats-layout="side-by-side"] #tab-stats:not(.compare-on) .build-extras { border-left: 1px solid var(--line-soft); padding-left: 20px; }
  body[data-stats-layout="side-by-side"] #tab-stats:not(.compare-on) .build-extras > .mini-section:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
}
@container (min-width: 1500px) {
  .guide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .move-accordion { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; align-content: start; max-height: calc(100dvh - 340px); }
}

@media (prefers-reduced-motion: reduce) {
  .audio-slider::-webkit-slider-thumb { transition: none; transform: none; }
  .audio-slider::-moz-range-thumb { transition: none; transform: none; }
  .btn-sm:active, .max-btn:active, .settings-toggle:active, .audio-toggle:active, .settings-close:active { transform: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* The style-kit focus colour stays visible against every charcoal surface. */
:focus-visible { outline-color: var(--acc); }

/* ---------- Optional extras (Settings > Extras) ---------- */
[hidden] { display: none !important; }
body.simple-view .adv-only { display: none !important; }

.x-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}

/* Live HUD pill, XynMacro's compact HUD shape */
.x-hud {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 14px;
  padding: 7px 8px 7px 14px; max-width: calc(100vw - 24px);
  background: color-mix(in srgb, var(--bg1) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-pop);
  font-size: 12px; color: var(--ink-dim); white-space: nowrap;
  animation: x-rise .18s ease-out;
}
.x-hud b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.x-hud b.x-neg { color: var(--bad); }
.x-hud-top {
  width: 28px; height: 28px; display: grid; place-items: center; flex: none;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 50%; color: var(--ink); cursor: pointer;
}
.x-hud-top:hover { border-color: var(--acc-line); }
@keyframes x-rise { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 420px) { .x-hud { gap: 10px; font-size: 11px; } .x-hud-dmg { display: none; } }

/* Xyn shell: rounded framed app with a quiet status footer */
.x-status {
  position: sticky; bottom: 0; z-index: 40; margin-top: auto;
  display: flex; align-items: center; gap: 14px; min-height: 30px; padding: 6px 22px;
  background: color-mix(in srgb, var(--bg1) 90%, transparent); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
}
.x-status > span:not(.x-dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-status-spacer { flex: 1; }
.x-status.x-warn .x-dot { background: #d9b45a; box-shadow: 0 0 0 3px rgba(217, 180, 90, .18); }
@media (min-width: 901px) {
  body.x-shell { background: #07070a; }
  body.x-shell .app-shell {
    margin: 10px; min-height: calc(100vh - 20px);
    border: 1px solid var(--line); border-radius: 14px; overflow: clip; background: var(--bg0);
  }
  body.x-shell #main-nav { top: 10px; height: calc(100vh - 20px); }
  body.x-shell .topbar { top: 10px; }
  body.x-shell .x-status { bottom: 10px; }
}
@media (max-width: 600px) { .x-status [data-status="cap"] { display: none; } .x-status { padding: 6px 14px; } }

/* Quick search */
.x-search-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-ctl);
  color: var(--ink-dim); font: 12px var(--font-body); cursor: pointer;
}
.x-search-btn:hover { color: var(--ink); border-color: var(--acc-line); }
.x-search-btn kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint);
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px;
}
@media (max-width: 600px) { .x-search-btn span, .x-search-btn kbd { display: none; } }
.x-palette {
  position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 12px 12px; background: rgba(5, 5, 8, .55); backdrop-filter: blur(3px);
}
.x-palette-box {
  width: min(560px, 100%); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--bg1); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop);
  overflow: hidden; animation: x-drop .16s ease-out;
}
@keyframes x-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.x-palette-input {
  border: none; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--ink);
  font: 15px var(--font-body); padding: 16px 18px; outline: none;
}
.x-palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.x-palette-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 13px;
}
.x-palette-item small { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.x-palette-item.active { background: var(--bg3); box-shadow: inset 2px 0 0 var(--acc); }
.x-palette-empty { padding: 14px 12px; color: var(--ink-faint); font-size: 13px; }
.x-palette-foot {
  display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint);
}
@media (hover: none) { .x-palette-foot { display: none; } }
@media (prefers-reduced-motion: reduce) { .x-hud, .x-palette-box { animation: none; } }
/* The search button needs the room on small phones; Raw math stays available in Settings. */
@media (max-width: 460px) { body.x-search-on .topbar .raw-toggle { display: none; } }
body.x-shell .x-hud { bottom: 46px; }
@media (min-width: 901px) { body.x-shell .x-hud { bottom: 54px; } }
.combo-warn { color: #d9b45a; font-size: 12px; margin: 2px 0 6px; }
