/* ============================================================================
   STYLES.CSS // DE-LEET CODE SWISS NEO-BRUTALIST COMMAND CENTER (IMPECCABLE CRAFT)
   Production-grade, Anti-Slop, WCAG 2.1 AA Compliant, 11px Text Floor
   ============================================================================ */

/* PALETTES — every color the UI and the canvases use. Keep values 6-digit hex:
   theme.js reads them for canvas drawing. Role names are stable across themes
   (--acid is "primary/verified", --orange is "hazard"), even when the hue isn't. */
:root,
:root[data-theme="carbon"] {
  --bg: #0A0A08;
  --panel: #11110E;
  --panel-alt: #161612;
  --sunken: #0D0D0B;
  --raised: #181814;
  --hover: #20201A;
  --selected: #211F16;
  --ink: #EAE6DF;
  --muted: #9C978D;
  --dim: #4A4842;
  --orange: #FF3B00;
  --acid: #C6FF00;
  --gold: #FFB800;
  --cyan: #00F0FF;
  --border: #2A2925;
  --border-strong: #45433D;
  --on-accent: #000000;
  --shadow: #000000;
  --wall-bg: #12120F;
  --mural: #22211C;
  --brick: #201F1A;
  --brick-hurt: #341E15;
  --brick-crit: #4A1608;
  --brick-edge: #35342D;
  --globe-hi: #191914;
  --globe-mid: #0D0D0A;
  --globe-lo: #070705;
  --globe-edge: #38362F;
}

:root[data-theme="mocha"] {
  --bg: #11111B;
  --panel: #181825;
  --panel-alt: #1E1E2E;
  --sunken: #141420;
  --raised: #232334;
  --hover: #2A2B3C;
  --selected: #2E2A40;
  --ink: #CDD6F4;
  --muted: #A6ADC8;
  --dim: #6C7086;
  --orange: #FAB387;
  --acid: #CBA6F7;
  --gold: #F9E2AF;
  --cyan: #89DCEB;
  --border: #313244;
  --border-strong: #45475A;
  --on-accent: #11111B;
  --shadow: #07070C;
  --wall-bg: #151522;
  --mural: #262637;
  --brick: #24273A;
  --brick-hurt: #3A2D3A;
  --brick-crit: #573043;
  --brick-edge: #45475A;
  --globe-hi: #262637;
  --globe-mid: #181825;
  --globe-lo: #0E0E17;
  --globe-edge: #45475A;
}

:root[data-theme="tokyo-night"] {
  --bg: #16161E;
  --panel: #1A1B26;
  --panel-alt: #1F2335;
  --sunken: #13131A;
  --raised: #222436;
  --hover: #292E42;
  --selected: #2A2F48;
  --ink: #C0CAF5;
  --muted: #A9B1D6;
  --dim: #565F89;
  --orange: #FF9E64;
  --acid: #7AA2F7;
  --gold: #E0AF68;
  --cyan: #7DCFFF;
  --border: #292E42;
  --border-strong: #3B4261;
  --on-accent: #16161E;
  --shadow: #0B0B10;
  --wall-bg: #13131A;
  --mural: #222436;
  --brick: #1F2335;
  --brick-hurt: #362A3A;
  --brick-crit: #4D2934;
  --brick-edge: #3B4261;
  --globe-hi: #24283B;
  --globe-mid: #1A1B26;
  --globe-lo: #101016;
  --globe-edge: #3B4261;
}

/* Light palette: white surfaces, purple as the primary accent. Accents are darkened
   so text on white stays above 4.5:1; hover mixes toward black instead of white. */
:root[data-theme="lavender"] {
  color-scheme: light;
  --bg: #FFFFFF;
  --panel: #F8F5FD;
  --panel-alt: #F1EBFA;
  --sunken: #F4EFFB;
  --raised: #EEE7F9;
  --hover: #E8DFF7;
  --selected: #E3D7F8;
  --ink: #1E1433;
  --muted: #5B5070;
  --dim: #A497BC;
  --orange: #A8360A;
  --acid: #6D28D9;
  --gold: #A15C07;
  --cyan: #0E7490;
  --border: #E2D9F0;
  --border-strong: #C4B5DD;
  --on-accent: #FFFFFF;
  --shadow: #C9B8E8;
  --hover-mix: #000000;
  --wall-bg: #F4EFFB;
  --mural: #E3D8F3;
  --brick: #FFFFFF;
  --brick-hurt: #F6DDE8;
  --brick-crit: #F9D7D3;
  --brick-edge: #CBBDE3;
  --globe-hi: #F3EEFB;
  --globe-mid: #E5DBF5;
  --globe-lo: #D4C6EE;
  --globe-edge: #B9A6DA;
}

:root {
  /* What hovered accent buttons mix toward: lighter on dark palettes, darker on light ones */
  --hover-mix: #FFFFFF;
  --font-display: 'Cabinet Grotesk', 'Arial Black', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Mono', 'Consolas', monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* BROWSER SURFACE THEMED INTEGRATION */
::selection {
  background: var(--acid);
  color: var(--on-accent);
}
::-moz-selection {
  background: var(--acid);
  color: var(--on-accent);
}
input, textarea, select {
  caret-color: var(--acid);
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-x: hidden;
  height: 100vh;
}

/* Desktop Viewport Discipline */
@media (min-width: 981px) {
  body {
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
  }
  /* Fill whatever the header leaves; its height changes with width and font size */
  .workspace {
    flex: 1;
    height: auto;
  }
}

/* User-select restricted to interactive canvas and controls */
button, .mode-tab, .city-pill, canvas, .dispatch-bar {
  user-select: none;
  -webkit-user-select: none;
}
p, .confession-item, .madlib-preview, .stat-val, .hud-overlay-tl {
  user-select: text;
  -webkit-user-select: text;
}

/* ACCESSIBILITY FOCUS INDICATORS (WCAG 2.1 AA) */
:focus-visible {
  outline: 2px solid var(--acid) !important;
  outline-offset: 2px !important;
}

/* INDUSTRIAL SCROLLBARS */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg);
}

/* LIVE DISPATCH BANNER */
.dispatch-bar {
  background: var(--orange);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--shadow);
  gap: 14px;
}
.dispatch-lead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  flex-shrink: 0;
}
.dispatch-badge {
  background: var(--shadow);
  color: var(--orange);
  font-size: 11.5px;
  font-weight: 900;
  padding: 2px 6px;
  letter-spacing: 0.05em;
}
.dispatch-message {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dispatch-action {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  color: var(--on-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

/* TOP TELEMETRY BAR */
.topbar {
  display: grid;
  grid-template-columns: 340px 1fr auto;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.brand-cell {
  padding: 14px 20px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
h1.brand-title {
  margin: 0;
}
.noscript-note {
  padding: 16px;
  color: var(--ink);
}
.brand-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  line-height: 1.1;
}
.brand-name {
  white-space: nowrap;
}
.brand-badge {
  background: var(--acid);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  letter-spacing: 0.04em;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat-cell {
  padding: 10px 16px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.stat-val {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-val.acid { color: var(--acid); }
.stat-val.orange { color: var(--orange); }
.stat-val.gold { color: var(--gold); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
}

/* NEO-BRUTALIST TACTILE BUTTONS */
.btn {
  background: var(--panel-alt);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 3px 3px 0px var(--shadow);
  transition: transform 0.08s var(--ease-out-expo), box-shadow 0.08s var(--ease-out-expo), background 0.12s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--shadow);
  background: var(--hover);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: 3px 3px 0px var(--shadow);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--shadow);
}
.btn-orange {
  background: var(--orange);
  color: var(--on-accent);
  border-color: var(--shadow);
}
.btn-orange:hover {
  background: color-mix(in srgb, var(--orange) 85%, var(--hover-mix));
  color: var(--on-accent);
}
.btn-acid {
  background: var(--acid);
  color: var(--on-accent);
  border-color: var(--shadow);
}
.btn-acid:hover {
  background: color-mix(in srgb, var(--acid) 80%, var(--hover-mix));
  color: var(--on-accent);
}
.btn-gold {
  background: var(--gold);
  color: var(--on-accent);
  border-color: var(--shadow);
}
.btn-gold:hover {
  background: color-mix(in srgb, var(--gold) 80%, var(--hover-mix));
  color: var(--on-accent);
}

/* MODE SWITCHER BAR */
.mode-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--sunken);
  justify-content: space-between;
  align-items: center;
  padding-right: 18px;
  overflow-x: auto;
}
.mode-tabs {
  display: flex;
  flex-shrink: 0;
}
.mode-tab {
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.1s, background 0.1s;
}
.mode-tab.active {
  background: var(--ink);
  color: var(--on-accent);
}
.mode-tab:hover:not(.active) {
  color: var(--ink);
  background: var(--raised);
}
.mode-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-left: 12px;
  font-size: 12px;
  color: var(--muted);
}
.mode-tools label {
  font-weight: 700;
}
.mode-tools select.theme-select {
  width: auto;
  padding: 4px 22px 4px 8px;
  margin-right: 10px;
  font-weight: 700;
}

/* MAIN WORKSPACE LAYOUT */
.workspace {
  display: grid;
  grid-template-columns: 1fr 400px;
  height: calc(100vh - 108px);
  min-height: 0;
}

.stage-col {
  position: relative;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 45%, var(--panel-alt) 0%, var(--bg) 75%);
  overflow: hidden;
}

/* VIEWPORT PANELS */
.view-section {
  display: none;
  flex: 1;
  position: relative;
  flex-direction: column;
  min-height: 0;
}
.view-section.active {
  display: flex;
}

/* 3D GLOBE CANVAS & OVERLAY HUD */
#globe-container {
  width: 100%;
  flex: 1;
  min-height: 380px;
  position: relative;
  cursor: grab;
  overflow: hidden;
  touch-action: pan-y;
}
#globe-container:active {
  cursor: grabbing;
}
#globe-canvas {
  /* Out of flow, so a size left over from a wider window can't hold the view open */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hud-overlay-tl {
  position: absolute;
  top: 18px;
  left: 18px;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border: 1px solid var(--border-strong);
  padding: 14px 16px;
  max-width: 380px;
  box-shadow: 4px 4px 0 var(--shadow);
}
.hud-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.hud-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* CITY QUICK-ZOOM BAR */
.city-bar {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
}
.city-pill {
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.city-pill:hover, .city-pill.active {
  background: var(--orange);
  color: var(--on-accent);
  border-color: var(--shadow);
}
.city-pill.gold-node {
  border-color: var(--gold);
  color: var(--gold);
}
.city-pill.gold-node.active, .city-pill.gold-node:hover {
  background: var(--gold);
  color: var(--on-accent);
  border-color: var(--shadow);
}

/* DEMOLITION WALL CANVAS */
#wall-canvas-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 380px;
  background: var(--wall-bg);
  overflow: hidden;
  cursor: crosshair;
  touch-action: pan-y;
}
#wall-canvas {
  /* Out of flow, so a size left over from a wider window can't hold the view open */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.wall-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.wall-hud {
  gap: 10px;
}
.active-weapon-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
}
.wall-hud-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
}
.wall-keys {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
/* Touch-only devices have no keys to press */
@media (pointer: coarse) {
  .wall-keys {
    display: none;
  }
}
.combo-box {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--orange);
  padding: 8px 14px;
  box-shadow: 4px 4px 0 var(--shadow);
}

/* WEAPON ARSENAL BAR */
.arsenal-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.weapon-card {
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.weapon-card:hover {
  background: var(--hover);
}
.weapon-card.active {
  background: var(--selected);
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}
.weapon-select {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.weapon-name {
  display: block;
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 4px;
}
.weapon-dmg {
  display: block;
  font-size: 12px;
  color: var(--orange);
  font-weight: 700;
}
.weapon-aff {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  text-align: left;
  margin-top: 8px;
  font-size: 12px;
  color: var(--acid);
  text-decoration: underline;
  display: inline-block;
  cursor: pointer;
  font-weight: 600;
}
.weapon-aff:hover {
  color: color-mix(in srgb, var(--acid) 80%, var(--hover-mix));
}

/* RIGHT SIDEBAR: DOSSIER + SPAM-PROOF RANT BUILDER */
.sidebar {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}
.sidebar-block {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.block-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--raised);
  color: var(--acid);
  border: 1px solid var(--border-strong);
}

/* FEED LIST */
.confession-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.confession-item {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 13px;
  position: relative;
  line-height: 1.5;
}
.confession-item.gold-item {
  border-color: var(--gold);
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 9%, transparent), color-mix(in srgb, var(--bg) 95%, transparent));
}
.confession-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.cosign-btn {
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
}
.cosign-btn:hover {
  background: var(--orange) !important;
  color: var(--on-accent) !important;
  border-color: var(--shadow) !important;
}
a.cosign-btn {
  display: inline-block;
  text-decoration: none;
}
.cosign-btn-acid {
  color: var(--acid);
}
.cosign-btn-cyan {
  color: var(--cyan);
}

/* ELDEN-RING STYLE SPAM-PROOF RANT BUILDER */
.madlib-box {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.madlib-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.madlib-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* TACTICAL FORM CONTROLS WITH CHEVRON */
select, input[type="text"], input[type="email"] {
  background: var(--panel-alt);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  width: 100%;
}
select {
  appearance: none;
  -webkit-appearance: none;
  /* Chevron drawn from two gradients so it follows the active palette */
  background-image: linear-gradient(45deg, transparent 50%, var(--acid) 50%), linear-gradient(135deg, var(--acid) 50%, transparent 50%);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  background-position: right 12px center, right 8px center;
  padding-right: 22px;
  cursor: pointer;
}

.madlib-preview {
  background: var(--panel-alt);
  border: 1px solid var(--border-strong);
  padding: 12px;
  font-size: 13px;
  color: var(--ink);
  font-style: italic;
  line-height: 1.5;
}

/* PASSIVE MONETIZATION CARDS */
.cashflow-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
}
.cash-card {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 20px;
  box-shadow: 5px 5px 0px var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cash-card h3 {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.cash-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* SPONSORED NATIVE AD SLOT (CLEAN 1PX BORDER WITH SOLID TOP STRIP) */
.native-ad-box {
  background: var(--panel-alt);
  border: 1px solid var(--border-strong);
  padding: 14px;
}
.native-ad-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--acid);
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.native-ad-box p {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
}

.confession-meta .handle {
  color: var(--acid);
}
.confession-meta .handle-gold {
  color: var(--gold);
}
.confession-reality {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-strong);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--acid);
}
.shuffle-btn {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}
.confession-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
}
.sample-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  padding: 0 4px;
  margin-left: 4px;
}
.turnstile-slot:empty {
  display: none;
}
.turnstile-slot {
  margin-top: 10px;
}
/* NO-LEETCODE PLEDGE: WALL, FORM AND DIALOG (pledge.js) */
.pledge-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
}
.pledge-item {
  background: var(--panel-alt);
  border: 1px solid var(--border-strong);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.pledge-visit {
  color: var(--acid);
  font-weight: 800;
  font-size: 12px;
  text-decoration: underline;
}
/* NO-LEETCODE WALL TAB */
.companies-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.companies-title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.companies-intro {
  color: var(--muted);
  max-width: 760px;
  line-height: 1.6;
}
.companies-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.company-search {
  background: var(--sunken);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  max-width: 420px;
}
.method-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.filter-chip:hover {
  background: var(--hover);
}
.filter-chip.on {
  background: var(--acid);
  color: var(--on-accent);
  border-color: var(--shadow);
}
#view-companies .pledge-wall {
  max-height: none;
  overflow: visible;
}
.companies-foot {
  font-size: 12.5px;
  color: var(--muted);
}
.companies-foot a, .link-btn {
  color: var(--acid);
  font-weight: 800;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.pledge-wall-note {
  grid-column: 1 / -1;
}
.pledge-item.sample {
  border-style: dashed;
}
.pledge-item.sample .pledge-item-head strong {
  color: var(--muted);
}
.pledge-item.highlighted {
  border-color: var(--acid);
  box-shadow: 4px 4px 0 var(--acid);
}
.pledge-item-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pledge-item-head strong {
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.pledge-domain {
  color: var(--muted);
  font-size: 12px;
}
.pledge-item-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pledge-item-foot > span:first-child {
  white-space: nowrap;
}
.pledge-item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.pledge-methods {
  border: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 4px 0;
}
.pledge-methods legend {
  margin-bottom: 6px;
}
.pledge-method, .pledge-agree {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}
.pledge-agree a {
  color: var(--acid);
}
.pledge-method input, .pledge-agree input {
  accent-color: var(--acid);
  margin-top: 2px;
}
.pledge-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--acid);
  min-height: 1em;
}
.pledge-status.error {
  color: var(--orange);
}
.pledge-copy {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.55;
}
.pledge-meta {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 12px;
  font-size: 12px;
  margin-bottom: 12px;
}
.pledge-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
}
.pledge-wide {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}
.pledge-badge-preview {
  display: block;
  margin: 8px 0;
  max-width: 100%;
}

.site-disclaimer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

/* LEGAL PAGES (legal/*.html) */
html:has(body.legal-page),
body.legal-page {
  height: auto;
  overflow-y: auto;
}
.legal-box {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.legal-box h1 {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.04em;
  margin: 18px 0 20px;
}
.legal-box h2 {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 26px 0 8px;
  color: var(--acid);
}
.legal-box p,
.legal-box li {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 10px;
}
.legal-box ul {
  padding-left: 20px;
}
.legal-box a,
.site-disclaimer a {
  color: var(--acid);
}
.legal-back {
  font-weight: 800;
  font-size: 12px;
}
.legal-draft {
  border: 1px solid var(--orange);
  background: var(--panel);
  padding: 10px 12px;
  color: var(--orange) !important;
  font-weight: 700;
}
.legal-updated {
  color: var(--muted) !important;
  font-size: 12px !important;
}
.legal-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
}

/* MODAL DIALOGS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--shadow) 88%, transparent);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
  overflow-y: auto;
}
.modal-backdrop.open {
  display: flex;
}
.modal-box {
  background: var(--panel);
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0px var(--shadow);
  max-width: 520px;
  width: 100%;
  padding: 20px;
  max-height: 94vh;
  overflow-y: auto;
}

/* THERMAL RECEIPT CANVAS */
#receipt-canvas {
  width: 380px;
  aspect-ratio: 380 / 560;
  height: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto 14px auto;
  box-shadow: 6px 6px 0 var(--shadow);
}
.receipt-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* TOAST NOTIFICATION WITH EXPONENTIAL EASING */
#toast-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--acid);
  color: var(--on-accent);
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.05em;
  box-shadow: 5px 5px 0 var(--shadow);
  z-index: 9999;
  transition: transform 0.24s var(--ease-out-expo);
  pointer-events: none;
}
#toast-banner.show {
  transform: translateX(-50%) translateY(0);
}

/* RESPONSIVE DESIGN (TABLET & MOBILE) */
@media (max-width: 980px) {
  html, body {
    height: auto;
    overflow-y: auto;
  }
  .topbar {
    grid-template-columns: 1fr;
  }
  .brand-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .telemetry-strip {
    grid-template-columns: repeat(2, 1fr);
    border-bottom: 1px solid var(--border);
  }
  .top-actions {
    padding: 12px 18px;
    justify-content: flex-end;
  }
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }
  .stage-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  #globe-container, #wall-canvas-wrap {
    height: 440px;
    min-height: 440px;
  }
  .arsenal-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar {
    height: auto;
    overflow-y: visible;
  }
  .companies-view {
    overflow-y: visible;
    padding: 16px;
  }
  .companies-title {
    font-size: 24px;
  }
  /* The page scrolls on phones, so no boxes that scroll inside it */
  .pledge-wall, .confession-list {
    max-height: none;
    overflow-y: visible;
  }
  .cashflow-grid {
    grid-template-columns: 1fr;
  }
  .receipt-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Weapon readout on top, the three wall buttons share one row under it */
  .wall-hud {
    top: 8px;
    left: 8px;
    right: 8px;
    flex-direction: column;
    gap: 8px;
  }
  .combo-box {
    padding: 6px 10px;
  }
  /* Smaller city card so it covers less of the globe */
  .hud-overlay-tl {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 8px 12px;
    box-shadow: 3px 3px 0 var(--shadow);
  }
  .hud-title {
    font-size: 15px;
    margin-bottom: 2px;
  }
  .hud-desc {
    font-size: 11.5px;
    line-height: 1.4;
  }
  .active-weapon-label {
    font-size: 13px;
  }
  .combo-meter {
    font-size: 11px;
  }
  .wall-hud-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .wall-hud-actions .btn {
    justify-content: center;
    padding: 8px 4px;
    font-size: 10.5px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 22px;
  }
  .mode-tab {
    padding: 11px 16px;
    font-size: 11.5px;
  }
  .arsenal-bar {
    grid-template-columns: 1fr;
  }
}

/* CAREER LADDER, COMBOS, TROPHY CASE & CITY WARS (game.js) */
.stat-val.stat-rank {
  font-size: 15px;
  color: var(--acid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-meter {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.combo-meter.live {
  color: var(--gold);
}
.career-rank {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  color: var(--acid);
}
.career-rank #career-xp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.xp-track {
  height: 8px;
  margin: 8px 0 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
}
.xp-fill {
  height: 100%;
  width: 0;
  background: var(--acid);
  transition: width 0.4s var(--ease-out-expo);
}
.career-next {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 10px;
}
.daily-boss {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--shadow);
}
.daily-boss:hover {
  background: var(--gold);
  color: var(--on-accent);
}
.daily-boss.done {
  color: var(--muted);
  border-color: var(--border-strong);
}
.trophy-case {
  margin-top: 12px;
}
.trophy-case summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.trophy-case summary span {
  color: var(--acid);
}
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.trophy {
  padding: 8px;
  border: 1px dashed var(--border-strong);
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.trophy strong {
  display: block;
  color: var(--muted);
}
.trophy.earned {
  border-style: solid;
  border-color: var(--gold);
}
.trophy.earned strong {
  color: var(--gold);
}
.weapon-card.locked {
  opacity: 0.55;
}
.weapon-card.locked .weapon-dmg {
  color: var(--muted);
}
.citywars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.citywars-row {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.citywars-row:hover {
  background: var(--hover);
}
.citywars-row.mine {
  border-color: var(--orange);
}
.citywars-pos {
  color: var(--orange);
}
.citywars-score {
  color: var(--acid);
  font-variant-numeric: tabular-nums;
}
.citywars-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* MOTION: views slide in on tab switch, panels rise as they scroll in (app.js revealOnScroll) */
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop-in {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes tab-glow {
  from { box-shadow: inset 0 -3px 0 transparent; }
  to { box-shadow: inset 0 -3px 0 var(--orange); }
}
.view-section.active {
  animation: view-in 0.4s var(--ease-out-expo);
}
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease-out-expo) var(--reveal-delay, 0ms),
              transform 0.5s var(--ease-out-expo) var(--reveal-delay, 0ms),
              background 0.12s;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.weapon-card.active {
  animation: pop-in 0.3s var(--ease-out-expo);
}
.mode-tab.active {
  animation: tab-glow 0.3s var(--ease-out-expo) forwards;
}
.city-pill.active {
  animation: pop-in 0.25s var(--ease-out-expo);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* The payment-result popup only needs its one button */
#checkout-modal.result-only [data-action="checkout-close"].btn { display: none; }

/* Merch tab: coming-soon cards */
.merch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.merch-item { border: 1px solid var(--border-strong); background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.merch-item h3 { font-family: var(--font-display); font-size: 16px; margin: 0; }
.merch-item p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.merch-soon { align-self: flex-start; font-family: var(--font-mono); font-size: 10px; font-weight: 900; letter-spacing: 0.08em; padding: 3px 7px; background: var(--acid); color: var(--on-accent); }
.merch-price { font-family: var(--font-mono); font-size: 12px; color: var(--acid); margin-left: 6px; }
.merch-later { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.merch-notify { margin-top: auto; justify-content: center; font-size: 11px; }
