/* fps.zmirburger.com — styles.css
   Dark-first gaming dashboard. Mobile-first, 375px+, no horizontal scroll. */

:root {
  --bg: #0b0d10;
  --bg-elev: #12151a;
  --card: #171b21;
  --card-2: #1d222a;
  --border: #262b33;
  --text: #e8eaed;
  --text-dim: #9aa0a6;
  --text-dimmer: #6b7280;
  --link: #7aa2e8;

  --cassidy: #d9822b;
  --ashe: #c23b3b;
  --soldier: #4a78c2;
  --bastion: #6b8e4e;
  --sojourn: #9aa0a6;

  --danger: #e5484d;
  --success: #3fb950;
  --warning: #d29922;
  --info: #4a78c2;

  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --maxw: 900px;

  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-2: #eef0f3;
  --border: #dde1e7;
  --text: #14161a;
  --text-dim: #545b66;
  --text-dimmer: #7b828d;
  --link: #2454b8;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f7;
    --bg-elev: #ffffff;
    --card: #ffffff;
    --card-2: #eef0f3;
    --border: #dde1e7;
    --text: #14161a;
    --text-dim: #545b66;
    --text-dimmer: #7b828d;
    --link: #2454b8;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
@media (min-width: 720px) {
  body { padding-bottom: 0; }
}

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.2; }
p { margin: 0 0 10px; }
a { color: var(--link); }
button, input, select, textarea { font-family: inherit; font-size: 1rem; color: inherit; }

.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------------------------------------------------------------- layout */
.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gutter);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.nav-links { display: none; gap: 4px; flex: 1; }
@media (min-width: 720px) {
  .nav-links { display: flex; }
}
.nav-links a, .icon-btn {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-links a:hover { background: var(--card-2); color: var(--text); }
.nav-links a.active { color: var(--text); background: var(--card-2); }
.icon-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.icon-btn:hover { background: var(--card-2); }

main#view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--gutter);
}

.bottom-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
@media (min-width: 720px) {
  .bottom-tabs { display: none; }
}
.bottom-tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 2px;
  min-height: 56px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
}
.bottom-tabs a .ic { font-size: 18px; line-height: 1; }
.bottom-tabs a.active { color: var(--text); }

/* ---------------------------------------------------------------- focus */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- basics */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2, .card h3 { margin-top: 0; }
.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dimmer);
  margin: 0 0 6px;
  font-weight: 700;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--text-dim); }
select, input[type="text"], input[type="number"], textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  min-height: 44px;
}
textarea { min-height: 72px; resize: vertical; }
input[type="range"] { width: 100%; height: 44px; }
input[type="checkbox"] { width: 20px; height: 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--link); border-color: var(--link); color: #06101f; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #200; }
.btn-success { background: var(--success); border-color: var(--success); color: #041; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-2);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 40px;
}
.chip.active { background: var(--link); border-color: var(--link); color: #06101f; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge-claude { color: #b98be8; border-color: #6a4a8c; }
.badge-changed { color: var(--warning); border-color: var(--warning); cursor: help; }
.badge-you { font-size: 0.68rem; }
.badge-you.main { color: var(--success); border-color: var(--success); }
.badge-you.learning { color: var(--warning); border-color: var(--warning); }
.badge-you.comfortable { color: var(--info); border-color: var(--info); }
.badge-you.notinpool { color: var(--text-dimmer); }
.badge.verify { color: var(--warning); border-color: var(--warning); cursor: pointer; }

.pill { padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; display: inline-block; }
.pill-critical { background: rgba(229,72,77,0.18); color: #ff8a8d; }
.pill-high { background: rgba(210,153,34,0.18); color: #f0b940; }
.pill-medium { background: rgba(74,120,194,0.18); color: #86b0ec; }
.pill-low { background: rgba(155,155,155,0.15); color: var(--text-dim); }

.note {
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 8px;
}
.note.warn { border-color: var(--warning); color: var(--warning); background: rgba(210,153,34,0.08); }

/* hero accent */
.hero-cassidy { --hero: var(--cassidy); }
.hero-ashe { --hero: var(--ashe); }
.hero-soldier { --hero: var(--soldier); }
.hero-bastion { --hero: var(--bastion); }
.hero-sojourn { --hero: var(--sojourn); }

.hero-card {
  border-left: 4px solid var(--hero, var(--border));
}
.hero-name { color: var(--hero, var(--text)); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.88rem; vertical-align: top; }
th { color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--card-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }

details.collapsible { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); margin-bottom: 14px; }
details.collapsible summary { padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
details.collapsible summary::-webkit-details-marker { display: none; }
details.collapsible summary::before { content: '▸'; transition: transform 0.15s; }
details.collapsible[open] summary::before { transform: rotate(90deg); }
details.collapsible .body { padding: 0 14px 14px; }

.result-card { border-left: 6px solid var(--hero, var(--link)); }
.primary-hero-name { font-size: 1.7rem; font-weight: 800; margin: 0; }
.primary-hero-meta { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin-top: 10px; font-size: 0.92rem; }
.kv dt { color: var(--text-dimmer); font-weight: 600; }
.kv dd { margin: 0; }

.progress-bar { height: 10px; border-radius: 999px; background: var(--card-2); overflow: hidden; border: 1px solid var(--border); }
.progress-bar > span { display: block; height: 100%; background: var(--link); }
.gate-row { margin-bottom: 16px; }
.gate-row .gate-label { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 4px; }
.gate-row .gate-then { font-size: 0.8rem; color: var(--text-dimmer); margin-top: 4px; }

/* ---------------------------------------------------------------- train */
.timeline { display: flex; gap: 3px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); margin: 10px 0; }
.timeline .blk { min-width: 3px; padding: 8px 4px; font-size: 0.68rem; text-align: center; color: #06101f; font-weight: 700; }
.timeline .blk.setup { color: var(--text); background: var(--card-2); flex: 0 0 auto; padding: 8px 10px; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; }
.timeline-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

.train-run {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.train-topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.session-progress { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.session-progress > span { display: block; height: 100%; background: var(--hero, var(--link)); transition: width 0.3s linear; }

.now-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 24px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--hero, var(--border));
  background: var(--card);
}
.now-label { font-size: 0.85rem; letter-spacing: 0.14em; color: var(--text-dimmer); font-weight: 800; text-transform: uppercase; }
.now-timer {
  font-size: clamp(3.2rem, 16vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: var(--hero, var(--text));
}
.now-timer.amber { color: var(--warning); }
.now-instruction {
  font-size: clamp(1.3rem, 4.5vw, 2.1rem);
  font-weight: 700;
  max-width: 640px;
}
.now-fail { font-size: 0.9rem; color: var(--text-dim); max-width: 520px; }
.next-preview { font-size: 0.85rem; color: var(--text-dimmer); }
.countdown-num { font-size: clamp(5rem, 30vw, 11rem); font-weight: 800; color: var(--hero, var(--link)); }

.train-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.stop-card {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 24px;
}
.stop-card h1 { color: var(--danger); font-size: 2.2rem; }

.checklist-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) {
  .checklist-grid.two-col { grid-template-columns: 1fr 1fr; }
}

.game-form { display: grid; gap: 10px; }

footer.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--gutter) 40px;
  color: var(--text-dimmer);
  font-size: 0.8rem;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dim { color: var(--text-dim); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.space-between { justify-content: space-between; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ---------------------------------------------------------------- map combobox */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  max-height: min(320px, 50vh); overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.combo-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 40px; padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.combo-list li[aria-selected="true"], .combo-list li[data-i]:hover { background: var(--card); color: var(--text); }
.combo-list li[aria-selected="true"] { outline: 1px solid var(--link); }
.combo-mode { color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; }
.combo-tag { color: var(--warning); font-size: 0.72rem; margin-left: 4px; }
.combo-empty { color: var(--text-dim); cursor: default; }
