:root {
  --bg: #050805;
  --bg-panel: #0a100a;
  --border: #1a3d1a;
  --text: #33ff33;
  --text-dim: #1a9929;
  --text-muted: #0f6618;
  --accent: #66ff66;
  --danger: #ff4444;
  --warning: #ffcc00;
  --glow: rgba(51, 255, 51, 0.12);
  --font: "JetBrains Mono", "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.test-influence-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25000;
  padding: 0.45rem 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: center;
  color: #111;
  background: linear-gradient(90deg, #ffcc66, #ff9966);
  border-bottom: 2px solid #ff6600;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.test-influence-banner strong {
  font-weight: 800;
}

body:has(.test-influence-banner) .terminal-header {
  margin-top: 2rem;
}

.test-endgame-banner a {
  color: #1a1a66;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.test-endgame-banner a[aria-current="page"] {
  color: #000;
  text-decoration: none;
  cursor: default;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1rem 0.5rem;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* Toasts sit bottom-center so they never cover Cash / Pending / Assets in the header */
.toast {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  background: rgba(10, 16, 10, 0.94);
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 0.5rem 0.65rem 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  transition: transform 0.25s ease, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  pointer-events: none;
  max-width: min(92vw, 420px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}

.toast-message {
  flex: 1;
  text-align: center;
}

.toast-dismiss {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.35rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.toast-dismiss:hover {
  opacity: 1;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

body.heat-hint-active #toast.show {
  bottom: max(5.25rem, calc(env(safe-area-inset-bottom, 0px) + 4rem));
}

/* Persistent heat / launder hint — same lane as toasts, stays until heat drops */
.heat-hint-toast {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 499;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: rgba(10, 16, 10, 0.94);
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 0.5rem 0.65rem 0.5rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  transition: transform 0.25s ease, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  pointer-events: none;
  max-width: min(92vw, 440px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}

.heat-hint-text {
  flex: 1;
  text-align: center;
}

.heat-hint-dismiss {
  flex-shrink: 0;
  margin: 0;
  padding: 0 0.35rem;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.heat-hint-dismiss:hover {
  opacity: 1;
}

.heat-hint-toast.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.heat-hint-toast.hidden {
  display: none;
}

.heat-hint-toast.heat-hint-warm {
  border-color: rgba(255, 204, 0, 0.55);
  color: #ffcc66;
}

.heat-hint-toast.heat-hint-critical {
  border-color: rgba(255, 68, 68, 0.65);
  color: #ff8888;
  animation: heat-hint-pulse 1.8s ease-in-out infinite;
}

@keyframes heat-hint-pulse {
  50% {
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.3);
  }
}

.toast.toast-reward {
  border-color: var(--accent);
  color: var(--accent);
  font-size: 0.9rem;
  box-shadow: 0 0 24px rgba(102, 255, 102, 0.35);
}

.toast.toast-good {
  border-color: #66cc88;
  color: #88ffaa;
}

.toast.toast-info {
  border-color: #66aacc;
  color: #88ccff;
}

.toast.toast-warn {
  border-color: var(--warning);
  color: var(--warning);
}

.hstat {
  position: relative;
}

.cash-float-delta {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(0);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  text-shadow: 0 0 8px rgba(102, 255, 102, 0.6);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

.cash-float-delta.cash-float-active {
  animation: cash-float-up 1s ease-out forwards;
}

@keyframes cash-float-up {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-1.4rem);
  }
}

.meters-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.meter-label {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meter-track {
  position: relative;
  height: 14px;
  margin-top: 0.35rem;
  padding: 0 4px;
}

.meter-line {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(26, 61, 26, 0.9);
  box-shadow: 0 0 6px rgba(51, 255, 51, 0.12);
}

.meter-line::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 8px;
  transform: translate(-50%, -50%);
  background: var(--text-muted);
  opacity: 0.45;
}

.meter-marker {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--bg);
  transition: left 0.35s ease, background 0.25s ease, box-shadow 0.25s ease;
  z-index: 1;
}

.policy-marker {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(102, 255, 102, 0.55);
}

.heat-marker {
  background: var(--warning);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.45);
}

.heat-marker.heat-high {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.55);
}

.reputation-marker {
  background: #66ccff;
  box-shadow: 0 0 10px rgba(102, 204, 255, 0.45);
}

.reputation-marker.rep-hard {
  background: #ff6666;
  box-shadow: 0 0 10px rgba(255, 102, 102, 0.45);
}

.reputation-marker.rep-soft {
  background: #88ddff;
  box-shadow: 0 0 10px rgba(136, 221, 255, 0.5);
}

#reputation-label {
  color: var(--text-dim);
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.market-tabs {
  display: flex;
  gap: 0.35rem;
}

.market-tab {
  font-family: var(--font);
  font-size: 0.72rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}

.market-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #0f1f0f;
}

.market-tab[data-class="pharma"].active {
  border-color: #55ccff;
  color: #55ccff;
  background: #0a1520;
}

.market-tab[data-class="assets"].active,
.market-tab.assets-tab.active {
  border-color: #dd88ff;
  color: #dd88ff;
  background: #150a1a;
}

.market-tab[data-class="operations"].active,
.market-tab.operations-tab.active {
  border-color: #ffaa44;
  color: #ffaa44;
  background: #1a1208;
}

.market-tab[data-class="stats"].active,
.market-tab.stats-tab.active {
  border-color: #55ddcc;
  color: #55ddcc;
  background: #081816;
}

.market-tab[data-class="missions"].active,
.market-tab.missions-tab.active {
  border-color: #88ff66;
  color: #88ff66;
  background: #0c180c;
}

.market-tab.missions-tab-pending:not(.active) {
  animation: missions-tab-pulse 0.85s ease-in-out infinite;
}

@keyframes missions-tab-pulse {
  0%,
  100% {
    border-color: var(--border);
    color: var(--text-dim);
    box-shadow: none;
    background: var(--bg-panel);
  }
  50% {
    border-color: #88ff66;
    color: #aaff88;
    background: rgba(136, 255, 102, 0.1);
    box-shadow:
      0 0 16px rgba(136, 255, 102, 0.45),
      inset 0 0 10px rgba(136, 255, 102, 0.1);
  }
}

.missions-tab-badge {
  display: inline-block;
  min-width: 1rem;
  padding: 0 0.25rem;
  margin-left: 0.15rem;
  font-size: 0.58rem;
  font-weight: 700;
  background: var(--accent);
  color: #001800;
  border-radius: 2px;
  box-shadow: 0 0 8px var(--glow);
  animation: missions-badge-pulse 0.85s ease-in-out infinite;
}

.missions-tab-badge.hidden {
  display: none;
}

@keyframes missions-badge-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px var(--glow);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(51, 255, 51, 0.85);
  }
}

.missions-progress-wrap {
  margin: 0.35rem 0 0.15rem;
  width: 100%;
  max-width: 28rem;
}

.missions-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.missions-progress-label {
  color: var(--text-muted);
}

.missions-progress-pct {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 8px var(--glow);
}

.missions-progress-track {
  height: 0.45rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.missions-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1a5c1a, var(--accent));
  box-shadow: 0 0 10px rgba(51, 255, 51, 0.45);
  transition: width 0.35s ease;
}

.missions-progress-count {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.missions-list {
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding: 0.35rem 0.5rem 0.75rem;
}

.missions-block {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  background: rgba(0, 12, 0, 0.35);
}

.missions-block-locked {
  opacity: 0.45;
  pointer-events: none;
}

.missions-block-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.missions-block-progress {
  color: var(--text-muted);
  font-size: 0.62rem;
}

.missions-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(51, 255, 51, 0.08);
  font-size: 0.68rem;
}

.mission-row:last-child {
  border-bottom: none;
}

.mission-label {
  color: var(--text-dim);
  flex: 1;
}

.mission-row-passed .mission-label {
  color: var(--text-muted);
}

.mission-status {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.mission-status-pending {
  color: var(--text-muted);
}

.mission-status-passed {
  color: var(--accent);
  text-shadow: 0 0 8px var(--glow);
  font-weight: 700;
}

.map-missions-unlock-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0.5rem 0 1rem;
  line-height: 1.45;
}

.stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.stats-summary strong {
  color: #55ddcc;
}

.stats-hint {
  flex: 1 1 100%;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.stats-table .stats-region {
  font-weight: 600;
  color: #55ddcc;
  text-align: left;
}

.stats-table tr.stats-row {
  cursor: pointer;
}

.stats-table tr.stats-row:hover {
  background: #0c1a18;
}

.stats-table tr.stats-row-locked {
  opacity: 0.5;
  cursor: default;
}

.stats-status-locked {
  color: var(--text-muted);
  font-size: 0.62rem;
}

/* —— Leaderboards panel —————————————————————————————————————————— */

.leaderboards-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
}

.leaderboards-identity {
  color: var(--text-dim);
}

.leaderboards-identity strong {
  color: #55ddcc;
}

.leaderboards-cycle-note {
  color: var(--text-muted);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leaderboards-join {
  border: 1px dashed var(--border);
  padding: 0.85rem 1rem;
  background: rgba(0, 12, 8, 0.45);
  margin-bottom: 0.85rem;
}

.leaderboards-join-copy {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.leaderboards-join-row {
  display: flex;
  gap: 0.5rem;
}

.leaderboards-username-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.leaderboards-username-input {
  flex: 1 1 220px;
  min-width: 180px;
  padding: 0.45rem 0.6rem;
  background: rgba(0, 4, 2, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  border-radius: 2px;
}

.leaderboards-username-input:focus {
  outline: none;
  border-color: var(--accent);
}

.leaderboards-username-error {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  color: #ff8484;
  min-height: 1em;
}

.leaderboards-board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.leaderboards-board-tab {
  border: 1px solid var(--border);
  background: rgba(0, 8, 4, 0.5);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  border-radius: 2px;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.leaderboards-board-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.leaderboards-board-tab.active {
  background: var(--accent);
  color: #001005;
  border-color: var(--accent);
}

.leaderboards-my-rank {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.leaderboards-my-rank strong {
  color: #55ddcc;
}

.leaderboards-table .leaderboards-col-rank {
  width: 3.5rem;
  text-align: right;
}

.leaderboards-table th:nth-child(2),
.leaderboards-table td:nth-child(2) {
  text-align: left;
}

.leaderboards-table .leaderboards-col-value {
  text-align: right;
}

.leaderboards-table .leaderboards-row-me {
  background: rgba(85, 221, 204, 0.12);
}

.leaderboards-table .leaderboards-row-me td {
  color: #cdfff2;
  font-weight: 600;
}

.leaderboards-table .leaderboards-row-top10 td:first-child {
  color: #ffd66b;
  font-weight: 700;
}

.leaderboards-loading,
.leaderboards-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 1rem 0.5rem;
}

.leaderboards-footnote {
  margin: 0.6rem 0 0;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: right;
}

.stats-status-open {
  color: var(--accent);
  font-size: 0.62rem;
}

.stats-status-active {
  color: #ffaa44;
  font-size: 0.62rem;
}

.operations-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.operations-summary strong {
  color: #ffaa44;
}

.operations-hint {
  flex: 1 1 100%;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.operations-table .op-name {
  font-weight: 600;
  color: #ffcc88;
  text-align: left;
}

.operations-table tr.op-locked {
  opacity: 0.55;
}

.op-status.op-locked {
  color: var(--text-muted);
  font-size: 0.58rem;
}

.op-status.op-ready {
  color: var(--accent);
}

.op-status.op-active {
  color: #ffaa44;
}

.btn-op-buy {
  border-color: #ffaa44;
  color: #ffaa44;
}

#stat-ops-income {
  color: #ffaa44;
}

.empire-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.empire-summary strong {
  color: #dd88ff;
}

.empire-hint {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.empire-table .empire-name {
  font-weight: 600;
  color: #dd88ff;
  text-align: left;
}

.empire-table .yield-rate {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.empire-table .yield-business {
  color: #dd88ff;
}

.empire-table .yield-positive {
  color: var(--accent);
}

.empire-table .yield-negative {
  color: var(--warning);
}

.empire-table .empire-cat {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: left;
}

.empire-table th:first-child,
.empire-table th:nth-child(2) {
  text-align: left;
}

.btn-empire-buy {
  border-color: #dd88ff;
  color: #dd88ff;
}

.btn-clear-debt {
  border-color: var(--warning);
  color: var(--warning);
}

.btn-clear-debt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions-bar .btn.hidden {
  display: none;
}

#stat-empire {
  color: #dd88ff;
}

#stat-cash.cash-tick-up {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(102, 255, 102, 0.45);
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

#stat-pending-cash.pending-tick-up {
  color: #ffcc66;
  text-shadow: 0 0 8px rgba(255, 204, 102, 0.4);
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.event-popup.event-need-cash {
  border-color: var(--warning);
  box-shadow: 0 0 24px rgba(255, 170, 0, 0.25);
}

.event-popup.event-need-cash .event-title {
  color: var(--warning);
}

.event-popup.event-need-cash .event-alert-badge {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning);
}

.sidebar-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 520px;
}

.sidebar-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.sidebar-tab {
  flex: 1;
  font-family: var(--font);
  font-size: 0.68rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}

.sidebar-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(51, 255, 51, 0.15);
}

/* Inbox tab pulse — 0.72s (faster than map/run/collect pulses) */
@keyframes inbox-tab-pulse-teal {
  0%,
  100% {
    border-color: var(--border);
    color: var(--text-muted);
    box-shadow: none;
    background: transparent;
  }
  50% {
    border-color: #2dd4bf;
    color: #5eead4;
    background: rgba(45, 212, 191, 0.12);
    box-shadow:
      0 0 18px rgba(45, 212, 191, 0.55),
      inset 0 0 12px rgba(94, 234, 212, 0.12);
  }
}

@keyframes inbox-tab-pulse-legal {
  0%,
  100% {
    border-color: var(--border);
    color: var(--text-muted);
    box-shadow: none;
    background: transparent;
  }
  50% {
    border-color: #ff3333;
    color: #ff7777;
    background: rgba(80, 0, 0, 0.35);
    box-shadow:
      0 0 20px rgba(255, 51, 51, 0.6),
      inset 0 0 14px rgba(255, 80, 80, 0.18);
  }
}

#sidebar-tab-inbox.inbox-tab-pending:not(.active):not(.inbox-tab-pending-legal) {
  animation: inbox-tab-pulse-teal 0.72s ease-in-out infinite;
}

#sidebar-tab-inbox.inbox-tab-pending-legal:not(.active) {
  animation: inbox-tab-pulse-legal 0.72s ease-in-out infinite;
}

.inbox-badge {
  display: inline-block;
  min-width: 1rem;
  padding: 0 0.25rem;
  margin-left: 0.15rem;
  font-size: 0.58rem;
  font-weight: 700;
  background: #2dd4bf;
  color: #001a18;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.45);
}

.inbox-badge.hidden {
  display: none;
}

.sidebar-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sidebar-view.hidden {
  display: none;
}

.inbox-messages {
  flex: 1;
  overflow-y: auto;
  font-size: 0.7rem;
  padding-right: 0.2rem;
}

.inbox-empty {
  font-size: 0.68rem;
  line-height: 1.45;
  padding: 0.5rem 0;
}

.inbox-msg {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.45rem;
  border: 1px solid rgba(26, 61, 26, 0.55);
  background: rgba(0, 12, 0, 0.35);
}

.inbox-msg.inbox-unread {
  border-left: 3px solid #66ccff;
}

.inbox-msg.inbox-read {
  opacity: 0.88;
  border-color: rgba(26, 61, 26, 0.55);
  background: rgba(0, 12, 0, 0.28);
}

.inbox-msg.inbox-read .inbox-type,
.inbox-msg.inbox-read .inbox-subject {
  color: inherit;
}

.inbox-msg.inbox-actionable {
  cursor: pointer;
}

.inbox-msg.inbox-actionable:hover {
  background: rgba(0, 24, 0, 0.45);
}

.inbox-msg.inbox-actionable .inbox-actions,
.inbox-msg.inbox-actionable .btn-inbox {
  cursor: pointer;
}

.inbox-msg.inbox-resolved {
  opacity: 0.55;
}

.inbox-msg.inbox-tier-whale,
.inbox-msg.inbox-tier-tycoon,
.inbox-msg.inbox-tier-mogul {
  border-color: rgba(221, 136, 255, 0.45);
}

.inbox-msg.inbox-tier-mogul {
  box-shadow: 0 0 12px rgba(221, 136, 255, 0.12);
}

.inbox-msg.inbox-legal {
  border-color: rgba(255, 80, 80, 0.55);
  background: rgba(40, 0, 0, 0.25);
}

.inbox-msg.inbox-legal.inbox-unread {
  border-left: 3px solid #ff5555;
}

.inbox-msg.inbox-legal .inbox-type {
  color: #ff6666;
}

.inbox-msg.inbox-legal .inbox-subject {
  color: #ff8888;
}

.inbox-msg.inbox-reward,
.inbox-msg.inbox-ops {
  border-color: rgba(102, 255, 102, 0.45);
  background: rgba(0, 40, 0, 0.2);
}

.inbox-msg.inbox-reward.inbox-unread,
.inbox-msg.inbox-ops.inbox-unread {
  border-left: 3px solid var(--accent);
  box-shadow: inset 0 0 12px rgba(102, 255, 102, 0.08);
}

.inbox-msg.inbox-reward .inbox-type,
.inbox-msg.inbox-ops .inbox-type {
  color: var(--accent);
}

.inbox-msg.inbox-reward .inbox-subject {
  color: #aaffaa;
}

.inbox-badge.inbox-badge-legal {
  background: #ff4444;
  color: #1a0000;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.55);
  animation: inbox-badge-pulse-legal 0.72s ease-in-out infinite;
}

@keyframes inbox-badge-pulse-legal {
  50% {
    background: #ff6666;
    box-shadow: 0 0 14px rgba(255, 80, 80, 0.75);
  }
}

.inbox-badge:not(.inbox-badge-legal):not(.hidden) {
  animation: inbox-badge-pulse-teal 0.72s ease-in-out infinite;
}

@keyframes inbox-badge-pulse-teal {
  50% {
    background: #5eead4;
    box-shadow: 0 0 14px rgba(94, 234, 212, 0.65);
  }
}

.sidebar-tab[data-view="inbox"].active {
  border-color: #2dd4bf;
  color: #5eead4;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.25);
}

.inbox-type {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #66ccff;
}

.inbox-subject {
  margin: 0.2rem 0 0.15rem;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--accent);
}

.inbox-body {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.4;
  font-size: 0.68rem;
}

.inbox-meta {
  margin-top: 0.35rem;
  font-size: 0.58rem;
  color: var(--text-muted);
}

.inbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.btn-inbox {
  font-size: 0.62rem;
  padding: 0.25rem 0.45rem;
}

.inbox-status {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.inbox-offer-timer {
  margin: 0.35rem 0 0;
  font-size: 0.65rem;
  color: var(--warning);
  letter-spacing: 0.04em;
}

.inbox-offer-timer strong {
  color: #ffcc66;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 180, 80, 0.45);
}

.inbox-offer-expired {
  margin: 0.35rem 0 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 520px;
}

.chat-subtitle {
  margin: -0.35rem 0 0.5rem;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  font-size: 0.72rem;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.chat-msg {
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(26, 61, 26, 0.4);
}

.chat-msg.chat-intel {
  border-left: 2px solid var(--warning);
  padding-left: 0.4rem;
}

.chat-msg.chat-good .chat-text { color: var(--accent); }
.chat-msg.chat-warn .chat-text { color: var(--warning); }

.chat-msg.chat-reward {
  border-left: 2px solid rgba(102, 255, 102, 0.5);
  padding-left: 0.35rem;
  margin-left: -0.35rem;
  background: rgba(0, 32, 0, 0.25);
}

.chat-offline {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
}

.chat-offline-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--warning, #ffb347);
}

.chat-offline-sub {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.inbox-offline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: var(--text-muted);
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.inbox-offline-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--warning, #ffb347);
}

.inbox-offline-sub {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.celestial-boost-panel {
  border-color: rgba(255, 220, 110, 0.55);
  box-shadow: 0 0 28px rgba(255, 220, 110, 0.35);
}

.celestial-boost-panel .map-region-unlock-title {
  color: #ffd76a;
  text-shadow: 0 0 12px rgba(255, 200, 80, 0.45);
}

.game-complete-popup .world-domination-briefing-panel.game-complete-panel {
  border-color: rgba(255, 220, 110, 0.6);
  box-shadow: 0 0 32px rgba(255, 200, 80, 0.4);
}

.game-complete-panel .map-region-unlock-title {
  color: #ffd76a;
  text-shadow: 0 0 12px rgba(255, 200, 80, 0.45);
  margin-bottom: 0.75rem;
}

.game-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1rem;
}

.chat-payout {
  color: #99ff99;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(102, 255, 102, 0.45);
}

.chat-perks {
  margin: 0.15rem 0 0;
  font-size: 0.62rem;
  color: #77cc88;
  letter-spacing: 0.02em;
}

.chat-name {
  font-weight: 700;
  font-size: 0.68rem;
}

.chat-time {
  float: right;
  font-size: 0.58rem;
  color: var(--text-muted);
}

.chat-text {
  margin: 0.2rem 0 0;
  color: var(--text-dim);
  line-height: 1.4;
}

.actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.limit-orders-list {
  flex: 1;
  min-width: 140px;
  font-size: 0.65rem;
}

.limit-row {
  margin-bottom: 0.15rem;
}

.muted { color: var(--text-muted); }

.toggle-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.start-toggle {
  justify-content: center;
  margin: 0.75rem 0;
}

.overlay-wide {
  max-width: 520px;
}

.slot-w {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 400;
}

.hstat-value.has-debt {
  color: var(--danger);
}

.terminal-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  padding-right: 4.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.btn-sound-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1;
  color: var(--accent);
  background: rgba(0, 12, 0, 0.65);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.btn-sound-toggle:hover {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
}

.btn-sound-toggle.is-muted {
  color: var(--text-muted);
  opacity: 0.75;
}

.btn-sound-toggle.is-muted:hover {
  color: var(--text-dim);
  border-color: var(--border);
  box-shadow: none;
}

.btn-sound-toggle-icon {
  display: block;
  pointer-events: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-shadow: 0 0 10px var(--glow);
}

.title-large {
  font-size: 1.75rem;
}

.terminal-badge {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--warning);
  border: 1px solid var(--warning);
  padding: 0.15rem 0.4rem;
  animation: pulse-badge 2s ease-in-out infinite;
}

.badge-center {
  display: inline-block;
  margin: 0.5rem 0;
}

@keyframes pulse-badge {
  50% { opacity: 0.65; }
}

.header-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.hstat-label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hstat-value {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

.hstat-timer .timer {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.timer-urgent {
  color: var(--danger) !important;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0.4; }
}

.pnl-up { color: var(--accent); }
.pnl-down { color: var(--danger); }
.pnl-flat { color: var(--text-dim); }

#game-screen.game-over {
  opacity: 0.45;
  pointer-events: none;
}

.event-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  padding: 1rem;
  animation: overlay-in 0.2s ease-out;
}

.event-overlay.hidden {
  display: none;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.event-popup {
  background: var(--bg-panel);
  border: 2px solid var(--warning);
  max-width: 480px;
  width: 100%;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 0 60px rgba(255, 204, 0, 0.25);
  animation: popup-pulse 1.2s ease-in-out infinite;
  text-align: center;
}

.event-popup.event-buy {
  border-color: var(--accent);
  box-shadow: 0 0 60px rgba(102, 255, 102, 0.3);
}

.event-popup.event-sell {
  border-color: var(--danger);
  box-shadow: 0 0 60px rgba(255, 68, 68, 0.25);
}

.event-popup.event-legal {
  border-color: #ff5555;
  box-shadow: 0 0 60px rgba(255, 80, 80, 0.35);
  animation: legal-popup-pulse 1.4s ease-in-out infinite;
}

@keyframes legal-popup-pulse {
  50% { box-shadow: 0 0 80px rgba(255, 80, 80, 0.5); }
}

.event-popup.event-legal .event-title {
  color: #ff8888;
}

.event-popup.event-legal .event-alert-badge {
  background: #ff4444;
  color: #fff;
}

.event-popup.event-legal .event-cta {
  color: #ffaa88;
  font-size: 0.85rem;
  text-transform: none;
  font-weight: 600;
}

.event-popup.event-legal .event-price {
  font-size: 0.72rem;
  color: #ff6666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.event-popup.event-reward {
  border-color: var(--accent);
  box-shadow: 0 0 60px rgba(102, 255, 102, 0.4);
  animation: reward-popup-pulse 1.2s ease-in-out infinite;
}

.event-popup.event-reward .event-alert-badge {
  background: var(--accent);
  color: #001a00;
}

.event-popup.event-reward .event-title {
  color: #aaffaa;
}

.event-popup.event-reward .event-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(102, 255, 102, 0.5);
  margin: 0.5rem 0;
}

.event-popup.event-reward .event-cta {
  color: #88cc88;
  font-size: 0.8rem;
  text-transform: none;
  font-weight: 600;
}

.event-popup.event-rank-up {
  border-color: #e8c547;
  box-shadow: 0 0 60px rgba(232, 197, 71, 0.45);
  animation: rank-popup-pulse 1.4s ease-in-out infinite;
}

.event-popup.event-rank-up .event-alert-badge {
  background: linear-gradient(135deg, #e8c547, #f5e6a8);
  color: #1a1400;
}

.event-popup.event-rank-up .event-title {
  color: #ffe88a;
  text-shadow: 0 0 24px rgba(232, 197, 71, 0.55);
}

.event-popup.event-rank-up .event-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c9b56a;
  text-transform: none;
  letter-spacing: 0.02em;
}

.event-popup.event-rank-up .event-cta {
  color: #ffe88a;
  font-size: 0.95rem;
  text-transform: none;
  font-weight: 700;
}

.event-popup.event-achievement {
  border-color: #66ccff;
  box-shadow: 0 0 60px rgba(102, 204, 255, 0.4);
  animation: achievement-popup-pulse 1.3s ease-in-out infinite;
}

.event-popup.event-achievement .event-alert-badge {
  background: linear-gradient(135deg, #66ccff, #a8e4ff);
  color: #001a28;
}

.event-popup.event-achievement .event-title {
  color: #88ddff;
  text-shadow: 0 0 20px rgba(102, 204, 255, 0.45);
}

.event-popup.event-achievement .event-price {
  font-size: 1.65rem;
  font-weight: 700;
  color: #66ccff;
  text-shadow: 0 0 18px rgba(102, 204, 255, 0.45);
  margin: 0.5rem 0;
}

.event-popup.event-achievement .event-cta {
  color: #a8e4ff;
  font-size: 0.88rem;
  text-transform: none;
  font-weight: 600;
}

@keyframes achievement-popup-pulse {
  50% {
    box-shadow: 0 0 70px rgba(102, 204, 255, 0.55);
  }
}

body.reward-popup-active .event-overlay {
  background: rgba(0, 20, 0, 0.72);
}

@keyframes reward-popup-pulse {
  50% {
    box-shadow: 0 0 80px rgba(102, 255, 102, 0.55);
  }
}

@keyframes rank-popup-pulse {
  50% {
    box-shadow: 0 0 90px rgba(232, 197, 71, 0.65);
  }
}

.event-popup.event-boss-offer {
  border-color: #cc8844;
  box-shadow: 0 0 50px rgba(204, 136, 68, 0.4);
  animation: boss-offer-pulse 1.6s ease-in-out infinite;
}

.event-popup.event-boss-offer .event-alert-badge {
  background: linear-gradient(135deg, #cc8844, #ffcc88);
  color: #1a1000;
}

.event-popup.event-boss-offer .event-title {
  color: #ffdd99;
}

.event-popup.event-boss-offer .event-price {
  color: #ccaa66;
  font-size: 0.9rem;
}

body.boss-offer-active .event-overlay {
  background: rgba(20, 12, 0, 0.82);
}

@keyframes boss-offer-pulse {
  50% {
    box-shadow: 0 0 70px rgba(204, 136, 68, 0.55);
  }
}

#btn-event-refuse {
  border-color: var(--danger);
  color: var(--danger);
}

@keyframes popup-pulse {
  50% { box-shadow: 0 0 80px rgba(255, 204, 0, 0.4); }
}

.event-alert-badge {
  display: inline-block;
  background: var(--warning);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.25rem 0.6rem;
  margin-bottom: 0.75rem;
}

.event-title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--warning);
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.event-popup.event-buy .event-title {
  color: var(--accent);
}

.event-popup.event-sell .event-title {
  color: var(--danger);
}

.event-body {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.event-cta {
  margin: 0.75rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.event-popup.event-sell .event-cta {
  color: var(--warning);
}

.event-price {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.event-actions .btn {
  min-width: 120px;
}

.event-hint {
  margin: 0.5rem 0 0;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.stat-value.timer-paused,
.hstat-value.timer-paused {
  color: var(--warning) !important;
  animation: blink 0.9s step-end infinite;
}

body.event-active .game-layout {
  filter: brightness(0.55);
}

body.event-active .event-overlay {
  filter: none;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
}

.panel-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-panel {
  flex: 1;
  min-height: 0;
}

.market-table-wrap {
  overflow-x: auto;
}

.terminal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.terminal-table th,
.terminal-table td {
  padding: 0.35rem 0.45rem;
  text-align: right;
  border-bottom: 1px solid rgba(26, 61, 26, 0.6);
  white-space: nowrap;
}

.terminal-table th:first-child,
.terminal-table td:first-child,
.terminal-table .symbol {
  text-align: left;
  font-weight: 700;
  color: var(--accent);
}

.terminal-table th {
  color: var(--text-muted);
  font-size: 0.58rem;
  text-transform: uppercase;
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg-panel);
}

.price-cell .last-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tick-up { color: var(--accent); }
.tick-down { color: var(--danger); }

.flash-up {
  animation: flash-green 0.45s ease-out;
}

.flash-down {
  animation: flash-red 0.45s ease-out;
}

@keyframes flash-green {
  0% { background: rgba(102, 255, 102, 0.35); }
  100% { background: transparent; }
}

@keyframes flash-red {
  0% { background: rgba(255, 68, 68, 0.35); }
  100% { background: transparent; }
}

.hi-lo {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.spark-cell {
  width: 72px;
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 22px;
}

.spark-bar {
  flex: 1;
  min-width: 2px;
  background: var(--text-dim);
  opacity: 0.7;
  align-self: flex-end;
}

.trade-cell {
  text-align: center !important;
}

.feed-panel {
  max-height: 140px;
}

.event-log {
  height: 100px;
  overflow-y: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.log-entry {
  margin-bottom: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.log-time {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.log-entry.event-bad { color: var(--danger); }
.log-entry.event-good { color: var(--accent); }
.log-entry.event-warn { color: var(--warning); }

.capacity-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.qty-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.qty-input {
  width: 3.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
}

.qty-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  font-family: var(--font);
  font-size: 0.7rem;
  padding: 0.3rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: #0f1f0f;
}

.btn-primary {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.btn-secondary {
  color: var(--text-dim);
}

.btn-small {
  padding: 0.15rem 0.4rem;
  margin: 0 0.1rem;
}

.btn-sell-all-row {
  color: var(--warning);
  border-color: rgba(255, 204, 0, 0.35);
}

.btn-sell-all-row:hover:not(:disabled) {
  border-color: var(--warning);
  color: var(--warning);
}

.btn-sell-all-row:disabled {
  opacity: 0.25;
}

.btn-large {
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 1rem;
}

.overlay-screen.hidden {
  display: none;
}

.splash-screen {
  background:
    radial-gradient(ellipse at center, rgba(0, 60, 0, 0.55) 0%, rgba(0, 0, 0, 0.95) 65%),
    repeating-linear-gradient(
      0deg,
      rgba(0, 255, 102, 0.05) 0px,
      rgba(0, 255, 102, 0.05) 1px,
      transparent 1px,
      transparent 3px
    ),
    #000;
  padding: 2rem 1rem;
}

.splash-stage {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  text-align: center;
}

.splash-brand-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.splash-brand {
  margin: 0;
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: clamp(2.5rem, 12vw, 9rem);
  letter-spacing: clamp(0.4rem, 2vw, 1.6rem);
  line-height: 1;
  color: var(--accent, #66ff66);
  text-shadow:
    0 0 18px rgba(102, 255, 102, 0.55),
    0 0 48px rgba(102, 255, 102, 0.25);
  white-space: nowrap;
}

.splash-tagline {
  margin: 0;
  font-family: var(--font-mono, monospace);
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  letter-spacing: clamp(0.2rem, 0.8vw, 0.55rem);
  text-transform: uppercase;
  color: var(--text-dim, #9adfa3);
  opacity: 0.85;
}

.splash-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: center;
  align-items: center;
}

.splash-btn {
  min-width: 11rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  letter-spacing: 0.18em;
}

.splash-save-summary {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim, #9adfa3);
  letter-spacing: 0.05em;
}

.splash-save-summary.hidden {
  display: none;
}

/* Returning player — welcome back dialog over start screen */
.welcome-back-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 1rem;
  animation: overlay-in 0.2s ease-out;
}

.welcome-back-overlay.hidden {
  display: none;
}

.welcome-back-popup {
  background: var(--bg-panel);
  border: 2px solid var(--accent);
  max-width: 22rem;
  width: 100%;
  padding: 1.5rem 1.35rem;
  text-align: center;
  box-shadow: 0 0 48px rgba(102, 255, 102, 0.28);
}

.welcome-back-badge {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid rgba(102, 255, 102, 0.45);
  border-radius: 2px;
}

.welcome-back-title {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.welcome-back-summary {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.welcome-back-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.welcome-back-actions .btn-large {
  width: 100%;
}

/* First-session guided tour */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: auto;
}

.tour-overlay.hidden {
  display: none;
}

.tour-highlight {
  position: fixed;
  z-index: 201;
  border: 2px solid var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.78);
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.tour-card {
  position: fixed;
  z-index: 202;
  max-width: min(92vw, 360px);
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  padding: 1rem 1.1rem;
  box-shadow: 0 0 40px var(--glow);
}

.tour-card.tour-card-centered {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tour-step-label {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.tour-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 700;
}

.tour-body {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

body.tour-active #game-screen {
  pointer-events: none;
}

.overlay-card {
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  padding: 1.75rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 0 50px var(--glow);
  text-align: center;
}

.intro-text {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: 0.75rem 0;
}

.intro-rules {
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0.75rem 0;
  padding-left: 1.2rem;
}

.intro-rules li {
  margin-bottom: 0.3rem;
}

kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.05rem 0.3rem;
  font-size: 0.7rem;
}

.continue-save-hint {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.continue-save-hint.hidden {
  display: none;
}

.start-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 18rem;
  margin: 0 auto;
}

.start-actions .btn-large {
  width: 100%;
}

.high-score {
  color: var(--warning);
  font-size: 0.82rem;
  margin: 0.5rem 0;
}

.end-message {
  color: var(--text-dim);
  margin: 0.75rem 0;
}

.end-score {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.end-pnl {
  font-size: 1rem;
  margin: 0.35rem 0 0.75rem;
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    max-height: 220px;
  }

  .meters-row {
    grid-template-columns: 1fr;
  }

  .terminal-table th:nth-child(5),
  .terminal-table td:nth-child(5),
  .terminal-table th:nth-child(6),
  .terminal-table td:nth-child(6) {
    display: none;
  }

  .header-stats {
    width: 100%;
    justify-content: space-between;
  }
}

/* —— Empire map —— */
.map-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.map-toolbar {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.map-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.map-tier-label {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 0.75rem;
  min-height: 360px;
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.map-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-map-zoom {
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.85rem;
  line-height: 1.2;
}

.map-canvas-wrap {
  position: relative;
  background: rgba(0, 12, 0, 0.6);
  border: 1px solid rgba(102, 255, 102, 0.25);
  padding: 0.5rem;
  min-height: 300px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.map-canvas-wrap.map-panning {
  cursor: grabbing;
}

.world-map {
  width: 100%;
  height: auto;
  min-height: 320px;
  display: block;
}

.map-ocean {
  fill: #020a02;
}

.map-grid {
  pointer-events: none;
}

.map-land-layer {
  pointer-events: none;
}

.map-land-path {
  fill: #0c2210;
  stroke: none;
  shape-rendering: geometricPrecision;
}

.map-land-layer .map-land-path:hover {
  fill: #102a12;
}

.map-route {
  stroke: rgba(102, 255, 102, 0.55);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  fill: none;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.map-route.map-route-hidden {
  opacity: 0;
  visibility: hidden;
}

.map-route.map-route-active {
  opacity: 1;
  visibility: visible;
  stroke: rgba(102, 255, 102, 0.65);
  stroke-width: 2;
  animation: map-route-flow 1.6s linear infinite;
}

/* Dashes move from remote territory toward South Side (hub at x2/y2). */
@keyframes map-route-flow {
  from {
    stroke-dashoffset: 0;
    stroke-opacity: 0.55;
  }
  to {
    stroke-dashoffset: -20;
    stroke-opacity: 0.85;
  }
}

.map-node {
  cursor: pointer;
  outline: none;
  pointer-events: none;
}

.map-node-ring {
  fill: rgba(0, 20, 0, 0.9);
  stroke: #446644;
  stroke-width: 1.5;
  transition: stroke 0.2s, fill 0.2s;
  pointer-events: none;
}

.map-node-core {
  fill: #224422;
  stroke: #558855;
  stroke-width: 1;
  pointer-events: none;
}

.map-node-label {
  fill: #668866;
  font-size: 10px;
  font-family: "JetBrains Mono", monospace;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.map-node-label.map-node-label-visible {
  opacity: 1;
  fill: #99dd99;
}

.map-node.map-node-selected .map-node-label {
  fill: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.map-node.map-node-selected .map-node-ring {
  stroke: var(--accent);
  stroke-width: 0.35;
  filter: url(#map-glow);
}

.map-node.map-node-unlocked .map-node-core {
  fill: #1a3d1a;
  stroke: #66aa66;
}

.map-node.map-node-active .map-node-core {
  fill: #0d4d0d;
  stroke: var(--accent);
  animation: map-node-pulse 1.8s ease-in-out infinite;
}

.map-node.map-node-available .map-node-ring {
  stroke: #88cc88;
  stroke-dasharray: 0.3 0.2;
  animation: map-node-available 2s linear infinite;
}

@keyframes map-node-available {
  to { stroke-dashoffset: -1; }
}

@keyframes map-node-pulse {
  50% {
    fill: #1a6b1a;
    filter: drop-shadow(0 0 3px rgba(102, 255, 102, 0.8));
  }
}

.map-node.map-node-locked .map-node-core {
  fill: #111811;
  stroke: #333;
  opacity: 0.55;
}

.map-node.map-node-flash-cash .map-node-core {
  animation: map-flash-cash 0.6s ease-out;
}

.map-node.map-node-flash-warn .map-node-core {
  animation: map-flash-warn 0.6s ease-out;
}

.map-node.map-node-flash-reward .map-node-core {
  animation: map-flash-reward 0.8s ease-out;
}

@keyframes map-flash-cash {
  0%, 100% { fill: #0d4d0d; }
  50% { fill: #99ff99; filter: drop-shadow(0 0 6px #6f6); }
}

@keyframes map-flash-warn {
  0%, 100% { fill: #0d4d0d; }
  50% { fill: #664400; filter: drop-shadow(0 0 6px #fa0); }
}

@keyframes map-flash-reward {
  0%, 100% { fill: #0d4d0d; }
  50% { fill: #aaffaa; filter: drop-shadow(0 0 10px #8f8); }
}

.map-node.map-node-ready .map-node-ring {
  stroke: #99ff99;
  stroke-width: 2;
  animation: map-node-ready-pulse 1.2s ease-in-out infinite;
}

.map-node.map-node-ready .map-node-core {
  fill: #1a6b1a;
  stroke: var(--accent);
}

.map-node.map-node-shipment .map-node-ring {
  stroke: #ffdd44;
  stroke-width: 2.5;
  animation: map-node-shipment-pulse 0.8s ease-in-out infinite;
}

.map-node.map-node-shipment .map-node-core {
  fill: #3d3d0a;
  stroke: #ffdd44;
}

@keyframes map-node-ready-pulse {
  50% {
    stroke-opacity: 1;
    filter: drop-shadow(0 0 5px rgba(102, 255, 102, 0.9));
  }
}

@keyframes map-node-shipment-pulse {
  50% {
    filter: drop-shadow(0 0 8px rgba(255, 221, 68, 0.95));
  }
}

.map-canvas-wrap.map-combo-shake {
  animation: map-combo-shake 0.22s ease-out;
}

@keyframes map-combo-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  75% { transform: translate(2px, -1px); }
}

.map-float-cash {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: #99ff99;
  text-shadow: 0 0 8px rgba(102, 255, 102, 0.8);
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.15s, transform 0.9s ease-out;
}

.map-float-cash.map-float-active {
  opacity: 1;
  transform: translate(-50%, -160%);
}

.map-float-income {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  font-size: clamp(0.72rem, 1.8vmin, 1rem);
  font-weight: 700;
  color: #ccffcc;
  text-shadow: 0 0 10px rgba(102, 255, 102, 0.85);
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.map-float-income.map-float-income-active {
  animation: map-float-income-rise 2.1s ease-out forwards;
}

@keyframes map-float-income-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -58%) scale(1);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -95%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(0.95);
  }
}

.map-float-cash-large {
  z-index: 8;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #bbffbb;
  text-shadow:
    0 0 12px rgba(102, 255, 102, 1),
    0 0 24px rgba(102, 255, 102, 0.65),
    0 0 40px rgba(102, 255, 102, 0.35);
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  transition: none;
  white-space: nowrap;
  max-width: min(96%, 100vw);
  overflow: visible;
  text-overflow: clip;
}

.map-float-cash-large.map-float-active-large {
  animation: map-float-large-rise 1.65s ease-out forwards;
}

@keyframes map-float-large-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -72%) scale(0.95);
  }
}

.map-region-unlock-popup {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: auto;
  background: rgba(0, 8, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.map-region-unlock-popup.map-region-unlock-popup-visible {
  opacity: 1;
}

.map-region-unlock-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  max-width: min(92%, 22rem);
  padding: 1.1rem 1.25rem 1rem;
  text-align: center;
  border: 1px solid rgba(102, 255, 102, 0.55);
  background: rgba(0, 14, 0, 0.92);
  box-shadow:
    0 0 28px rgba(102, 255, 102, 0.35),
    inset 0 0 20px rgba(102, 255, 102, 0.08);
  animation: map-region-unlock-panel-pop 1.1s ease-out forwards;
}

@keyframes map-region-unlock-panel-pop {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  18% {
    opacity: 1;
    transform: scale(1.04) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.map-region-unlock-title {
  margin: 0;
  font-size: clamp(1.35rem, 4.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #bbffbb;
  text-shadow:
    0 0 12px rgba(102, 255, 102, 1),
    0 0 24px rgba(102, 255, 102, 0.65);
  animation: map-region-unlock-title-glow 1.65s ease-out forwards;
}

@keyframes map-region-unlock-title-glow {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  12% {
    opacity: 1;
    transform: scale(1.05);
  }
  28% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.map-region-unlock-name {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #66ccff;
}

.map-region-unlock-amount {
  margin: 0.15rem 0 0;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  color: #bbffbb;
  text-shadow:
    0 0 12px rgba(102, 255, 102, 1),
    0 0 24px rgba(102, 255, 102, 0.55);
}

.map-region-unlock-claim {
  margin-top: 0.35rem;
  min-width: 11rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.map-all-regions-bonus-popup .map-all-regions-bonus-panel {
  border-color: rgba(255, 204, 102, 0.65);
  box-shadow:
    0 0 32px rgba(255, 180, 60, 0.45),
    inset 0 0 22px rgba(255, 200, 80, 0.1);
}

.map-all-regions-bonus-title {
  color: #ffe8a8;
  text-shadow:
    0 0 14px rgba(255, 200, 80, 1),
    0 0 28px rgba(255, 160, 40, 0.7);
}

.map-all-regions-bonus-sub {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffcc66;
}

.map-all-regions-bonus-amount {
  color: #ffe8a8;
  text-shadow:
    0 0 14px rgba(255, 200, 80, 1),
    0 0 26px rgba(255, 160, 40, 0.55);
}

.map-standard-empire-complete-popup {
  position: fixed;
  inset: 0;
  z-index: 15000;
}

.map-standard-empire-complete-sub,
.map-standard-empire-complete-detail {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #88ddff;
}

.map-standard-empire-complete-detail {
  color: #66ccff;
  font-size: 0.72rem;
}

.global-influence-briefing {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #000;
  animation: global-influence-fade-in 0.45s ease-out forwards;
}

@keyframes global-influence-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.global-influence-briefing-panel {
  max-width: min(92vw, 34rem);
  padding: 1.5rem 1.35rem;
  text-align: center;
  border: 1px solid rgba(255, 204, 102, 0.45);
  background: rgba(8, 4, 0, 0.92);
  box-shadow: 0 0 40px rgba(255, 180, 60, 0.25);
}

.global-influence-briefing-label {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ff6666;
}

.global-influence-briefing-body {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #e8e0d0;
}

body.global-influence-briefing-active .game-screen {
  filter: brightness(0);
}

.map-influence-portfolio-complete-popup {
  position: fixed;
  inset: 0;
  z-index: 16000;
}

.map-influence-portfolio-complete-sub {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffaa66;
}

.diplomatic-immunity-popup {
  position: fixed;
  inset: 0;
  z-index: 15500;
}

.diplomatic-immunity-body {
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #d8f0ff;
  text-align: center;
}

body.diplomatic-immunity-popup-active .game-screen {
  filter: brightness(0.35);
}

body.world-domination-fade-active .game-screen {
  filter: brightness(0);
  transition: filter 0.75s ease-in;
}

.world-domination-briefing {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #000;
  animation: global-influence-fade-in 0.45s ease-out forwards;
}

.world-domination-briefing-panel {
  max-width: min(92vw, 36rem);
  padding: 1.5rem 1.35rem;
  text-align: center;
  border: 1px solid rgba(255, 220, 120, 0.5);
  background: rgba(6, 4, 0, 0.94);
  box-shadow: 0 0 48px rgba(255, 200, 80, 0.3);
}

.world-domination-briefing-body {
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #f0e8d8;
}

body.world-domination-briefing-active .game-screen {
  filter: brightness(0);
}

body.world-domination-active .map-node,
body.world-domination-active .map-route,
body.world-domination-active .map-influence-node {
  opacity: 0;
  pointer-events: none;
}

body.world-domination-active .map-layout {
  grid-template-columns: 1fr;
}

.world-domination-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 72%);
}

.world-domination-overlay.hidden {
  display: none;
}

.world-domination-overlay-inner {
  text-align: center;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(255, 210, 100, 0.45);
  background: rgba(4, 8, 4, 0.88);
  box-shadow: 0 0 32px rgba(255, 200, 80, 0.22);
  max-width: min(92%, 22rem);
  pointer-events: auto;
}

.world-domination-overlay-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffcc66;
}

.world-domination-value {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffe8a8;
  text-shadow: 0 0 18px rgba(255, 200, 80, 0.55);
}

.world-domination-growth {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #88ddaa;
}

.world-domination-net-worth {
  margin: 0 0 1rem;
  font-size: 0.8rem;
}

.btn-world-domination-new-game {
  width: 100%;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: world-domination-new-game-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(255, 200, 80, 0.45);
}

.btn-world-domination-new-game.hidden {
  display: none;
}

@keyframes world-domination-new-game-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 200, 80, 0.35);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 24px rgba(255, 220, 120, 0.75);
  }
}

.market-tab.world-domination-tab-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.map-panel.world-domination-map .map-canvas-wrap {
  min-height: 280px;
}

.empire-row-influence .empire-name {
  color: #ffcc88;
}

.empire-row-influence .empire-cat {
  color: #ff9966;
}

tr.empire-row-highlight {
  outline: 1px solid rgba(255, 204, 102, 0.85);
  outline-offset: -1px;
  background: rgba(255, 180, 60, 0.12);
}

.yield-rate.yield-influence {
  color: #ffcc66;
  font-weight: 700;
}

.map-influence-layer.hidden {
  display: none;
}

.map-influence-node {
  cursor: pointer;
}

.map-influence-ring {
  fill: none;
  stroke: rgba(255, 200, 80, 0.35);
  stroke-width: 1.2;
}

.map-influence-core {
  fill: rgba(40, 28, 8, 0.95);
  stroke: rgba(255, 200, 80, 0.55);
  stroke-width: 1;
}

.map-influence-label {
  fill: rgba(255, 220, 140, 0.35);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.map-influence-label.map-influence-label-visible {
  opacity: 1;
}

.map-influence-node.map-influence-owned .map-influence-core {
  fill: rgba(255, 200, 80, 0.85);
  stroke: #ffe8a8;
}

.map-influence-node.map-influence-available .map-influence-ring {
  stroke: #ffcc66;
  animation: map-influence-pulse 1.6s ease-in-out infinite;
}

.map-influence-node.map-influence-available .map-influence-core {
  stroke: #ffcc66;
}

.map-influence-node.map-influence-locked .map-influence-core {
  opacity: 0.45;
}

@keyframes map-influence-pulse {
  0%,
  100% {
    stroke-opacity: 0.45;
  }
  50% {
    stroke-opacity: 1;
  }
}

.map-dot-influence {
  background: linear-gradient(135deg, #ffcc66, #ff8844);
  box-shadow: 0 0 6px rgba(255, 180, 60, 0.8);
}

.map-legend-influence.hidden {
  display: none;
}

.map-run-drop-row {
  position: relative;
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  width: 100%;
  padding: 0.6rem 0.75rem 0.85rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(102, 255, 102, 0.12);
  overflow: visible;
}

.btn-run-drop {
  min-width: 14rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-color: rgba(102, 255, 102, 0.45);
  box-shadow:
    0 0 14px rgba(102, 255, 102, 0.25),
    0 0 28px rgba(102, 255, 102, 0.12);
  animation: run-drop-glow-pulse 2.4s ease-in-out infinite;
}

.btn-run-drop:hover:not(:disabled) {
  border-color: var(--accent);
  background: #0f2810;
}

@keyframes run-drop-glow-pulse {
  0%,
  100% {
    box-shadow:
      0 0 12px rgba(102, 255, 102, 0.28),
      0 0 24px rgba(102, 255, 102, 0.1);
    border-color: rgba(102, 255, 102, 0.4);
  }
  50% {
    box-shadow:
      0 0 26px rgba(102, 255, 102, 0.65),
      0 0 52px rgba(102, 255, 102, 0.32);
    border-color: rgba(102, 255, 102, 0.85);
  }
}

.btn-run-drop-pulse {
  animation:
    run-drop-glow-pulse 2.4s ease-in-out infinite,
    btn-run-drop-click 0.4s ease-out;
}

@keyframes btn-run-drop-click {
  50% {
    transform: scale(1.04);
    box-shadow:
      0 0 32px rgba(102, 255, 102, 0.85),
      0 0 64px rgba(102, 255, 102, 0.45);
  }
}

.map-status-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

.map-status-row .shipment-bar {
  flex: 1;
  margin: 0;
}

.btn-collect-all {
  position: relative;
  flex-shrink: 0;
  min-width: 8.5rem;
  font-size: 0.68rem;
  padding: 0.35rem 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.65;
  box-sizing: border-box;
  border: 2px solid rgba(102, 255, 102, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease,
    opacity 0.25s ease;
}

.btn-collect-all-label {
  position: relative;
}

.btn-collect-all.btn-collect-all-active {
  opacity: 1;
  color: #ffdd88;
  border-color: rgba(255, 204, 0, 0.55);
  animation: collect-all-yellow-pulse 1.35s ease-in-out infinite;
}

@keyframes collect-all-yellow-pulse {
  0%,
  100% {
    border-color: rgba(255, 170, 68, 0.45);
    box-shadow:
      inset 0 0 10px rgba(255, 204, 0, 0.1),
      0 0 10px rgba(255, 204, 0, 0.18);
    color: #ffcc66;
  }
  50% {
    border-color: rgba(255, 221, 102, 0.9);
    box-shadow:
      inset 0 0 18px rgba(255, 204, 0, 0.22),
      0 0 20px rgba(255, 204, 0, 0.42);
    color: var(--warning);
  }
}

.shipment-bar {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 20, 0, 0.55);
  border: 1px solid rgba(102, 255, 102, 0.2);
}

.shipment-bar.shipment-ready {
  color: #ffdd88;
  border-color: rgba(255, 221, 68, 0.55);
  animation: shipment-ready-blink 1.5s ease-in-out infinite;
}

@keyframes shipment-ready-blink {
  50% { background: rgba(40, 35, 0, 0.5); }
}

.hstat-value.combo-active {
  color: #99ff99;
  text-shadow: 0 0 6px rgba(102, 255, 102, 0.5);
}

.hstat-value.pending-active {
  color: #aaddaa;
}

.region-run-panel {
  padding: 0.45rem 0;
  border-top: 1px dashed rgba(102, 255, 102, 0.2);
  border-bottom: 1px dashed rgba(102, 255, 102, 0.2);
}

.region-run-panel.hidden {
  display: none;
}

.run-label {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.run-stake-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-run-stake {
  flex: 1;
  min-width: 4.5rem;
}

.run-active {
  margin: 0;
  font-size: 0.72rem;
  color: #ffdd88;
  animation: run-active-pulse 1s ease-in-out infinite;
}

.run-intel {
  color: #99ff99;
}

.run-muted {
  margin: 0;
  font-size: 0.65rem;
}

@keyframes run-active-pulse {
  50% { opacity: 0.7; }
}

.map-node.map-node-run .map-node-ring {
  stroke: #ffaa44;
  stroke-width: 2;
  animation: map-node-run-pulse 0.9s ease-in-out infinite;
}

.map-node.map-node-run .map-node-core {
  fill: #4d3a0a;
  stroke: #ffaa44;
}

@keyframes map-node-run-pulse {
  50% {
    filter: drop-shadow(0 0 7px rgba(255, 170, 68, 0.9));
  }
}

.map-dot-ready {
  background: #99ff99;
  border-color: #99ff99;
  box-shadow: 0 0 6px #99ff99;
  animation: map-dot-ready-blink 1.2s ease-in-out infinite;
}

@keyframes map-dot-ready-blink {
  50% { opacity: 0.55; }
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.4rem;
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.map-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #446644;
}

.map-dot-owned {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.map-dot-unlocked {
  background: #1a4d1a;
  border-color: #66aa66;
}

.map-dot-available {
  background: transparent;
  border-color: #88cc88;
}

.map-dot-locked {
  background: #111;
  border-color: #333;
}

.region-panel {
  background: rgba(0, 16, 0, 0.5);
  border: 1px solid rgba(102, 255, 102, 0.2);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.region-panel-title {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
}

.region-panel-meta {
  margin: 0;
  font-size: 0.65rem;
}

.region-panel-status {
  margin: 0;
  font-size: 0.72rem;
  color: #88cc88;
}

.region-panel-income {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.region-ops-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.region-op-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  background: rgba(0, 24, 0, 0.5);
  border: 1px solid rgba(102, 255, 102, 0.15);
  font-size: 0.68rem;
}

.region-op-row.op-locked {
  opacity: 0.55;
}

.region-op-name {
  font-weight: 600;
  color: #aaddaa;
}

.region-op-meta {
  grid-column: 1 / -1;
  font-size: 0.58rem;
  color: var(--text-muted);
}

.region-op-owned {
  color: var(--accent);
  font-weight: 600;
}
