/* Critical Path in the Civil Systems design language: drafting paper, square corners,
   1px borders, soft ambient shadows, Inter and IBM Plex Mono. Loaded last, so it sets the
   tokens styles.css reads and replaces what they cannot reach. Critical Path is blue. */

/* --- Tokens: day ---------------------------------------------------------- */
body.light-mode {
  color-scheme: light;
  --bg-dark: #f4f4f5;
  --bg-panel: #ffffff;
  --bg-active: #e8efff;
  --text: #27272a;
  --text-dim: #52525b;
  --text-bright: #09090b;
  --red: #b91c1c;
  --orange: #c2410c;
  --green: #15803d;
  --green-dim: #dcfce7;
  --cyan: #1d4ed8;
  --cyan-dim: #dbeafe;
  --blue: #1d4ed8;
  --purple: #6d28d9;
  --gold: #a16207;
  --gold-dim: #fef9c3;
  --border: rgba(9, 9, 11, 0.14);
  --grid-line: rgba(9, 9, 11, 0.05);
  --action: #1d4ed8;
  --red-tint: #fef2f2;
  --orange-tint: #fff7ed;
  --green-tint: #f0fdf4;
  --purple-tint: #f5f3ff;
  --shadow-ao: 0 0 1px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.06),
    0 14px 32px rgba(0, 0, 0, 0.04);
  --scrim: rgba(9, 9, 11, 0.55);
}

/* --- Tokens: night -------------------------------------------------------- */
body:not(.light-mode) {
  color-scheme: dark;
  --bg-dark: #09090b;
  --bg-panel: #141416;
  --bg-active: #1c2740;
  --text: #e4e4e7;
  --text-dim: #a1a1aa;
  --text-bright: #fafafa;
  --red: #f87171;
  --orange: #fb923c;
  --green: #4ade80;
  --green-dim: #14361f;
  --cyan: #93b4fc;
  --cyan-dim: #1c2740;
  --blue: #93b4fc;
  --purple: #c4b5fd;
  --gold: #facc15;
  --gold-dim: #3a3112;
  --border: rgba(255, 255, 255, 0.13);
  --grid-line: rgba(255, 255, 255, 0.05);
  --action: #1d4ed8;
  --red-tint: #2a1416;
  --orange-tint: #2b1a0e;
  --green-tint: #12251a;
  --purple-tint: #211a33;
  --shadow-ao: 0 4px 18px rgba(0, 0, 0, 0.6);
  --scrim: rgba(0, 0, 0, 0.72);
}

/* --- Base ----------------------------------------------------------------- */
body {
  background-color: var(--bg-dark);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

/* No scanlines, glows, or rounded corners. */
body::after {
  display: none;
}

body *,
body *::before,
body *::after {
  border-radius: 0 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  filter: none !important;
}

::-webkit-scrollbar-track,
.terminal::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  border: 0;
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover,
.terminal::-webkit-scrollbar-thumb {
  background: var(--border);
}

* {
  scrollbar-color: var(--border) var(--bg-dark);
}

:is(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.game-container {
  background: transparent;
}

/* --- Type ----------------------------------------------------------------- */
.game-title {
  color: var(--text-bright);
  font: 900 clamp(44px, 9vw, 76px) / 1 Inter, sans-serif;
  letter-spacing: -0.045em;
  text-transform: none;
}

.modal-title,
.header-title,
.project-name {
  font-family: Inter, sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* --- Buttons -------------------------------------------------------------- */
.btn,
.menu-btn,
body.light-mode .menu-btn {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-bright);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.btn:hover:not(:disabled),
.menu-btn:hover,
body.light-mode .menu-btn:hover {
  border-color: var(--cyan);
  background: var(--bg-active);
  color: var(--text-bright);
}

/* Every primary action is the same blue, including the dialogs that used to be gold. */
body .btn.primary {
  border-color: var(--action) !important;
  background: var(--action) !important;
  color: #ffffff !important;
}

body .btn.primary:hover:not(:disabled) {
  border-color: #1e40af;
  background: #1e40af;
  color: #ffffff;
}

.btn.danger {
  border-color: var(--red);
  background: var(--red-tint);
  color: var(--red);
}

.btn.danger-outline:hover,
.slot-delete-btn:hover,
.career-slot.delete-select:hover {
  background: var(--red-tint);
}

.btn-subtle:hover,
.history-download-btn:hover,
.bn-pool-item:hover {
  background: var(--bg-active);
}

body.light-mode .icon-btn,
.icon-btn {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
}

body.light-mode .icon-btn:hover,
.icon-btn:hover {
  background: var(--bg-active);
}

.toggle-switch,
body.light-mode .toggle-switch {
  border: 1px solid var(--border);
  background: var(--bg-dark);
}

.toggle-switch.active,
body.light-mode .toggle-switch.active {
  border-color: var(--action);
  background: var(--action);
}

.toggle-switch::after,
body.light-mode .toggle-switch::after {
  background: var(--text-dim);
}

.toggle-switch.active::after,
body.light-mode .toggle-switch.active::after {
  background: #ffffff;
}

.flash-attention {
  outline: 2px solid var(--cyan);
}

/* --- Header and status ---------------------------------------------------- */
.game-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}

.week-bar,
.budget-bar-container,
.metric-bar-container {
  border: 1px solid var(--border);
  background: var(--bg-dark);
}

.ap-pip.spent {
  border-color: var(--border);
}

.status-box {
  background: var(--bg-panel);
}

.status-box.status-good,
.status-box.status-excellent {
  border-color: var(--green);
}

.status-box.status-good .status-box-label,
.status-box.status-excellent .status-box-label {
  color: var(--green);
}

.status-box.status-concerned {
  border-color: var(--orange);
}

.status-box.status-concerned .status-box-label {
  color: var(--orange);
}

.status-box.status-critical {
  border-color: var(--red);
  background: var(--red-tint);
}

/* --- Terminal, now the project log ---------------------------------------- */
.terminal {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-family: Inter, sans-serif;
  font-size: 15px;
}

.terminal-line {
  color: var(--text);
}

.terminal-line.action {
  border-color: var(--border);
  color: var(--text-dim);
}

.terminal-line.dim {
  color: var(--text-dim);
  opacity: 1;
}

.terminal-line.random-event {
  background: var(--red-tint);
}

.terminal-line.week-header {
  background: var(--cyan-dim);
  color: var(--text-bright);
  font-family: 'IBM Plex Mono', monospace;
}

.terminal-line.closeout-header {
  background: var(--green-tint);
  color: var(--text-bright);
  font-family: 'IBM Plex Mono', monospace;
}

.terminal-line.week-header.animate::after,
.terminal-line.closeout-header.animate::after {
  display: none;
}

.terminal-line.call,
.terminal-line.email,
.terminal-line.meeting {
  background: var(--bg-dark);
}

.terminal-line.learning {
  background: var(--cyan-dim);
}

.archive-toggle {
  background: var(--bg-dark);
  color: var(--text-dim);
}

.archive-toggle:hover {
  background: var(--bg-active);
}

/* --- Action bar ----------------------------------------------------------- */
.action-bar {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}

.action-category,
.action-category.metrics-btn {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
}

.action-category:hover {
  border-color: var(--cyan);
}

.action-category.active,
.action-category[data-category='client'].active,
.action-category[data-category='admin'].active,
.action-category[data-category='work'].active {
  border-color: var(--cyan);
  background: var(--bg-active);
}

.sub-option-btn {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
}

.sub-option-btn:hover:not(:disabled) {
  border-color: var(--cyan);
}

.sub-option-btn.standard-action {
  background: var(--bg-active);
}

.sub-option-btn.standard-action:hover {
  background: var(--cyan-dim);
}

.sub-option-btn.is-new {
  border-color: var(--cyan);
}

.sub-option-btn.used .cost-pip,
.sub-option-btn.no-ap .cost-pip {
  border-color: var(--border);
}

/* --- Modals and cards ----------------------------------------------------- */
.modal {
  background: var(--scrim);
}

.modal-content {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: var(--shadow-ao) !important;
}

.role-card,
.project-card,
.staff-card,
.trait-card,
.career-slot,
.quick-option {
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.role-card.selected,
.trait-card.selected,
.project-card.selected,
.staff-card.selected {
  border-color: var(--cyan);
  background: var(--bg-active);
}

.project-card.high_stakes.selected,
.project-column h4.high-stakes,
.difficulty-badge.high_stakes {
  background: var(--red-tint);
}

.difficulty-badge.challenging {
  background: var(--orange-tint);
}

.client-trait,
.pdh-upgrade-prompt,
.pdh-disclaimer {
  background: var(--orange-tint);
}

.player-info-section {
  background: var(--purple-tint);
}

.card-trait,
.hire-tier {
  background: var(--cyan-dim);
}

.promotion-banner {
  background: var(--green-tint);
}

.evm-chart-wrapper {
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.result-item.score-excellent {
  background: var(--green-tint);
}

.result-item.score-good {
  background: var(--cyan-dim);
}

.result-item.score-moderate {
  background: var(--orange-tint);
}

.result-item.score-poor {
  background: var(--red-tint);
}

.quick-option.easy:hover {
  background: var(--green-tint);
}

.quick-option.moderate:hover {
  background: var(--orange-tint);
}

.quick-option.hard:hover {
  background: var(--red-tint);
}

/* --- Puzzles -------------------------------------------------------------- */
.puzzle-narrative {
  background: var(--gold-dim);
}

.risk-cell,
.sequence-item {
  border-color: var(--border);
  background: var(--bg-panel);
}

.risk-cell:hover,
.sequence-item:hover {
  background: var(--bg-active);
}

.cpm-node.selected rect {
  fill: var(--gold-dim);
}

.bottleneck-container .bn-node.empty circle,
.bottleneck-container .bn-node.empty:hover circle {
  fill: var(--cyan-dim);
}

/* --- Live project board --------------------------------------------------- */
.live-board {
  border: 1px solid var(--border);
  background: var(--bg-panel);
}

.board-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
  color: var(--text-bright);
  background: none;
  font: 700 12px/1.3 'IBM Plex Mono', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.board-period {
  color: var(--text-dim);
  font: 600 11px/1.4 'IBM Plex Mono', monospace;
}

.live-board progress {
  appearance: none;
  height: 6px;
  border: 0;
  background: var(--border);
  accent-color: var(--cyan);
}

.live-board progress::-webkit-progress-bar {
  background: var(--border);
}

.live-board progress::-webkit-progress-value {
  background: var(--cyan);
}

.board-metric dt {
  font: 600 11px/1.3 'IBM Plex Mono', monospace;
}

.board-metric dd {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.board-client strong {
  display: block;
}

.board-client span {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
}

/* --- Calmer alerts: a colored edge, with text in ink -------------------------- */
.terminal-line.random-event {
  border-left: 3px solid var(--red);
  color: var(--text-bright);
  animation: none;
}

/* --- Dashboard chart ------------------------------------------------------ */
.evm-chart-wrapper {
  height: auto;
  max-height: none;
  min-height: 0;
  padding: 12px;
  aspect-ratio: auto;
}

.evm-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--text-dim);
  font: 600 11px/1.3 'IBM Plex Mono', monospace;
}

.evm-legend span::before {
  display: inline-block;
  width: 16px;
  margin-right: 6px;
  border-top: 2px solid currentColor;
  vertical-align: middle;
  content: '';
}

.evm-legend .evm-pv::before {
  border-top-style: dashed;
}

.evm-legend .evm-ev {
  color: var(--cyan);
}

.evm-legend .evm-ac {
  color: var(--orange);
}

@media (max-width: 900px) {
  .live-board {
    margin: 0 10px 10px;
  }
}

/* --- Phones: nothing wider than the screen, and the log gets the room -------- */
@media (max-width: 520px) {
  .game-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .game-header {
    flex-wrap: wrap;
    height: auto;
    gap: 6px 8px;
    padding: 6px 10px;
  }

  .header-left,
  .header-right {
    width: auto;
  }

  /* Week, time, budget and End Week on one row, with Team and Client below. */
  .header-center {
    display: contents;
  }

  .header-right {
    order: 1;
    margin-left: auto;
  }

  .header-center .status-box {
    order: 2;
    flex: 1 1 40%;
  }

  .header-right .btn {
    min-height: 36px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .terminal {
    font-size: 15px;
  }

  .live-board.is-collapsed {
    padding: 10px 12px;
  }
}

/* --- Header items the docked board replaces ----------------------------------- */
.board-docked .budget-stat,
.board-docked #teamStatusBox,
.board-docked #clientStatusBox {
  display: none;
}

/* --- Board layout: docked, or folded to a rail -------------------------------- */
.simulation-workspace .terminal-section {
  flex: 1;
}

.live-board {
  transition: width 0.2s ease;
}

.board-toggle-icon {
  transition: transform 0.2s ease;
}

.live-board:not(.is-collapsed) .board-toggle-icon {
  transform: rotate(90deg);
}

@media (min-width: 901px) {
  .live-board.is-collapsed {
    width: 42px;
    padding: 10px 0;
    overflow: hidden;
  }

  .live-board.is-collapsed .board-toggle {
    flex-direction: column-reverse;
    gap: 10px;
    height: 100%;
    justify-content: flex-end;
  }

  .live-board.is-collapsed .board-toggle-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }

  .live-board.is-collapsed .board-toggle-icon {
    transform: rotate(180deg);
  }

  .live-board:not(.is-collapsed) .board-toggle-icon {
    transform: none;
  }
}

/* --- Board content ------------------------------------------------------------ */
.board-period {
  margin: 10px 0 14px;
}

.board-gauge {
  margin-bottom: 14px;
}

.board-gauge-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.board-gauge-head strong {
  color: var(--text-bright);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.board-gauge-head span,
.board-gauge-foot {
  color: var(--text-dim);
  font-size: 12px;
}

.board-track {
  position: relative;
  height: 8px;
  margin: 6px 0 5px;
  background: var(--track);
}

.board-track i {
  display: block;
  height: 100%;
  background: var(--cyan);
  transition: width 0.3s ease;
}

.board-track.spend i {
  background: var(--text-dim);
}

.board-track b {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--text-bright);
}

.board-indices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.board-index {
  display: grid;
  gap: 1px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
}

.board-index span {
  color: var(--text-dim);
  font: 600 11px/1.3 'IBM Plex Mono', monospace;
}

.board-index strong {
  color: var(--text-bright);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.board-index small {
  color: var(--text-dim);
  font-size: 12px;
}

.board-index.good {
  border-left-color: var(--green);
}

.board-index.watch {
  border-left-color: var(--orange);
}

.board-index.bad {
  border-left-color: var(--red);
}

.board-numbers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 10px;
  border: 1px solid var(--border);
}

.board-numbers > div {
  min-width: 0;
  padding: 7px 4px;
  border-right: 1px solid var(--border);
  text-align: center;
}

.board-numbers > div:last-child {
  border-right: 0;
}

.board-numbers dt {
  color: var(--text-dim);
  font: 600 11px/1.3 'IBM Plex Mono', monospace;
}

.board-numbers dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 700;
}

.board-note {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.board-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.board-status button {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.board-status button:hover {
  border-color: var(--cyan);
  background: var(--bg-active);
}

.board-status span {
  color: var(--text-dim);
  font: 600 11px/1.3 'IBM Plex Mono', monospace;
}

.board-status strong {
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 800;
}

.board-status .status-excellent,
.board-status .status-good {
  color: var(--green);
}

.board-status .status-concerned {
  color: var(--orange);
}

.board-status .status-poor,
.board-status .status-critical {
  color: var(--red);
}

.board-client {
  margin: 12px 0 6px;
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 700;
}

.board-client span {
  display: block;
  font-weight: 400;
}

.board-roster {
  margin: 0;
  border-top: 1px solid var(--border);
}

.board-roster li {
  align-items: center;
  padding: 7px 0;
  font-size: 13px;
}

.board-roster span {
  font-size: 12px;
}

.board-staff-cost {
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 600;
}

/* --- EVM trend ----------------------------------------------------------------- */
body.light-mode {
  --chart-ev: #1d4ed8;
  --chart-ac: #c2410c;
  --chart-pv: #71717a;
  --track: #e4e4e7;
}

body:not(.light-mode) {
  --chart-ev: #3b82f6;
  --chart-ac: #e8660f;
  --chart-pv: #8496b5;
  --track: rgba(147, 180, 252, 0.16);
}

.evm-summary {
  margin: 6px 0 10px;
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

#evmChart {
  position: relative;
}

#evmChart svg {
  display: block;
  max-width: 100%;
}

.evm-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.evm-axis {
  fill: var(--text-dim);
  font: 500 11px 'IBM Plex Mono', monospace;
}

.evm-end-label {
  fill: var(--text-bright);
  font: 700 11px 'IBM Plex Mono', monospace;
}

.evm-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}

.evm-line.evm-pv {
  stroke: var(--chart-pv);
  stroke-dasharray: 6 5;
}

.evm-line.evm-ev {
  stroke: var(--chart-ev);
}

.evm-line.evm-ac {
  stroke: var(--chart-ac);
}

.evm-marker {
  stroke: var(--bg-panel);
  stroke-width: 2;
}

.evm-marker.evm-ev {
  fill: var(--chart-ev);
}

.evm-marker.evm-ac {
  fill: var(--chart-ac);
}

.evm-crosshair {
  stroke: var(--text-dim);
  stroke-width: 1;
}

.evm-target {
  fill: transparent;
}

.evm-tooltip {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 7px 9px;
  border: 1px solid var(--border);
  color: var(--text-bright);
  background: var(--bg-panel);
  box-shadow: var(--shadow-ao) !important;
  font: 500 12px/1.5 'IBM Plex Mono', monospace;
  white-space: pre-line;
  pointer-events: none;
}

.evm-legend .evm-pv {
  color: var(--text-dim);
}

.evm-legend .evm-ev {
  color: var(--text-dim);
}

.evm-legend .evm-ac {
  color: var(--text-dim);
}

.evm-legend .evm-ev::before {
  border-top-color: var(--chart-ev);
}

.evm-legend .evm-ac::before {
  border-top-color: var(--chart-ac);
}

.evm-weekly {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.evm-weekly summary {
  cursor: pointer;
}

.evm-weekly table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  color: var(--text);
  font: 500 12px/1.5 'IBM Plex Mono', monospace;
}

.evm-weekly th,
.evm-weekly td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.evm-weekly th:first-child,
.evm-weekly td:first-child {
  text-align: left;
}

/* --- Deep blue night, with a soft glow on what matters ------------------------- */
body:not(.light-mode) {
  --bg-dark: #0a1120;
  --bg-panel: #101a2e;
  --bg-active: #1a2a4a;
  --text: #dbe4f3;
  --text-dim: #9fb0cc;
  --text-bright: #f8fafc;
  --cyan: #93c5fd;
  --cyan-dim: #15233f;
  --blue: #93c5fd;
  --border: rgba(147, 180, 252, 0.18);
  --grid-line: rgba(147, 180, 252, 0.05);
  --action: #2563eb;
  --glow: rgba(59, 130, 246, 0.45);
  --glow-soft: rgba(59, 130, 246, 0.14);
}

body:not(.light-mode) .game-title {
  text-shadow: 0 0 28px var(--glow) !important;
}

body:not(.light-mode) .btn.primary,
body:not(.light-mode) .board-track i {
  box-shadow: 0 0 14px var(--glow) !important;
}

body:not(.light-mode) .terminal,
body:not(.light-mode) .live-board,
body:not(.light-mode) .modal-content {
  box-shadow: 0 0 26px var(--glow-soft) !important;
}

body:not(.light-mode) .action-category.active,
body:not(.light-mode) .terminal-line.week-header {
  box-shadow: 0 0 12px var(--glow-soft) !important;
}

body:not(.light-mode) .ap-pip:not(.spent) {
  box-shadow: 0 0 7px var(--glow) !important;
}

body:not(.light-mode) .evm-line.evm-ev,
body:not(.light-mode) .evm-line.evm-ac {
  filter: drop-shadow(0 0 4px var(--glow)) !important;
}

/* --- Neon night: the original terminal's colors on deep blue ---------------------
   Glow goes on titles, labels, icons, controls, and bars. Reading text stays clean. */
body:not(.light-mode) {
  --cyan: #00e5ff;
  --cyan-dim: #0f2740;
  --blue: #4da3ff;
  --green: #2ff08f;
  --green-dim: #0e3a2a;
  --red: #ff5c70;
  --orange: #ffab2e;
  --purple: #c58bff;
  --gold: #ffe066;
  --text-dim: #a9bad6;
  --glow: rgba(0, 229, 255, 0.55);
  --glow-soft: rgba(0, 229, 255, 0.16);
  --chart-ev: #0ea5c9;
  --chart-ac: #e8660f;
}

body:not(.light-mode) .game-title {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.8), 0 0 30px rgba(0, 229, 255, 0.45) !important;
}

/* Glow is kept for the few things that carry the week: the week number, action points,
   and the main button. Labels, headings, icons, and bars stay clean. */
body:not(.light-mode) #weekNum {
  text-shadow: 0 0 9px color-mix(in srgb, currentColor 65%, transparent) !important;
}



body:not(.light-mode) .btn.primary {
  border-color: var(--cyan) !important;
  color: var(--cyan) !important;
  background: rgba(0, 229, 255, 0.12) !important;
  box-shadow: 0 0 14px var(--glow), inset 0 0 12px var(--glow-soft) !important;
  text-shadow: 0 0 8px var(--glow) !important;
}

body:not(.light-mode) .btn.primary:hover:not(:disabled) {
  background: rgba(0, 229, 255, 0.22) !important;
  box-shadow: 0 0 22px var(--glow), inset 0 0 14px var(--glow-soft) !important;
}

body:not(.light-mode) .ap-pip:not(.spent) {
  box-shadow: 0 0 8px var(--glow) !important;
}



body:not(.light-mode) :is(.status-box.status-excellent, .status-box.status-good, .board-index.good) {
  box-shadow: 0 0 10px rgba(47, 240, 143, 0.28) !important;
}

body:not(.light-mode) :is(.status-box.status-concerned, .board-index.watch) {
  box-shadow: 0 0 10px rgba(255, 171, 46, 0.28) !important;
}

body:not(.light-mode) :is(.status-box.status-critical, .board-index.bad) {
  box-shadow: 0 0 12px rgba(255, 92, 112, 0.35) !important;
}

body:not(.light-mode) :is(.action-category.active, .sub-option-btn.is-new, .role-card.selected,
  .project-card.selected, .trait-card.selected) {
  border-color: var(--cyan);
  box-shadow: 0 0 12px var(--glow-soft), inset 0 0 10px var(--glow-soft) !important;
}

body:not(.light-mode) .terminal-line.week-header {
  border-left-color: var(--cyan);
  box-shadow: 0 0 14px var(--glow-soft) !important;
}

body:not(.light-mode) .evm-line.evm-ev,
body:not(.light-mode) .evm-line.evm-ac {
  filter: drop-shadow(0 0 5px currentColor) !important;
}

body:not(.light-mode) .evm-line.evm-ev {
  color: var(--chart-ev);
}

body:not(.light-mode) .evm-line.evm-ac {
  color: var(--chart-ac);
}

/* --- Screens: center when there is room, and scroll from the top when there is not -- */
body {
  --bg-card: var(--bg-panel);
}

.screen:not(#gameScreen) {
  justify-content: flex-start;
}

.screen:not(#gameScreen) > * {
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: auto;
}

/* --- Professional Development ---------------------------------------------------- */
.pdh-section-slots {
  padding: 18px 20px;
  box-shadow: var(--shadow-ao) !important;
}

.pdh-section-header h3 {
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 800;
}

.pdh-user-email,
.pdh-detail-label {
  color: var(--text);
}

.pdh-summary-stats,
.pdh-detail-value {
  color: var(--text-bright);
}

.pdh-area-grid > *,
.pdh-area-item {
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text);
}
