/* Vanilla-inspired theme layer (non-breaking). Overrides only visuals. */

html.theme-vanilla{
  /* Palette tuned to existing vars so engine semantics remain intact */
  --bg: #0b0c0f;
  --surface: #12141a;
  --panel: #12141a;
  --text: #e8eaed;
  --muted: #b7bcc8;
  --border: rgba(255,255,255,.08);
  --accent: #60a5fa;        /* blue tells remain blue */
  --focus: #61e4b6;         /* accessible highlight */
  --danger: #f97373;        /* red tells remain red */
  --success: #34d399;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
}

body.theme-vanilla{
  background: radial-gradient(1200px 800px at 70% -10%, #0f1322 0%, #0b0c0f 55%);
  color: var(--text);
}

/* Header → glassy sticky bar with HUD pills */
body.theme-vanilla .site-header{
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,12,15,.6);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

body.theme-vanilla .logo-wrapper{ display:flex; align-items:center; gap:.5rem; }
body.theme-vanilla .site-logo-svg{ width:22px; height:22px; border-radius:6px; padding:2px; background:linear-gradient(135deg,#fff,rgba(255,255,255,.6)); box-shadow:inset 0 0 0 1px rgba(255,255,255,.25); }
body.theme-vanilla .site-sub-logo-svg{ opacity:.9; }

body.theme-vanilla #top-stats{
  margin-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}
body.theme-vanilla #top-stats .divider{ display:none; }
body.theme-vanilla #top-stats .stat{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 1 1 150px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  font-weight: 700;
}
body.theme-vanilla #top-stats .stat .label{
  color: #cbd1dc;
  font-weight: 600;
}
@media (min-width: 960px){
  body.theme-vanilla #top-stats{
    margin-left: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
  body.theme-vanilla #top-stats .stat{
    justify-content: flex-end;
    padding: 16px 18px;
  }
  body.theme-vanilla #top-stats .stat .label{
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.09);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
  }
}

/* Main container width and spacing */
body.theme-vanilla .container{ max-width: 1400px; padding: 12px 18px 32px; }

/* HUD grid (left/mid/right) aligned to mock’s columns */
@media (min-width: 1024px){
  body.theme-vanilla #pane-game .hud{
    display: grid;
    grid-template-columns: minmax(240px, 260px) minmax(0, 1fr) minmax(280px, 320px);
    gap: 16px;
    align-items: start;
  }
  body.theme-vanilla #pane-game .hud .mid-stack{ display:flex; flex-direction:column; gap:14px; margin-top:10px; }
  body.theme-vanilla #pane-game .hud .mid-stack .choices{ margin-top:8px; }
}

/* Objectives panel left column */
body.theme-vanilla .objectives-panel .panel-body{ padding:10px 14px; }
body.theme-vanilla .objectives-panel #run-goals{ display:flex; flex-direction:column; gap:12px; }
body.theme-vanilla .objectives-panel #run-goals .goal{ background: rgba(255,255,255,.06); border:1px solid var(--border); padding:10px 12px; border-radius:12px; }

/* Panels (inventory/promises) */
body.theme-vanilla #pane-game .panel{ background: var(--panel); border:1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow:hidden; }
body.theme-vanilla #pane-game .panel .panel-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; border-bottom:1px solid var(--border); background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)); border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
body.theme-vanilla #panel-promises .panel-header{ justify-content:flex-end; }
body.theme-vanilla #pane-game .panel .panel-body{ padding:12px 14px; }
body.theme-vanilla #pane-game .panel .panel-body{ transition: height .22s ease, opacity .2s ease; overflow: hidden; }
body.theme-vanilla #pane-game .panel.collapsed .panel-body{ opacity:.0; }

/* Desktop HUD tabs */
body.theme-vanilla .hud-right.tabbed{ display:flex; flex-direction:column; gap:10px; width:100%; }
body.theme-vanilla .hud-right .hud-tabs{ display:flex; gap:6px; border-bottom:1px solid var(--border); padding:0 2px 6px; }
body.theme-vanilla .hud-right .hud-tab{ appearance:none; background:none; border:none; color:var(--muted); padding:8px 10px; border-radius:10px; cursor:pointer; }
body.theme-vanilla .hud-right .hud-tab.active{ color:var(--text); background: rgba(255,255,255,.06); box-shadow: inset 0 -2px 0 0 var(--focus); }
body.theme-vanilla .hud-right .tab-panel{ display:block; }
body.theme-vanilla .hud-right .tab-panel:not(.active){ display:none; }

/* Threat clock → elegant meter */
body.theme-vanilla .threat-bar{ height:10px; border-radius:999px; background:#0e1016; border:1px solid var(--border); overflow:hidden; }
body.theme-vanilla .threat-bar-fill{ background:linear-gradient(90deg, #61e4b6, #60a5fa) !important; height:100%; }

/* Story/prose card */
body.theme-vanilla #prose{ background: #171a21; border:1px solid var(--border); border-radius: var(--radius-lg); padding:18px; box-shadow: var(--shadow); }
body.theme-vanilla #prose h2, body.theme-vanilla #prose h3{ margin-top:0; }

/* Choices: harmonize with card style (respects existing choice-layout.css) */
@media (min-width:1024px){
  body.theme-vanilla .choice-card{ background: rgba(255,255,255,.04); border-color: var(--border); border-radius: 14px; box-shadow: var(--shadow); }
  body.theme-vanilla .choice-card:hover{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
  body.theme-vanilla .chip{ background: rgba(255,255,255,.08); border-color: var(--border); }
}

/* Presence chip & meta chips */
body.theme-vanilla .badge, body.theme-vanilla .meta-chip{ background: rgba(255,255,255,.08); border:1px solid var(--border); color: var(--text); border-radius: 999px; }
body.theme-vanilla #carry-count.meta-chip{ padding:2px 8px; font-weight:700; font-variant-numeric: tabular-nums; margin-left:8px; }
body.theme-vanilla .inv-divider{ border-top:1px solid var(--border); margin:8px 0 10px; opacity:.6; }
body.theme-vanilla .story-wrap{ margin-top: 16px; display:flex; flex-direction:column; gap:14px; }

/* Footer hotkeys */
body.theme-vanilla .hotkey-footer{ color: var(--muted); border-top: 1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)); border-radius: var(--radius); }

/* Buttons: gradient primary, subtle ghost */
body.theme-vanilla .primary{ border:none; color:#0b0c0f; font-weight:700; background: linear-gradient(90deg,#61e4b6,#60a5fa); }
body.theme-vanilla .primary:disabled{ opacity:.6; }
body.theme-vanilla .ghost{ background: rgba(255,255,255,.06); border:1px solid var(--border); }
body.theme-vanilla .ghost:hover{ background: rgba(255,255,255,.1); }

/* Lists used in right/left panels */
body.theme-vanilla #states li, body.theme-vanilla #trust li{ background: rgba(255,255,255,.08); border:1px solid var(--border); }

/* Journal & misc containers */
body.theme-vanilla .journal{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); padding:12px; box-shadow: var(--shadow); }

/* Site footer refinement */
body.theme-vanilla .site-footer{ background: rgba(11,12,15,.6); -webkit-backdrop-filter: saturate(1.2) blur(8px); backdrop-filter: saturate(1.2) blur(8px); border-top:1px solid var(--border); }

/* Dev/HC/reduce-motion compatibility remains from base CSS */
