/* base.css — design tokens + shared layout primitives + onboarding chrome
 *
 * "Balcony Boys" — the trade engine reskinned as an extension of
 * thebalconyboys.com. Palette pulled 1:1 from the site's tokens.css:
 * pure-neutral near-black field, orange (#F39C2C) as the signature accent,
 * purple (#7C3AFF) + teal (#2BC4D9) as the secondary brand pops, the
 * signature purple→orange gradient on primary CTAs, warm-white text,
 * Anton for display/brand voice and DM Sans for body — same as the site.
 *
 * Token + class NAMES are a stable contract: page CSS references the
 * variables and JS-rendered HTML uses the utility classes, so re-theming
 * is just editing :root. Don't rename tokens/classes — only retune them.
 */

/* ===================================================================
 * Design tokens
 * =================================================================== */
:root {
  /* Surfaces — pure-neutral near-black (matches thebalconyboys.com) */
  --bg-page:       #0A0A0A;
  --bg-overlay:    rgba(10, 10, 10, 0.96);
  --bg-panel:      #141414;
  --bg-panel-2:    #1C1C1C;
  --bg-input:      #0E0E0E;
  --bg-chip:       #242424;
  --bg-banner:     #141414;

  /* Strokes */
  --stroke:        #2A2A2A;
  --stroke-soft:   #1F1F1F;

  /* Text — warm-white scale, exact site values */
  --text:          #F4F1EB;
  --text-2:        #ADA39A;
  --text-muted:    #6B6259;
  --text-faint:    #564E45;

  /* Accents — the site triad: orange primary, purple + teal secondary */
  --accent:             #F39C2C;   /* --orange  · signature accent (wordmark, buttons, nav) */
  --accent-bright:      #FFB23F;   /* --orange-bright · hover / gradient tops */
  --accent-soft:        #5A3A12;
  --accent-warn:        #e0a93a;
  --accent-good:        #4ade80;
  --accent-bad:         #ff5d57;
  --accent-action:      #C76A1B;   /* --orange-deep */
  --accent-ok:          #1f9d4d;
  --accent-gold:        #E8B14C;   /* --champion · value gold, reserved for $ values */
  --accent-teal:        #2BC4D9;   /* --teal · secondary pop (the shades / shirts) */
  --accent-teal-2:      #5AD4E6;
  --accent-purple:      #7C3AFF;   /* --purple · third brand color (CTA gradient, tiers, accents) */
  --accent-purple-deep: #4A12B0;   /* --purple-deep */

  /* Glows (atmosphere) */
  --glow-accent:   rgba(243, 156, 44, 0.42);
  --glow-gold:     rgba(232, 177, 76, 0.32);
  --glow-teal:     rgba(43, 196, 217, 0.35);
  --glow-purple:   rgba(124, 58, 255, 0.40);

  /* Layout */
  --radius:        14px;
  --radius-sm:     9px;
  --radius-pill:   999px;
  --shadow-1:      0 1px 2px rgba(0,0,0,0.5);
  --shadow-2:      0 6px 20px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.02) inset;
  --shadow-modal:  0 24px 70px rgba(0,0,0,0.72), 0 1px 0 rgba(255,255,255,0.04) inset;
  --maxw:          1180px;

  /* Typography — same families as thebalconyboys.com */
  --font-brand:   "Anton", "Bebas Neue", sans-serif;
  --font-display: "Anton", "DM Sans", sans-serif;
  --font-stack:   "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Kill any accidental horizontal page scroll on mobile — wide content (tables,
 * etc.) scrolls within its own container instead of shoving the whole layout
 * sideways. */
html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-stack);
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.005em;
  min-height: 100vh;
}

/* Atmosphere: a fixed accent glow + a faint engineering grid behind it all */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 520px at 80% -8%, rgba(243, 156, 44, 0.11), transparent 60%),
    radial-gradient(820px 460px at 12% 2%, rgba(124, 58, 255, 0.10), transparent 58%),
    radial-gradient(900px 520px at 50% 108%, rgba(43, 196, 217, 0.05), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
}

/* Numerals: tabular everywhere they matter */
.mono, table, .value, .totals, td, th, input, select {
  font-variant-numeric: tabular-nums;
}

::selection { background: rgba(243, 156, 44,0.30); color: #fff; }

/* Custom scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--stroke) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #3A3A3A; background-clip: content-box; }

a { color: var(--accent); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===================================================================
 * Header — sticky, glass, with a glowing hairline
 * =================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(21,21,26,0.93), rgba(10, 10, 10,0.88));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--stroke);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow-purple), var(--glow-accent), transparent);
  opacity: 0.7;
}

header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 0;
}
/* the Balcony Boys circular logo as the persistent brand mark */
header h1::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  margin-right: 13px;
  border-radius: 50%;
  background: #000 center/cover no-repeat;
  background-image: url("../img/bb-mark.png");
  box-shadow: 0 0 0 1px var(--stroke), 0 0 18px var(--glow-accent);
  align-self: center;
}

header h1 .subtitle {
  color: var(--text-muted);
  font-family: var(--font-stack);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0;
  margin-left: 12px;
}

.nav-links {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: 18px;
}

.nav-links a {
  font-family: var(--font-stack);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-links a.warn { color: var(--accent-warn); }
.nav-links a.nav-suite { color: var(--accent-gold); }
.nav-links a.nav-suite[aria-current="page"] {
  background: linear-gradient(180deg, rgba(232, 177, 76,0.20), rgba(232, 177, 76,0.08));
  border-color: rgba(232, 177, 76,0.45);
}
.nav-links a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, rgba(243, 156, 44,0.22), rgba(243, 156, 44,0.10));
  border-color: rgba(243, 156, 44,0.45);
  box-shadow: 0 0 0 1px rgba(243, 156, 44,0.08), 0 4px 14px rgba(243, 156, 44,0.10);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.controls select, .controls input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--stroke);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-stack);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.controls select:focus, .controls input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 156, 44,0.15);
}
.controls label {
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ===================================================================
 * Shared page container + page-load choreography
 * =================================================================== */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
main > * {
  animation: riseIn .5s cubic-bezier(.21,.6,.35,1) both;
}
main > *:nth-child(1) { animation-delay: .02s; }
main > *:nth-child(2) { animation-delay: .08s; }
main > *:nth-child(3) { animation-delay: .14s; }
main > *:nth-child(4) { animation-delay: .20s; }
main > *:nth-child(5) { animation-delay: .26s; }
main > *:nth-child(n+6) { animation-delay: .30s; }
@media (prefers-reduced-motion: reduce) {
  main > * { animation: none; }
  html { scroll-behavior: auto; }
}
/* after the first page this session, skip the entrance choreography */
html.no-anim main > * { animation: none; }

/* ===================================================================
 * Identity chip + manage-picks button (header right side)
 * =================================================================== */
.header-personal {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: 12px;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-chip);
  border: 1px solid var(--stroke);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-2);
}
.identity-chip::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-good);
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
}
.identity-chip .ic-name { font-weight: 600; }
.identity-chip button {
  background: none; border: 0;
  color: var(--text-faint);
  cursor: pointer; font-size: 14px;
  padding: 0 2px; line-height: 1;
  transition: color .15s ease;
}
.identity-chip button:hover { color: var(--text-2); }

.btn-picks {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text-2);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.btn-picks:hover { border-color: var(--accent); color: var(--accent); background: rgba(243, 156, 44,0.06); }

/* ===================================================================
 * Onboarding overlay
 * =================================================================== */
#onboarding-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.onboarding-card {
  background:
    radial-gradient(600px 200px at 50% -40%, rgba(243, 156, 44,0.12), transparent 70%),
    var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 40px 42px;
  max-width: 470px;
  width: 92%;
  box-shadow: var(--shadow-modal);
  animation: riseIn .4s cubic-bezier(.21,.6,.35,1) both;
}
.onboarding-card h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.onboard-tag {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.onboard-section label {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.onboard-row { display: flex; gap: 8px; }
.onboard-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--stroke);
  color: var(--text);
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-stack);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.onboard-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(243, 156, 44,0.15); }
.onboard-row button {
  background: linear-gradient(180deg, #28b85b, var(--accent-ok));
  border: 0; color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease, transform .05s ease;
}
.onboard-row button:hover { filter: brightness(1.08); }
.onboard-row button:active { transform: translateY(1px); }
.onboard-row button:disabled { filter: grayscale(0.4) brightness(0.7); cursor: not-allowed; }

.onboard-error { color: var(--accent-bad); font-size: 12px; margin-top: 8px; }
.onboard-status { color: var(--accent); font-size: 12px; margin-top: 8px; }

.onboard-divider {
  text-align: center;
  margin: 26px 0 18px;
  position: relative;
  color: var(--text-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.onboard-divider::before {
  content: ""; position: absolute;
  left: 0; right: 0; top: 50%; height: 1px;
  background: var(--stroke); z-index: 0;
}
.onboard-divider span { background: var(--bg-panel); padding: 0 12px; position: relative; }

.onboard-guest {
  width: 100%;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text-2);
  padding: 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-stack);
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.onboard-guest:hover { border-color: var(--accent); color: var(--accent); background: rgba(243, 156, 44,0.06); }

.onboard-foot { color: var(--text-faint); font-size: 11px; margin-top: 18px; line-height: 1.6; }

/* ===================================================================
 * Modals (shared backdrop + picks modal contents)
 * =================================================================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  max-width: 580px; width: 92%;
  max-height: 85vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: riseIn .35s cubic-bezier(.21,.6,.35,1) both;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--stroke);
}
.modal-header h2 {
  margin: 0; font-size: 15px; font-weight: 700; color: var(--text);
  font-family: var(--font-display); letter-spacing: -0.01em;
}
.modal-header h2 #picks-modal-league {
  color: var(--text-muted); font-weight: 400; font-size: 12px; margin-left: 8px;
  font-family: var(--font-stack);
}
.modal-close {
  background: none; border: 0; color: var(--text-muted);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
  transition: color .15s ease;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 22px; overflow-y: auto; }

.picks-add-row {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.picks-add-row select, .picks-add-row input {
  background: var(--bg-input); border: 1px solid var(--stroke); color: var(--text-2);
  padding: 7px 9px; border-radius: var(--radius-sm); font-size: 12px; font-family: var(--font-stack);
}
.picks-add-row button {
  background: linear-gradient(180deg, #28b85b, var(--accent-ok));
  border: 0; color: white; padding: 7px 15px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 700;
}
.picks-list { display: flex; flex-direction: column; gap: 5px; }
.pick-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: border-color .15s ease;
}
.pick-row:hover { border-color: var(--stroke); }
.pick-row .pick-label { color: var(--text-2); font-family: var(--font-mono); font-size: 12px; }
.pick-row button {
  background: none; border: 0; color: var(--accent-bad);
  cursor: pointer; font-size: 18px; padding: 0 6px; line-height: 1;
}
.picks-empty { color: var(--text-faint); font-style: italic; padding: 16px 0; text-align: center; font-size: 12px; }
.picks-modal-foot {
  color: var(--text-faint); font-size: 11px; margin-top: 16px; line-height: 1.6;
  border-top: 1px solid var(--stroke-soft); padding-top: 13px;
}

/* ===================================================================
 * Guest mode (body class + banner)
 * =================================================================== */
body.guest-mode .only-personal       { display: none !important; }
body.guest-mode .only-personal-link  { display: none !important; }

.guest-banner {
  background: var(--bg-banner);
  border-bottom: 1px solid var(--stroke);
  border-left: 3px solid var(--accent);
  padding: 11px 28px;
  font-size: 12px;
  color: var(--text-2);
  display: flex; align-items: center; gap: 12px;
}
.guest-banner button {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  padding: 5px 13px; border-radius: var(--radius-pill); font-size: 12px; cursor: pointer; font-weight: 600;
  transition: background .16s ease;
}
.guest-banner button:hover { background: rgba(243, 156, 44,0.13); }
.banner-desc { color: var(--text-muted); font-size: 11px; }

/* ===================================================================
 * Generic primitives reused across pages
 * =================================================================== */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-2);
}
.panel h2 {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-2);
  position: relative;
  transition: border-color .18s ease, transform .18s ease;
}
.section:hover { border-color: #3A3A3A; }
.section h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.empty { color: var(--text-muted); font-style: italic; padding: 22px; text-align: center; }

/* Buttons */
.btn {
  /* the site's signature purple→orange CTA gradient */
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent) 100%);
  border: 1px solid rgba(124, 58, 255, 0.45);
  color: #fff;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-stack);
  box-shadow: 0 4px 16px rgba(124, 58, 255, 0.30);
  transition: filter .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:hover { filter: brightness(1.10); box-shadow: 0 6px 22px rgba(124, 58, 255, 0.42); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--stroke); border-color: var(--stroke); cursor: not-allowed; opacity: 0.7; box-shadow: none; }
.btn-secondary { background: transparent; border-color: var(--stroke); color: var(--text-2); box-shadow: none; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(243, 156, 44,0.06); filter: none; box-shadow: none; }

/* Tables — shared baseline */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  padding: 9px 12px;
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--stroke-soft); }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child td { border-bottom: 0; }

/* "match" cards used by Trade Finder + League View suggested-partner UI */
.match {
  background: var(--bg-panel-2);
  border: 1px solid var(--stroke-soft);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  transition: border-color .16s ease, transform .16s ease;
}
.match:hover { transform: translateX(2px); border-left-color: var(--accent-gold); }
.match.fit-high { border-left-color: var(--accent-good); }
.match.fit-mid  { border-left-color: var(--accent-warn); }
.match.fit-low  { border-left-color: var(--accent-bad); }
.match-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.match-meta { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.match-fit { padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; }
.match-fit.fit-high { background: rgba(74,222,128,0.14); color: var(--accent-good); }
.match-fit.fit-mid  { background: rgba(224,169,58,0.14); color: var(--accent-warn); }
.match-fit.fit-low  { background: rgba(255,93,87,0.14); color: var(--accent-bad); }
.match-rationale { margin-top: 7px; font-size: 11px; color: var(--text-muted); padding-left: 0; }
.match-rationale li { margin-left: 18px; padding: 2px 0; }

/* Alert/callout boxes */
.alert { padding: 9px 13px; border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 12px; border-left: 3px solid; }
.alert.sell  { background: rgba(255,93,87,0.10);  border-left-color: var(--accent-bad); }
.alert.decay { background: rgba(224,169,58,0.10); border-left-color: var(--accent-warn); }
.alert.clog  { background: rgba(255,93,87,0.05);  border-left-color: var(--accent-bad); }

/* Archetype color encoding */
.arch-contender { color: var(--accent-bad); }
.arch-rebuilder { color: var(--accent-good); }
.arch-fringe    { color: var(--accent-warn); }
.arch-middle    { color: var(--accent-warn); }

/* ===================================================================
 * Utility color classes — how JS-rendered HTML reaches the tokens
 * =================================================================== */
.c-text     { color: var(--text); }
.c-text-2   { color: var(--text-2); }
.c-muted    { color: var(--text-muted); }
.c-faint    { color: var(--text-faint); }
.c-accent   { color: var(--accent); }
.c-good     { color: var(--accent-good); }
.c-bad      { color: var(--accent-bad); }
.c-warn     { color: var(--accent-warn); }
.c-action   { color: var(--accent-action); }
.c-ok       { color: var(--accent-ok); }
.c-gold     { color: var(--accent-gold); }
.c-teal     { color: var(--accent-teal); }
.c-purple   { color: var(--accent-purple); }

.bg-good    { background: rgba(74,222,128,0.08); }
.bg-bad     { background: rgba(255,93,87,0.08); }
.bg-warn    { background: rgba(224,169,58,0.08); }
.bg-accent  { background: rgba(243, 156, 44,0.08); }
.bg-teal    { background: rgba(43, 196, 217, 0.08); }
.bg-purple  { background: rgba(124, 58, 255, 0.10); }
.bg-panel-2 { background: var(--bg-panel-2); }

.bl-good    { border-left: 3px solid var(--accent-good); }
.bl-bad     { border-left: 3px solid var(--accent-bad); }
.bl-warn    { border-left: 3px solid var(--accent-warn); }
.bl-accent  { border-left: 3px solid var(--accent); }
.bl-teal    { border-left: 3px solid var(--accent-teal); }
.bl-purple  { border-left: 3px solid var(--accent-purple); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-10  { font-size: 10px; }
.fs-11  { font-size: 11px; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.upper  { text-transform: uppercase; letter-spacing: 0.06em; }
.mono   { font-family: var(--font-mono); }

/* ===================================================================
 * Loading skeletons (replaces bare "Loading…" text)
 * =================================================================== */
.skeleton-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-panel-2) 25%, rgba(255,255,255,0.06) 37%, var(--bg-panel-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton.row { height: 40px; }
.skeleton.lg  { height: 22px; }
.skeleton.w-40 { width: 40%; } .skeleton.w-60 { width: 60%; } .skeleton.w-80 { width: 80%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ===================================================================
 * Responsive: tame the sticky header + table overflow on small screens
 * =================================================================== */
@media (max-width: 900px) {
  header { position: static; padding: 12px 16px; }
  header h1 { font-size: 18px; }
  main { padding: 18px 14px; }
}
@media (max-width: 700px) {
  /* ANY data table becomes horizontally scrollable instead of crushed or
   * overflowing — covers tables outside .section too (e.g. the Suite player
   * card's season table). */
  main table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  /* Controls stack and fill width rather than running off-screen. */
  .bb-controls, .controls { flex-wrap: wrap; }
  .bb-search { margin-left: 0; min-width: 100%; width: 100%; }
  .bb-field, .bb-field select { max-width: 100%; }
  .bb-hero, .wv-intro, .eval-hero { max-width: 100%; }
}

/* ===================================================================
 * Shared footer — consistent trust/methodology line on every page
 * =================================================================== */
.site-foot {
  max-width: var(--maxw);
  margin: 40px auto 28px;
  padding: 18px 28px 0;
  border-top: 1px solid var(--stroke-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.6;
}
.site-foot .foot-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}
.site-foot .foot-line { flex: 1; min-width: 240px; }

/* ── Smoke / Fire trade-flow badges (soft-fill) — shared across pages ── */
.flow-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1;
  vertical-align: middle; white-space: nowrap;
}
.flow-badge .fb-ic { flex-shrink: 0; }
.flow-badge.fire  { color: var(--accent-warn); background: rgba(224, 169, 58, 0.13); }
.flow-badge.smoke { color: var(--text-muted);  background: rgba(134, 147, 166, 0.13); }
