/* NETWORLD — global design system. No rounded corners, no white, neon glow. */
:root {
  --bg: #000308;
  --panel-bg: #010D1A;
  --text: #C8E8F0;
  --accent: #00FFFF;
  --green: #00FF41;
  --magenta: #FF00AA;
  --gold: #FFD700;
  --red: #FF2200;
  --dim: #3A6076;
  --line: rgba(0, 255, 255, 0.25);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

#scene-root { position: fixed; inset: 0; z-index: 0; }
#scene-root canvas { display: block; }

/* CSS2D labels live above canvas */
.css2d-layer { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* --- Building labels (CSS2D) --- */
.bldg-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text);
  text-shadow: 0 0 6px currentColor;
  white-space: nowrap;
  padding: 1px 5px;
  background: rgba(1, 13, 26, 0.55);
  border: 1px solid var(--line);
  pointer-events: none;
  transform: translate(-50%, 0);
  user-select: none;
}
.bldg-label.major { font-family: var(--font-display); font-weight: 700; font-size: 13px; }

/* --- Hub POI markers --- */
.hub-marker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent), 0 0 3px #000;
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
  text-transform: uppercase;
}
.hub-marker::before {
  content: '◇ ';
  opacity: 0.7;
  font-size: 11px;
}
.hub-marker.minor {
  font-size: 11px;
  font-weight: 500;
  color: var(--dim);
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.4), 0 0 3px #000;
}

/* --- Scanline overlay --- */
#scanlines {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 255, 0.03) 0px,
    rgba(0, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: screen;
}

/* --- HUD --- */
#hud {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 18px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--dim);
  background: rgba(1, 13, 26, 0.5);
  border: 1px solid var(--line);
  transition: color 0.4s ease-out, box-shadow 0.4s ease-out;
}
#hud.active { color: var(--accent); box-shadow: 0 0 14px rgba(0, 255, 255, 0.25); }
#hud span { white-space: nowrap; }

/* --- Minimap --- */
#minimap-wrap {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 20;
  background: rgba(1, 13, 26, 0.7);
  border: 1px solid var(--line);
  padding: 4px;
}
#minimap { display: block; cursor: crosshair; image-rendering: pixelated; }
.minimap-label {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--dim);
  text-align: center;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* --- Map controls (compass + buttons) --- */
#map-controls {
  position: fixed;
  top: 156px;
  right: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
#compass {
  background: rgba(1, 13, 26, 0.7);
  border: 1px solid var(--line);
}
.ctl-btn {
  width: 64px;
  background: rgba(1, 13, 26, 0.7);
  border: 1px solid var(--line);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 5px 0;
  cursor: pointer;
}
.ctl-btn:hover { box-shadow: 0 0 10px rgba(0, 255, 255, 0.3); }
.mc-row { display: flex; align-items: center; gap: 6px; }
.ctl-btn.gear { width: 30px; height: 30px; font-size: 15px; padding: 0; }

/* Settings popover */
#settings-panel {
  position: fixed; inset: 0; z-index: 70; display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 3, 8, 0.55);
}
#settings-panel.show { display: flex; }
.settings-card {
  position: relative;
  width: 320px;
  background: linear-gradient(180deg, rgba(2,16,31,0.97), rgba(0,8,18,0.98));
  border: 1px solid var(--accent);
  box-shadow: 0 0 30px rgba(0,255,255,0.25);
  padding: 20px;
}
.set-close { position: absolute; top: 10px; right: 12px; background: none; border: 1px solid var(--line); color: var(--accent); width: 24px; height: 24px; cursor: pointer; }
.set-title { font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; color: var(--text); font-size: 15px; margin-bottom: 12px; }
.set-sec { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--dim); margin: 14px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.set-btns { display: flex; gap: 8px; }
.set-opt { flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--line); color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 1px; padding: 9px 4px; cursor: pointer; }
.set-opt small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 9px; color: var(--dim); margin-top: 3px; }
.set-opt.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px rgba(0,255,255,0.3); }
.set-check { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text); margin: 5px 0; cursor: pointer; }
.set-check input { accent-color: var(--accent); }
.set-vol { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.set-vol input[type="range"] { flex: 1; accent-color: var(--accent); }
.set-vol b { color: var(--accent); width: 28px; text-align: right; }
.set-legal-btn { width: 100%; background: rgba(255,34,0,0.08); border: 1px solid var(--red); color: var(--red); font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; padding: 7px; cursor: pointer; }
.set-legal-btn:hover { background: rgba(255,34,0,0.18); }
.set-legal-text { margin-top: 8px; padding: 8px; border: 1px solid var(--line); background: rgba(0,0,0,0.4); font-family: var(--font-mono); font-size: 10px; line-height: 1.5; color: var(--dim); }
.set-legal-links { margin-top: 8px; }
.set-legal-links a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }

/* --- Category legend --- */
#legend {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 20;
  background: rgba(1, 13, 26, 0.7);
  border: 1px solid var(--line);
  min-width: 130px;
}
.legend-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dim);
  padding: 6px 8px;
  cursor: pointer;
}
.legend-body { display: none; padding: 0 8px 8px; }
#legend.open .legend-body { display: block; }
.legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  padding: 2px 0;
}
.legend-sw { width: 11px; height: 11px; box-shadow: 0 0 5px currentColor; }

/* --- Hover tooltip --- */
#hover-tip {
  position: fixed;
  z-index: 40;
  display: none;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(1, 13, 26, 0.85);
  border: 1px solid var(--line);
  padding: 3px 7px;
  text-shadow: 0 0 6px var(--accent);
  transform: translate(12px, 12px);
}

/* --- Buttons (shared) --- */
.big-btn {
  width: 100%;
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 10px;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.2s ease-out, box-shadow 0.2s ease-out;
}
.big-btn:hover { background: rgba(0, 255, 255, 0.2); box-shadow: 0 0 16px rgba(0, 255, 255, 0.4); }
.big-btn.outline { background: none; }
.small-link {
  background: none; border: none; color: var(--dim);
  font-family: var(--font-mono); font-size: 10px; cursor: pointer; margin-top: 6px;
}
.small-link:hover { color: var(--accent); }

/* --- Intel panel (right) --- */
:root { --game: #c44dff; } /* The Sandbox subsystem colour */

#right-actions {
  position: fixed;
  right: 0;
  bottom: 12px;
  width: 320px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(1, 13, 26, 0.6), rgba(0, 6, 14, 0.92));
}
#right-actions button {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 10px;
  cursor: pointer;
  background: none;
  transition: background 0.2s ease-out, box-shadow 0.2s ease-out;
}
#sandbox-btn {
  border: 1px solid var(--game);
  color: var(--game);
  background: rgba(196, 77, 255, 0.1);
  text-shadow: 0 0 8px rgba(196, 77, 255, 0.6);
}
#sandbox-btn:hover { background: rgba(196, 77, 255, 0.25); box-shadow: 0 0 16px rgba(196, 77, 255, 0.5); }
#share-btn { border: 1px solid var(--line); color: var(--accent); }
#share-btn:hover { background: rgba(0, 255, 255, 0.15); box-shadow: 0 0 12px rgba(0, 255, 255, 0.3); }

#intel-panel {
  position: fixed;
  right: 0;
  top: 290px;
  bottom: 96px;
  width: 320px;
  z-index: 25;
  background: linear-gradient(180deg, rgba(1, 13, 26, 0.92), rgba(0, 6, 14, 0.92));
  border-left: 1px solid var(--line);
  backdrop-filter: blur(3px);
  transition: transform 0.35s ease-out;
}
#intel-panel.collapsed { transform: translateX(300px); }
#intel-toggle {
  position: absolute;
  left: -22px; top: 14px;
  width: 22px; height: 56px;
  background: var(--panel-bg); border: 1px solid var(--line); border-right: none;
  color: var(--accent); cursor: pointer; font-size: 12px;
}
#intel-panel.collapsed #intel-toggle { transform: rotate(180deg); }
.intel-body { height: 100%; overflow-y: auto; padding: 14px 14px 20px; }
.intel-body::-webkit-scrollbar { width: 5px; }
.intel-body::-webkit-scrollbar-thumb { background: var(--line); }
#digest-week { color: var(--dim); font-size: 9px; }
.trend-box { height: 90px; margin: 6px 0 12px; }
.digest-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-title { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; margin-bottom: 4px; }
.mini-title.up { color: var(--green); }
.mini-title.down { color: var(--red); }
.movers { list-style: none; }
.movers li {
  display: flex; justify-content: space-between; gap: 4px;
  font-family: var(--font-mono); font-size: 10px; padding: 2px 0; cursor: pointer;
  border-bottom: 1px solid rgba(0, 255, 255, 0.06);
}
.movers li:hover { color: var(--accent); }
.movers .dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movers .chg.up { color: var(--green); }
.movers .chg.down { color: var(--red); }
.sotd { font-family: var(--font-mono); font-size: 12px; cursor: pointer; padding: 8px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); }
.sotd:hover { border-color: var(--accent); box-shadow: 0 0 10px rgba(0,255,255,0.2); }
.sotd .sdom { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--accent); }
.sotd .sblurb { color: var(--dim); margin-top: 4px; font-size: 11px; }
.sotd .sgo { color: var(--accent); font-size: 10px; margin-top: 6px; display: inline-block; }
.game-desc { font-family: var(--font-mono); font-size: 11px; color: var(--text); line-height: 1.45; }
.game-stats { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--accent); margin-bottom: 6px; }
#game-hint { font-family: var(--font-mono); font-size: 11px; color: var(--gold); text-shadow: 0 0 6px var(--gold); }

/* --- Onboarding tablet --- */
#onboard {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(2,16,31,0.86) 0%, rgba(0,3,8,0.94) 70%);
  transition: opacity 0.5s ease-out;
}
#onboard.hidden { opacity: 0; pointer-events: none; }
.tablet {
  position: relative;
  width: min(760px, 92vw);
  padding: 30px 34px 24px;
  background: linear-gradient(180deg, rgba(2,20,36,0.96), rgba(0,8,18,0.97));
  border: 1px solid var(--accent);
  box-shadow: 0 0 40px rgba(0,255,255,0.25), inset 0 0 30px rgba(0,255,255,0.05);
}
.tablet-corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--accent); }
.tablet-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.tablet-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.tablet-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.tablet-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.tablet-title { font-family: var(--font-display); font-weight: 900; font-size: 34px; letter-spacing: 8px; color: var(--text); }
.tablet-title span { color: var(--accent); text-shadow: 0 0 14px var(--accent); }
.tablet-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 3px; color: var(--dim); margin: 4px 0 20px; }
.tablet-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ocard { border: 1px solid var(--line); padding: 14px; background: rgba(0,0,0,0.25); }
.ocard .oic { font-size: 22px; color: var(--accent); text-shadow: 0 0 10px var(--accent); }
.ocard h4 { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 1px; color: var(--text); margin: 6px 0 5px; }
.ocard p { font-family: var(--font-mono); font-size: 11px; color: var(--text); line-height: 1.45; }
.tablet-skip { display: flex; align-items: center; gap: 7px; justify-content: center; font-family: var(--font-mono); font-size: 11px; color: var(--dim); margin-top: 8px; cursor: pointer; }
.tablet-skip input { accent-color: var(--accent); }

/* --- Win prompt --- */
#win-prompt {
  position: fixed; inset: 0; z-index: 95; display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0,40,40,0.5), rgba(0,3,8,0.85));
}
#win-prompt.show { display: flex; }
.win-card {
  text-align: center; padding: 30px 40px;
  background: rgba(0,12,18,0.96); border: 1px solid var(--green);
  box-shadow: 0 0 40px rgba(0,255,65,0.4);
}
.win-title { font-family: var(--font-display); font-weight: 900; font-size: 30px; letter-spacing: 4px; color: var(--green); text-shadow: 0 0 18px var(--green); }
.win-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text); margin: 10px 0; }
.win-card .big-btn { border-color: var(--green); color: var(--green); }
.win-card .big-btn:hover { background: rgba(0,255,65,0.15); box-shadow: 0 0 16px rgba(0,255,65,0.4); }

/* --- In-world game HUD --- */
#game-hud {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 45; width: 320px; padding: 10px 14px;
  background: rgba(1,13,26,0.9); border: 1px solid var(--magenta);
  box-shadow: 0 0 18px rgba(255,0,170,0.3);
}
.ghud-top { display: flex; justify-content: space-between; align-items: center; }
#ghud-title { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 2px; color: var(--magenta); text-shadow: 0 0 8px var(--magenta); }
#ghud-abort { background: none; border: 1px solid var(--line); color: var(--dim); width: 20px; height: 20px; cursor: pointer; }
.ghud-stats { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--accent); margin: 4px 0; }
#ghud-hint { font-family: var(--font-mono); font-size: 11px; color: var(--gold); text-shadow: 0 0 6px var(--gold); }

/* --- Arcade tablet --- */
#game-tablet {
  position: fixed; inset: 0; z-index: 92; display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(2,16,31,0.86), rgba(0,3,8,0.95));
}
#game-tablet.show { display: flex; }
.tablet.gt { width: min(880px, 95vw); max-height: 93vh; overflow-y: auto; overflow-x: hidden; border-color: var(--game); box-shadow: 0 0 40px rgba(196,77,255,0.3), inset 0 0 30px rgba(196,77,255,0.05); }
/* styled scrollbars to match the UI */
.tablet.gt::-webkit-scrollbar, .ice-log::-webkit-scrollbar, .duel-log::-webkit-scrollbar, .fw-log::-webkit-scrollbar, .fw-overlay::-webkit-scrollbar { width: 8px; height: 8px; }
.tablet.gt::-webkit-scrollbar-track, .ice-log::-webkit-scrollbar-track, .duel-log::-webkit-scrollbar-track, .fw-log::-webkit-scrollbar-track { background: rgba(0,0,0,0.4); }
.tablet.gt::-webkit-scrollbar-thumb { background: var(--game); box-shadow: 0 0 6px var(--game); }
.ice-log::-webkit-scrollbar-thumb, .duel-log::-webkit-scrollbar-thumb, .fw-log::-webkit-scrollbar-thumb { background: var(--accent); }
.tablet.gt { scrollbar-width: thin; scrollbar-color: var(--game) rgba(0,0,0,0.4); }

/* game tiers in launcher */
.gt-tier { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.gt-tier span { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 2px; color: var(--game); }
.gt-tier small { font-family: var(--font-mono); font-size: 10px; color: var(--dim); }

/* win / lose result */
.gt-result { text-align: center; padding: 16px 0; }
.gt-badge { display: inline-block; font-family: var(--font-display); font-weight: 700; letter-spacing: 3px; font-size: 13px; padding: 6px 16px; margin-bottom: 14px; border: 1px solid; }
.gt-result.win .gt-badge { color: var(--green); border-color: var(--green); box-shadow: 0 0 18px rgba(0,255,65,0.4); text-shadow: 0 0 8px var(--green); }
.gt-result.lose .gt-badge { color: var(--red); border-color: var(--red); }
.gt-result.win .gt-title span { color: var(--green); text-shadow: 0 0 14px var(--green); }
.gt-result-btns { display: flex; gap: 12px; max-width: 420px; margin: 18px auto 0; }
.tablet.gt .tablet-corner { border-color: var(--game); }
#gt-close { position: absolute; top: 10px; right: 12px; background: none; border: 1px solid var(--game); color: var(--game); width: 26px; height: 26px; cursor: pointer; }
#gt-content { min-height: 360px; }

.gt-title { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: 4px; color: var(--text); }
.gt-title span { color: var(--game); text-shadow: 0 0 12px var(--game); }
.gcard:hover { border-color: var(--game); box-shadow: 0 0 16px rgba(196,77,255,0.3); }
.gcard .gic { color: var(--game); text-shadow: 0 0 10px var(--game); }
.gt-diff:hover { border-color: var(--game); box-shadow: 0 0 12px rgba(196,77,255,0.35); color: var(--game); }
.gt-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--dim); margin: 4px 0 18px; }

/* launcher grid */
.gt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.gcard { border: 1px solid var(--line); padding: 16px; background: rgba(0,0,0,0.3); cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
.gcard:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(0,255,255,0.25); transform: translateY(-2px); }
.gcard .gic { font-size: 26px; color: var(--accent); text-shadow: 0 0 10px var(--accent); }
.gcard h4 { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 1px; margin: 8px 0 5px; color: var(--text); }
.gcard p { font-family: var(--font-mono); font-size: 11px; color: var(--dim); line-height: 1.4; }

/* difficulty */
.gt-diffs { display: flex; gap: 12px; margin-top: 20px; }
.gt-diff { flex: 1; border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--text); font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; padding: 18px 0; cursor: pointer; }
.gt-diff:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(0,255,255,0.3); color: var(--accent); }
.gt-diff small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 10px; color: var(--dim); letter-spacing: 1px; margin-top: 6px; }
.gt-back { margin-top: 16px; }

/* HUD inside tablet games */
.gt-hud { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; color: var(--accent); margin-bottom: 12px; }
.gt-hud .lives { color: var(--magenta); }
.gt-prompt { font-family: var(--font-mono); font-size: 13px; color: var(--text); margin-bottom: 12px; }
.gt-prompt b { color: var(--accent); }

/* phish options */
.phish-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.phish-opt { font-family: var(--font-mono); font-size: 14px; padding: 12px; border: 1px solid var(--line); background: rgba(0,0,0,0.3); color: var(--text); cursor: pointer; text-align: center; }
.phish-opt:hover { border-color: var(--accent); }
.phish-opt.good { border-color: var(--green); color: var(--green); box-shadow: 0 0 12px rgba(0,255,65,0.4); }
.phish-opt.bad { border-color: var(--red); color: var(--red); box-shadow: 0 0 12px rgba(255,34,0,0.4); }

/* hacking terminal */
.hack-wrap { font-family: var(--font-mono); }
.hack-cands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.hack-cand { padding: 8px; border: 1px solid var(--line); background: rgba(0,0,0,0.4); color: var(--green); cursor: pointer; text-align: center; letter-spacing: 2px; }
.hack-cand:hover { border-color: var(--green); box-shadow: 0 0 8px rgba(0,255,65,0.35); }
.hack-cand.used { color: var(--dim); cursor: default; border-color: rgba(0,255,255,0.08); }
.hack-log { background: rgba(0,0,0,0.5); border: 1px solid var(--line); padding: 8px; height: 120px; overflow-y: auto; font-size: 12px; color: var(--green); }
.hack-log div { padding: 1px 0; }

/* relay grid */
.relay-grid { display: grid; gap: 4px; margin: 12px auto; width: max-content; }
.relay-cell { width: 46px; height: 46px; border: 1px solid var(--line); background: rgba(0,0,0,0.35); cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.relay-cell.on { background: rgba(0,255,255,0.25); border-color: var(--accent); box-shadow: inset 0 0 10px rgba(0,255,255,0.4); }
.relay-cell.wall { background: rgba(255,34,0,0.18); border-color: var(--red); cursor: not-allowed; color: var(--red); }
.relay-cell.src { background: rgba(0,255,65,0.3); border-color: var(--green); color: var(--green); }
.relay-cell.exit { background: rgba(255,215,0,0.25); border-color: var(--gold); color: var(--gold); }

/* ICE Breaker terminal (cyan/matrix; keys & brackets blend in) */
.ice-dump { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; color: #2c6f7a; background: rgba(0,10,16,0.7); border: 1px solid var(--line); padding: 10px; }
.ice-col { flex: 1; }
.hl { white-space: pre; }
.haddr { color: #1b4e5a; margin-right: 8px; }
.ice-dump .g { color: #2c6f7a; }
.hw { color: #2c6f7a; cursor: pointer; }
.hw:hover { background: var(--accent); color: #001; }
.hw.used { color: #143; text-decoration: line-through; cursor: default; }
.hb { color: #2c6f7a; cursor: pointer; }
.hb:hover { background: var(--gold); color: #210; }
.ice-log { font-family: var(--font-mono); font-size: 11px; color: var(--accent); background: rgba(0,10,16,0.7); border: 1px solid var(--line); padding: 8px; height: 88px; overflow-y: auto; margin-top: 10px; }
.ice-log div { padding: 1px 0; }

/* Packet relay pipes */
.pipe-grid { display: grid; gap: 5px; width: max-content; margin: 14px auto; }
.pipe { width: 48px; height: 48px; border: 1px solid var(--line); background: rgba(0,0,0,0.35); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pipe.pwr { box-shadow: inset 0 0 12px rgba(0,255,255,0.35); }
.pipe.src { border-color: var(--green); }
.pipe.exit { border-color: var(--gold); }
.pipe.dead { background: rgba(60,60,70,0.4); border-color: #444; color: #556; cursor: not-allowed; }
.pipe.inf { border-color: rgba(255,51,68,0.5); }
.pipe.inf-pwr { border-color: var(--red); background: rgba(255,34,0,0.3); box-shadow: inset 0 0 14px rgba(255,34,0,0.6); }

/* Cyber duel */
.duel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 12px; }
.duel-side { border: 1px solid var(--line); padding: 12px; background: rgba(0,0,0,0.3); }
.duel-name { font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; color: var(--accent); margin-bottom: 8px; }
.duel-k { font-family: var(--font-mono); font-size: 10px; color: var(--dim); margin-top: 8px; }
.duel-bar { height: 8px; background: rgba(255,255,255,0.08); margin-top: 3px; }
.duel-fill { height: 100%; transition: width 0.3s ease-out; }
.duel-fill.hp { background: var(--green); }
.duel-fill.trace { background: var(--red); }
.duel-fill.foe { background: var(--magenta); }
.duel-tag { font-family: var(--font-mono); font-size: 10px; color: var(--gold); margin-top: 6px; }
.duel-log { font-family: var(--font-mono); font-size: 11px; color: var(--text); background: rgba(0,0,0,0.4); border: 1px solid var(--line); padding: 8px; height: 92px; overflow-y: auto; margin-bottom: 10px; }
.duel-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.duel-act { background: rgba(0,255,255,0.06); border: 1px solid var(--line); color: var(--accent); font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 1px; padding: 10px 4px; cursor: pointer; }
.duel-act:hover { background: rgba(0,255,255,0.18); box-shadow: 0 0 10px rgba(0,255,255,0.3); }
.duel-act small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 9px; color: var(--dim); margin-top: 4px; letter-spacing: 0; }

/* Gatekeeper (social) */
.case-wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; }
.case-rules { border: 1px solid var(--line); padding: 12px; background: rgba(0,0,0,0.3); }
.rules-h { font-family: var(--font-mono); font-size: 10px; color: var(--gold); letter-spacing: 1px; margin-bottom: 8px; }
.rule { font-family: var(--font-mono); font-size: 11px; color: var(--text); line-height: 1.5; margin-bottom: 4px; }
.case-doc { border: 1px solid var(--accent); padding: 14px; background: rgba(0,10,18,0.6); position: relative; }
.case-stamp { font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; color: var(--accent); font-size: 12px; margin-bottom: 10px; }
.case-row { display: grid; grid-template-columns: 80px 1fr; font-family: var(--font-mono); font-size: 12px; padding: 3px 0; border-bottom: 1px solid rgba(0,255,255,0.06); }
.case-row span:first-child { color: var(--dim); }
.flagable { color: var(--gold); }
.case-fb { min-height: 18px; text-align: center; font-family: var(--font-mono); font-size: 12px; margin: 8px 0; }
.fb-good { color: var(--green); }
.fb-bad { color: var(--red); }
.case-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Firewall defense */
.fw-top { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.fw-stat { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.fw-stat b { font-family: var(--font-display); font-size: 16px; color: var(--accent); }
.fw-infobtn { margin-left: auto; background: none; border: 1px solid var(--game); color: var(--game); font-family: var(--font-mono); font-size: 11px; padding: 5px 10px; cursor: pointer; }
.fw-palette { display: flex; gap: 8px; margin-bottom: 8px; }
.fw-tower { flex: 1; background: rgba(0,0,0,0.35); border: 1px solid var(--line); color: var(--text); font-family: var(--font-mono); font-size: 10px; padding: 6px; cursor: pointer; text-align: center; }
.fw-tower.sel { border-color: var(--tc); box-shadow: 0 0 10px var(--tc); }
.fw-tower .fw-sym { display: block; font-size: 18px; color: var(--tc); }
.fw-tower small { display: block; color: var(--dim); margin-top: 2px; }
#fw-canvas { width: 100%; height: auto; aspect-ratio: 760 / 340; border: 1px solid var(--line); display: block; cursor: crosshair; background: #01060c; }
.fw-log { font-family: var(--font-mono); font-size: 11px; color: var(--gold); height: 56px; overflow-y: auto; margin-top: 6px; }
.fw-overlay { position: absolute; inset: 0; background: rgba(0,5,10,0.95); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.fw-info-card { max-width: 620px; }
.fw-info-card h3 { font-family: var(--font-display); color: var(--accent); letter-spacing: 2px; font-size: 14px; margin: 12px 0 8px; }
.fw-info-card p { font-family: var(--font-mono); font-size: 12px; color: var(--text); line-height: 1.5; margin-bottom: 7px; }

/* --- Toast --- */
#toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%) translateY(20px);
  z-index: 60; padding: 8px 18px; opacity: 0; pointer-events: none;
  background: rgba(1,13,26,0.92); border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Boot overlay --- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #02101f 0%, #000308 70%);
  transition: opacity 0.8s ease-out;
}
#boot.hidden { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 64px;
  letter-spacing: 12px;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent), 0 0 60px rgba(0, 255, 255, 0.4);
}
.boot-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--dim);
  margin: 12px 0 26px;
}
.boot-bar {
  width: 360px;
  height: 4px;
  margin: 0 auto;
  background: rgba(0, 255, 255, 0.12);
  overflow: hidden;
}
#boot-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.3s ease-out;
}
#boot-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 14px;
  letter-spacing: 1px;
}
