:root {
  color-scheme: dark;
  --bg: #050912;
  --surface: #0b1220;
  --surface-2: #101a2d;
  --surface-3: #16233a;
  --line: rgba(118, 205, 255, 0.18);
  --cyan: #17d8ff;
  --blue: #0b8cff;
  --green: #55f2b0;
  --amber: #ffca5c;
  --red: #ff5470;
  --purple: #b57cff;
  --text: #eef8ff;
  --muted: #96a9bd;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 14% 16%, rgba(11, 140, 255, 0.14), transparent 28rem),
    radial-gradient(circle at 88% 40%, rgba(181, 124, 255, 0.09), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.55;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  min-height: 94px;
  padding: 14px 48px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(64px, 1fr);
  align-items: center;
  gap: 24px;
  background: rgba(2, 5, 10, 0.94);
  border-bottom: 1px solid rgba(23, 216, 255, 0.12);
  backdrop-filter: blur(18px);
}

.site-logo {
  width: 238px;
  display: block;
}

.site-logo img {
  display: block;
  width: 100%;
  height: auto;
}

nav {
  display: flex;
  align-items: center;
}

nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 27px;
  list-style: none;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  transition: color 0.2s ease;
  white-space: nowrap;
}

nav a:hover,
nav a.active {
  color: var(--cyan);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.55rem;
  cursor: pointer;
}

.armino-account-slot {
  justify-self: end;
}

main {
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 126px;
}

.game-intro {
  padding: 44px 0 34px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.eyebrow,
.section-label {
  color: var(--cyan);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.eyebrow {
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.section-label {
  display: inline-block;
  font-size: 0.68rem;
  margin-bottom: 7px;
}

.game-intro h1 {
  font-size: clamp(2.7rem, 6vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
  margin-bottom: 20px;
}

.game-intro p {
  max-width: 790px;
  color: #c4d2df;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.prototype-note {
  flex: 0 0 290px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 202, 92, 0.26);
  border-radius: 16px;
  background: rgba(255, 202, 92, 0.07);
}

.prototype-note strong,
.prototype-note span {
  display: block;
}

.prototype-note strong {
  color: var(--amber);
  margin-bottom: 4px;
}

.prototype-note span {
  color: #c3ced9;
  font-size: 0.86rem;
}

.game-shell {
  padding: 22px;
  background: linear-gradient(145deg, rgba(15, 26, 45, 0.96), rgba(6, 12, 22, 0.98));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.game-heading,
.module-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.game-heading {
  padding: 2px 4px 20px;
}

.game-heading h2,
.module-heading h3,
.panel-card h3 {
  line-height: 1.12;
}

.game-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.game-heading > p,
.module-heading > p {
  max-width: 530px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.status-card {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid rgba(118, 205, 255, 0.13);
  border-radius: 12px;
  background: rgba(7, 14, 26, 0.9);
}

.status-card span,
.status-card strong {
  display: block;
}

.status-card span {
  color: #7e94aa;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-card strong {
  color: #fff;
  margin-top: 2px;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 16px;
  align-items: start;
}

.stage-column {
  min-width: 0;
}

.canvas-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(23, 216, 255, 0.28);
  border-radius: 18px;
  background: #030812;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.55);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #050a14;
  cursor: crosshair;
  touch-action: none;
}

#gameCanvas:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: -4px;
}

.message-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 5;
  max-width: calc(100% - 36px);
  padding: 10px 16px;
  border: 1px solid rgba(23, 216, 255, 0.32);
  border-radius: 999px;
  background: rgba(4, 11, 21, 0.92);
  color: #dffaff;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.message-banner.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.message-banner.warning {
  border-color: rgba(255, 202, 92, 0.42);
  color: #ffe4a1;
}

.message-banner.danger {
  border-color: rgba(255, 84, 112, 0.5);
  color: #ffbdc8;
}

.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 0 4px;
}

.control-btn,
.inspector-actions button {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(118, 205, 255, 0.22);
  border-radius: 10px;
  background: #121d31;
  color: #eaf8ff;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.control-btn:hover,
.inspector-actions button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--cyan);
}

.control-btn.primary {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #021018;
}

.control-btn.danger {
  margin-left: auto;
  border-color: rgba(255, 84, 112, 0.38);
  color: #ff9bad;
}

.module-section {
  margin-top: 8px;
  padding: 18px;
  border: 1px solid rgba(118, 205, 255, 0.12);
  border-radius: 18px;
  background: rgba(5, 11, 21, 0.76);
}

.module-heading {
  margin-bottom: 13px;
}

.module-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.module-card {
  position: relative;
  min-width: 0;
  min-height: 128px;
  padding: 13px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  align-items: center;
  gap: 2px 10px;
  border: 1px solid rgba(118, 205, 255, 0.14);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(19, 31, 51, 0.92), rgba(10, 17, 30, 0.96));
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.module-card:hover,
.module-card.selected {
  transform: translateY(-2px);
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(15, 61, 82, 0.92), rgba(9, 25, 40, 0.96));
}

.module-card.unavailable {
  opacity: 0.46;
}

.module-icon {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(23, 216, 255, 0.13);
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 900;
}

.scanner-icon { color: #8fe8ff; background: rgba(143, 232, 255, 0.11); }
.limiter-icon { color: var(--amber); background: rgba(255, 202, 92, 0.11); }
.scrubber-icon { color: var(--purple); background: rgba(181, 124, 255, 0.11); }
.quarantine-icon { color: var(--red); background: rgba(255, 84, 112, 0.11); }
.honeypot-icon { color: var(--green); background: rgba(85, 242, 176, 0.11); }
.tracer-icon { color: #ff7bd8; background: rgba(255, 123, 216, 0.12); }

.module-key {
  position: absolute;
  top: 7px;
  right: 8px;
  color: #6f849a;
  font-size: 0.64rem;
  font-weight: 900;
}

.module-card strong {
  padding-right: 14px;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-card small {
  color: #8ea2b6;
  font-size: 0.67rem;
  line-height: 1.25;
}

.module-stats {
  grid-column: 1 / -1;
  align-self: end;
  padding-top: 9px;
  color: #b9c7d5;
  font-size: 0.64rem;
  font-weight: 700;
}

.operations-panel {
  display: grid;
  gap: 12px;
}

.panel-card {
  padding: 17px;
  border: 1px solid rgba(118, 205, 255, 0.13);
  border-radius: 16px;
  background: rgba(7, 14, 26, 0.9);
}

.panel-card h3 {
  margin-bottom: 8px;
  font-size: 1.04rem;
}

.panel-card p {
  color: var(--muted);
  font-size: 0.78rem;
}

.selection-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 0;
}

.selection-stats > div {
  min-width: 0;
  padding: 8px;
  border-radius: 9px;
  background: var(--surface-2);
}

.selection-stats dt {
  color: #6f859b;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.selection-stats dd {
  margin-top: 2px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.inspector-actions button {
  min-width: 0;
  padding-inline: 9px;
  font-size: 0.7rem;
}

.inspector-actions button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.inspector-actions .danger-outline {
  border-color: rgba(255, 84, 112, 0.3);
  color: #ff9bad;
}

.legend-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  color: #b4c3d2;
  font-size: 0.72rem;
}

.legend-list > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.legend-line {
  width: 28px;
  border-top: 3px solid var(--cyan);
}

.closed-line {
  border-color: #39465b;
  border-top-style: dashed;
}

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

.clean-dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.threat-dot { background: var(--red); box-shadow: 0 0 10px var(--red); }

.incident-log {
  min-height: 140px;
  max-height: 190px;
  overflow: auto;
  margin-top: 10px;
  display: flex;
  flex-direction: column-reverse;
  gap: 7px;
  scrollbar-width: thin;
}

.log-entry {
  padding-left: 9px;
  border-left: 2px solid #33445a;
  color: #8fa2b6;
  font-size: 0.68rem;
  line-height: 1.35;
}

.log-entry strong {
  color: #dbeeff;
}

.log-entry.warning { border-color: var(--amber); }
.log-entry.danger { border-color: var(--red); }
.log-entry.success { border-color: var(--green); }

.prototype-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 24px 0 70px;
}

.prototype-details article {
  padding: 28px;
  border: 1px solid rgba(118, 205, 255, 0.12);
  border-radius: 20px;
  background: rgba(10, 18, 31, 0.74);
}

.prototype-details h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.prototype-details p {
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  padding: 38px 24px;
  border-top: 1px solid rgba(118, 205, 255, 0.1);
  background: #02050a;
  color: #7f92a6;
  text-align: center;
  font-size: 0.82rem;
}

footer p + p {
  margin-top: 7px;
}

footer a {
  color: var(--cyan);
  text-decoration: none;
}

@media (max-width: 1240px) {
  .site-header {
    grid-template-columns: 220px 1fr auto;
    padding-inline: 26px;
  }

  nav ul {
    gap: 16px;
  }

  nav a {
    font-size: 0.82rem;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .operations-panel {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
    min-height: 82px;
    padding: 12px 18px;
  }

  .site-logo {
    width: 205px;
  }

  nav {
    order: 3;
  }

  nav ul {
    position: fixed;
    top: 82px;
    left: 0;
    right: 0;
    padding: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: rgba(2, 5, 10, 0.98);
    border-bottom: 1px solid var(--line);
  }

  nav.active ul {
    display: flex;
  }

  nav a {
    display: block;
    padding: 8px;
    text-align: center;
  }

  .menu-toggle {
    display: block;
  }

  main {
    width: min(100% - 20px, 1540px);
    padding-top: 98px;
  }

  .game-intro {
    align-items: stretch;
    flex-direction: column;
    padding-top: 30px;
  }

  .prototype-note {
    flex-basis: auto;
  }

  .status-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .operations-panel {
    grid-template-columns: 1fr;
  }

  .module-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .site-logo {
    width: 160px;
  }

  .game-shell {
    padding: 10px;
    border-radius: 17px;
  }

  .game-heading,
  .module-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .game-heading > p,
  .module-heading > p {
    text-align: left;
  }

  .status-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .canvas-frame {
    border-radius: 12px;
  }

  .game-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .control-btn.danger {
    margin-left: 0;
  }

  .module-section {
    padding: 12px;
  }

  .module-palette {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 108px;
  }

  .prototype-details {
    grid-template-columns: 1fr;
  }
}

@media (pointer: fine) {
  .menu-toggle {
    display: none;
  }

  @media (max-width: 900px) {
    .menu-toggle {
      display: block;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Firewall Protocol v0.2: light-first interface and focused play mode */
:root {
  color-scheme: light;
  --bg: #f2f6fa;
  --surface: #ffffff;
  --surface-2: #edf3f8;
  --surface-3: #e2ebf3;
  --line: rgba(25, 68, 103, 0.16);
  --line-strong: rgba(25, 68, 103, 0.28);
  --text: #102235;
  --muted: #607488;
  --shadow: 0 20px 60px rgba(25, 54, 78, 0.12);
}

body {
  background: var(--bg);
  color: var(--text);
}

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 28px rgba(25, 54, 78, 0.08);
}

nav a {
  color: var(--text);
}

.game-intro,
.prototype-details,
footer {
  color: var(--text);
}

.game-shell {
  position: relative;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.status-card strong,
.prototype-note span {
  color: var(--text);
}

.status-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.overloaded {
  color: #c6283d !important;
}

.prototype-note,
.status-card,
.module-section,
.panel-card,
.prototype-details article {
  background: var(--surface-2);
  border-color: var(--line);
}

.status-card span,
.module-heading p,
.panel-card p,
.prototype-details p,
.selection-stats dt,
.incident-log,
.module-card small {
  color: var(--muted);
}

.canvas-frame {
  background: #eaf1f7;
  border-color: rgba(10, 174, 239, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.control-btn,
.inspector-actions button,
.branch-choices button {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text);
}

.control-btn:hover:not(:disabled),
.inspector-actions button:hover:not(:disabled),
.branch-choices button:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--cyan);
}

.control-btn.primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04131d;
}

.control-btn.danger,
.danger-outline {
  color: #c6283d !important;
}

.module-card {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

.module-card:hover:not(:disabled) {
  background: #f7fbfe;
  border-color: var(--cyan);
}

.module-card.selected {
  background: rgba(0, 174, 239, 0.1);
  border-color: var(--cyan);
}

.module-card.unavailable {
  background: #edf1f4;
}

.module-stats,
.incident-entry,
.legend-list,
.service-row,
.incoming-chip {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  color: var(--text);
}

.message-banner {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 174, 239, 0.4);
  color: var(--text);
}

footer {
  background: #e7eef5;
  border-top-color: var(--line);
}

body.dark-mode {
  color-scheme: dark;
  --bg: #06111b;
  --surface: #0b1825;
  --surface-2: #112231;
  --surface-3: #172c3c;
  --line: rgba(141, 202, 230, 0.16);
  --line-strong: rgba(141, 202, 230, 0.3);
  --text: #f2f8fc;
  --muted: #9bb1c1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

body.dark-mode .site-header {
  background: rgba(3, 10, 16, 0.96);
  box-shadow: none;
}

body.dark-mode .canvas-frame {
  background: #07131e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

body.dark-mode .module-card,
body.dark-mode .module-stats,
body.dark-mode .incident-entry,
body.dark-mode .legend-list,
body.dark-mode .service-row,
body.dark-mode .incoming-chip {
  background: rgba(5, 15, 24, 0.62);
}

body.dark-mode .module-card:hover:not(:disabled) {
  background: rgba(0, 174, 239, 0.1);
}

body.dark-mode .module-card.unavailable {
  background: rgba(30, 40, 48, 0.8);
}

body.dark-mode .message-banner {
  background: rgba(6, 17, 27, 0.94);
}

body.dark-mode footer {
  background: #050d14;
}

.game-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-menu {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: start center;
  padding: 28px;
  overflow: auto;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 24%, rgba(0, 174, 239, 0.18), transparent 36%),
    rgba(236, 244, 250, 0.97);
  backdrop-filter: blur(12px);
}

body.dark-mode .game-menu {
  background:
    radial-gradient(circle at 50% 24%, rgba(0, 174, 239, 0.2), transparent 36%),
    rgba(3, 11, 18, 0.97);
}

.game-menu[hidden],
.menu-panel[hidden] {
  display: none;
}

.menu-panel {
  width: min(500px, 100%);
  padding: 30px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-panel-wide {
  width: min(900px, 100%);
  text-align: left;
}

.menu-panel h2 {
  margin: 6px 0 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.menu-panel > p {
  margin: 0 auto 22px;
  color: var(--muted);
  max-width: 680px;
}

.menu-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border: 2px solid var(--cyan);
  border-radius: 20px;
  color: var(--cyan);
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(0, 174, 239, 0.2);
}

.menu-actions {
  display: grid;
  gap: 9px;
}

.menu-btn,
.setting-row {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.menu-btn:hover,
.setting-row:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.menu-btn.primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #03131d;
}

.menu-btn.text-link {
  display: block;
  text-decoration: none;
}

.menu-back {
  width: auto;
  min-width: 130px;
  margin-top: 20px;
}

.how-grid,
.threat-database {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.how-grid article,
.threat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.how-grid article {
  display: grid;
  gap: 5px;
}

.how-grid span,
.threat-card p,
.threat-card small {
  color: var(--muted);
  line-height: 1.55;
}

.threat-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.threat-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--threat-color, var(--cyan));
  color: #06111b;
  font-weight: 900;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
}

.setting-row strong {
  color: var(--cyan);
}

.wave-preview {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 70%;
  pointer-events: none;
}

.wave-preview:empty {
  display: none;
}

.preview-chip,
.incoming-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

body.dark-mode .preview-chip {
  background: rgba(5, 15, 24, 0.86);
}

.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--cyan));
}

.tutorial-prompt {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 10;
  width: min(520px, calc(100% - 24px));
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--cyan);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(9, 57, 84, 0.18);
}

body.dark-mode .tutorial-prompt {
  background: rgba(5, 15, 24, 0.94);
}

.branch-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.branch-choices[hidden] {
  display: none;
}

.upgrade-prompt,
.chosen-path-summary {
  grid-column: 1 / -1;
}

.upgrade-prompt {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.branch-choices button {
  min-height: 78px;
  padding: 9px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.branch-choices button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.branch-choices button.unaffordable {
  border-color: rgba(198, 40, 61, 0.42);
}

.branch-choices button.unaffordable small::after {
  content: " · Insufficient processing";
  color: #c6283d;
  font-weight: 750;
}

.chosen-path-summary {
  padding: 10px 12px;
  border: 1px solid rgba(0, 174, 239, 0.38);
  border-radius: 10px;
  background: rgba(0, 174, 239, 0.08);
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.45;
}

.chosen-path-summary strong,
.chosen-path-summary span {
  display: block;
}

.chosen-path-summary span {
  margin-top: 3px;
  color: var(--muted);
}

.branch-choices.attention {
  animation: upgradeAttention 420ms ease;
}

@keyframes upgradeAttention {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  65% { transform: translateX(4px); }
}

.service-throughput,
.incoming-threats {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.service-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 700;
}

.service-meter {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.service-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--meter-color, var(--cyan));
}

.incoming-threats {
  display: flex;
  flex-wrap: wrap;
}

body.game-focused {
  overflow: hidden;
}

.game-shell.focused {
  position: fixed;
  inset: 94px 0 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 12px;
  border-width: 1px 0 0;
  border-radius: 0;
  overflow: hidden;
}

.game-shell.focused .game-heading {
  min-height: 34px;
  margin-bottom: 6px;
}

.game-shell.focused .game-heading h2,
.game-shell.focused .game-heading .section-label {
  display: none;
}

.game-shell.focused .status-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 6px;
}

.game-shell.focused .status-card {
  min-height: 45px;
  padding: 5px 9px;
}

.game-shell.focused .status-card span {
  font-size: 0.62rem;
}

.game-shell.focused .status-card strong {
  font-size: 0.9rem;
}

.game-shell.focused .game-layout {
  flex: 1;
  min-height: 0;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 20vw);
}

.game-shell.focused .stage-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  gap: 5px;
}

.game-shell.focused .canvas-frame {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: auto;
  aspect-ratio: 16 / 9;
}

.game-shell.focused canvas {
  width: 100%;
  height: 100%;
}

.game-shell.focused .game-controls {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.game-shell.focused .control-btn {
  min-height: 31px;
  padding: 5px 8px;
  font-size: 0.72rem;
}

.game-shell.focused .control-btn.danger {
  margin-left: 0;
}

.game-shell.focused .module-section {
  margin: 0;
  padding: 5px;
  border-radius: 10px;
}

.game-shell.focused .module-heading {
  display: none;
}

.game-shell.focused .module-palette {
  grid-template-columns: repeat(var(--palette-columns, 6), minmax(0, 1fr));
  gap: 5px;
}

.game-shell.focused .module-card {
  min-height: 54px;
  padding: 5px 5px 5px 39px;
}

.game-shell.focused .module-card strong {
  font-size: 0.68rem;
}

.game-shell.focused .module-card small,
.game-shell.focused .module-stats {
  display: none;
}

.game-shell.focused .module-icon {
  left: 5px;
  top: 9px;
  width: 29px;
  height: 29px;
  font-size: 0.58rem;
}

.game-shell.focused .module-key {
  top: 3px;
  right: 5px;
}

.game-shell.focused .operations-panel {
  min-height: 0;
  overflow-y: auto;
  gap: 6px;
}

.game-shell.focused .panel-card {
  padding: 9px;
  border-radius: 10px;
}

.game-shell.focused .panel-card h3 {
  margin: 2px 0 4px;
  font-size: 0.9rem;
}

.game-shell.focused .panel-card p,
.game-shell.focused .legend-list,
.game-shell.focused .incident-log,
.game-shell.focused .selection-stats {
  font-size: 0.68rem;
}

.game-shell.focused .section-label {
  font-size: 0.58rem;
}

.game-shell.focused .inspector-actions button {
  padding: 6px;
  font-size: 0.65rem;
}

.game-shell.focused .incident-log {
  max-height: 92px;
}

@media (max-width: 900px) {
  .status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .game-shell.focused {
    inset: 82px 0 0;
    overflow-y: auto;
  }

  .game-shell.focused .game-layout {
    display: block;
  }

  .game-shell.focused .stage-column {
    height: auto;
  }

  .game-shell.focused .canvas-frame {
    width: 100%;
    height: auto;
  }

  .game-shell.focused .operations-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
    overflow: visible;
  }

  .game-shell.focused .status-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .game-menu {
    padding: 12px;
  }
}

@media (max-width: 650px) {
  .how-grid,
  .threat-database,
  .game-shell.focused .operations-panel {
    grid-template-columns: 1fr;
  }

  .menu-panel {
    padding: 20px;
  }

  .game-shell.focused .module-palette {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-shell.focused .game-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-strip,
  .game-shell.focused .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Firewall Protocol v0.3 campaign, loadout, results, and Last-Line systems */
.campaign-panel {
  width: min(1040px, 100%);
}

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.campaign-map {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(rgba(0, 174, 239, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 174, 239, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 18% 62%, rgba(0, 174, 239, 0.18), transparent 19%),
    radial-gradient(circle at 82% 34%, rgba(255, 84, 112, 0.13), transparent 23%),
    var(--surface-2);
  background-size: 30px 30px, 30px 30px, auto, auto, auto;
}

.campaign-map::before {
  content: "EDGE NETWORK // INCIDENT TOPOLOGY";
  position: absolute;
  top: 14px;
  left: 16px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.campaign-path {
  position: absolute;
  z-index: 1;
  height: 4px;
  transform-origin: left center;
  border-radius: 999px;
  background: var(--line-strong);
}

.campaign-path.unlocked {
  background: linear-gradient(90deg, var(--cyan), rgba(0, 174, 239, 0.35));
  box-shadow: 0 0 12px rgba(0, 174, 239, 0.25);
}

.campaign-node {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border: 3px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font: 900 0.82rem/1 Inter, sans-serif;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.campaign-node:hover:not(:disabled),
.campaign-node.selected {
  transform: translate(-50%, -50%) scale(1.08);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 0 7px rgba(0, 174, 239, 0.1), var(--shadow);
}

.campaign-node.current {
  animation: campaignPulse 1.8s ease-in-out infinite;
}

.campaign-node.completed {
  border-color: #20bf78;
  color: #137849;
}

.campaign-node.locked {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.8);
}

.campaign-node-label {
  position: absolute;
  z-index: 4;
  width: 120px;
  transform: translate(-50%, 42px);
  color: var(--text);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  pointer-events: none;
}

.campaign-node-stars {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -34px);
  color: #e5a824;
  font-size: 0.62rem;
  letter-spacing: 1px;
  pointer-events: none;
}

@keyframes campaignPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.12), var(--shadow); }
  50% { box-shadow: 0 0 0 11px rgba(0, 174, 239, 0), var(--shadow); }
}

.level-brief {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.level-brief h3 {
  margin: 5px 0 8px;
  font-size: 1.35rem;
}

.level-brief > p {
  color: var(--muted);
  line-height: 1.55;
}

.level-brief-stars,
.results-stars {
  margin: 14px 0;
  color: #e5a824;
  font-size: 1.55rem;
  letter-spacing: 4px;
}

.level-objectives {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 0;
  list-style: none;
}

.level-objectives li {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.76rem;
}

.level-objectives li::before {
  content: "☆";
  margin-right: 7px;
  color: #e5a824;
}

.loadout-section {
  margin-top: 18px;
}

.loadout-heading,
.loadout-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.loadout-heading {
  margin-bottom: 9px;
}

.loadout-heading span {
  color: var(--muted);
  font-size: 0.75rem;
}

.loadout-grid,
.last-line-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.last-line-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loadout-card,
.last-line-choice {
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.loadout-card strong,
.loadout-card small,
.last-line-choice strong,
.last-line-choice small {
  display: block;
}

.loadout-card small,
.last-line-choice small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.42;
}

.loadout-card.selected,
.last-line-choice.selected {
  border-color: var(--cyan);
  background: rgba(0, 174, 239, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 174, 239, 0.16);
}

.loadout-card:not(.selected) {
  opacity: 0.68;
}

.last-line-choice {
  position: relative;
  padding-left: 58px;
}

.last-line-choice::before {
  content: attr(data-short);
  position: absolute;
  left: 12px;
  top: 13px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--last-line-color, var(--cyan));
  border-radius: 9px;
  color: var(--last-line-color, var(--cyan));
  font-size: 0.62rem;
  font-weight: 900;
}

.loadout-message {
  min-height: 22px;
  margin: 12px 0 4px;
  color: #c6283d;
  font-size: 0.76rem;
  font-weight: 750;
}

.loadout-actions .menu-btn {
  width: auto;
  min-width: 180px;
}

.results-stars {
  font-size: 2.2rem;
  text-align: center;
}

.results-objectives {
  display: grid;
  gap: 7px;
  margin: 16px 0 20px;
}

.result-objective {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
}

.result-objective.earned {
  border-color: rgba(32, 191, 120, 0.35);
  color: var(--text);
}

.result-objective strong {
  color: #e5a824;
}

.last-line-card {
  border-color: rgba(232, 169, 47, 0.48);
  background: linear-gradient(145deg, rgba(232, 169, 47, 0.12), var(--surface));
}

.last-line-card.selected {
  border-color: #e5a824;
  background: rgba(232, 169, 47, 0.13);
}

.last-line-card.deployed {
  opacity: 0.58;
}

.last-line-icon {
  border-color: #e5a824;
  background: rgba(232, 169, 47, 0.13);
  color: #b67c09;
}

.last-line-control {
  border-color: rgba(232, 169, 47, 0.5);
  color: #a66e00;
}

.last-line-control.ready {
  background: #e5a824;
  border-color: #e5a824;
  color: #211600;
  box-shadow: 0 0 18px rgba(232, 169, 47, 0.22);
}

.module-card.loadout-disabled {
  display: none;
}

.game-shell.focused .game-controls {
  grid-template-columns: 1.35fr repeat(5, minmax(0, 1fr));
}

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

  .campaign-map {
    min-height: 360px;
  }

  .loadout-grid,
  .last-line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-shell.focused .game-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .loadout-grid,
  .last-line-grid {
    grid-template-columns: 1fr;
  }

  .loadout-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .loadout-actions .menu-btn {
    width: 100%;
  }

  .game-shell.focused .game-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Firewall Protocol v0.9.0 ingress resistance and Traceback Cannon */
.status-card.status-warning {
  border-color: rgba(229, 168, 36, 0.48);
  background: linear-gradient(145deg, rgba(229, 168, 36, 0.12), rgba(7, 14, 26, 0.92));
}

.status-card.status-warning strong,
.status-card.status-warning small {
  color: #c88c14;
}

.status-card.status-danger {
  border-color: rgba(229, 75, 98, 0.58);
  background: linear-gradient(145deg, rgba(229, 75, 98, 0.15), rgba(7, 14, 26, 0.94));
  box-shadow: inset 0 0 0 1px rgba(229, 75, 98, 0.08);
}

.status-card.status-danger strong,
.status-card.status-danger small {
  color: #e54b62;
}

.scaling-chip {
  flex-basis: 100%;
  justify-content: center;
  border-color: rgba(229, 168, 36, 0.42) !important;
  background: rgba(229, 168, 36, 0.1) !important;
  color: #c88c14 !important;
  font-size: 0.58rem !important;
  letter-spacing: 0.025em;
}

.game-shell.focused .status-card small {
  font-size: 0.52rem;
}

@media (max-width: 650px) {
  .status-card small {
    white-space: normal;
  }
}

/* Firewall Protocol v0.4 usability and guided onboarding */
.game-shell.focused .module-palette {
  grid-template-columns: repeat(var(--palette-columns, 6), minmax(0, 1fr));
}

.status-card small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-card.processing-healthy small {
  color: #148957;
}

.status-card.processing-low small {
  color: #c6283d;
}

.operations-tabs {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.operations-tabs button {
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font: 750 0.64rem/1 Inter, sans-serif;
  cursor: pointer;
}

.operations-tabs button.active {
  border-color: var(--cyan);
  background: rgba(0, 174, 239, 0.1);
  color: var(--cyan);
}

.tutorial-prompt {
  display: block;
  bottom: 12px;
  padding: 12px 14px;
  text-align: left;
}

.tutorial-prompt[hidden] {
  display: none;
}

.tutorial-topline,
.tutorial-actions,
.wave-receipt-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tutorial-topline span {
  color: var(--cyan);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-topline button,
.tutorial-actions button,
.threat-intro button,
.placement-undo button,
.wave-receipt button {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: 750 0.68rem/1 Inter, sans-serif;
  cursor: pointer;
}

.tutorial-prompt > strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.tutorial-prompt p {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.tutorial-actions {
  justify-content: flex-end;
}

.tutorial-actions button:last-child,
.threat-intro > button {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #04131d;
}

.tutorial-highlight {
  position: relative;
  z-index: 22 !important;
  animation: tutorialHighlight 1.25s ease-in-out infinite;
}

@keyframes tutorialHighlight {
  0%, 100% { box-shadow: 0 0 0 2px rgba(0, 174, 239, 0.25); }
  50% { box-shadow: 0 0 0 7px rgba(0, 174, 239, 0.08), 0 0 24px rgba(0, 174, 239, 0.28); }
}

.threat-intro {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  width: min(480px, calc(100% - 28px));
  padding: 18px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 84, 112, 0.48);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(4, 20, 32, 0.3);
}

body.dark-mode .threat-intro {
  background: rgba(5, 15, 24, 0.98);
}

.threat-intro[hidden] {
  display: none;
}

.threat-intro-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 3px solid var(--threat-intro-color, #ff5470);
  border-radius: 14px;
  color: var(--threat-intro-color, #ff5470);
  font-size: 1.1rem;
  font-weight: 900;
}

.threat-intro h3 {
  margin: 3px 0 5px;
}

.threat-intro p,
.threat-intro strong {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.threat-intro strong {
  margin-top: 6px;
  color: var(--text);
}

.threat-intro > button {
  grid-column: 1 / -1;
  justify-self: end;
}

.placement-undo {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 18;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  padding: 8px 9px 8px 12px;
  border: 1px solid rgba(0, 174, 239, 0.42);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font-size: 0.7rem;
  box-shadow: 0 14px 36px rgba(5, 35, 52, 0.2);
}

body.dark-mode .placement-undo {
  background: rgba(5, 15, 24, 0.96);
}

.placement-undo[hidden] {
  display: none;
}

#tutorialPrompt:not([hidden]) ~ .placement-undo {
  bottom: 156px;
}

.wave-receipt {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 25;
  width: min(430px, calc(100% - 28px));
  padding: 16px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(32, 191, 120, 0.42);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(4, 30, 43, 0.28);
}

body.dark-mode .wave-receipt {
  background: rgba(5, 15, 24, 0.98);
}

.wave-receipt[hidden] {
  display: none;
}

.wave-receipt h3 {
  margin: 2px 0 0;
}

.wave-receipt-heading > button {
  padding: 5px 8px;
  font-size: 1rem;
}

.wave-receipt-rows {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
}

.receipt-row strong {
  color: var(--text);
}

.receipt-row.total {
  border: 1px solid rgba(32, 191, 120, 0.32);
  color: var(--text);
  font-weight: 800;
}

@media (max-height: 820px) and (min-width: 901px) {
  .game-shell.focused {
    padding: 5px 9px;
  }

  .game-shell.focused .game-heading {
    display: none;
  }

  .game-shell.focused .status-strip {
    margin-bottom: 4px;
  }

  .game-shell.focused .status-card {
    min-height: 36px;
    padding: 3px 7px;
  }

  .game-shell.focused .status-card strong {
    font-size: 0.8rem;
  }

  .game-shell.focused .status-card small {
    font-size: 0.5rem;
  }

  .game-shell.focused .stage-column {
    grid-template-rows: minmax(190px, 1fr) 28px 46px;
    gap: 3px;
  }

  .game-shell.focused .canvas-frame {
    min-height: 0;
  }

  .game-shell.focused .control-btn {
    min-height: 27px;
    padding: 3px 5px;
    font-size: 0.62rem;
  }

  .game-shell.focused .module-section {
    min-height: 46px;
    padding: 3px;
  }

  .game-shell.focused .module-card {
    min-height: 40px;
    padding: 3px 3px 3px 34px;
  }

  .game-shell.focused .module-icon {
    top: 6px;
    width: 27px;
    height: 27px;
  }

  .game-shell.focused .operations-tabs {
    display: grid;
  }

  .game-shell.focused .operations-panel .panel-card:not(.compact-active) {
    display: none;
  }

  .game-shell.focused .operations-panel {
    align-content: start;
  }
}

/* Firewall Protocol v0.14.0 compact intelligence and adaptive game shell */
.class-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.class-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--class-color) 46%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--class-color) 10%, var(--surface));
  color: color-mix(in srgb, var(--class-color) 78%, var(--text));
  font-size: 0.52rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.module-class-list {
  margin: 3px 0 1px;
}

.selection-classes {
  margin: -2px 0 10px;
}

.threat-intro-classes {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.threat-intro-classes small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.incident-intel-disclosure {
  margin: 12px 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.incident-intel-disclosure > summary,
.class-reference details > summary,
.manual-groups details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.incident-intel-disclosure > summary::-webkit-details-marker,
.class-reference summary::-webkit-details-marker,
.manual-groups summary::-webkit-details-marker,
.threat-card > summary::-webkit-details-marker {
  display: none;
}

.incident-intel-disclosure > summary::after,
.class-reference summary::after,
.manual-groups summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1.15rem;
}

.incident-intel-disclosure[open] > summary::after,
.class-reference details[open] > summary::after,
.manual-groups details[open] > summary::after {
  content: "−";
}

.incident-intel-disclosure > summary strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.incident-intel-disclosure .incident-intel-preview {
  padding: 0 12px 12px;
}

.intel-threat {
  grid-template-columns: auto minmax(0, 1fr);
}

.intel-class-data {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
}

.intel-class-data small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.threat-filter-bar {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.threat-filter-bar button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
}

.threat-filter-bar button.active {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 14%, var(--surface));
  color: var(--text);
}

.class-reference {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.class-reference details,
.manual-groups details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.class-reference details > summary,
.manual-groups details > summary {
  padding: 10px 12px;
  font-size: 0.75rem;
}

.class-glossary {
  display: grid;
  gap: 5px;
  max-height: 280px;
  overflow: auto;
  padding: 0 10px 10px;
}

.class-glossary-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 5px 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 0.62rem;
}

.class-glossary-row > small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.5;
}

.threat-database {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.threat-card {
  padding: 0;
  overflow: hidden;
}

.threat-card[hidden] {
  display: none;
}

.threat-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 9px;
  cursor: pointer;
  list-style: none;
}

.threat-card > summary > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.threat-card > summary small {
  color: var(--muted);
  font-size: 0.57rem;
}

.threat-card > summary .class-chip-list {
  grid-column: 1 / -1;
}

.threat-card-body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
  border-top: 1px solid var(--line);
}

.threat-card-body p {
  margin: 9px 0 0;
  font-size: 0.68rem;
}

.threat-counter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
}

.manual-groups {
  display: grid;
  gap: 8px;
}

.manual-groups details > p {
  margin: 0;
  padding: 0 12px 9px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.mobile-play-hint {
  display: none;
}

.game-shell.menu-active {
  padding: 0;
  overflow: hidden;
}

.game-shell.menu-active > .game-heading,
.game-shell.menu-active > .status-strip,
.game-shell.menu-active > .game-layout {
  display: none !important;
}

.game-shell.menu-active .game-menu {
  position: relative;
  inset: auto;
  height: min(780px, calc(100dvh - 138px));
  min-height: min(500px, calc(100dvh - 138px));
  border-radius: inherit;
}

.game-shell:fullscreen,
.game-shell.pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  background: var(--surface);
}

.game-shell:fullscreen.focused,
.game-shell.pseudo-fullscreen.focused {
  inset: 0;
}

.game-shell:fullscreen.menu-active .game-menu,
.game-shell.pseudo-fullscreen.menu-active .game-menu {
  height: 100dvh;
  min-height: 0;
  border-radius: 0;
}

.game-shell.focused .module-class-list {
  display: none;
}

@media (max-width: 900px) {
  .game-shell.menu-active .game-menu {
    height: min(720px, calc(100dvh - 96px));
    min-height: min(460px, calc(100dvh - 96px));
  }

  .threat-database {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .class-reference,
  .threat-database {
    grid-template-columns: 1fr;
  }

  .game-shell.focused .status-strip {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .game-shell.focused .status-strip::-webkit-scrollbar {
    display: none;
  }

  .game-shell.focused .status-card {
    flex: 0 0 112px;
    scroll-snap-align: start;
  }

  .game-shell.focused .stage-column {
    display: block;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .game-shell.focused .canvas-frame {
    width: 720px;
    max-width: none;
    height: auto;
    margin: 0;
  }

  .game-shell.focused .game-controls,
  .game-shell.focused .module-section {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .game-shell.focused .mobile-play-hint {
    display: block;
    width: calc(100vw - 24px);
    margin: 0 0 5px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.6rem;
  }
}

@media (max-width: 650px) and (orientation: landscape) {
  .game-shell.focused .canvas-frame {
    width: 100%;
  }

  .game-shell.focused .mobile-play-hint {
    display: none;
  }
}

/* Firewall Protocol v0.16.0: centered page shell and unobtrusive incident HUD */
html,
body.firewall-page {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.firewall-page {
  position: static;
  width: auto;
}

body.firewall-page .game-intro,
body.firewall-page .prototype-details,
body.firewall-page footer {
  display: grid;
}

body.firewall-page main {
  width: min(1440px, calc(100% - 40px));
  height: auto;
  min-height: 0;
  margin: 0 auto;
  padding: 118px 0 0;
}

body.firewall-page .game-intro {
  min-height: 0;
  padding: 30px 4px 24px;
}

body.firewall-page .game-intro h1 {
  margin-bottom: 12px;
  font-size: clamp(2.65rem, 5vw, 4.8rem);
}

body.firewall-page .prototype-note {
  flex-basis: 320px;
}

body.firewall-page .game-shell {
  width: 100%;
  max-width: 1400px;
  height: min(820px, calc(100dvh - 118px));
  min-height: 620px;
  margin: 0 auto;
  padding: 9px 11px;
  border-width: 1px;
  border-radius: 22px;
}

body.firewall-page .game-shell.menu-active {
  padding: 0;
}

body.firewall-page .game-shell.menu-active .game-menu {
  height: 100%;
  min-height: 0;
  border-radius: inherit;
}

body.firewall-page .game-shell:fullscreen,
body.firewall-page .game-shell.pseudo-fullscreen {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

body.firewall-page .game-shell:not(.menu-active) .game-heading {
  flex: 0 0 38px;
  min-height: 38px;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
  padding: 0 2px;
}

body.firewall-page .game-shell:not(.menu-active) .game-heading > div:first-child {
  min-width: 150px;
}

body.firewall-page .game-shell:not(.menu-active) .game-heading h2,
body.firewall-page .game-shell:not(.menu-active) .game-heading .section-label {
  display: block;
}

body.firewall-page .game-shell:not(.menu-active) .game-heading .section-label {
  margin-bottom: 0;
  font-size: 0.48rem;
}

body.firewall-page .game-shell:not(.menu-active) .game-heading h2 {
  font-size: 0.88rem;
}

.incident-rule-strip {
  min-width: 0;
  max-width: none !important;
  margin-right: auto;
  padding: 5px 9px;
  border: 1px solid rgba(255, 84, 112, 0.24);
  border-radius: 999px;
  background: color-mix(in srgb, var(--red) 7%, var(--surface-2));
  color: var(--muted);
  font-size: 0.56rem !important;
  line-height: 1.2;
  text-align: left !important;
  white-space: nowrap;
}

.incident-rule-strip strong {
  margin-right: 5px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.firewall-page .game-shell:not(.menu-active) .status-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr)) repeat(3, minmax(82px, 0.68fr));
}

body.firewall-page .game-shell:not(.menu-active) .game-layout {
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 8px;
}

body.firewall-page .game-shell:not(.menu-active) .canvas-frame {
  justify-self: center;
  width: min(100%, calc((100dvh - 292px) * 16 / 9));
  height: auto;
}

body.firewall-page .wave-preview {
  top: 10px;
  right: 10px;
  left: auto;
  z-index: 12;
  width: auto;
  max-width: 270px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 9px;
  border: 1px solid rgba(23, 216, 255, 0.28);
  border-radius: 12px;
  background: rgba(246, 251, 255, 0.92);
  box-shadow: 0 8px 24px rgba(8, 35, 53, 0.16);
  backdrop-filter: blur(9px);
}

body.dark-mode.firewall-page .wave-preview {
  background: rgba(5, 15, 24, 0.9);
}

.wave-hud-copy {
  display: grid;
  min-width: 78px;
  line-height: 1.08;
}

.wave-hud-copy small {
  color: var(--cyan);
  font-size: 0.46rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wave-hud-copy strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.62rem;
  white-space: nowrap;
}

.wave-hud-threats {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wave-hud-threat {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--chip-color) 60%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--chip-color) 13%, var(--surface));
  color: var(--chip-color);
  font-size: 0.46rem;
  font-weight: 900;
}

.wave-hud-threat small {
  position: absolute;
  right: -4px;
  bottom: -5px;
  min-width: 13px;
  padding: 1px 3px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.42rem;
  line-height: 1.2;
  text-align: center;
}

.wave-hud-threats > i {
  color: var(--muted);
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 900;
}

body.firewall-page .message-banner {
  top: 10px;
  max-width: min(44%, 460px);
  padding: 7px 12px;
  font-size: 0.68rem;
}

body.firewall-page .prototype-details {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 64px;
}

body.firewall-page .prototype-details article {
  padding: 24px;
}

body.firewall-page footer {
  display: block;
}

@media (max-width: 1180px) {
  body.firewall-page .game-shell:not(.menu-active) .game-layout {
    position: relative;
    display: block;
    overflow: hidden;
  }

  body.firewall-page .game-shell:not(.menu-active) .stage-column {
    width: 100%;
  }

  body.firewall-page .game-shell:not(.menu-active) .operations-panel {
    position: absolute;
    z-index: 35;
    inset: 0 0 0 auto;
    width: min(330px, 88vw);
    padding: 5px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: -18px 0 40px rgba(1, 14, 24, 0.26);
    transform: translateX(calc(100% + 12px));
    transition: transform 160ms ease;
  }

  body.firewall-page .game-shell.operations-open .operations-panel {
    transform: translateX(0);
  }

  body.firewall-page .panel-toggle {
    display: inline-flex;
  }

  body.firewall-page .incident-rule-strip {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 900px) {
  body.firewall-page main {
    width: min(calc(100% - 20px), 760px);
    padding-top: 94px;
  }

  body.firewall-page .game-intro {
    align-items: flex-start;
    padding: 24px 2px 18px;
  }

  body.firewall-page .prototype-note {
    width: 100%;
    flex-basis: auto;
  }

  body.firewall-page .game-shell {
    height: min(760px, calc(100dvh - 92px));
    min-height: 590px;
  }

  body.firewall-page .game-shell:not(.menu-active) .game-heading > div:first-child {
    display: none;
  }

  body.firewall-page .game-shell:not(.menu-active) .status-strip {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.firewall-page .game-shell:not(.menu-active) .status-card {
    flex: 0 0 104px;
  }

  body.firewall-page .prototype-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  body.firewall-page main {
    width: 100%;
    padding-top: 82px;
  }

  body.firewall-page .game-intro,
  body.firewall-page .prototype-details {
    width: calc(100% - 24px);
    margin-right: auto;
    margin-left: auto;
  }

  body.firewall-page .game-intro {
    display: block;
  }

  body.firewall-page .game-intro h1 {
    font-size: clamp(2.35rem, 13vw, 3.6rem);
  }

  body.firewall-page .prototype-note {
    margin-top: 16px;
  }

  body.firewall-page .game-shell {
    height: min(720px, calc(100dvh - 80px));
    min-height: 560px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .incident-rule-strip {
    padding: 5px 7px;
    font-size: 0.5rem !important;
  }

  .incident-rule-strip strong {
    display: none;
  }

  body.firewall-page .wave-preview {
    top: 7px;
    right: 7px;
    max-width: 188px;
    padding: 5px 6px;
  }

  .wave-hud-threat {
    width: 20px;
    height: 20px;
  }

  .wave-hud-threats .wave-hud-threat:nth-child(n+4) {
    display: none;
  }

  body.firewall-page .message-banner {
    right: 7px;
    left: 7px;
    top: 40px;
    max-width: none;
    transform: translateY(-8px);
  }

  body.firewall-page .message-banner.visible {
    transform: translateY(0);
  }

  body.firewall-page .prototype-details {
    margin-top: 20px;
    margin-bottom: 42px;
  }
}

/* Firewall Protocol v0.15.0 viewport shell, compact records, and role consolidation */
html,
body.firewall-page {
  height: 100%;
  overflow: hidden;
}

body.firewall-page {
  position: fixed;
  inset: 0;
  width: 100%;
}

body.firewall-page .game-intro,
body.firewall-page .prototype-details,
body.firewall-page footer {
  display: none;
}

body.firewall-page main {
  width: 100%;
  height: 100dvh;
  margin: 0;
  padding: 94px 0 0;
}

body.firewall-page .game-shell {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-width: 1px 0 0;
  border-radius: 0;
}

body.firewall-page .game-shell.menu-active {
  padding: 0;
}

body.firewall-page .game-shell.menu-active .game-menu {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  place-items: center;
  border-radius: 0;
}

body.firewall-page .menu-panel[hidden],
body.firewall-page .loadout-tab-panel[hidden],
body.firewall-page .firewall-profile-panel[hidden] {
  display: none !important;
}

body.firewall-page .menu-panel {
  max-height: 100%;
}

body.firewall-page .menu-panel-wide {
  width: min(1240px, 100%);
}

body.firewall-page [data-menu-view="campaign"],
body.firewall-page [data-menu-view="loadout"],
body.firewall-page [data-menu-view="threats"],
body.firewall-page [data-menu-view="profile"] {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 12px 16px;
  overflow: hidden;
}

body.firewall-page .menu-panel > .eyebrow {
  margin-bottom: 2px;
  font-size: 0.66rem;
}

body.firewall-page .menu-panel > h2 {
  margin: 1px 0 3px;
  font-size: clamp(1.35rem, 2.8vw, 2.2rem);
  line-height: 1;
}

body.firewall-page .menu-panel > p {
  margin-bottom: 8px;
  font-size: 0.76rem;
  line-height: 1.35;
}

body.firewall-page [data-menu-view="home"] {
  width: min(410px, 100%);
  padding: 18px;
}

body.firewall-page [data-menu-view="home"] .menu-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
  border-radius: 14px;
  font-size: 1rem;
}

body.firewall-page [data-menu-view="home"] .menu-actions {
  gap: 5px;
}

body.firewall-page [data-menu-view="home"] .menu-btn {
  min-height: 31px;
  padding: 6px 10px;
  font-size: 0.72rem;
}

body.firewall-page .campaign-panel {
  display: flex;
  flex-direction: column;
}

body.firewall-page .campaign-progress {
  flex: 0 0 auto;
  margin: 7px 0;
  gap: 5px;
}

body.firewall-page .campaign-progress > div {
  padding: 6px 9px;
}

body.firewall-page .campaign-layout {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.31fr);
  gap: 8px;
}

body.firewall-page .campaign-map-shell {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.firewall-page .campaign-camera-controls {
  flex: 0 0 auto;
  margin-bottom: 4px;
  padding: 3px;
}

body.firewall-page .campaign-camera-controls button,
body.firewall-page .campaign-camera-controls output {
  height: 25px;
}

body.firewall-page .campaign-map {
  flex: 1;
  min-height: 0;
  max-height: none;
}

body.firewall-page .campaign-map-legend {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 4px 7px;
}

body.firewall-page .level-brief {
  min-height: 0;
  padding: 11px;
  overflow: hidden;
}

body.firewall-page .level-brief h3 {
  margin: 2px 0 4px;
  font-size: 1rem;
}

body.firewall-page .level-brief > p {
  font-size: 0.68rem;
  line-height: 1.35;
}

body.firewall-page .level-brief-stars {
  margin: 6px 0;
  font-size: 1rem;
}

body.firewall-page .level-objectives {
  gap: 4px;
  margin: 6px 0;
}

body.firewall-page .level-objectives li {
  padding: 5px 7px;
  font-size: 0.64rem;
}

body.firewall-page .level-brief .menu-btn {
  min-height: 31px;
  padding: 6px 8px;
  font-size: 0.68rem;
}

body.firewall-page .campaign-panel > .menu-back {
  flex: 0 0 auto;
  min-height: 29px;
  margin-top: 5px;
  padding: 4px 12px;
}

.loadout-tabs,
.profile-tabs,
.threat-page-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.loadout-tabs,
.profile-tabs {
  margin: 7px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.loadout-tabs button,
.profile-tabs button,
.threat-page-controls button {
  min-height: 29px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: 800 0.68rem/1 Inter, sans-serif;
  cursor: pointer;
}

.loadout-tabs button.active,
.profile-tabs button.active {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 12%, var(--surface));
  color: var(--cyan);
}

.loadout-tab-panel[hidden],
.firewall-profile-panel[hidden] {
  display: none;
}

.loadout-tab-panel {
  flex: 1;
  min-height: 0;
  margin-top: 4px;
}

body.firewall-page [data-menu-view="loadout"] {
  display: flex;
  flex-direction: column;
}

body.firewall-page .incident-intel-disclosure {
  flex: 0 0 auto;
  margin: 3px 0;
}

body.firewall-page .incident-intel-disclosure > summary {
  min-height: 30px;
  padding: 5px 8px;
}

body.firewall-page .loadout-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

body.firewall-page .last-line-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

body.firewall-page .directive-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

body.firewall-page .loadout-card,
body.firewall-page .last-line-choice,
body.firewall-page .directive-choice {
  min-height: 74px;
  padding: 8px;
}

body.firewall-page .last-line-choice {
  padding-left: 54px;
}

body.firewall-page .last-line-choice::before {
  top: 10px;
  left: 10px;
}

body.firewall-page .directive-choice {
  padding-left: 42px;
}

body.firewall-page .loadout-message {
  flex: 0 0 auto;
  min-height: 25px;
  margin-top: 5px;
  padding: 4px 8px;
  font-size: 0.64rem;
}

body.firewall-page .loadout-actions {
  flex: 0 0 auto;
  margin-top: 5px;
}

body.firewall-page .loadout-actions .menu-btn {
  min-height: 32px;
  padding: 6px 10px;
}

body.firewall-page [data-menu-view="threats"],
body.firewall-page [data-menu-view="profile"] {
  display: flex;
  flex-direction: column;
}

body.firewall-page .threat-filter-bar {
  flex: 0 0 auto;
  margin-bottom: 5px;
}

body.firewall-page .class-reference {
  flex: 0 0 auto;
  margin-bottom: 5px;
}

body.firewall-page .threat-database {
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  align-content: start;
}

body.firewall-page .threat-card {
  min-height: 0;
}

body.firewall-page .threat-card > summary {
  min-height: 52px;
  padding: 6px;
}

body.firewall-page .threat-card-body {
  gap: 5px;
  padding: 0 7px 7px;
}

body.firewall-page .threat-card-body p {
  margin-top: 5px;
  font-size: 0.62rem;
  line-height: 1.35;
}

.trait-list {
  color: var(--muted);
  font-size: 0.6rem;
}

.threat-page-controls {
  flex: 0 0 auto;
  justify-content: center;
  margin-top: 5px;
}

.threat-page-controls span {
  min-width: 150px;
  color: var(--muted);
  font-size: 0.64rem;
  text-align: center;
}

.threat-page-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

body.firewall-page [data-menu-view="threats"] > .menu-back,
body.firewall-page [data-menu-view="profile"] > .menu-back {
  position: absolute;
  right: 16px;
  top: 12px;
  min-width: 86px;
  margin: 0;
  padding: 5px 9px;
}

body.firewall-page #firewallProfile {
  flex: 1;
  min-height: 0;
}

body.firewall-page .firewall-profile-intro {
  margin-bottom: 6px;
  padding: 8px 11px;
}

body.firewall-page .firewall-profile-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

body.firewall-page .firewall-profile-stat {
  padding: 9px;
}

body.firewall-page .firewall-profile-section {
  margin-top: 4px;
}

body.firewall-page .firewall-incident-table {
  min-width: 0;
  border-spacing: 0 3px;
  font-size: 0.66rem;
}

body.firewall-page .firewall-incident-table td {
  padding: 5px 7px;
}

body.firewall-page .firewall-achievement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

body.firewall-page .firewall-achievement {
  padding: 7px 9px;
}

.panel-toggle {
  display: none;
}

body.firewall-page .game-shell:not(.menu-active) .game-heading {
  flex: 0 0 31px;
  min-height: 31px;
  padding: 0;
  margin-bottom: 4px;
}

body.firewall-page .game-shell:not(.menu-active) .game-heading h2,
body.firewall-page .game-shell:not(.menu-active) .game-heading .section-label {
  display: none;
}

body.firewall-page .game-shell:not(.menu-active) .status-strip {
  flex: 0 0 auto;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 5px;
}

body.firewall-page .game-shell:not(.menu-active) .status-card {
  min-height: 43px;
  padding: 4px 7px;
}

body.firewall-page .game-shell:not(.menu-active) .status-card span {
  font-size: 0.55rem;
}

body.firewall-page .game-shell:not(.menu-active) .status-card strong {
  font-size: 0.82rem;
}

body.firewall-page .game-shell:not(.menu-active) .status-card small {
  font-size: 0.52rem;
}

body.firewall-page .game-shell:not(.menu-active) .game-layout {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 20vw);
  gap: 7px;
  overflow: hidden;
}

body.firewall-page .game-shell:not(.menu-active) .stage-column {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 31px 57px;
  gap: 4px;
  overflow: hidden;
}

body.firewall-page .game-shell:not(.menu-active) .canvas-frame {
  width: auto;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  margin: auto;
  aspect-ratio: 16 / 9;
}

body.firewall-page .game-shell:not(.menu-active) canvas {
  width: 100%;
  height: 100%;
}

body.firewall-page .game-shell:not(.menu-active) .game-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
}

body.firewall-page .game-shell:not(.menu-active) .control-btn {
  min-height: 29px;
  padding: 4px 6px;
  font-size: 0.65rem;
}

body.firewall-page .game-shell:not(.menu-active) .control-btn.danger {
  margin-left: 0;
}

body.firewall-page .game-shell:not(.menu-active) .module-section {
  height: 57px;
  min-height: 57px;
  margin: 0;
  padding: 4px;
  overflow: hidden;
  border-radius: 9px;
}

body.firewall-page .game-shell:not(.menu-active) .module-heading,
body.firewall-page .game-shell:not(.menu-active) .module-class-list {
  display: none;
}

body.firewall-page .game-shell:not(.menu-active) .module-palette {
  height: 100%;
  grid-template-columns: repeat(var(--palette-columns, 6), minmax(0, 1fr));
  gap: 4px;
}

body.firewall-page .game-shell:not(.menu-active) .module-card {
  min-height: 47px;
  height: 47px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: center;
  padding: 4px 4px 4px 34px;
}

body.firewall-page .game-shell:not(.menu-active) .module-card strong {
  font-size: 0.6rem;
}

body.firewall-page .game-shell:not(.menu-active) .module-card small,
body.firewall-page .game-shell:not(.menu-active) .module-stats {
  display: none;
}

body.firewall-page .game-shell:not(.menu-active) .module-icon {
  position: absolute;
  left: 4px;
  top: 8px;
  width: 26px;
  height: 26px;
  font-size: 0.53rem;
}

body.firewall-page .game-shell:not(.menu-active) .operations-panel {
  min-height: 0;
  height: 100%;
  grid-template-rows: 31px minmax(0, 1fr);
  gap: 5px;
  overflow: hidden;
}

body.firewall-page .game-shell:not(.menu-active) .operations-tabs {
  display: grid;
  flex: 0 0 auto;
}

body.firewall-page .game-shell:not(.menu-active) .operations-panel .panel-card:not(.compact-active) {
  display: none;
}

body.firewall-page .game-shell:not(.menu-active) .panel-card {
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  border-radius: 9px;
}

body.firewall-page .game-shell:not(.menu-active) .panel-card h3 {
  margin: 1px 0 4px;
  font-size: 0.84rem;
}

body.firewall-page .game-shell:not(.menu-active) .panel-card p,
body.firewall-page .game-shell:not(.menu-active) .legend-list,
body.firewall-page .game-shell:not(.menu-active) .incident-log,
body.firewall-page .game-shell:not(.menu-active) .selection-stats {
  font-size: 0.62rem;
}

body.firewall-page .game-shell:not(.menu-active) .selection-stats {
  margin: 6px 0;
}

@media (max-width: 900px) {
  body.firewall-page main {
    padding-top: 82px;
  }

  body.firewall-page .game-shell:not(.menu-active) .game-layout {
    position: relative;
    display: block;
    overflow: hidden;
  }

  body.firewall-page .game-shell:not(.menu-active) .stage-column {
    width: 100%;
    grid-template-rows: minmax(0, 1fr) 31px 57px;
  }

  body.firewall-page .game-shell:not(.menu-active) .operations-panel {
    position: absolute;
    z-index: 35;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(330px, 88vw);
    padding: 5px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: -18px 0 40px rgba(1, 14, 24, 0.26);
    transform: translateX(calc(100% + 12px));
    transition: transform 160ms ease;
  }

  body.firewall-page .game-shell.operations-open .operations-panel {
    transform: translateX(0);
  }

  .panel-toggle {
    display: inline-flex;
  }

  body.firewall-page .game-shell:not(.menu-active) .module-palette {
    display: flex;
    width: max-content;
  }

  body.firewall-page .game-shell:not(.menu-active) .module-section {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body.firewall-page .game-shell:not(.menu-active) .module-card {
    flex: 0 0 128px;
  }

  body.firewall-page .campaign-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  body.firewall-page .level-brief {
    max-height: 152px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 3px 7px;
  }

  body.firewall-page .level-brief .section-label,
  body.firewall-page .level-brief h3,
  body.firewall-page .level-brief-stars,
  body.firewall-page .level-objectives {
    grid-column: 1;
  }

  body.firewall-page .level-brief > p {
    display: none;
  }

  body.firewall-page .level-brief .menu-btn {
    grid-row: 1 / span 3;
  }

  body.firewall-page .level-objectives {
    display: none;
  }

  body.firewall-page .loadout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.firewall-page .last-line-grid,
  body.firewall-page .directive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.firewall-page .threat-database {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
  }
}

@media (max-width: 600px) {
  body.firewall-page [data-menu-view="campaign"],
  body.firewall-page [data-menu-view="loadout"],
  body.firewall-page [data-menu-view="threats"],
  body.firewall-page [data-menu-view="profile"] {
    padding: 8px;
  }

  body.firewall-page .campaign-progress {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.firewall-page .campaign-progress > div {
    padding: 4px;
  }

  body.firewall-page .campaign-progress strong {
    font-size: 0.62rem;
  }

  body.firewall-page .campaign-map-legend {
    display: none;
  }

  body.firewall-page .threat-filter-bar {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  body.firewall-page .threat-filter-bar button {
    min-width: 0;
    padding: 4px 5px;
    font-size: 0.54rem;
  }

  body.firewall-page .class-reference {
    display: flex;
    gap: 4px;
  }

  body.firewall-page .class-reference details {
    flex: 1;
  }

  body.firewall-page .class-reference summary {
    padding: 5px;
    font-size: 0.57rem;
  }

  body.firewall-page .threat-card > summary {
    grid-template-columns: 26px minmax(0, 1fr);
    min-height: 44px;
  }

  body.firewall-page .threat-card-icon {
    width: 26px;
    height: 26px;
    font-size: 0.57rem;
  }

  body.firewall-page .threat-card > summary .class-chip-list {
    display: none;
  }

  body.firewall-page .firewall-profile-intro p {
    display: none;
  }

  body.firewall-page .profile-tabs button {
    flex: 1;
    padding-inline: 4px;
  }

  body.firewall-page .firewall-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  body.firewall-page .firewall-profile-stat {
    padding: 6px;
  }

  body.firewall-page .firewall-incident-table th:nth-child(4),
  body.firewall-page .firewall-incident-table td:nth-child(4),
  body.firewall-page .firewall-incident-table th:nth-child(5),
  body.firewall-page .firewall-incident-table td:nth-child(5) {
    display: none;
  }

  body.firewall-page .firewall-achievement-grid {
    grid-template-columns: 1fr 1fr;
  }

  body.firewall-page .firewall-achievement {
    font-size: 0.62rem;
  }

  body.firewall-page .game-shell:not(.menu-active) .status-strip {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.firewall-page .game-shell:not(.menu-active) .status-card {
    flex: 0 0 92px;
  }

  body.firewall-page .message-banner {
    top: 6px;
    width: calc(100% - 24px);
    max-width: none;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    line-height: 1.3;
  }

  body.firewall-page .wave-preview {
    top: 42px;
  }
}

@media (max-width: 1100px) {
  .game-shell.focused .operations-tabs {
    display: grid;
  }

  .game-shell.focused .operations-panel .panel-card:not(.compact-active) {
    display: none;
  }
}

@media (max-width: 900px) {
  .game-shell.focused .module-section {
    position: sticky;
    bottom: 0;
    z-index: 24;
    box-shadow: 0 -10px 24px rgba(14, 44, 63, 0.12);
  }

  .game-shell.focused .operations-tabs {
    grid-column: 1 / -1;
  }

  .game-shell.focused .module-palette {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .game-shell.focused .module-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Firewall Protocol v0.5.0 interaction and Focus Mode repairs */
#gameCanvas.tutorial-highlight {
  z-index: 1 !important;
}

.tutorial-prompt {
  z-index: 24;
}

@media (min-width: 901px) {
  .game-shell.focused .game-layout {
    padding-bottom: 0;
    overflow: hidden;
  }

  .game-shell.focused .stage-column {
    grid-template-rows: minmax(0, 1fr) 33px 58px;
    height: 100%;
    overflow: hidden;
    padding-bottom: 0;
  }

  .game-shell.focused .canvas-frame {
    justify-self: center;
    min-width: 0;
    min-height: 0;
  }

  .game-shell.focused .module-section {
    position: static;
    height: 58px;
    min-height: 58px;
    overflow: hidden;
    padding: 4px;
    box-shadow: 0 -8px 26px rgba(6, 30, 44, 0.18);
  }

  .game-shell.focused .module-palette {
    height: 100%;
  }

  .game-shell.focused .module-card {
    min-height: 48px;
    height: 48px;
  }
}

@media (max-width: 900px) {
  .game-shell.focused {
    padding-bottom: 8px;
  }

  .game-shell.focused .module-section {
    position: sticky;
    right: auto;
    bottom: 0;
    left: auto;
    z-index: 28;
    max-height: 66px;
    min-height: 58px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px;
    box-shadow: 0 -8px 26px rgba(6, 30, 44, 0.2);
  }

  .game-shell.focused .stage-column {
    padding-bottom: 0;
  }

  .game-shell.focused .module-palette {
    display: flex;
    width: max-content;
    height: 50px;
  }

  .game-shell.focused .module-card {
    flex: 0 0 150px;
    min-height: 48px;
    height: 48px;
  }
}

.game-shell.focused .game-controls {
  padding: 0;
}

/* Firewall Protocol v0.6.0 campaign expansion, progression, and presentation */
.campaign-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.72fr)) minmax(190px, 1.15fr);
  gap: 8px;
  margin: 16px 0;
}

.campaign-progress > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.campaign-progress span,
.campaign-progress strong {
  display: block;
}

.campaign-progress span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.campaign-progress strong {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-next-reward {
  border-color: rgba(229, 168, 36, 0.36) !important;
  background: linear-gradient(135deg, rgba(229, 168, 36, 0.1), var(--surface-2)) !important;
}

.campaign-next-reward strong {
  color: #c88c14;
}

.campaign-map {
  min-height: 480px;
  background:
    linear-gradient(rgba(0, 174, 239, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 174, 239, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 18% 68%, rgba(0, 174, 239, 0.2), transparent 24%),
    radial-gradient(circle at 73% 19%, rgba(181, 124, 255, 0.19), transparent 26%),
    var(--surface-2);
  background-size: 30px 30px, 30px 30px, auto, auto, auto;
}

.campaign-map::before {
  content: "THE PERIMETER // INCIDENT TOPOLOGY";
}

.campaign-path.region-link {
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 15px);
}

.campaign-path.region-link.unlocked {
  background: repeating-linear-gradient(90deg, #b57cff 0 8px, transparent 8px 15px);
  box-shadow: 0 0 14px rgba(181, 124, 255, 0.28);
}

.campaign-region-label {
  position: absolute;
  z-index: 2;
  width: min(240px, 31%);
  transform: translate(-50%, -50%);
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
}

.campaign-region-label b {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-right: 7px;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-size: 0.58rem;
}

.campaign-region-label small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.54rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.campaign-region-label.region-2 {
  color: var(--purple);
  text-align: right;
}

.directive-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.directive-choice {
  position: relative;
  min-height: 102px;
  padding: 12px 10px 10px 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.directive-choice::before {
  content: attr(data-short);
  position: absolute;
  top: 12px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 0.55rem;
  font-weight: 900;
}

.directive-choice strong,
.directive-choice small {
  display: block;
}

.directive-choice strong {
  font-size: 0.75rem;
}

.directive-choice small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.directive-choice.selected {
  border-color: var(--cyan);
  background: rgba(0, 174, 239, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 174, 239, 0.16);
}

.directive-choice.locked {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.46;
}

.results-progression {
  display: grid;
  gap: 7px;
  margin: 0 0 18px;
}

.results-progression p {
  padding: 9px 11px;
  border: 1px solid rgba(181, 124, 255, 0.35);
  border-radius: 9px;
  background: rgba(181, 124, 255, 0.09);
  color: var(--muted);
  font-size: 0.73rem;
}

.results-progression strong {
  color: var(--purple);
}

/* Firewall Protocol v0.10.0 balance reporting */
.results-telemetry,
.telemetry-disclosure {
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(23, 216, 255, 0.22);
  border-radius: 10px;
  background: rgba(23, 216, 255, 0.07);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.results-telemetry.submitted {
  border-color: rgba(85, 242, 176, 0.34);
  background: rgba(85, 242, 176, 0.09);
  color: #117a55;
}

body.dark-mode .results-telemetry.submitted {
  color: #76f7c3;
}

.telemetry-disclosure {
  margin-bottom: 14px;
}

.wave-announcement {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 18;
  display: grid;
  min-width: 250px;
  padding: 16px 24px;
  border: 1px solid rgba(23, 216, 255, 0.5);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(2, 10, 19, 0.96), rgba(10, 28, 43, 0.94));
  color: #fff;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 42px rgba(23, 216, 255, 0.2);
  animation: waveAnnouncement 1.8s ease both;
}

.wave-announcement[hidden] {
  display: none;
}

.wave-announcement span {
  color: var(--cyan);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.wave-announcement strong {
  margin: 3px 0;
  font-size: 1.45rem;
  line-height: 1;
}

.wave-announcement small {
  color: #a9bfd0;
  font-size: 0.66rem;
}

.wave-announcement.boss {
  border-color: rgba(255, 79, 154, 0.65);
  box-shadow: 0 0 52px rgba(255, 79, 154, 0.28);
}

.wave-announcement.boss span {
  color: #ff78b5;
}

@keyframes waveAnnouncement {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
  14%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1.03); }
}

.game-shell.impact .canvas-frame {
  animation: breachImpact 420ms ease-out;
}

@keyframes breachImpact {
  0%, 100% { transform: translate(0); filter: none; }
  18% { transform: translate(-4px, 2px); filter: saturate(1.45); }
  38% { transform: translate(4px, -2px); }
  62% { transform: translate(-2px, 1px); }
}

@media (max-width: 1000px) {
  .campaign-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .campaign-map {
    min-height: 500px;
  }

  .directive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .campaign-progress {
    grid-template-columns: 1fr 1fr;
  }

  .campaign-progress > div {
    padding: 8px;
  }

  .campaign-map {
    min-height: 560px;
  }

  .campaign-node {
    width: 50px;
    height: 50px;
  }

  .campaign-node-label {
    width: 94px;
    transform: translate(-50%, 34px);
    font-size: 0.58rem;
  }

  .directive-grid {
    grid-template-columns: 1fr;
  }
}

/* Firewall Protocol v0.11.0 campaign navigation, profiles, and leaderboards */
.campaign-map {
  min-height: 500px;
  max-height: 500px;
  overflow: auto;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.campaign-map::-webkit-scrollbar {
  display: none;
}

.campaign-map:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.campaign-map.dragging {
  cursor: grabbing;
}

.campaign-map-track {
  position: relative;
  width: max(880px, 135%);
  min-height: 580px;
  overflow: hidden;
  user-select: none;
}

.campaign-map::before {
  content: none;
}

.campaign-pan-hint {
  position: sticky;
  z-index: 8;
  top: 14px;
  left: calc(100% - 124px);
  display: block;
  width: max-content;
  height: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.campaign-region-label {
  width: 270px;
  padding: 9px 11px;
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 24px rgba(1, 14, 24, 0.12);
}

.campaign-region-label small {
  margin-top: 6px;
  font-size: 0.58rem;
  line-height: 1.42;
}

.level-leaderboard-btn {
  margin-top: 9px;
}

.profile-panel h2 {
  margin-bottom: 18px;
}

.firewall-profile-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.firewall-profile-intro strong,
.firewall-profile-intro span {
  display: block;
}

.firewall-profile-intro span,
.firewall-profile-intro p {
  color: var(--muted);
  font-size: 0.76rem;
}

.firewall-profile-intro p {
  margin: 4px 0 0;
}

.firewall-profile-sync {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
}

.firewall-profile-sync.synced {
  border-color: rgba(32, 191, 120, 0.38);
  color: #168657;
}

.firewall-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.firewall-profile-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.firewall-profile-stat span,
.firewall-profile-stat strong {
  display: block;
}

.firewall-profile-stat span {
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.firewall-profile-stat strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firewall-profile-section {
  margin-top: 18px;
}

.firewall-profile-section h3 {
  margin-bottom: 9px;
  font-size: 1rem;
}

.firewall-profile-table-wrap {
  overflow-x: auto;
}

.firewall-incident-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 0.72rem;
}

.firewall-incident-table th {
  padding: 0 9px 3px;
  color: var(--muted);
  text-align: left;
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.firewall-incident-table td {
  padding: 9px;
  background: var(--surface-2);
}

.firewall-incident-table td:first-child {
  border-radius: 9px 0 0 9px;
  font-weight: 800;
}

.firewall-incident-table td:last-child {
  border-radius: 0 9px 9px 0;
}

.firewall-achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.firewall-achievement {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  opacity: 0.5;
}

.firewall-achievement.unlocked {
  border-color: rgba(229, 168, 36, 0.42);
  background: rgba(229, 168, 36, 0.08);
  opacity: 1;
}

.firewall-achievement strong,
.firewall-achievement small {
  display: block;
}

.firewall-achievement small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.4;
}

.leaderboard-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 9, 16, 0.76);
  backdrop-filter: blur(9px);
}

.leaderboard-modal[hidden] {
  display: none;
}

.leaderboard-window {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.leaderboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.leaderboard-heading h3 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.leaderboard-heading button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
}

.leaderboard-status {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.leaderboard-entries {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: 32px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.leaderboard-rank {
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.leaderboard-entry img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.leaderboard-player strong,
.leaderboard-player small,
.leaderboard-result strong,
.leaderboard-result small {
  display: block;
}

.leaderboard-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-player small,
.leaderboard-result small {
  color: var(--muted);
  font-size: 0.64rem;
}

.leaderboard-result {
  text-align: right;
}

.message-banner {
  top: 10px;
  z-index: 9;
}

.wave-preview {
  top: 55px;
  z-index: 8;
  max-width: calc(100% - 20px);
}

@media (max-width: 800px) {
  .campaign-map {
    min-height: 460px;
    max-height: 460px;
  }

  .campaign-map-track {
    width: 900px;
  }

  .firewall-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .campaign-pan-hint {
    left: calc(100% - 54px);
    font-size: 0;
  }

  .campaign-pan-hint::after {
    content: "DRAG";
    font-size: 0.55rem;
  }

  .firewall-profile-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .firewall-achievement-grid {
    grid-template-columns: 1fr;
  }

  .firewall-incident-table th:nth-child(4),
  .firewall-incident-table td:nth-child(4) {
    display: none;
  }

  .leaderboard-entry {
    grid-template-columns: 28px 34px minmax(0, 1fr) auto;
  }
}

/* Firewall Protocol v0.12.0 campaign camera and SVG topology */
.campaign-map-shell {
  position: relative;
  min-width: 0;
}

.campaign-map {
  position: relative;
}

.campaign-map-content {
  position: relative;
  width: var(--campaign-scaled-width, 880px);
  min-width: 100%;
  height: var(--campaign-scaled-height, 580px);
  min-height: 100%;
}

.campaign-map-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--campaign-scaled-width, 880px);
  height: var(--campaign-scaled-height, 580px);
  transform: translate(-50%, -50%);
}

.campaign-map-track {
  position: absolute;
  inset: 0 auto auto 0;
  width: 880px;
  min-height: 0;
  height: 580px;
  overflow: visible;
  transform-origin: left top;
  will-change: transform;
}

.campaign-paths {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.campaign-path {
  position: static;
  height: auto;
  transform: none;
  transform-origin: initial;
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.campaign-path.unlocked {
  background: none;
  stroke: var(--cyan);
  filter: drop-shadow(0 0 5px rgba(0, 174, 239, 0.25));
}

.campaign-path.region-link,
.campaign-path.region-link.unlocked {
  height: auto;
  background: none;
  stroke: var(--line-strong);
  stroke-width: 3;
  stroke-dasharray: 8 7;
  filter: none;
}

.campaign-path.region-link.unlocked {
  stroke: var(--purple);
  filter: drop-shadow(0 0 5px rgba(181, 124, 255, 0.28));
}

.campaign-camera-controls {
  position: relative;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-bottom: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 24px rgba(1, 14, 24, 0.13);
  backdrop-filter: blur(7px);
}

.campaign-camera-controls button,
.campaign-camera-controls output {
  min-width: 31px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font: 800 0.66rem/1 Inter, sans-serif;
}

.campaign-camera-controls button {
  cursor: pointer;
}

.campaign-camera-controls button:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
}

.campaign-camera-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.campaign-camera-controls output {
  min-width: 49px;
  color: var(--cyan);
}

.campaign-map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 750;
}

.campaign-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.campaign-legend-line {
  display: inline-block;
  width: 23px;
  border-top: 3px solid var(--cyan);
  border-radius: 999px;
}

.campaign-legend-line.region-link {
  border-color: var(--purple);
  border-top-style: dashed;
}

.campaign-pan-hint {
  display: none;
}

@media (max-width: 560px) {
  .campaign-camera-controls {
    justify-content: center;
  }

  .campaign-camera-controls button,
  .campaign-camera-controls output {
    min-width: 29px;
    padding-inline: 6px;
  }

  .campaign-map-legend {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Firewall Protocol v0.13.0 deep-network expansion */
.campaign-map-track {
  width: 1180px;
}

.campaign-map-content {
  --campaign-scaled-width: 1180px;
}

.arc-icon {
  color: #5ee7ff;
  background: rgba(94, 231, 255, 0.12);
}

.daemon-icon {
  color: #72f0a6;
  background: rgba(114, 240, 166, 0.12);
}

.breaker-icon {
  color: #ff9f68;
  background: rgba(255, 159, 104, 0.13);
}

.incident-intel-preview {
  margin: 13px 0 16px;
  min-width: 0;
}

.incident-intel {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 94%, transparent), color-mix(in srgb, var(--surface) 98%, transparent));
}

.incident-intel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.incident-intel > header strong {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.incident-intel > header span,
.intel-loading {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.intel-threat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.intel-threat {
  min-width: 0;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--intel-color) 28%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--intel-color) 7%, var(--surface));
}

.intel-threat-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--intel-color) 18%, transparent);
  color: var(--intel-color);
  font-size: 0.63rem;
  font-weight: 950;
}

.intel-threat > span:nth-child(2) {
  min-width: 0;
}

.intel-threat strong,
.intel-threat small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intel-threat strong {
  color: var(--text);
  font-size: 0.67rem;
}

.intel-threat small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.57rem;
}

.intel-threat em {
  grid-column: 1 / -1;
  color: var(--intel-color);
  font-size: 0.54rem;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.intel-zone-list {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 6px;
}

.intel-zone-list > b {
  width: 100%;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.intel-zone {
  flex: 1 1 150px;
  min-width: 0;
  padding: 7px 8px;
  border-left: 3px solid var(--zone-color);
  border-radius: 6px;
  background: color-mix(in srgb, var(--zone-color) 8%, var(--surface-2));
}

.intel-zone strong,
.intel-zone small {
  display: block;
}

.intel-zone strong {
  color: var(--zone-color);
  font-size: 0.62rem;
}

.intel-zone small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.35;
}

.intel-wave-list {
  max-height: 176px;
  display: grid;
  gap: 4px;
  overflow: auto;
  padding-right: 3px;
}

.intel-wave-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.intel-wave-row > strong {
  padding-top: 4px;
  color: var(--cyan);
  font-size: 0.58rem;
}

.intel-wave-row > span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.intel-wave-row i {
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--intel-color) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--intel-color) 7%, var(--surface));
  color: var(--text);
  font-size: 0.54rem;
  font-style: normal;
  font-weight: 750;
}

.loadout-grid .loadout-card.locked {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.48;
}

.loadout-grid .loadout-card.locked:hover {
  border-color: var(--line);
  transform: none;
}

.loadout-message.warning {
  color: #9c5a00;
  border-color: color-mix(in srgb, var(--amber) 52%, var(--line));
  background: color-mix(in srgb, var(--amber) 11%, var(--surface));
}

[data-game-theme="dark"] .loadout-message.warning {
  color: var(--amber);
}

@media (max-width: 900px) {
  .incident-intel-preview.detailed .intel-threat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .intel-threat-grid {
    grid-template-columns: 1fr;
  }

  .incident-intel > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  .game-shell.focused .game-heading {
    min-height: 28px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 3px;
  }

  .game-shell.focused .game-heading-actions {
    gap: 5px;
  }

  .game-shell.focused .game-heading-actions .control-btn {
    min-height: 27px;
  }
}

/* v0.14.0 final cascade overrides */
.game-shell.menu-active {
  padding: 0;
  overflow: hidden;
}

.game-shell.menu-active > .game-heading,
.game-shell.menu-active > .status-strip,
.game-shell.menu-active > .game-layout {
  display: none;
}

.game-shell.menu-active .game-menu {
  position: relative;
  inset: auto;
  height: min(780px, calc(100dvh - 138px));
  min-height: min(500px, calc(100dvh - 138px));
  border-radius: inherit;
}

.game-shell:fullscreen,
.game-shell.pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  background: var(--surface);
}

.game-shell:fullscreen.focused,
.game-shell.pseudo-fullscreen.focused {
  inset: 0;
}

.game-shell:fullscreen.menu-active .game-menu,
.game-shell.pseudo-fullscreen.menu-active .game-menu {
  height: 100dvh;
  min-height: 0;
  border-radius: 0;
}

.incident-intel-disclosure .incident-intel-preview {
  margin: 0;
}

.intel-threat .intel-class-data {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 5px;
}

.intel-threat > .intel-threat-icon {
  grid-column: 1;
  grid-row: 1;
}

.intel-threat > span:nth-child(3) {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.intel-threat > em {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .game-shell.menu-active .game-menu {
    height: min(720px, calc(100dvh - 96px));
    min-height: min(460px, calc(100dvh - 96px));
  }
}

@media (max-width: 650px) {
  .game-shell.focused .status-strip {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .game-shell.focused .status-card {
    flex: 0 0 112px;
    scroll-snap-align: start;
  }

  .game-shell.focused .stage-column {
    display: block;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .game-shell.focused .canvas-frame {
    width: 720px;
    max-width: none;
    height: auto;
    margin: 0;
  }

  .game-shell.focused .game-controls,
  .game-shell.focused .module-section,
  .game-shell.focused .mobile-play-hint {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .game-shell.focused .mobile-play-hint {
    display: block;
  }
}

@media (max-width: 650px) and (orientation: landscape) {
  .game-shell.focused .canvas-frame {
    width: 100%;
  }

  .game-shell.focused .mobile-play-hint {
    display: none;
  }
}
