/* Wyrmtable 2.0 — frontend styles built from "Wyrmtable Brand.dc.html"
   Tokens: Night/Slate surfaces, Ember accent, Frost text, Mist muted,
   Archivo for headings & UI, JetBrains Mono for numbers & data. */

:root {
  --night: #0a0c0e;
  --slate: #101418;
  --slate-2: #12171c;
  --slate-3: #181f26;
  --border: #1f262c;
  --border-soft: #1c2228;
  --border-strong: #273038;
  --row-border: #171d23;
  --ember: #ff5c1f;
  --ember-soft: #ff8a5c;
  --frost: #e6edf2;
  --mist: #7f8b94;
  --mist-2: #aeb9c2;
  --dim: #4d565e;
  --green: #4ecb71;
  --red: #e05b4f;
  --neutral: #9aa5ad;
  --legendary: #e8b84a;
  --epic: #b07ce8;
  --rare: #5ba7e0;
  --font-ui: 'Archivo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--frost);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--ember); text-decoration: none; }
a:hover { color: var(--ember-soft); }
button { font-family: inherit; cursor: pointer; }
select, input {
  font-family: inherit;
  color: var(--frost);
  background: var(--slate-3);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 13px;
}
select:focus, input:focus { outline: 1px solid var(--ember); outline-offset: 0; }

.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-weight: 600; }

/* ---------- shared building blocks ---------- */
.kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ember);
}
.section-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mist);
}
.h-display {
  font-weight: 800; letter-spacing: -0.02em; line-height: 0.98;
  text-transform: uppercase;
}
.card {
  background: var(--slate);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.btn {
  display: inline-block; border-radius: 6px; border: 0;
  font-weight: 800; font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 14px 26px; text-align: center;
}
.btn-primary { background: var(--ember); color: var(--night); }
.btn-primary:hover { background: var(--ember-soft); color: var(--night); }
.btn-ghost {
  background: transparent; color: var(--frost); font-weight: 600;
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--mist); color: var(--frost); }
.btn-sm { padding: 9px 16px; font-size: 11px; }

.rarity { font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.rarity-Legendary { color: var(--legendary); }
.rarity-Epic { color: var(--epic); }
.rarity-Rare { color: var(--rare); }
.rarity-badge {
  font-size: 9.5px; border-radius: 4px; padding: 2px 6px;
}
.rarity-badge.rarity-Legendary { border: 1px solid rgba(232, 184, 74, 0.45); }
.rarity-badge.rarity-Epic { border: 1px solid rgba(176, 124, 232, 0.45); }
.rarity-badge.rarity-Rare { border: 1px solid rgba(91, 167, 224, 0.45); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-neutral { background: var(--neutral); }
.affinity-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.affinity-green { color: var(--green); }
.affinity-red { color: var(--red); }
.affinity-neutral { color: var(--neutral); }

/* star pips */
.pips { display: flex; gap: 2.5px; }
.pips span { flex: 1; height: 4px; border-radius: 2px; background: var(--border-strong); }
.pips span.on { background: var(--ember); }

/* habit chips */
.habit-chips { display: flex; gap: 4px; }
.habit-chips span {
  flex: 1; text-align: center; font-family: var(--font-mono); font-size: 10.5px;
  padding: 4px 0; border-radius: 4px; background: var(--slate-2);
  color: var(--dim); border: 1px solid var(--border);
}
.habit-chips span.on {
  background: rgba(255, 92, 31, 0.16); color: var(--ember-soft);
  border-color: rgba(255, 92, 31, 0.4);
}

/* the scale texture — hero sections only, never behind data */
.scale-texture {
  background-image:
    radial-gradient(700px 420px at 18% 0%, rgba(255, 92, 31, 0.10), transparent 70%),
    radial-gradient(circle 12px at 12px 0, transparent 11px, #10151a 11.5px),
    radial-gradient(circle 12px at 36px 12px, transparent 11px, rgba(16, 21, 26, 0.6) 11.5px);
  background-size: 100% 100%, 48px 24px, 48px 24px;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 48px; border-bottom: 1px solid var(--border-soft);
}
.logo-lockup { display: inline-flex; align-items: center; gap: 11px; color: var(--frost); }
.logo-lockup:hover { color: var(--frost); }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--ember); flex: none;
}
.logo-word {
  font-weight: 800; font-size: 18px; letter-spacing: 0.04em; text-transform: uppercase;
}
.topnav { display: flex; align-items: center; gap: 26px; }
.topnav a {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mist);
}
.topnav a:hover, .topnav a.active { color: var(--frost); }
.hamburger { display: none; background: none; border: 0; padding: 12px 4px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--frost); margin: 4px 0; }

/* segmented app tabs (calculator header) */
.seg-tabs {
  display: flex; gap: 4px; background: var(--slate);
  border: 1px solid var(--border); border-radius: 7px; padding: 3px;
}
.seg-tabs a {
  color: var(--mist); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 7px 16px; border-radius: 5px;
}
.seg-tabs a.active { background: var(--ember); color: var(--night); font-weight: 800; }

/* ---------- homepage ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 560px; gap: 56px; align-items: center;
  padding: 76px 48px 68px;
}
.hero h1 { font-size: 58px; max-width: 560px; margin: 16px 0 0; }
.hero-sub { color: var(--mist); font-size: 17px; margin-top: 18px; max-width: 480px; line-height: 1.6; text-wrap: pretty; }
.hero-ctas { display: flex; gap: 12px; margin-top: 28px; }
.hero-note { font-family: var(--font-mono); font-size: 12px; color: var(--dim); margin-top: 24px; }

.hero-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.preview-card {
  background: var(--slate); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

/* Latest updates block: three newest entries from /data/news.json */
.news-card { padding: 18px 22px 8px; }
.news-viewall {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ember);
}
.news-row {
  display: grid; grid-template-columns: 8px 54px 1fr; align-items: baseline; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--border); color: inherit;
}
.news-row:first-child { border-top: 0; }
.news-row:hover .news-row-title { color: var(--ember); }
.news-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--dim);
  align-self: start; margin-top: 6px;   /* lines up with the first line, not the middle of a wrapped title */
}
.news-dot.latest { background: var(--ember); }
.news-row-date { font-size: 11px; color: var(--dim); white-space: nowrap; }
.news-row-title { font-size: 13px; color: var(--mist-2); line-height: 1.45; }
.preview-row {
  display: grid; grid-template-columns: 92px 1fr 118px 70px; align-items: center;
  gap: 12px; background: var(--slate-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 11px 14px;
}
.preview-row.lead { border-color: rgba(255, 92, 31, 0.35); }
.pos-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mist);
}
.preview-row.lead .pos-label { color: var(--ember); }

.section { padding: 64px 48px; }
.section + .section { padding-top: 0; }
.section h2 {
  font-size: 30px; font-weight: 800; letter-spacing: -0.01em;
  text-transform: uppercase; margin: 10px 0 36px;
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-card { padding: 22px 24px; }
.step-num { font-family: var(--font-mono); font-size: 12px; color: var(--ember); margin-bottom: 12px; }
.step-card h3 { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; margin: 0; }
.step-card p { color: var(--mist); font-size: 13.5px; line-height: 1.6; margin: 8px 0 0; text-wrap: pretty; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card { padding: 20px 22px; }
.feature-card h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; margin: 0; }
.feature-card p { color: var(--mist); font-size: 12.5px; line-height: 1.55; margin: 8px 0 0; }

.cta-band {
  margin: 0 48px; border: 1px solid rgba(255, 92, 31, 0.35); border-radius: 10px;
  padding: 44px; text-align: center;
  background: radial-gradient(420px 200px at 50% 0%, rgba(255, 92, 31, 0.12), transparent 70%);
}
.cta-band h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; margin: 0; }
.cta-band p { color: var(--mist); font-size: 14.5px; margin: 10px 0 0; }

.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 36px 48px 32px; margin-top: 56px; border-top: 1px solid var(--border-soft);
}
.footer-disclaimer {
  font-size: 11.5px; color: var(--dim); max-width: 560px; line-height: 1.55; text-align: center;
}
.footer-links { display: flex; gap: 18px; }
.footer-links a {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mist);
}

/* ---------- data tables (roster / dragons) ---------- */
.data-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.data-table .thead, .data-table .trow { display: grid; gap: 12px; padding: 12px 20px; align-items: center; }
.data-table .thead {
  background: var(--slate); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist);
  border-bottom: 1px solid var(--border);
}
.data-table .trow { border-bottom: 1px solid var(--row-border); font-size: 14.5px; }
.data-table .trow:last-child { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* ---------- calculator layout ---------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--border-soft); gap: 16px;
}
.appbar-left { display: flex; align-items: center; gap: 28px; }
.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 65px); }
.sidebar {
  border-right: 1px solid var(--border-soft); padding: 20px 18px;
  display: flex; flex-direction: column; gap: 20px;
}
.roster-item {
  width: 100%; text-align: left; background: var(--slate); border: 1px solid var(--border);
  border-radius: 7px; padding: 10px 12px; display: flex; align-items: center;
  justify-content: space-between; color: var(--frost); gap: 8px;
}
.roster-item:hover { border-color: var(--border-strong); }
.roster-item.selected { border-color: rgba(255, 92, 31, 0.4); }
.roster-name { font-size: 13px; font-weight: 800; }
.roster-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--mist); margin-top: 2px; }
.roster-tag { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; vertical-align: 2px; }
.add-dragon {
  width: 100%; border: 1px dashed var(--border-strong); border-radius: 7px; background: none;
  padding: 10px 12px; text-align: center; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--mist);
}
.add-dragon:hover { color: var(--frost); border-color: var(--mist); }

.build-item {
  width: 100%; display: flex; justify-content: space-between; gap: 8px; background: var(--slate);
  border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--mist); text-align: left;
}
.build-item:hover { border-color: var(--border-strong); }
.build-item.active { border-color: rgba(255, 92, 31, 0.4); color: var(--frost); }

.workspace { padding: 24px 28px; }
.workspace-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.workspace-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; margin: 4px 0 0; }
.army-power { font-family: var(--font-mono); font-size: 32px; font-weight: 600; color: var(--ember); line-height: 1.15; }
.army-delta { font-family: var(--font-mono); font-size: 12px; }

.position-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.position-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.position-card.vanguard {
  border-color: rgba(255, 92, 31, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 92, 31, 0.12), 0 8px 24px rgba(255, 92, 31, 0.06);
}
.position-card.vanguard > .position-head .section-label { color: var(--ember); }
.position-head { display: flex; align-items: center; justify-content: space-between; }
.position-dragon { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.position-dragon .name { font-size: 18px; font-weight: 800; }
.position-dragon select { width: 100%; }
.stat-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.mini-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); }
.troop-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--slate-3); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 8px 11px;
}
.troop-select select { border: 0; background: none; padding: 0; font-size: 12.5px; font-weight: 700; }
.power-lines { font-family: var(--font-mono); font-size: 12px; color: var(--mist); display: flex; flex-direction: column; gap: 3px; }
.power-lines .row { display: flex; justify-content: space-between; }
.power-lines .total { border-top: 1px solid var(--border); padding-top: 5px; margin-top: 2px; }
.power-lines .total .k { color: var(--frost); font-weight: 600; }
.power-lines .total .v { color: var(--ember); font-weight: 600; font-size: 13px; }
.attr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.attr-cell { background: var(--slate-2); border-radius: 5px; padding: 6px 8px; text-align: center; }
.attr-cell .k { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }
.attr-cell .v { font-family: var(--font-mono); font-size: 13px; color: var(--mist-2); margin-top: 2px; }
.empty-slot { color: var(--dim); font-size: 12.5px; text-align: center; padding: 24px 8px; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.panel { padding: 16px 18px; }
.enemy-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.enemy-row .mini-label { color: var(--dim); }
.matchup-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--slate-2); border-radius: 5px; padding: 7px 11px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--neutral); margin-bottom: 8px;
}
.matchup-adv { color: var(--green); }
.matchup-dis { color: var(--red); }
.matchup-neu { color: var(--neutral); }
.panel-tip { font-size: 11.5px; color: var(--mist); margin-top: 11px; line-height: 1.5; }
.display-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); margin-top: 10px; }

/* ---------- dialogs ---------- */
dialog {
  background: var(--slate); color: var(--frost); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 24px; width: min(420px, calc(100vw - 40px));
}
dialog::backdrop { background: rgba(4, 5, 6, 0.7); }
.dialog-title { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; margin: 0 0 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; }
.field select, .field input { width: 100%; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.danger-link { background: none; border: 0; color: var(--red); font-size: 11.5px; padding: 0; margin-right: auto; }
/* Secondary in-dialog action (forgot password): readable, never competes with
   the primary button. */
.link-quiet {
  background: none; border: 0; padding: 0; font-family: inherit;
  font-size: 11.5px; color: var(--mist); text-decoration: underline; cursor: pointer;
}
.link-quiet:hover { color: var(--ember); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--slate-3); border: 1px solid var(--border-strong); border-radius: 7px;
  color: var(--frost); font-size: 12.5px; padding: 10px 18px; opacity: 0;
  pointer-events: none; transition: opacity 0.25s; z-index: 60;
}
.toast.show { opacity: 1; }

/* mobile bottom tab bar */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0;
  border-top: 1px solid var(--border-soft); background: #0d1013; z-index: 50;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 0 14px; color: var(--mist);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.tabbar a.active { color: var(--ember); }
.tabbar a svg [stroke] { stroke: currentColor; }
.tabbar a svg [fill]:not([fill='none']) { fill: currentColor; }

/* mobile nav drawer (homepage) */
.mobile-nav { display: none; border-bottom: 1px solid var(--border-soft); padding: 8px 20px 16px; }
.mobile-nav.open { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav a {
  padding: 10px 4px; color: var(--mist); font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ================= Step 2 · mobile (390 reference) ================= */
@media (max-width: 900px) {
  .topbar { padding: 16px 20px; }
  /* Hide nav + the CTA (it lives in the drawer) so the hamburger fits. */
  .topnav, .topbar > .btn, .topbar .btn-primary { display: none; }
  .hamburger { display: block; }

  .hero { grid-template-columns: 1fr; gap: 32px; padding: 40px 20px 36px; }
  .hero h1 { font-size: 38px; line-height: 1; }
  .hero-sub { font-size: 15px; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; padding: 16px 0; }
  .hero-note { text-align: center; }
  .preview-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .preview-row .pos-label { grid-column: 1 / -1; }

  .section { padding: 36px 20px; }
  .section h2 { font-size: 24px; margin-bottom: 18px; }
  .steps, .features { grid-template-columns: 1fr; gap: 10px; }
  .step-card { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px 18px; }
  .step-num { margin: 2px 0 0; }
  .cta-band { margin: 0 20px; padding: 28px 22px; }
  .cta-band h2 { font-size: 22px; }
  .footer { flex-direction: column; padding: 32px 20px 92px; text-align: center; }

  .appbar { padding: 14px 20px; }
  .appbar .seg-tabs { display: none; }
  .app-shell { grid-template-columns: 1fr; min-height: 0; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .workspace { padding: 16px 16px 96px; }
  .position-grid, .panel-grid { grid-template-columns: 1fr; }
  .army-power { font-size: 28px; }
  .tabbar { display: flex; }

  .data-table .thead, .data-table .trow { padding: 11px 14px; gap: 8px; }
}

/* ---------- war room ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.mode-card {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  background: var(--slate-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; color: var(--frost); cursor: pointer;
}
.mode-card:hover { border-color: var(--border-strong); }
.mode-card.active {
  border-color: rgba(255, 92, 31, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 92, 31, 0.15);
}
.mode-card.active > span:first-child { color: var(--ember); }
@media (max-width: 900px) {
  .mode-grid { grid-template-columns: 1fr; }
}

/* ---------- de-emphasized power + war room breakdown ---------- */
.power-est {
  font-family: var(--font-mono); font-size: 11px; color: var(--dim); margin-top: 4px;
}
.power-lines.power-muted, .power-lines .row.power-muted { color: var(--dim); }
.power-lines.power-muted .total .v { color: var(--mist); font-size: 12px; }
.power-lines.power-muted .total .k { color: var(--mist); }
.army-detail { margin-top: 12px; border-top: 1px solid var(--border); }
.army-detail summary {
  cursor: pointer; padding: 10px 0 2px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--mist);
  list-style: none;
}
.army-detail summary::before { content: '▸ '; color: var(--ember); }
.army-detail[open] summary::before { content: '▾ '; }
.army-detail summary::-webkit-details-marker { display: none; }
.army-detail-body {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 12px 0 4px;
}
.army-detail-body > div:last-child { grid-column: 1 / -1; }
.synergy-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--mist-2); padding: 4px 0;
  border-bottom: 1px solid var(--row-border);
}
.synergy-line:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .army-detail-body { grid-template-columns: 1fr; }
}

/* ---------- v2.1: global footer, score bars, job progress ---------- */
.site-footer {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 32px 20px 40px; margin-top: 48px; border-top: 1px solid var(--border-soft);
  text-align: center;
}
.site-footer p { font-size: 11.5px; color: var(--dim); max-width: 520px; line-height: 1.55; margin: 0; }
.score-bar { height: 5px; border-radius: 2.5px; background: var(--border-strong); overflow: hidden; min-width: 120px; }
.score-bar > span { display: block; height: 100%; background: var(--ember); border-radius: 2.5px; }
.job-progress {
  display: flex; align-items: center; gap: 12px; padding: 20px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--mist);
}
.job-progress .score-bar { flex: 1; }
@media (max-width: 900px) { .site-footer { padding-bottom: 96px; } }

/* ---------- v2.2: verify banner + cookie notice ---------- */
.notice-bar {
  display: flex; align-items: center; gap: 14px; justify-content: center;
  padding: 9px 20px; background: rgba(255, 92, 31, 0.10);
  border-bottom: 1px solid rgba(255, 92, 31, 0.35);
  font-size: 12.5px; color: var(--mist-2);
}
.notice-close { background: none; border: 0; color: var(--mist); font-size: 16px; padding: 2px 8px; }
.cookie-notice {
  position: fixed; left: 16px; bottom: 16px; z-index: 70;
  display: flex; align-items: center; gap: 12px; max-width: 420px;
  background: var(--slate-3); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 10px 14px; font-size: 12px; color: var(--mist-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
@media (max-width: 900px) { .cookie-notice { left: 12px; right: 12px; bottom: 84px; } }

.notice-bar.notice-ok { background: rgba(78, 203, 113, 0.10); border-bottom-color: rgba(78, 203, 113, 0.35); }
.notice-bar.notice-error { background: rgba(224, 91, 79, 0.10); border-bottom-color: rgba(224, 91, 79, 0.40); }
.notice-bar span { max-width: 820px; line-height: 1.5; }

/* ---------- v2.3: inline roster editor ---------- */
.roster-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
}
.roster-toolbar input[type="search"] { min-width: 220px; flex: 1 1 220px; }
.toolbar-check {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px;
  color: var(--mist-2); white-space: nowrap;
}
.save-state { font-family: var(--font-mono); font-size: 11.5px; margin-top: 4px; min-height: 16px; }
.save-state.saving { color: var(--mist); }
.save-state.saved { color: var(--green); }
.save-state.error { color: var(--red); }

.bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255, 92, 31, 0.08); border: 1px solid rgba(255, 92, 31, 0.35);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 12.5px;
}
.bulk-bar label { display: inline-flex; align-items: center; gap: 6px; color: var(--mist-2); }
.bulk-bar input { width: 68px; padding: 5px 8px; }

.roster-head, .roster-row {
  display: grid;
  grid-template-columns: 26px 26px minmax(190px, 1.4fr) 118px minmax(190px, 1fr) minmax(230px, 1.1fr);
  align-items: center; gap: 12px;
}
.roster-head {
  padding: 0 14px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mist);
}
.roster-row {
  background: var(--slate); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 14px; margin-bottom: 6px;
}
.roster-row.owned { border-color: var(--border-strong); }
.roster-row.selected { border-color: rgba(255, 92, 31, 0.5); }
.roster-row:not(.owned) .roster-name .name { color: var(--mist); }
.roster-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--ember); }

.roster-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.roster-name .name { font-size: 14.5px; font-weight: 800; }
.roster-name .breed { font-size: 10.5px; color: var(--dim); }

.habit-toggle {
  display: flex; align-items: center; gap: 8px; background: var(--slate-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px;
  color: var(--mist-2); font-size: 12px; width: 100%;
}
.habit-toggle:hover { border-color: var(--border-strong); }
.habit-toggle.open { border-color: rgba(255, 92, 31, 0.4); color: var(--ember-soft); }
.habit-toggle::before { content: '▸'; color: var(--ember); font-size: 10px; }
.habit-toggle.open::before { content: '▾'; }
.habit-next { font-size: 10.5px; color: var(--dim); }

.star-pick { display: flex; align-items: center; gap: 1px; }
.star-pick .star {
  background: none; border: 0; padding: 0 1px; font-size: 15px; line-height: 1;
  color: var(--border-strong);
}
.star-pick .star.on { color: var(--ember); }
.star-pick:not(.disabled) .star:hover { color: var(--ember-soft); }
.star-pick .star:disabled { cursor: default; }
.star-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); margin-left: 7px; }

.roster-level { display: flex; align-items: center; gap: 7px; }
.roster-level .step {
  background: var(--slate-2); border: 1px solid var(--border); border-radius: 5px;
  color: var(--frost); width: 24px; height: 24px; font-size: 14px; line-height: 1; padding: 0;
}
.roster-level .step:disabled { color: var(--dim); cursor: default; }
.roster-level input[type="range"] { flex: 1; min-width: 70px; accent-color: var(--ember); }
.roster-level .level-num {
  width: 54px; padding: 4px 6px; text-align: center;
  font-family: var(--font-mono); font-size: 12px;
}

.habit-drawer {
  grid-column: 1 / -1; margin-top: 8px; padding: 12px 14px;
  background: var(--slate-2); border: 1px solid var(--border); border-radius: 7px;
}
.habit-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 5px 0; border-bottom: 1px solid var(--row-border);
}
.habit-row:last-of-type { border-bottom: 0; }
.habit-row.locked .habit-name { color: var(--dim); }
.habit-name { font-size: 12.5px; color: var(--mist-2); }
.rank-pick { display: flex; gap: 4px; flex: none; }
.rank-pick .rank {
  width: 26px; height: 24px; border-radius: 5px; background: var(--slate-3);
  border: 1px solid var(--border); color: var(--mist); font-size: 11.5px;
  font-family: var(--font-mono); padding: 0;
}
.rank-pick .rank.on { background: var(--ember); border-color: var(--ember); color: var(--night); font-weight: 700; }
.rank-pick .rank:disabled { color: var(--dim); background: var(--slate-2); cursor: default; }
.habit-hint { font-size: 11.5px; color: var(--dim); line-height: 1.55; margin-top: 10px; }

@media (max-width: 900px) {
  /* No column titles to head on mobile, but the two "all shown" toggles still
     need a home, so the head becomes a labelled strip instead of a grid. */
  .roster-head { display: flex; flex-wrap: wrap; gap: 18px; padding: 0 2px 10px; letter-spacing: 0.06em; }
  .roster-head > span { display: none; }
  .roster-row {
    grid-template-columns: 22px 22px 1fr; row-gap: 8px; padding: 12px;
  }
  .roster-habits, .roster-stars, .roster-level { grid-column: 1 / -1; }
  .roster-level input[type="range"] { min-width: 0; }
}

.habit-row.locked .rank-pick { opacity: 0.45; }
.roster-row:hover .sel-check, .roster-row.selected .sel-check { opacity: 1; }

/* ---------- footer: one-line disclaimer, Ko-fi accent, copyright ---------- */
.site-footer p.site-disclaimer {
  max-width: none;          /* one line on desktop (beats .site-footer p's 520px) */
  white-space: nowrap;
  font-size: 11.5px;
}
.kofi-link {
  color: var(--night) !important;
  background: var(--ember);
  border-radius: 5px;
  padding: 5px 12px;
}
.kofi-link:hover { background: var(--ember-soft); color: var(--night) !important; }
.site-copyright {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}
/* Narrow screens: let it wrap rather than force a horizontal scrollbar. */
@media (max-width: 780px) {
  .site-footer p.site-disclaimer { white-space: normal; max-width: 420px; }
}

/* ---------- v2.3: Database menu, tier list, roster select mode ---------- */
.nav-secondary {
  display: flex; align-items: center; gap: 14px; margin-left: 18px;
  padding-left: 18px; border-left: 1px solid var(--border);
}
.db-menu { position: relative; }
.db-toggle, .nav-plain {
  background: none; border: 0; padding: 6px 2px; color: var(--mist);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  font-family: inherit;
}
.db-toggle::after { content: ' ▾'; font-size: 9px; }
.db-toggle:hover, .nav-plain:hover, .db-toggle.active { color: var(--frost); }
.db-dropdown {
  display: none; position: absolute; top: 100%; left: -10px; z-index: 60; min-width: 150px;
  background: var(--slate-3); border: 1px solid var(--border-strong); border-radius: 7px;
  padding: 5px; margin-top: 6px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.db-dropdown.open { display: block; }
.db-dropdown a {
  display: block; padding: 8px 12px; border-radius: 5px; color: var(--mist-2);
  font-size: 12.5px; font-weight: 600;
}
.db-dropdown a:hover { background: var(--slate-2); color: var(--frost); }

/* Bulk-select checkbox: neutral outline, never confusable with owned (orange) */
.roster-row input[type="checkbox"].sel-check {
  accent-color: var(--mist);
  opacity: 0.8;
}
.roster-row:hover .sel-check, .roster-row.selected .sel-check { opacity: 1; }
.roster-head.no-select-col, .roster-row.no-select-col {
  grid-template-columns: 26px 0 minmax(190px, 1.4fr) 118px minmax(190px, 1fr) minmax(230px, 1.1fr);
}

/* "All shown" toggles in the head: same colour coding as the row checkboxes,
   so the ownership one reads orange and the mass-select one stays neutral. */
.head-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; min-width: 0; }
.roster-head input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--ember); }
.roster-head input[type="checkbox"].sel-check { accent-color: var(--mist); }
.roster-head input[type="checkbox"]:disabled { opacity: 0.35; cursor: default; }
.head-check-label { display: none; }              /* desktop: the column IS the label */
/* Must stay a grid item when Mass Action is off, or the column titles all shift
   one column left and DRAGON lands on top of HABITS. The rows keep an empty
   <span> for the same reason. */
.roster-head.no-select-col .head-check.sel { visibility: hidden; }
/* Mobile drops the column titles, so the toggles have to name themselves. That
   labelled strip sits right under the bulk bar, making its button a duplicate.
   No columns to line up with here, so the hidden toggle can leave the flow. */
@media (max-width: 900px) {
  .head-check-label { display: inline; }
  #bulkSelectAll { display: none; }
  .roster-head.no-select-col .head-check.sel { display: none; }
}
.btn:disabled { opacity: 0.45; cursor: default; }

/* Tier list */
.view-tabs { display: flex; gap: 4px; background: var(--slate-2); border: 1px solid var(--border); border-radius: 7px; padding: 3px; }
.view-tab {
  background: none; border: 0; padding: 7px 16px; border-radius: 5px; color: var(--mist);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-family: inherit;
}
.view-tab.active { background: var(--ember); color: var(--night); font-weight: 800; }
.tier-row {
  display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: stretch;
  background: var(--slate); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; margin-bottom: 8px;
}
.tier-label {
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
  font-size: 26px; font-weight: 800; color: var(--night);
}
.tier-S .tier-label { background: #ff5c1f; }
.tier-A .tier-label { background: #e8b84a; }
.tier-B .tier-label { background: #b07ce8; }
.tier-C .tier-label { background: #5ba7e0; }
.tier-D .tier-label { background: #7f8b94; }
.tier-F .tier-label { background: #4d565e; color: var(--frost); }
.tier-chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; }
.tier-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  background: var(--slate-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 11px; font-size: 13px;
}
.tier-rank { font-size: 10.5px; color: var(--dim); }
.tier-name { font-weight: 800; }
.tier-breed { font-size: 10.5px; color: var(--dim); }
.tier-score { font-size: 11.5px; color: var(--ember); }
@media (max-width: 900px) {
  .nav-secondary { margin-left: 10px; padding-left: 10px; gap: 10px; }
  .tier-row { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; }
  .tier-label { font-size: 20px; }
  .tier-chip { font-size: 12px; padding: 6px 9px; gap: 6px; flex-wrap: wrap; }
  .roster-toolbar .view-tabs { width: 100%; }
  .roster-toolbar .view-tab { flex: 1; }
}
.tier-chips { min-width: 0; }
.tier-row { grid-template-columns: 62px minmax(0, 1fr); }

/* v2.3: the appbar carries more now (nav + Database menu + account zone),
   so let it wrap on narrow screens instead of pushing the account button
   past the viewport edge. */
@media (max-width: 900px) {
  .appbar { flex-wrap: wrap; row-gap: 10px; }
  .appbar-left { flex-wrap: wrap; row-gap: 10px; min-width: 0; }
  .appbar > #globalAuth { margin-left: auto; }
  .seg-tabs { flex: 1 1 auto; }
  .seg-tabs a { flex: 1; text-align: center; padding: 7px 10px; }
}

/* The no-select-col override must not beat the mobile stacked layout. */
@media (max-width: 900px) {
  .roster-head.no-select-col, .roster-row.no-select-col {
    grid-template-columns: 22px 0 minmax(0, 1fr);
  }
  .roster-row.no-select-col > .roster-name { min-width: 0; }
}

/* ---------- v2.4: dragon monogram badges (brand file section 06) ---------- */
.dragon-icon {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; border: 1px solid; flex: none; vertical-align: middle;
}
.dragon-icon > span {
  font-family: var(--font-mono); font-weight: 800; letter-spacing: -0.05em; line-height: 1;
}

/* ---------- v2.4: changelog, upcoming, contact ---------- */
.release-tag {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--night); background: var(--ember); border-radius: 5px; padding: 3px 10px;
}
.release-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.release-list li { color: var(--mist-2); font-size: 13.5px; line-height: 1.6; }

/* News page entries */
.news-entry { scroll-margin-top: 84px; }   /* clears the sticky appbar on deep links */
.news-entry-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.news-entry .news-date { font-size: 11.5px; color: var(--dim); }
.news-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ember); border: 1px solid rgba(255, 92, 31, 0.35); border-radius: 4px; padding: 2px 7px;
}
.news-author { font-size: 11.5px; color: var(--mist); }
.news-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.news-links a {
  font-size: 12px; font-weight: 600; color: var(--mist-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 5px 11px;
}
.news-links a:hover { color: var(--ember); border-color: rgba(255, 92, 31, 0.45); }
.news-entry h2 { font-size: 17px; margin: 0 0 8px; }
.news-entry p { color: var(--mist-2); font-size: 13.5px; line-height: 1.65; margin: 0; max-width: 68ch; }
.news-entry.targeted { border-color: rgba(255, 92, 31, 0.5); }
.support-callout {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border: 1px solid rgba(255, 92, 31, 0.35); border-radius: 10px; padding: 22px 24px;
  margin-bottom: 18px;
  background: radial-gradient(420px 200px at 20% 0%, rgba(255, 92, 31, 0.12), transparent 70%);
}
textarea {
  font-family: inherit; color: var(--frost); background: var(--slate-3);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 9px 11px;
  font-size: 13.5px; width: 100%; resize: vertical; line-height: 1.55;
}
textarea:focus { outline: 1px solid var(--ember); }

/* ---------- v2.4.1: footer polish (grouped links, own Ko-fi row) ---------- */
.site-footer-groups {
  display: flex; gap: 56px; flex-wrap: wrap; justify-content: center; text-align: left;
  margin-bottom: 4px;
}
.site-footer-groups > div { display: flex; flex-direction: column; gap: 7px; }
.site-footer-heading {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 2px;
}
.site-footer-groups a {
  font-size: 12.5px; font-weight: 600; color: var(--mist); letter-spacing: 0;
  text-transform: none;
}
.site-footer-groups a:hover { color: var(--frost); }
@media (max-width: 900px) {
  .site-footer-groups { gap: 32px; }
}
