:root {
  --bg: #050505;
  --panel: #111111;
  --accent: #00ff9d;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #444444;
  --border: #1e1e1e;
  --danger: #ff3b30;
  --warning: #f5a623;
  --panel-deep: #0a0a0a;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 300;
}

#app {
  min-height: 100vh;
}

/* —— Fonts —— */
.home-title,
.game-title,
.debrief-head,
.debrief-sub,
.difficulty-name,
.score-bar-label,
.alert-banner-title,
.debrief-xp-val {
  font-family: 'Syne', sans-serif;
}

.packet-card-k,
.packet-card-v,
.packet-card-id,
.packet-card-cta,
.threat-log-header,
.threat-log-line,
.difficulty-level,
.difficulty-meta,
.btn-init,
.btn-allow,
.btn-quarantine,
.game-feed-label,
.game-packet-count,
.debrief-stats dt,
.debrief-stats dd,
.debrief-mini-title,
.debrief-row-label,
.debrief-row-count,
.debrief-table,
.inspection-k,
.inspection-panel-head,
.inspection-panel-id {
  font-family: 'JetBrains Mono', monospace;
}

/* —— Animations —— */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Top-based drift — more reliable than transform with nested pulse styles */
@keyframes packetDrift {
  from {
    top: -160px;
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  to {
    top: calc(100% + 48px);
    opacity: 0.2;
  }
}

@keyframes scanLine {
  0% {
    transform: translateX(-100%);
    opacity: 0.7;
  }
  100% {
    transform: translateX(100%);
    opacity: 0.7;
  }
}

@keyframes screenFlashRed {
  0% {
    opacity: 0.35;
  }
  100% {
    opacity: 0;
  }
}

@keyframes screenFlashGreen {
  0% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.2);
  }
  50% {
    box-shadow: 0 0 12px 2px rgba(0, 255, 157, 0.15);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideBannerIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-slide-up {
  animation: fadeSlideUp 0.65s ease both;
}

/* —— Home —— */
.home-screen {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.home-mission-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.home-rule {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

.home-title {
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  line-height: 1.1;
}

.home-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.home-body p {
  margin: 0 0 1rem;
}

.home-what-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1.25rem;
}

.home-what-title--tier {
  margin-top: 1.75rem;
  color: var(--accent);
}

.home-what-lead {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0.75rem !important;
  font-style: italic;
}

.home-what-tier-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem !important;
}

.home-what-tier-note--small {
  font-size: 0.75rem;
  opacity: 0.9;
}

.home-what-ol {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.home-what-ol li {
  margin-bottom: 0.45rem;
}

.home-what-ol code {
  font-size: 0.88em;
  color: var(--text-primary);
  background: rgba(0, 255, 157, 0.06);
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
}

.home-what-list {
  margin: 0.5rem 0 1rem;
  padding-left: 0;
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.home-what-list--baseline li,
.home-what-list--tier li {
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.home-what-list code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  color: var(--text-primary);
  background: rgba(0, 255, 157, 0.06);
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
}

.home-what-list li {
  margin-bottom: 0.35rem;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .difficulty-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.difficulty-card {
  text-align: left;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font: inherit;
}

.difficulty-card:hover {
  border-color: rgba(0, 255, 157, 0.3);
  background: rgba(0, 255, 157, 0.04);
}

.difficulty-card.is-selected {
  border-color: var(--accent);
  background: rgba(0, 255, 157, 0.06);
}

.difficulty-card.is-selected .difficulty-level {
  color: var(--accent);
}

.difficulty-level {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.difficulty-name {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.difficulty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1rem;
  min-height: 4.5rem;
}

.difficulty-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.home-section--start {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.btn-init {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1rem 2.5rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-init:not(:disabled):hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-init:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-muted);
}

.scanning {
  position: relative;
  overflow: hidden;
}

.scanning::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanLine 2s linear infinite;
}

/* —— Game shell —— */
.game-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 0;
  position: relative;
}

/* Session end — in-game overlay (timer / score / queue drained) */
.game-session-end {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(5, 5, 5, 0.94);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.game-session-end[hidden] {
  display: none !important;
}

.game-session-end-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 0 60px rgba(0, 255, 157, 0.08);
}

.game-session-end-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.game-session-end-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.game-session-end-score {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3rem, 12vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin: 0 0 0.35rem;
  line-height: 1;
}

.game-session-end-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 1.75rem;
}

.btn-game-session-home {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: none;
  padding: 0.9rem 1.75rem;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  transition: background 0.2s, transform 0.15s;
}

.btn-game-session-home:hover {
  background: #33ffa8;
  transform: translateY(-1px);
}

.screen-flash-red-host {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.screen-flash-red {
  position: absolute;
  inset: 0;
  background: var(--danger);
  animation: screenFlashRed 0.65s ease forwards;
}

.game-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.game-timer {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

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

.game-timer-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 4.25ch;
}

.game-header-score {
  flex: 1 1 200px;
  min-width: 0;
}

.game-title {
  font-size: clamp(0.75rem, 2.5vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0;
}

.game-packet-count {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.btn-game-exit {
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border2);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-game-exit:hover {
  color: var(--accent);
  border-color: rgba(0, 255, 157, 0.45);
  background: rgba(0, 255, 157, 0.06);
}

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

@media (min-width: 900px) {
  .game-main {
    grid-template-columns: 1fr 280px;
  }
}

.game-feed {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  border: 1px solid var(--border);
  background: var(--panel);
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .game-feed {
    min-height: min(62vh, 560px);
  }
}

.game-feed-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}

.game-feed-zone {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}

.packet-stream {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

/* —— Packet cards —— */
.packet-card {
  position: absolute;
  left: var(--packet-left-pct, 12%);
  top: -160px;
  width: min(340px, 88%);
  max-width: calc(100% - 8px);
  z-index: 2;
  animation: packetDrift var(--packet-lifetime, 10s) linear forwards;
  will-change: top;
  cursor: pointer;
}

.packet-card.paused {
  animation-play-state: paused;
}

.packet-card-inner {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  animation: pulseGlow 2.8s ease-in-out infinite;
}

.packet-card--exit .packet-card-inner {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.packet-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.packet-card-id {
  color: var(--text-muted);
  font-size: 0.55rem;
}

.packet-card-rule {
  height: 1px;
  background: var(--border);
  margin: 0.35rem 0;
}

.packet-card-field {
  font-size: 0.62rem;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.packet-card-k {
  color: var(--accent);
  font-weight: 500;
}

.packet-card-v {
  color: var(--text-primary);
}

.packet-card-payload .packet-card-v {
  display: inline;
}

.packet-card-cta {
  text-align: center;
  font-size: 0.58rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* —— Score bar —— */
.score-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.score-bar-label {
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: none;
}

@media (min-width: 600px) {
  .score-bar-label {
    display: inline;
  }
}

.score-bar-track {
  width: min(160px, 28vw);
  height: 8px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.5s ease;
  background: var(--accent);
}

.score-bar-fill--high {
  background: var(--accent);
}

.score-bar-fill--mid {
  background: var(--warning);
}

.score-bar-fill--low {
  background: var(--danger);
}

.score-bar-numbers {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
}

.score-bar--flash-bad .score-bar-fill {
  filter: brightness(1.4) saturate(1.2);
  box-shadow: 0 0 16px rgba(255, 59, 48, 0.5);
}

.score-bar--flash-good .score-bar-fill {
  filter: brightness(1.25);
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.45);
}

/* —— Threat log —— */
.threat-log {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--panel);
  max-height: 320px;
}

@media (min-width: 900px) {
  .threat-log {
    max-height: none;
    height: 100%;
    min-height: 280px;
  }
}

.threat-log-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}

.threat-log-scroll {
  flex: 1;
  overflow: auto;
  padding: 0.5rem;
}

.threat-log-line {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  gap: 0.35rem 0.5rem;
  font-size: 0.58rem;
  line-height: 1.35;
  margin-bottom: 0.45rem;
  align-items: baseline;
}

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

.threat-log-action {
  font-weight: 500;
}

.threat-log-icon {
  color: var(--text-secondary);
}

.threat-log-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.threat-log-type {
  font-size: 0.52rem;
  color: var(--text-muted);
}

.threat-log-line--ok .threat-log-action {
  color: var(--accent);
}

.threat-log-line--fp .threat-log-action {
  color: var(--warning);
}

.threat-log-line--breach .threat-log-action {
  color: var(--danger);
}

.threat-log-line--miss-bad .threat-log-action {
  color: var(--danger);
}

.threat-log-line--miss-safe .threat-log-action {
  color: var(--text-secondary);
}

/* —— Inspection —— */
.game-inspection-host {
  position: relative;
  z-index: 40;
  flex-shrink: 0;
}

.inspection-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45vh;
  min-height: 280px;
  background: var(--panel-deep);
  border-top: 2px solid var(--accent);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
}

.inspection-panel.is-open {
  transform: translateY(0);
}

.inspection-panel-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.inspection-panel-head {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  color: var(--accent);
}

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

.inspection-panel-body {
  flex: 1;
  overflow: auto;
}

.inspection-field {
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.inspection-k {
  color: var(--accent);
  font-weight: 500;
  margin-right: 0.35rem;
  display: block;
  margin-bottom: 0.2rem;
}

.inspection-value.text-data {
  white-space: pre-wrap;
  word-break: break-word;
}

.text-data {
  color: var(--text-primary);
}

.inspection-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1rem;
}

.btn-allow {
  background: rgba(0, 255, 157, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  padding: 14px 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.1em;
}

.btn-allow:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-quarantine {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  padding: 14px 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.1em;
}

.btn-quarantine:hover {
  background: var(--danger);
  color: #fff;
}

/* —— Alert banner (bottom-right, slides in from the right) —— */
.game-alert-host {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: auto;
  top: auto;
  z-index: 220;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0;
}

.alert-banner-host {
  width: 100%;
  max-width: 420px;
  transform: translateX(calc(100% + 1.5rem));
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.alert-banner-host.is-visible {
  transform: translateX(0);
  opacity: 1;
}

/* Sit above the bottom inspection drawer when it is open (drawer is max(45vh, 280px)) */
.game-screen:has(.inspection-panel.is-open) .game-alert-host {
  bottom: calc(max(45vh, 280px) + 0.75rem);
}

.alert-banner-card {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.alert-banner-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.alert-banner-body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: var(--text-secondary);
}

.alert-banner-card--correct-block,
.alert-banner-card--correct-allow {
  border-color: var(--accent);
  background: rgba(0, 255, 157, 0.08);
}

.alert-banner-card--correct-allow {
  background: rgba(0, 255, 157, 0.05);
}

.alert-banner-card--correct-block .alert-banner-title,
.alert-banner-card--correct-allow .alert-banner-title {
  color: var(--accent);
}

.alert-banner-card--wrong-allow {
  border-color: var(--danger);
  background: rgba(255, 59, 48, 0.12);
}

.alert-banner-card--wrong-allow .alert-banner-title {
  color: var(--danger);
}

.alert-banner-card--wrong-block {
  border-color: var(--warning);
  background: rgba(245, 162, 35, 0.1);
}

.alert-banner-card--wrong-block .alert-banner-title {
  color: var(--warning);
}

.alert-banner-card--miss-malicious {
  border-color: var(--danger);
  background: rgba(255, 59, 48, 0.12);
}

.alert-banner-card--miss-malicious .alert-banner-title {
  color: var(--danger);
}

/* —— Debrief —— */
.debrief-screen {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.debrief-head {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  margin: 0 0 2rem;
  line-height: 1.1;
}

.debrief-head--emerald {
  color: var(--accent);
}

.debrief-head--white {
  color: var(--text-primary);
}

.debrief-head--amber {
  color: var(--warning);
}

.debrief-head--red {
  color: var(--danger);
}

.debrief-reveal {
  opacity: 0;
  animation: fadeSlideUp 0.7s ease both;
}

.debrief-sub {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  letter-spacing: 0.04em;
}

.debrief-sub--inline {
  margin-top: 1.25rem;
}

.debrief-score-hero {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin: 0 0 0.25rem;
  line-height: 1;
}

.debrief-score-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.debrief-stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  margin: 1rem 0;
}

.debrief-stats dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin: 0;
}

.debrief-stats dd {
  margin: 0;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  text-align: right;
}

.text-breach {
  color: var(--danger);
}

.text-fp {
  color: var(--warning);
}

.debrief-mini-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.debrief-breakdown {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.debrief-row {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.debrief-row-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.debrief-row-count {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.debrief-row-tip {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

.debrief-missed-row {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.debrief-missed-exp {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

.debrief-xp {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 2rem 0 1.5rem;
}

.debrief-xp-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.debrief-xp-val {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent);
  animation: countUp 0.6s ease both;
}

.debrief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.btn-debrief-primary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}

.btn-debrief-ghost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-debrief-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

a.btn-debrief-ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-next-module {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.home-next-module-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.home-next-module-link:hover {
  text-decoration: underline;
}

.debrief-review {
  border: 1px solid var(--border);
  background: var(--panel);
  max-height: 50vh;
  overflow: auto;
  margin-bottom: 2rem;
}

.debrief-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.62rem;
}

.debrief-table th,
.debrief-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.debrief-table-exp-row td {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  line-height: 1.45;
  padding-bottom: 0.75rem;
}

/* Mobile stack order: feed, inspection, log */
@media (max-width: 899px) {
  .game-main {
    display: flex;
    flex-direction: column;
  }

  .game-feed {
    order: 1;
    min-height: 240px;
  }

  .game-sidebar {
    order: 3;
  }

  .game-inspection-host {
    order: 2;
  }
}
