/* Umbrella Regiment — design tokens
   Set data-theme on <html>: "offseason" (default) | "warden" | "colonial".
   Resolve it server-side from the active war's faction, overridden by the
   user's stored preference. Six variables change; nothing else does. */

:root,
[data-theme="offseason"] {
  --accent:        #C8A24A;
  --on-accent:     #0B0F13;
  --bg-base:       #0B0F13;
  --bg-surface:    #11161B;
  --bg-raised:     #131920;
  --border:        #222A31;
  --border-strong: #2C3742;
}

[data-theme="warden"] {
  --accent:        #4D8FBE;
  --on-accent:     #08131C;
  --bg-base:       #0A1017;
  --bg-surface:    #111C26;
  --bg-raised:     #12202B;
  --border:        #1E2F3D;
  --border-strong: #2A4256;
}

[data-theme="colonial"] {
  --accent:        #93A559;
  --on-accent:     #0D1109;
  --bg-base:       #0D1109;
  --bg-surface:    #151B10;
  --bg-raised:     #181F11;
  --border:        #26301C;
  --border-strong: #34411F;
}

/* Theme-independent. Text never changes with the theme. */
:root {
  --text-primary:   #F2F4F6;
  --text-body:      #C9D2D9;
  --text-secondary: #A9B3BB;
  --text-muted:     #8B969F;
  --text-faint:     #6F7A83;
  --text-dim:       #5F6A73;

  /* Semantic — reserved meanings, never re-themed.
     A Warden row reads blue on the Colonial theme too. */
  --faction-warden:   #5B9FCC;
  --faction-colonial: #9BAB63;
  --state-ok:         #5FA863;
  --state-warn:       #D4A03C;
  --state-danger:     #C07A5C;
  --highlight-self:   #C8A24A;   /* "this row is you" — gold on all themes */

  --font-display: 'Oswald', system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-phone: 14px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 14px;
  --space-5: 18px; --space-6: 22px; --space-7: 28px; --space-8: 40px;

  --shell-sidebar: 236px;
  --shell-topbar:  60px;
  --settings-rail: 238px;
  --tap-min:       44px;
}

html { background: var(--bg-base); }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
}
a       { color: var(--accent); text-decoration: none; }
a:hover { color: color-mix(in oklch, var(--accent) 80%, white); }
* { box-sizing: border-box; }

/* Type scale ---------------------------------------------------------- */
.t-hero    { font-family: var(--font-display); font-weight: 600; font-size: 76px; line-height: 1; letter-spacing: .03em; color: var(--text-primary); }
.t-h1      { font-family: var(--font-display); font-size: 40px; letter-spacing: .02em; color: var(--text-primary); }
.t-h2      { font-family: var(--font-display); font-size: 30px; letter-spacing: .03em; color: var(--text-primary); }
.t-h3      { font-family: var(--font-display); font-size: 21px; letter-spacing: .05em; color: var(--text-primary); }
.t-page    { font-family: var(--font-display); font-size: 19px; letter-spacing: .06em; color: var(--text-primary); }
.t-metric  { font-family: var(--font-display); font-size: 28px; color: var(--text-primary); }
.t-label   { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; color: var(--text-muted); text-transform: uppercase; }
.t-meta    { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: var(--text-faint); }
.t-num     { font-family: var(--font-mono); font-size: 14px; }

/* Mobile: hero and h1 step down. */
@media (max-width: 640px) {
  .t-hero { font-size: 38px; line-height: 1.02; }
  .t-h1   { font-size: 24px; }
  .t-h2   { font-size: 22px; }
}

/* Surfaces ------------------------------------------------------------ */
.card        { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.card-raised { background: var(--bg-raised);  border: 1px solid var(--border); border-radius: var(--radius-md); }
.card-hero   { background: linear-gradient(135deg, #141B22 0%, #10151A 100%); border: 1px solid var(--border); border-radius: var(--radius-md); }
.card-active { border-left: 2px solid var(--accent); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.row-self    { background: var(--bg-raised); border-left: 2px solid var(--highlight-self); }

/* Controls ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap-min); padding: 0 26px;
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost   { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.btn-mono    { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; font-weight: 400; padding: 0 18px; }

.pill {           /* channel / role picker trigger */
  font-size: 13px; color: var(--text-primary);
  background: #1E2731; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 12px;
}
.pill-empty { color: var(--text-faint); background: #171D24; border-style: dashed; }

/* Drawn on a <button>, so the UA's border, padding and appearance have to go:
   a 2px outset border inside a border-box 40x22 leaves the knob cramped and
   rings the whole control in white. */
.toggle       { appearance: none; -webkit-appearance: none; border: 0; padding: 0; width: 40px; height: 22px; border-radius: 11px; background: #242D36; position: relative; flex: none; cursor: pointer; }
.toggle::after{ content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #4A555F; transition: .12s; }
.toggle[aria-checked="true"]        { background: var(--accent); }
.toggle[aria-checked="true"]::after { left: auto; right: 3px; background: var(--on-accent); }
.toggle[aria-disabled="true"]       { opacity: .55; cursor: not-allowed; }

.tabs      { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.tab       { min-height: var(--tap-min); display: flex; align-items: center; padding: 0 22px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; color: var(--text-muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

/* Shell --------------------------------------------------------------- */
.shell       { display: flex; min-height: 100vh; }
.shell-nav   { width: var(--shell-sidebar); flex: none; background: color-mix(in oklch, var(--bg-base) 88%, black); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.shell-main  { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.shell-top   { height: var(--shell-topbar); flex: none; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.nav-item    { min-height: var(--tap-min); display: flex; align-items: center; padding: 0 10px; font-size: 14px; color: var(--text-secondary); border-radius: var(--radius-sm); }
.nav-item[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.nav-group   { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; color: var(--text-dim); padding: 18px 10px 6px; }

/* Data tables --------------------------------------------------------- */
.table        { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.table-head   { background: var(--bg-raised); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--text-muted); }
.table-row    { border-bottom: 1px solid color-mix(in oklch, var(--border) 70%, black); align-items: center; }
.table-row:last-child { border-bottom: 0; }
.table-cell   { padding: 13px 16px; }
.cell-num     { text-align: right; font-family: var(--font-mono); font-size: 14px; }

/* Mobile: sidebar becomes bottom bar + drawer; tables become cards. ---- */
@media (max-width: 640px) {
  .shell     { flex-direction: column; }
  .shell-nav { position: fixed; inset: 0; z-index: 40; width: 100%; transform: translateX(-100%); transition: transform .18s; }
  .shell-nav[data-open="true"] { transform: none; }
  .shell-nav > .nav-list { flex: 1; min-height: 0; overflow-y: auto; }   /* footer stays pinned */
  .shell-top { padding: 0 18px; height: 56px; }
  .tabbar    { position: sticky; bottom: 0; height: 64px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); background: color-mix(in oklch, var(--bg-base) 88%, black); }
  .table     { border: 0; }
  .table-head { display: none; }
  .table-row { display: flex; gap: 14px; align-items: center; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 8px; padding: 14px 16px; }
}
