:root {
  color-scheme: dark;
  --bg: #060a06;
  --bg-panel: #0b120b;
  --fg: #3af23a;
  --fg-bright: #8dffb0;
  --fg-dim: #3a7a4a;
  --accent: #29ffa0;
  --border: #1f3a1f;
  --error: #ff7a6b;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 14px;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.6rem;
}

#topbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-panel);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
}

.ambush-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.4rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--error);
  border-radius: 4px;
  background: rgba(255, 122, 107, 0.08);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  animation: ambush-pulse 1.6s ease-in-out infinite;
}

.ambush-banner-label {
  color: var(--error);
  font-weight: bold;
  text-transform: uppercase;
}

.ambush-banner-time {
  color: var(--fg-bright);
  font-variant-numeric: tabular-nums;
}

.ambush-banner-hint {
  color: var(--fg-dim);
  margin-left: auto;
  text-transform: none;
  letter-spacing: normal;
}

@keyframes ambush-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 122, 107, 0); }
  50% { box-shadow: 0 0 12px rgba(255, 122, 107, 0.35); }
}

.brand {
  color: var(--fg-dim);
}

.brand .accent {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(41, 255, 160, 0.6);
}

.status {
  display: flex;
  align-items: center;
  color: var(--fg-dim);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  margin-right: 6px;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

#layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 0.6rem;
}

#terminal-area {
  flex: 5 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---- Terminal tabs -- one shell per tab (server/game-session.js#shells),
   so one can sit on the player's own machine while another stays connected
   to a compromised box. ---- */

.term-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow-x: auto;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

.term-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.term-tab-btn:hover {
  color: var(--fg-bright);
}

.term-tab-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  border-bottom-color: var(--bg-panel);
}

.term-tab-close {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
}

.term-tab-close:hover {
  opacity: 1;
  color: var(--error);
}

.term-tab-add {
  flex: 0 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 13px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  border-radius: 4px;
}

.term-tab-add:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.term-panes {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.terminal-pane {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  box-shadow: 0 0 24px rgba(58, 242, 58, 0.06), inset 0 0 40px rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 2px rgba(58, 242, 58, 0.3);
}

/* CRT vignette, scoped to the terminal pane itself -- the page-wide
   .scanlines overlay already covers scanline texture everywhere; this adds
   just a soft corner darkening so the terminal specifically reads as a CRT. */
.terminal-pane::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.35) 130%);
}

.editor-overlay,
.browser-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 4px;
}

.browser-url {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  background: #fff;
}

.editor-titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.8rem;
  background: var(--fg-dim);
  color: var(--bg);
  font-size: 12px;
  font-weight: bold;
}

.editor-filename {
  flex: 1;
  text-align: center;
}

.editor-modified {
  color: var(--bg);
}

.editor-textarea {
  flex: 1;
  min-height: 0;
  resize: none;
  background: var(--bg);
  color: var(--fg);
  border: none;
  outline: none;
  font: inherit;
  padding: 0.6rem 0.8rem;
  white-space: pre;
}

.editor-status {
  flex: 0 0 auto;
  min-height: 1.2em;
  padding: 0.15rem 0.8rem;
  color: var(--accent);
  font-size: 12px;
}

.editor-shortcuts {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding: 0.35rem 0.8rem;
  background: var(--fg-dim);
  color: var(--bg);
  font-size: 12px;
}

.editor-key {
  font-weight: bold;
  margin-right: 0.2rem;
}

.editor-btn {
  margin-left: auto;
  background: var(--bg);
  color: var(--fg-bright);
  border: 1px solid var(--bg);
  border-radius: 3px;
  padding: 0.15rem 0.6rem;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.editor-btn:hover {
  color: var(--accent);
}

.editor-exit-btn {
  margin-left: 0;
}

.output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--fg-dim) var(--bg);
}

.output::-webkit-scrollbar {
  width: 10px;
}

.output::-webkit-scrollbar-track {
  background: var(--bg);
}

.output::-webkit-scrollbar-thumb {
  background: var(--fg-dim);
  border-radius: 4px;
  border: 2px solid var(--bg);
}

.output::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.line {
  min-height: 1.2em;
}

.stderr-line {
  color: var(--error);
  text-shadow: 0 0 2px rgba(255, 122, 107, 0.35);
}

.mission-line {
  color: var(--accent);
  text-shadow: 0 0 4px rgba(41, 255, 160, 0.5);
  animation: missionFlash 0.6s ease-out;
}

@keyframes missionFlash {
  0% { text-shadow: 0 0 12px rgba(41, 255, 160, 0.9), 0 0 4px rgba(41, 255, 160, 0.9); }
  100% { text-shadow: 0 0 4px rgba(41, 255, 160, 0.5); }
}

.loading-line {
  color: var(--fg-dim);
  font-style: italic;
}

.transmission-line {
  color: var(--accent);
  font-style: italic;
  text-shadow: 0 0 4px rgba(41, 255, 160, 0.5);
}

.rival-alert-line {
  color: var(--error);
  font-weight: bold;
  text-shadow: 0 0 4px rgba(255, 122, 107, 0.6);
}

.input-line {
  display: flex;
  align-items: center;
  margin-top: 0.35rem;
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
}

.prompt {
  white-space: pre;
  margin-right: 0.25rem;
  color: var(--accent);
}

.cmdline {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font: inherit;
  text-shadow: inherit;
}

#sidebar {
  flex: 2 1 0;
  min-width: 340px;
  max-width: 460px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tabs-scroller {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0.3rem;
}

.tabs-arrow {
  flex: 0 0 auto;
  width: 22px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.tabs-arrow:hover:not(:disabled) {
  color: var(--fg-bright);
  border-color: var(--fg-dim);
}

.tabs-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.tabs {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.tab-btn:hover {
  color: var(--fg-bright);
  border-color: var(--fg-dim);
}

.tab-btn:active {
  transform: scale(0.96);
}

.tab-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(41, 255, 160, 0.2);
}

@keyframes tabFlash {
  0% { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px rgba(41, 255, 160, 0.8); }
  100% { box-shadow: 0 0 10px rgba(41, 255, 160, 0.2); }
}

.tab-flash {
  animation: tabFlash 0.8s ease-out;
}

.panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.65rem 0.8rem;
  box-shadow: 0 0 20px rgba(58, 242, 58, 0.05);
  overflow: hidden;
}

/* #boxes-panel holds several independently-collapsible sections (tips,
   mentor, story, advanced) stacked in normal block flow, not one single
   flex-sized list -- the base .panel-body scroll trick above only engages
   inside a flex parent with a bounded height, so a list nested two levels
   deep inside a collapsible section's body never actually got a scrollbar,
   and the outer .panel's overflow:hidden just clipped everything below the
   fold with no way to reach it (real bug, reported live: "some boxes i
   cant see and cant scroll down"). Scrolling the whole panel as one unit
   fixes it with no other layout change needed. */
#boxes-panel {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-fade-in {
  animation: panelFadeIn 0.18s ease;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--fg-dim) var(--bg-panel);
  padding-right: 2px;
}

.panel-body::-webkit-scrollbar {
  width: 10px;
}

.panel-body::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

.panel-body::-webkit-scrollbar-thumb {
  background: var(--fg-dim);
  border-radius: 4px;
  border: 2px solid var(--bg-panel);
}

.panel-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.dim {
  color: var(--fg-dim);
}

.target-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.2rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 11px;
  flex-wrap: wrap;
}

.target-row:last-of-type {
  border-bottom: none;
}

.target-host {
  font-weight: bold;
  color: var(--fg-bright);
  flex: 1 1 auto;
}

.target-ip {
  color: var(--fg-dim);
}

.target-rooted.yes { color: var(--accent); }
.target-rooted.no { color: var(--fg-dim); }
.target-bounty.yes { color: #ffbd2e; }

.stats {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--accent);
}

.heat-low { color: var(--fg); }
.heat-medium { color: #ffbd2e; }
.heat-high { color: var(--error); }

.ref-category {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0.6rem 0 0.3rem;
}

.ref-category:first-child {
  margin-top: 0;
}

.advanced-boxes-section {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.advanced-boxes-section .tips-title {
  margin-bottom: 0.5rem;
}

.advanced-boxes-section.collapsed .tips-arrow {
  transform: rotate(0deg);
}

.advanced-boxes-section.collapsed .tips-title {
  margin-bottom: 0;
}

.advanced-boxes-section.collapsed #advanced-boxes-body {
  display: none;
}

.story-boxes-section {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.story-boxes-section .tips-title {
  margin-bottom: 0.5rem;
}

.story-boxes-section.collapsed .tips-arrow {
  transform: rotate(0deg);
}

.story-boxes-section.collapsed .tips-title {
  margin-bottom: 0;
}

.story-boxes-section.collapsed #story-boxes-body {
  display: none;
}

.mentor-boxes-section .tips-title {
  margin-bottom: 0.5rem;
}

.mentor-boxes-section.collapsed .tips-arrow {
  transform: rotate(0deg);
}

.mentor-boxes-section.collapsed .tips-title {
  margin-bottom: 0;
}

.mentor-boxes-section.collapsed #mentor-boxes-body {
  display: none;
}

.ref-entry {
  margin-bottom: 0.45rem;
}

.ref-name {
  color: var(--fg-bright);
  font-weight: bold;
}

.ref-link {
  color: var(--fg-dim);
  font-weight: normal;
  font-size: 10px;
  text-decoration: none;
  border-bottom: 1px dotted var(--fg-dim);
}

.ref-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.ref-summary {
  opacity: 0.85;
}

.ref-example {
  color: var(--fg-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.ref-example::before {
  content: '$ ';
}

.browser-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.browser-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.browser-dot.red { background: #ff5f56; }
.browser-dot.yellow { background: #ffbd2e; }
.browser-dot.green { background: #27c93f; }

.browser-url {
  margin-left: 8px;
  font-size: 11px;
  color: var(--fg-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 10px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  background: #fff;
  border-radius: 2px;
}

@media (max-width: 900px) {
  #layout {
    flex-direction: column;
    overflow-y: auto;
  }
  #terminal {
    flex: 1 1 55vh;
  }
  #sidebar {
    max-width: none;
    flex: 1 1 auto;
  }
}

.alignment-black { color: var(--error); }
.alignment-grey { color: var(--fg-dim); }
.alignment-white { color: #7bd0ff; }

.tips-box {
  flex: 0 0 auto;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  background: rgba(41, 255, 160, 0.04);
  font-size: 11px;
}

.tips-title {
  display: flex;
  align-items: center;
  gap: 0.3em;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: bold;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
  font-size: 10px;
  cursor: pointer;
  text-align: left;
}

.tips-title:hover {
  color: var(--fg-bright);
}

.tips-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
  transform: rotate(90deg);
}

.tips-hint {
  margin-left: auto;
  color: var(--fg-dim);
  font-weight: normal;
  letter-spacing: normal;
  font-size: 9px;
  text-transform: none;
}

.tips-box.collapsed .tips-arrow {
  transform: rotate(0deg);
}

.tips-box.collapsed .tips-title {
  margin-bottom: 0;
}

.tips-box.collapsed ul {
  display: none;
}

.tips-box ul {
  margin: 0;
  padding-left: 1.1em;
  list-style: square;
}

.tips-box li {
  margin-bottom: 0.3rem;
  color: var(--fg);
  line-height: 1.35;
}

.random-box-row {
  flex: 0 0 auto;
  margin-bottom: 0.65rem;
}

.billing-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.billing-box #billing-status-text {
  color: var(--fg);
  flex: 1 1 auto;
  min-width: 0;
}

.billing-actions {
  display: flex;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.random-box-row .box-btn {
  width: 100%;
  padding: 0.45rem 0.7rem;
}

.tips-box li:last-child {
  margin-bottom: 0;
}

.tips-box strong {
  color: var(--fg-bright);
}

.market-item {
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
}

.market-item:last-child {
  border-bottom: none;
}

.market-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.market-item-name {
  color: var(--fg-bright);
  font-weight: bold;
}

.market-item-price {
  font-size: 11px;
  white-space: nowrap;
}

.market-item-price.affordable { color: var(--accent); }
.market-item-price.unaffordable { color: var(--fg-dim); }

.market-item-desc {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 0.15rem;
}

.market-item-id {
  font-size: 11px;
  color: var(--fg-dim);
  margin-top: 0.25rem;
}

.market-item-id::before {
  content: '$ ';
}

.tips-box code {
  font-family: inherit;
  color: var(--fg-bright);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 3px;
  border-radius: 2px;
}

.boot-banner {
  color: var(--accent);
  white-space: pre;
  text-shadow: 0 0 6px rgba(41, 255, 160, 0.35);
}

.network-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.network-svg {
  width: 100%;
  max-width: 380px;
}

.net-edge {
  stroke: var(--fg-dim);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.net-node-player {
  fill: var(--accent);
  stroke: var(--fg-bright);
  stroke-width: 1.5;
}

.net-node-known {
  fill: var(--bg);
  stroke: var(--fg-dim);
  stroke-width: 1.5;
}

.net-node-rooted {
  fill: #7bd88f;
  stroke: var(--fg-bright);
  stroke-width: 1.5;
}

.net-node-backdoor {
  fill: none;
  stroke: #ffbd2e;
  stroke-width: 1.5;
  stroke-dasharray: 2 2;
}

.net-label {
  fill: var(--fg-dim);
  font-size: 8px;
  text-anchor: middle;
  font-family: inherit;
}

.network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 10px;
  color: var(--fg-dim);
}

.network-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.net-node-player { background: var(--accent); }
.legend-dot.net-node-known { background: var(--bg); border: 1.5px solid var(--fg-dim); }
.legend-dot.net-node-rooted { background: #7bd88f; }
.legend-dot.net-node-backdoor-swatch { background: transparent; border: 1.5px dashed #ffbd2e; }

/* ── Contracts (job board) ─────────────────────────────────────────── */

.contract-line {
  color: #ffbd2e;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(255, 189, 46, 0.5);
}

.rep-rank {
  color: var(--fg-dim);
}

.section-heading {
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0.7rem 0 0.4rem;
}

.contract-active {
  margin-bottom: 0.7rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #ffbd2e;
  border-radius: 3px;
  background: rgba(255, 189, 46, 0.05);
}

.contract-active-title {
  color: #ffbd2e;
  font-weight: bold;
  font-size: 11px;
  margin-bottom: 0.35rem;
}

.contract-objectives {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 11px;
}

.contract-objectives li {
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.contract-objectives li.done {
  color: var(--accent);
  text-decoration: line-through;
  opacity: 0.75;
}

.contract-row-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
  font-size: 11px;
}

.contract-action {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline dotted;
}

.contract-action:hover {
  color: var(--fg-bright);
}

.contract-action.dim {
  color: var(--fg-dim);
}

.contract-item {
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.contract-item[data-cmd]:hover {
  border-color: var(--accent);
  background: rgba(41, 255, 160, 0.05);
}

.contract-item.locked {
  opacity: 0.5;
  cursor: default;
}

.contract-item.active {
  border-color: #ffbd2e;
  cursor: default;
}

.contract-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.contract-diff {
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border: 1px solid;
  border-radius: 2px;
}

.contract-diff.diff-easy { color: #7bd0ff; border-color: #7bd0ff; }
.contract-diff.diff-medium { color: #ffbd2e; border-color: #ffbd2e; }
.contract-diff.diff-hard { color: var(--error); border-color: var(--error); }
.contract-diff::before { margin-right: 0.35em; letter-spacing: -1px; }
.contract-diff.diff-easy::before { content: '\25CF'; }
.contract-diff.diff-medium::before { content: '\25CF\25CF'; }
.contract-diff.diff-hard::before { content: '\25CF\25CF\25CF'; }
.contract-diff.diff-expert { color: #ff6bf0; border-color: #ff6bf0; }

.contract-stars {
  color: #ffbd2e;
  font-size: 10px;
}

.contract-item-title {
  color: var(--fg-bright);
  font-weight: bold;
  font-size: 12px;
}

.contract-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 10px;
  color: var(--fg-dim);
}

.contract-reward {
  color: var(--accent);
}

.contract-lock {
  color: var(--fg-dim);
}

.contract-active-tag {
  color: #ffbd2e;
  font-weight: bold;
}

/* ── Mail (phishing compose/inbox) ─────────────────────────────────── */

.mail-subtabs {
  flex: 0 0 auto;
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.mail-subtab-btn {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.3rem;
  cursor: pointer;
  border-radius: 3px;
}

.mail-subtab-btn:hover {
  color: var(--fg-bright);
}

.mail-subtab-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(41, 255, 160, 0.2);
}

.mail-compose {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mail-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mail-field label {
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.mail-field input,
.mail-field select,
.mail-field textarea {
  background: var(--bg);
  color: var(--fg-bright);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 11.5px;
  outline: none;
  resize: vertical;
}

.mail-field input:focus,
.mail-field select:focus,
.mail-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(41, 255, 160, 0.2);
}

.mail-field textarea {
  font-family: inherit;
  line-height: 1.4;
}

.mail-send-btn {
  align-self: flex-start;
  background: rgba(41, 255, 160, 0.08);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.4rem 1rem;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}

.mail-send-btn:hover {
  background: rgba(41, 255, 160, 0.18);
  box-shadow: 0 0 10px rgba(41, 255, 160, 0.25);
}

.mail-recon {
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  padding: 0.45rem 0.6rem;
  background: rgba(41, 255, 160, 0.04);
  font-size: 11px;
  line-height: 1.5;
}

.mail-recon-title {
  color: var(--accent);
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.mail-recon-hint {
  margin-top: 0.25rem;
  color: var(--fg-dim);
  font-style: italic;
}

.mail-tip {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--fg-dim);
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

.mail-tip strong {
  color: var(--fg-bright);
}

.mail-row {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 11px;
}

.mail-row.ok {
  border-left: 2px solid var(--accent);
}

.mail-row.fail {
  border-left: 2px solid var(--error);
}

.mail-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.mail-row-status {
  font-weight: bold;
  font-size: 10.5px;
}

.mail-row.ok .mail-row-status {
  color: var(--accent);
}

.mail-row.fail .mail-row-status {
  color: var(--error);
}

.mail-row-spoof {
  font-size: 9.5px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mail-row-line {
  line-height: 1.5;
}

.mail-row-note {
  margin-top: 0.25rem;
  color: var(--fg-dim);
  font-style: italic;
  line-height: 1.4;
}

/* ── Vuln Box Arena: box-select cards + flag slots ─────────────────── */

.box-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.65rem;
}

.box-card.current {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(41, 255, 160, 0.15);
}

/* Completed but not the currently-loaded box -- a quieter marker than
   .current's full glow, so "done" and "active right now" stay visually
   distinct at a glance instead of both just looking like a plain card. */
.box-card.done:not(.current) {
  border-left: 3px solid var(--accent);
}

.box-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.box-diff {
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border: 1px solid;
  border-radius: 2px;
  text-transform: uppercase;
}

.box-diff.diff-easy { color: #7bd0ff; border-color: #7bd0ff; }
.box-diff.diff-medium { color: #ffbd2e; border-color: #ffbd2e; }
.box-diff.diff-hard { color: var(--error); border-color: var(--error); }
.box-diff::before { margin-right: 0.35em; letter-spacing: -1px; }
.box-diff.diff-easy::before { content: '\25CF'; }
.box-diff.diff-medium::before { content: '\25CF\25CF'; }
.box-diff.diff-hard::before { content: '\25CF\25CF\25CF'; }

.box-done {
  color: var(--accent);
  font-weight: bold;
  font-size: 10px;
}

.box-current-tag {
  color: #ffbd2e;
  font-weight: bold;
  font-size: 10px;
}

.box-title {
  color: var(--fg-bright);
  font-weight: bold;
  font-size: 13px;
}

.box-client {
  color: var(--fg-dim);
  font-size: 10.5px;
  margin-top: 0.1rem;
}

.box-ip {
  color: var(--accent);
  font-size: 11px;
  margin-top: 0.25rem;
}

.box-flags {
  font-size: 10.5px;
  color: var(--fg-dim);
  margin-top: 0.2rem;
}

.box-actions {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.box-btn-ghost {
  background: transparent;
  color: var(--fg-dim);
  border-color: var(--border);
}

.box-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  box-shadow: none;
}

.box-btn {
  background: rgba(41, 255, 160, 0.08);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.box-btn:hover {
  background: rgba(41, 255, 160, 0.18);
  box-shadow: 0 0 8px rgba(41, 255, 160, 0.25);
}

.box-btn:active {
  transform: scale(0.96);
  background: rgba(41, 255, 160, 0.26);
}

.flag-slots {
  list-style: none;
  margin: 0.6rem 0;
  padding: 0;
  font-size: 12px;
}

.flag-slots li {
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--border);
  color: var(--fg);
}

.flag-slots li:last-child {
  border-bottom: none;
}

.flag-slots li.done {
  color: var(--accent);
}

.flag-slots li.bonus {
  margin-top: 0.3rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  border-bottom: none;
  color: var(--fg-dim);
  font-size: 11px;
}

.flag-slots li.bonus.done {
  color: var(--accent);
}

.box-complete {
  margin-top: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: rgba(41, 255, 160, 0.06);
  color: var(--accent);
  font-size: 11.5px;
  text-align: center;
}

.hints-section {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.hints-list {
  list-style: none;
  margin: 0.4rem 0 0.6rem;
  padding: 0;
  font-size: 11.5px;
}

.hints-list li {
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.4rem;
  border-left: 2px solid var(--border);
  color: var(--fg-dim);
  line-height: 1.4;
}

/* ── Storyline toast popups (js/toast.js) ──────────────────────────── */

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 320px;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(41, 255, 160, 0.2), 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 0.6rem 0.75rem;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.hide {
  opacity: 0;
  transform: translateX(24px);
}

.toast-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.toast-title {
  color: var(--accent);
  font-weight: bold;
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(41, 255, 160, 0.5);
}

.toast-close {
  background: none;
  border: none;
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 0.5rem;
}

.toast-close:hover {
  color: var(--accent);
}

.toast-body {
  color: var(--fg-bright);
  font-size: 12px;
  line-height: 1.45;
  font-style: italic;
  white-space: pre-line;
}

/* ---- Boot intro sequence ---- */

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 2rem;
}

.intro-text {
  max-width: 640px;
  width: 100%;
  margin: 0;
  color: var(--accent);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  text-shadow: 0 0 6px rgba(41, 255, 160, 0.35);
}

.intro-text::after {
  content: '\2588';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.intro-hint {
  margin-top: 1.5rem;
  color: var(--fg-dim);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---- Auth screen ---- */

.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 50;
}

.auth-box {
  width: 100%;
  max-width: 340px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-panel);
}

.auth-box .brand {
  text-align: center;
  margin-bottom: 1.1rem;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.auth-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.auth-tab-btn {
  flex: 1;
  background: var(--bg);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.4rem;
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-tab-btn.active {
  color: var(--accent);
  border-color: var(--accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-form input {
  background: var(--bg);
  color: var(--fg-bright);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 13px;
}

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

.auth-form .box-btn {
  margin-top: 0.3rem;
  padding: 0.5rem;
  font-size: 11px;
}

.auth-hint {
  margin-top: -0.5rem;
  font-size: 10px;
  color: var(--fg-dim);
}

.auth-error {
  min-height: 1em;
  font-size: 11px;
  color: #ff5c5c;
}

/* ---- Topbar account controls ---- */

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-user {
  color: var(--fg-bright);
}

.topbar-user::before {
  content: '@ ';
  color: var(--fg-dim);
}

.topbar-logout {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}

.topbar-logout:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Leaderboard ---- */

.leaderboard-list {
  list-style: decimal;
  margin: 0.4rem 0 1rem 1.2rem;
  padding: 0;
  font-size: 12px;
}

.leaderboard-list li {
  padding: 0.2rem 0;
  color: var(--fg);
}

.lb-user {
  color: var(--fg-bright);
  text-decoration: none;
  border-bottom: 1px dotted var(--fg-dim);
}

.lb-user:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.lb-time {
  color: var(--accent);
  margin-left: 0.4rem;
}

.lb-clean {
  color: var(--fg-dim);
  font-size: 10px;
  margin-left: 0.4rem;
}

/* ---- Chat ---- */

.chat-channel-switcher {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex: 0 0 auto;
}

.chat-channel-switcher:empty {
  display: none;
}

.chat-channel-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-dim);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}

.chat-channel-btn:hover {
  color: var(--fg-bright);
  border-color: var(--fg-dim);
}

.chat-channel-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(41, 255, 160, 0.15);
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--fg-dim) var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-right: 2px;
}

.chat-msg {
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-user {
  color: var(--accent);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 3px;
  font-size: 0.85em;
  font-weight: bold;
  margin-right: 0.35em;
  flex: 0 0 auto;
  vertical-align: -0.28em;
}

.crew-tag-badge {
  display: inline-block;
  background: rgba(41, 255, 160, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 3px;
  padding: 0.05em 0.4em;
  font-size: 0.72em;
  font-weight: bold;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.chat-msg-body {
  color: var(--fg);
}

.chat-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex: 0 0 auto;
}

.chat-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-bright);
  font-family: inherit;
  font-size: 12px;
  padding: 0.4rem 0.5rem;
}

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

/* ---- Admin page ---- */

.admin-app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100vh;
  box-sizing: border-box;
}

#admin-main {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
}

.admin-panel h2 {
  margin: 0 0 0.7rem 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-dim);
}

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

.admin-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 100px;
}

.admin-stat-n {
  font-size: 24px;
  color: var(--accent);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th {
  text-align: left;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px dashed var(--border);
  vertical-align: top;
}

.admin-table tr.admin-row-flagged td {
  color: #ff9d5c;
}

.admin-detail {
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}

.admin-audit-controls {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
  font-size: 11px;
  color: var(--fg-dim);
}

.admin-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg-dim);
  margin-right: 0.4em;
  vertical-align: middle;
}

.admin-online-dot.online {
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}

.admin-ban-btn {
  color: var(--error);
  border-color: var(--error);
  background: rgba(255, 122, 107, 0.08);
}

.admin-ban-btn:hover {
  background: rgba(255, 122, 107, 0.18);
  box-shadow: 0 0 8px rgba(255, 122, 107, 0.25);
}

.admin-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-actions .box-btn {
  padding: 3px 8px;
  font-size: 10.5px;
}

.plan-pro {
  color: var(--bg);
  background: var(--accent);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 2px;
}

.admin-audit-controls input {
  background: var(--bg);
  color: var(--fg-bright);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.3rem 0.5rem;
  font: inherit;
  font-size: 12px;
  min-width: 260px;
}

/* ---- Help modal ---- */

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

.help-box {
  width: 100%;
  max-width: 680px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.help-titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  background: var(--fg-dim);
  color: var(--bg);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.help-titlebar .editor-btn {
  background: var(--bg-panel);
  border-color: var(--bg-panel);
}

.help-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.2rem;
}

.help-section {
  margin-bottom: 1.3rem;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  margin: 0 0 0.4rem 0;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.help-section p {
  margin: 0 0 0.5rem 0;
  font-size: 12px;
  color: var(--fg);
  line-height: 1.5;
}

.help-section ul {
  margin: 0;
  padding-left: 1.2em;
  list-style: square;
}

.help-section li {
  margin-bottom: 0.4rem;
  color: var(--fg);
  font-size: 12px;
  line-height: 1.45;
}

.help-section li:last-child {
  margin-bottom: 0;
}

.mentor-box {
  max-width: 480px;
}

.mentor-body {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.mentor-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(162, 55%, 22%);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-weight: bold;
  font-size: 15px;
}

.mentor-text {
  flex: 1;
  min-width: 0;
}

.mentor-text p {
  margin: 0 0 0.6rem 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg);
}

.mentor-text p:last-child {
  margin-bottom: 0;
}

.mentor-boxes-section {
  margin-bottom: 0.7rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--border);
}

.help-section code {
  font-family: inherit;
  color: var(--fg-bright);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 3px;
  border-radius: 2px;
}

/* Step-by-step first-run tutorial (public/js/tutorial.js). Non-modal --
   deliberately not a backdrop overlay like .help-overlay, since the player
   needs the terminal underneath fully usable while it's up. */
.tutorial-panel {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 90;
  width: 300px;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(41, 255, 160, 0.25);
}

.tutorial-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  background: var(--accent);
  color: var(--bg);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tutorial-head .editor-btn {
  background: var(--bg-panel);
  border-color: var(--bg-panel);
  color: var(--fg);
  padding: 2px 8px;
}

.tutorial-body {
  padding: 0.7rem 0.8rem;
}

.tutorial-body h4 {
  margin: 0 0 0.4rem 0;
  color: var(--fg-bright);
  font-size: 13px;
}

.tutorial-body p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg);
}

.tutorial-body code {
  font-family: inherit;
  color: var(--fg-bright);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 3px;
  border-radius: 2px;
}

.tutorial-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.8rem 0.7rem;
}

.tutorial-dots {
  display: flex;
  gap: 5px;
}

.tutorial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

.tutorial-dot.active {
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}

.tutorial-dot.done {
  background: var(--fg-dim);
}

.tutorial-foot .box-btn {
  padding: 4px 10px;
  font-size: 11px;
}

/* Applied to whatever DOM element the current tutorial step points at
   (e.g. the RANDOM EASY button) so it's obvious what to click next. */
.tutorial-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  animation: tutorial-glow 1.4s infinite;
}

@keyframes tutorial-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(41, 255, 160, 0); }
  50% { box-shadow: 0 0 12px rgba(41, 255, 160, 0.9); }
}
