/* css/style.css - V.O.I.D. Cyberpunk Terminal Theme */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0f1520;
  --bg-hud: #0c1018;
  --bg-panel: #0d1119;
  --text-primary: #c0f0c0;
  --text-dim: #4a6a4a;
  --text-bright: #00ff88;
  --text-cyan: #00e5ff;
  --text-yellow: #ffd740;
  --text-red: #ff4444;
  --text-red-bright: #ff6666;
  --text-white: #e0e0e0;
  --text-muted: #607070;
  --accent-green: #00ff88;
  --accent-cyan: #00e5ff;
  --accent-red: #ff2d2d;
  --bar-bg: #1a2030;
  --glow-green: 0 0 10px rgba(0, 255, 136, 0.3);
  --glow-red: 0 0 15px rgba(255, 45, 45, 0.4);
  --glow-cyan: 0 0 10px rgba(0, 229, 255, 0.3);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
}

/* ============================================================
   SCANLINE OVERLAY (CRT effect)
   ============================================================ */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden {
  display: none !important;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
#app {
  height: 100vh;
  width: 100vw;
}

/* ============================================================
   START MENU
   ============================================================ */
#start-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  min-height: 100vh;
  width: 100vw;
  background: var(--bg-primary);
  position: relative;
  padding-bottom: 90px;
  box-sizing: border-box;
}

.menu-container {
  text-align: center;
  max-width: 650px;
  width: 90%;
  animation: fadeIn 0.8s ease;
  padding-bottom: 0;
  margin-bottom: 0;
}

.ascii-art {
  color: var(--accent-green);
  font-size: 13px;
  line-height: 1.2;
  text-shadow: var(--glow-green), 0 0 40px rgba(0, 255, 136, 0.15);
  margin-bottom: 10px;
  user-select: none;
}

.menu-subtitle {
  color: var(--text-cyan);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.menu-tagline {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.menu-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}

.menu-field {
  width: 100%;
  text-align: left;
}

.menu-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.menu-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid #2a3a4a;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 18px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.menu-input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
}

.menu-input::placeholder {
  color: var(--text-dim);
}

/* OS Selector */
.os-selector {
  display: flex;
  gap: 14px;
}

.os-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 14px;
  background: var(--bg-secondary);
  border: 2px solid #2a3a4a;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-mono);
}

.os-btn:hover {
  border-color: var(--text-dim);
  background: #141c28;
}

.os-btn.selected {
  border-color: var(--accent-green);
  background: rgba(0, 255, 136, 0.05);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.1);
}

.os-icon { font-size: 32px; }
.os-name { color: var(--text-white); font-size: 15px; font-weight: 700; }
.os-detail { color: var(--text-muted); font-size: 11px; }

/* Difficulty Selector */
.difficulty-selector {
  display: flex;
  gap: 12px;
}

.difficulty-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 14px;
  background: var(--bg-secondary);
  border: 2px solid #2a3a4a;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-mono);
}

.difficulty-btn:hover {
  border-color: var(--text-dim);
  background: #141c28;
}

.difficulty-btn.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.05);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.12);
}

.difficulty-name { color: var(--text-white); font-size: 15px; font-weight: 700; }
.difficulty-detail { color: var(--text-muted); font-size: 12px; text-align: center; }

/* Start Button */
.start-btn {
  width: 100%;
  padding: 18px;
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 229, 255, 0.1));
  border: 2px solid var(--accent-green);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-mono);
}

.start-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(0, 229, 255, 0.15));
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.2);
  transform: translateY(-1px);
}

.start-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #2a3a4a;
}

.start-btn-text {
  color: var(--accent-green);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
}

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

.menu-secondary-btn {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid #2a3a4a;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-mono);
}

.menu-secondary-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
  transform: translateY(-1px);
}

.menu-secondary-text {
  color: var(--text-cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

.menu-hint {
  color: var(--text-muted);
  font-size: 14px;
  margin: 24px 0 32px;
}

.menu-hint strong { color: var(--text-yellow); }

.menu-footer {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #7a8a8a;
  font-size: 12px;
  line-height: 1.9;
  z-index: 1000;
}

/* ============================================================
   GAME VIEW
   ============================================================ */
#game-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ============================================================
   HUD BAR (top)
   ============================================================ */
#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--bg-hud);
  border-bottom: 1px solid #1a2a3a;
  font-size: 15px;
  flex-shrink: 0;
  z-index: 100;
  min-height: 48px;
}

.hud-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1.5px;
}

.hud-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-cyan);
}

.hud-value.critical {
  color: var(--text-red-bright);
  animation: pulse-red 0.8s infinite;
}

.hud-value.warning { color: var(--text-yellow); }

/* V.O.I.D. logo - clickable to go back to menu */
#hud-title {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 3px;
  text-shadow: var(--glow-green);
  cursor: pointer;
  transition: text-shadow 0.3s;
  user-select: none;
}

#hud-title:hover {
  text-shadow: var(--glow-green), 0 0 20px rgba(0, 255, 136, 0.4);
}

/* Encryption progress bar */
.hud-bar-container {
  width: 200px;
  height: 14px;
  background: var(--bar-bg);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #2a3a4a;
}

.hud-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-red);
  transition: width 0.5s ease;
  box-shadow: var(--glow-red);
}

.hud-bar-fill.flash {
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.65), var(--glow-red);
  filter: brightness(1.3);
}

.hud-value.flash {
  color: var(--text-red-bright);
  text-shadow: 0 0 10px rgba(255, 77, 109, 0.6);
}

.hud-bar-fill.danger { animation: pulse-bar 1s infinite; }
.hud-bar-fill.critical { animation: pulse-bar 0.4s infinite; }

/* ============================================================
   GAME BODY (terminal + learning panel)
   ============================================================ */
#game-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ============================================================
   TERMINAL
   ============================================================ */
#terminal {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

#terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 18px 28px;
  scroll-behavior: smooth;
}

/* Scrollbar */
#terminal-output::-webkit-scrollbar { width: 6px; }
#terminal-output::-webkit-scrollbar-track { background: var(--bg-primary); }
#terminal-output::-webkit-scrollbar-thumb { background: #2a3a4a; border-radius: 3px; }

/* ============================================================
   TERMINAL LINES
   ============================================================ */
.terminal-line {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 15px;
  line-height: 1.7;
  min-height: 1.7em;
  max-width: 900px;
}

.terminal-line.input-echo { color: var(--text-dim); }
.terminal-line.error { color: var(--text-red); font-weight: 700; }
.terminal-line.success { color: var(--accent-green); font-weight: 700; }
.terminal-line.warning { color: var(--text-yellow); }
.terminal-line.alert {
  color: var(--text-red-bright);
  font-weight: 700;
  text-shadow: var(--glow-red);
  animation: flash-alert 0.3s ease;
}
.terminal-line.header { color: var(--text-cyan); font-weight: 700; }
.terminal-line.info { color: var(--text-dim); }
.terminal-line.dim { color: #3a4a3a; }
.terminal-line.intro { color: var(--text-bright); }
.terminal-line.hex { color: #8ab4f8; font-size: 13px; }
.terminal-line.hint-text { color: var(--text-yellow); font-style: italic; }
.terminal-line.suspicious { color: var(--text-yellow); }
.terminal-line.table-header { color: var(--text-white); font-weight: 700; }
.terminal-line.mission-accept {
  color: var(--text-yellow);
  font-weight: 700;
  letter-spacing: 1px;
  animation: blink-text 1s steps(1, end) infinite;
}

/* ============================================================
   INPUT LINE
   ============================================================ */
#terminal-input-line {
  display: flex;
  align-items: center;
  padding: 12px 28px 18px 28px;
  background: var(--bg-primary);
  border-top: 1px solid #1a2a3a;
  flex-shrink: 0;
}

#terminal-prompt {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 15px;
  margin-right: 10px;
  white-space: nowrap;
  text-shadow: var(--glow-green);
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  caret-color: var(--accent-green);
  animation: blink-caret 1s step-end infinite;
}

#terminal-input::placeholder { color: var(--text-dim); }
#terminal-input:disabled { opacity: 0.4; }

/* ============================================================
   LEARNING PANEL (right sidebar)
   ============================================================ */
#learning-panel {
  width: 340px;
  background: var(--bg-panel);
  border-left: 1px solid #1a2a3a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

#learning-panel.collapsed {
  width: 0;
  border-left: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #1a2a3a;
  flex-shrink: 0;
}

.panel-title {
  color: var(--text-cyan);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.panel-close-btn {
  background: none;
  border: 1px solid #2a3a4a;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 3px;
  transition: all 0.2s;
}

.panel-close-btn:hover {
  border-color: var(--text-cyan);
  color: var(--text-cyan);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.panel-content::-webkit-scrollbar { width: 4px; }
.panel-content::-webkit-scrollbar-track { background: var(--bg-panel); }
.panel-content::-webkit-scrollbar-thumb { background: #2a3a4a; border-radius: 2px; }

.panel-empty {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 24px 12px;
  line-height: 1.8;
}

/* Individual lesson card */
.lesson-card {
  background: rgba(0, 229, 255, 0.04);
  border: 1px solid #1a2a3a;
  border-left: 3px solid var(--accent-cyan);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
  animation: slideIn 0.4s ease;
}

.lesson-card .lesson-title {
  color: var(--text-cyan);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lesson-card .lesson-text {
  color: var(--text-white);
  font-size: 16px;
  line-height: 1.75;
}

.lesson-card .lesson-source {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 6px;
}

/* Learning panel toggle button (visible when panel is collapsed) */
#learning-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--accent-cyan);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text-cyan);
  cursor: pointer;
  padding: 16px 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
  z-index: 200;
  transition: all 0.3s;
  display: none;
  box-shadow: -2px 0 12px rgba(0, 229, 255, 0.1);
}

#learning-toggle:hover {
  background: rgba(0, 229, 255, 0.1);
  box-shadow: -2px 0 20px rgba(0, 229, 255, 0.2), var(--glow-cyan);
}

#learning-toggle.visible {
  display: block;
}

.toggle-badge {
  display: inline-block;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-top: 6px;
  writing-mode: horizontal-tb;
}

/* ============================================================
   LESSON TOAST (centered pop-up with backdrop)
   ============================================================ */
.toast-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 499;
}

.lesson-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: 92vw;
  background: var(--bg-panel);
  border: 1px solid var(--accent-cyan);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 8px;
  padding: 28px 32px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 229, 255, 0.15);
  z-index: 500;
  animation: toastIn 0.4s ease;
}

.lesson-toast .toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lesson-toast .toast-label {
  color: var(--accent-cyan);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.lesson-toast .toast-close {
  background: none;
  border: 1px solid #2a3a4a;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  transition: all 0.2s;
}

.lesson-toast .toast-close:hover { color: var(--text-white); border-color: var(--text-cyan); }

.lesson-toast .toast-title {
  color: var(--text-white);
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
}

.lesson-toast .toast-text {
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.8;
}

.lesson-toast .toast-hint {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 12px;
  text-align: center;
  letter-spacing: 1px;
}

.lesson-toast.hiding {
  animation: toastOut 0.3s ease forwards;
}

/* ============================================================
   TUTORIAL OVERLAY (interactive onboarding)
   ============================================================ */
.tutorial-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 520;
}

.tutorial-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 760px;
  max-width: 94vw;
  max-height: 92vh;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-cyan);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 10px;
  padding: 26px 30px;
  z-index: 521;
  animation: toastIn 0.4s ease;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6), 0 0 36px rgba(0, 229, 255, 0.12);
}

.tutorial-label {
  color: var(--text-cyan);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tutorial-title {
  color: var(--text-white);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.tutorial-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.tutorial-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.tutorial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #2a3a4a;
  background: #0e1520;
}

.tutorial-dot.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

.tutorial-dot.done {
  background: rgba(0, 255, 136, 0.2);
  border-color: rgba(0, 255, 136, 0.6);
}

.tutorial-body {
  background: var(--bg-primary);
  border: 1px solid #1a2a3a;
  border-radius: 8px;
  padding: 18px 20px;
  font-family: var(--font-mono);
}

.tutorial-step-title {
  color: var(--accent-green);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.tutorial-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 2.0;
}

.tutorial-list code {
  color: var(--text-cyan);
  background: rgba(0, 229, 255, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.15);
  font-family: var(--font-mono);
}

.tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.tutorial-btn {
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border: 1px solid #2a3a4a;
  background: rgba(0, 229, 255, 0.05);
  color: var(--text-cyan);
  transition: all 0.2s ease;
}

.tutorial-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.15);
  transform: translateY(-1px);
}

.tutorial-btn.primary {
  border-color: rgba(0, 255, 136, 0.6);
  color: var(--accent-green);
  background: rgba(0, 255, 136, 0.08);
}

.tutorial-btn.primary:hover {
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.18);
}

.tutorial-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   REPORT MODAL (end-game full-screen overlay)
   ============================================================ */
.report-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 600;
}

.report-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1200px;
  max-width: 96vw;
  max-height: 96vh;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-cyan);
  border-radius: 10px;
  padding: 28px 36px;
  z-index: 601;
  animation: toastIn 0.5s ease;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 229, 255, 0.12);
}

/* Report tab system */
.report-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-tabs-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(10, 18, 24, 0.4);
  border-radius: 6px;
  border: 1px solid #1a2a3a;
  flex-shrink: 0;
}

.report-tab-btn {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid #2a3a4a;
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.report-tab-btn:hover {
  color: var(--text-primary);
  border-color: #3a4a5a;
}

.report-tab-btn.active-tab {
  color: var(--text-white);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.08), rgba(0, 255, 136, 0.05));
  border-color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.report-tab-contents {
  /* No overflow:hidden here — let the modal handle scrolling */
}

.report-tab-content {
  padding: 4px 0;
}

/* ── Telemetry Tab ─────────────────────────────────────── */
.tele-dist-row {
  display: grid;
  grid-template-columns: 90px 1fr 36px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.tele-dist-cmd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

.tele-dist-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.tele-dist-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.tele-dist-count {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #8899aa;
  text-align: right;
}


.scrollable {
  max-height: 38vh;
  overflow-y: auto;
  padding: 8px;
  border: 1px dashed rgba(42, 58, 74, 0.3);
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar { width: 5px; }
.scrollable::-webkit-scrollbar-track { background: var(--bg-primary); }
.scrollable::-webkit-scrollbar-thumb { background: #2a3a4a; border-radius: 3px; }

.audit-log .audit-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px;
  border-bottom: 1px solid rgba(42, 58, 74, 0.1);
}

.audit-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
}

.sev-info    { background: rgba(0, 229, 255, 0.08); color: var(--text-cyan); border: 1px solid rgba(0,229,255,0.2); }
.sev-success { background: rgba(0, 255, 136, 0.08); color: var(--accent-green); border: 1px solid rgba(0,255,136,0.2); }
.sev-warning { background: rgba(255, 215, 64, 0.08); color: var(--text-yellow); border: 1px solid rgba(255,215,64,0.2); }
.sev-critical{ background: rgba(255, 68, 68, 0.08); color: var(--text-red-bright); border: 1px solid rgba(255,68,68,0.2); }
.audit-empty { color: var(--text-dim); padding: 12px; font-size: 13px; }

.report-modal .report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}

.report-modal h2 {
  color: var(--accent-cyan);
  font-size: 22px;
  letter-spacing: 3px;
  text-align: center;
  margin: 0 0 6px 0;
}

.report-modal .report-outcome {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.report-modal .report-outcome.win { color: var(--accent-green); }
.report-modal .report-outcome.loss { color: var(--text-red); }

.report-modal .report-section {
  margin-bottom: 12px;
}

.report-modal .report-section-title {
  color: var(--text-cyan);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid #1a2a3a;
  padding-bottom: 5px;
  margin-bottom: 8px;
}

.report-modal .report-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 16px;
}

.report-modal .report-row .label { color: var(--text-muted); }
.report-modal .report-row .value { color: var(--text-primary); font-weight: 600; }
.report-modal .report-row .value.ok { color: var(--accent-green); }
.report-modal .report-row .value.fail { color: var(--text-red); }

.report-modal .report-rank {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 14px 0;
  letter-spacing: 2px;
}

.report-modal .report-continue {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 255, 136, 0.1));
  border: 2px solid var(--accent-cyan);
  border-radius: 6px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.report-modal .report-continue:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 255, 136, 0.15));
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.2);
  transform: translateY(-1px);
}

.report-cmds-list {
  background: var(--bg-primary);
  border-radius: 4px;
  padding: 10px 12px;
}

.report-cmd {
  font-size: 14px;
  color: var(--text-muted);
  padding: 3px 0;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-tip {
  font-size: 15px;
  color: var(--text-yellow);
  padding: 3px 0;
}

/* ============================================================
   ANALYST EVALUATION (report modal — grade-driven narrative)
   ============================================================ */
.report-evaluation {
  background: rgba(0, 0, 0, 0.25);
  border-left: 4px solid var(--text-muted);
  border-radius: 4px;
  padding: 14px 16px;
  margin-top: 4px;
}

.report-evaluation .eval-verdict {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.report-evaluation .eval-detail {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.report-evaluation .eval-action {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Grade colour accents — left border + verdict colour */
.report-evaluation.eval-s {
  border-left-color: var(--accent-cyan);
}
.report-evaluation.eval-s .eval-verdict {
  color: var(--accent-cyan);
}

.report-evaluation.eval-a {
  border-left-color: var(--accent-green);
}
.report-evaluation.eval-a .eval-verdict {
  color: var(--accent-green);
}

.report-evaluation.eval-b {
  border-left-color: var(--text-yellow);
}
.report-evaluation.eval-b .eval-verdict {
  color: var(--text-yellow);
}

.report-evaluation.eval-c {
  border-left-color: #ff9800;
}
.report-evaluation.eval-c .eval-verdict {
  color: #ff9800;
}

.report-evaluation.eval-d {
  border-left-color: var(--text-red);
}
.report-evaluation.eval-d .eval-verdict {
  color: var(--text-red);
}

/* ============================================================
   INTEL BASE — Lesson cards (report modal)
   ============================================================ */
.learning-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.lesson-item {
  background: rgba(0, 255, 255, 0.04);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 4px;
  padding: 10px 14px;
}

.lesson-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.lesson-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
}

.audit-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0;
}

.quiz-score-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid #1a2a3a;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.quiz-score-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.quiz-score-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.quiz-score-badge.ok {
  color: var(--accent-green);
  border-color: rgba(0, 255, 136, 0.5);
  background: rgba(0, 255, 136, 0.12);
}

.quiz-score-badge.warn {
  color: var(--text-yellow);
  border-color: rgba(255, 214, 102, 0.5);
  background: rgba(255, 214, 102, 0.12);
}

.quiz-score-badge.fail {
  color: var(--text-red);
  border-color: rgba(255, 77, 109, 0.5);
  background: rgba(255, 77, 109, 0.12);
}

.audit-log {
  background: var(--bg-primary);
  border-radius: 4px;
  padding: 10px 12px;
  border: 1px solid #12202a;
}

.audit-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 6px 0 10px 0;
}

.audit-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}

.audit-legend-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.audit-row {
  display: grid;
  grid-template-columns: 88px 120px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 4px 0;
  border-bottom: 1px dashed #1b2a36;
}

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

.audit-time { color: var(--text-muted); }
.audit-type { color: var(--text-cyan); letter-spacing: 0.4px; }
.audit-desc {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-badge {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.audit-badge.sev-info {
  color: var(--text-cyan);
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.08);
}

.audit-badge.sev-warning {
  color: var(--text-yellow);
  border-color: rgba(255, 214, 102, 0.4);
  background: rgba(255, 214, 102, 0.08);
}

.audit-badge.sev-critical {
  color: var(--text-red);
  border-color: rgba(255, 77, 109, 0.45);
  background: rgba(255, 77, 109, 0.08);
}

.audit-badge.sev-success {
  color: var(--accent-green);
  border-color: rgba(0, 255, 136, 0.4);
  background: rgba(0, 255, 136, 0.08);
}

.audit-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
  font-family: var(--font-mono);
}

/* ============================================================
   REPORT EXPORT BUTTONS
   ============================================================ */
.report-export-bar {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 6px;
}

.report-export-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.08), rgba(0, 229, 255, 0.05));
  border: 1px solid #2a4a3a;
  border-radius: 6px;
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.report-export-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.18), rgba(0, 229, 255, 0.1));
  border-color: var(--accent-green);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.15), var(--glow-green);
  transform: translateY(-1px);
}

.report-export-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.1);
}

.report-export-btn .export-icon {
  font-size: 16px;
  line-height: 1;
}

/* ============================================================
   CONTINUE BUTTON (end-game)
   ============================================================ */
.continue-btn-wrapper {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px 0;
}

.continue-btn {
  padding: 12px 40px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 255, 136, 0.1));
  border: 2px solid var(--accent-cyan);
  border-radius: 6px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.continue-btn:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 255, 136, 0.15));
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.2);
  transform: translateY(-1px);
}

/* ============================================================
   RESULTS PAGE
   ============================================================ */
#results-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background: var(--bg-primary);
  overflow-y: auto;
}

.results-container {
  text-align: center;
  max-width: 700px;
  width: 90%;
  padding: 40px 0;
  animation: fadeIn 0.6s ease;
}

.results-title {
  color: var(--accent-cyan);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.results-outcome {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

.results-outcome.win { color: var(--accent-green); }
.results-outcome.loss { color: var(--text-red); }

.results-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid #1a2a3a;
  border-radius: 6px;
  padding: 16px 12px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-cyan);
}

.stat-value.green { color: var(--accent-green); }
.stat-value.red { color: var(--text-red); }
.stat-value.yellow { color: var(--text-yellow); }

.leaderboard-section {
  margin: 24px 0;
  text-align: left;
}

.leaderboard-title {
  color: var(--text-cyan);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-align: center;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.leaderboard-table th {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid #2a3a4a;
  text-align: left;
}

.leaderboard-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #141c28;
  color: var(--text-primary);
}

.leaderboard-table tr.current {
  background: rgba(0, 229, 255, 0.06);
}

.leaderboard-table tr.current td {
  color: var(--text-cyan);
  font-weight: 700;
}

.leaderboard-table .rank-col { width: 50px; text-align: center; }
.leaderboard-table .score-col { text-align: right; }

.results-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 30px;
}

.result-btn {
  padding: 14px 32px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.result-btn.primary {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 229, 255, 0.1));
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
}

.result-btn.primary:hover {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.25), rgba(0, 229, 255, 0.15));
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
  transform: translateY(-1px);
}

.result-btn.secondary {
  background: transparent;
  border: 2px solid #3a4a5a;
  color: var(--text-muted);
}

.result-btn.secondary:hover {
  border-color: var(--text-cyan);
  color: var(--text-cyan);
}

/* ============================================================
   QUIZ UI
   ============================================================ */
.quiz-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(10, 15, 20, 0.85);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  width: 600px;
  max-width: 95vw;
  background: var(--bg-secondary);
  border: 1px solid #1f2937;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 229, 255, 0.1);
  padding: 30px;
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quiz-header {
  margin-bottom: 24px;
  text-align: center;
}

.quiz-label {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-cyan);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.quiz-subtitle {
  font-size: 16px;
  color: var(--text-muted);
}

.quiz-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.quiz-dot {
  width: 40px;
  height: 4px;
  background: #1f2937;
  border-radius: 2px;
  transition: all 0.3s;
}

.quiz-dot.active { background: var(--text-cyan); box-shadow: 0 0 8px var(--glow-cyan); }
.quiz-dot.done.correct { background: var(--accent-green); }
.quiz-dot.done.wrong { background: var(--text-red); }

.quiz-question-number {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-yellow);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quiz-question {
  font-size: 18px;
  color: #fff;
  line-height: 1.65;
  margin-bottom: 24px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(16, 24, 39, 0.6);
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-option:hover:not(.disabled) {
  background: rgba(0, 229, 255, 0.05);
  border-color: var(--text-cyan);
}

.quiz-option.correct {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
}

.quiz-option.wrong {
  background: rgba(255, 45, 45, 0.1);
  border-color: var(--text-red);
}

.quiz-option.disabled {
  cursor: default;
  opacity: 0.6;
}

.quiz-option.correct.disabled, .quiz-option.wrong.disabled {
  opacity: 1;
}

.quiz-option-key {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-cyan);
  background: #0d1420;
  border: 1px solid #1f2937;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.quiz-option.correct .quiz-option-key { color: var(--accent-green); border-color: var(--accent-green); }
.quiz-option.wrong .quiz-option-key { color: var(--text-red); border-color: var(--text-red); }

.quiz-option-text {
  font-size: 16px;
  line-height: 1.6;
}

.quiz-explanation {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s;
}

.quiz-explanation.correct {
  background: rgba(0, 255, 136, 0.05);
  border-left: 3px solid var(--accent-green);
}

.quiz-explanation.wrong {
  background: rgba(255, 45, 45, 0.05);
  border-left: 3px solid var(--text-red);
}

.quiz-explanation-header {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
}

.quiz-explanation.correct .quiz-explanation-header { color: var(--accent-green); }
.quiz-explanation.wrong .quiz-explanation-header { color: var(--text-red); }

.quiz-explanation-text {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.quiz-next-btn {
  width: 100%;
  padding: 14px;
  background: var(--text-cyan);
  color: #04070c;
  border: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-next-btn:hover {
  background: #00ffff;
  box-shadow: 0 0 15px var(--glow-cyan);
}

/* ============================================================
   KNOWLEDGE ASSESSMENT GRID (REPORT)
   ============================================================ */
.quiz-assessment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quiz-assessment-card {
  background: #0d1420;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.quiz-assessment-card.delta {
  background: rgba(0, 229, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.2);
}

.quiz-assessment-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.quiz-assessment-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.quiz-assessment-value.positive { color: var(--accent-green); }
.quiz-assessment-value.negative { color: var(--text-red); }

/* ============================================================
   GAME OVER SCREEN
   ============================================================ */
.game-over-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse 80% 70% at center,
    rgba(10, 2, 4, 0.95) 0%,
    rgba(60, 0, 0, 0.92) 30%,
    rgba(40, 0, 0, 0.75) 55%,
    rgba(15, 0, 0, 0.45) 75%,
    rgba(5, 0, 0, 0.15) 90%,
    transparent 100%
  );
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.game-over-screen.visible {
  opacity: 1;
  visibility: visible;
}

.game-over-content {
  text-align: center;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

.game-over-title {
  font-family: var(--font-mono);
  font-size: clamp(72px, 18vw, 180px);
  font-weight: 700;
  letter-spacing: 6px;
  color: #cc0020;
  text-transform: uppercase;
  text-shadow:
    0 0 30px rgba(200, 0, 30, 0.7),
    0 0 80px rgba(180, 0, 25, 0.4),
    0 0 140px rgba(150, 0, 20, 0.2);
  animation: game-over-flicker 2.4s infinite;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes flash-alert {
  0% { background: rgba(255, 45, 45, 0.15); }
  100% { background: transparent; }
}

@keyframes blink-caret {
  50% { caret-color: transparent; }
}

@keyframes blink-text {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes game-over-flicker {
  0%   { opacity: 1; text-shadow: 0 0 30px rgba(200, 0, 30, 0.7), 0 0 80px rgba(180, 0, 25, 0.4), 0 0 140px rgba(150, 0, 20, 0.2); transform: translate(0, 0); }
  12%  { opacity: 0.85; }
  16%  { opacity: 0.6; text-shadow: 0 0 15px rgba(255, 40, 40, 0.4), 0 0 40px rgba(200, 0, 30, 0.2); transform: translate(1px, 0); }
  20%  { opacity: 1; text-shadow: 0 0 30px rgba(200, 0, 30, 0.7), 0 0 80px rgba(180, 0, 25, 0.4), 0 0 140px rgba(150, 0, 20, 0.2); transform: translate(0, 0); }
  45%  { opacity: 0.9; }
  60%  { opacity: 1; }
  70%  { opacity: 0.7; text-shadow: 0 0 10px rgba(255, 40, 40, 0.3), 0 0 30px rgba(200, 0, 30, 0.15); }
  100% { opacity: 1; text-shadow: 0 0 30px rgba(200, 0, 30, 0.7), 0 0 80px rgba(180, 0, 25, 0.4), 0 0 140px rgba(150, 0, 20, 0.2); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  #learning-panel { width: 280px; }
  .lesson-toast { width: 380px; }
  .results-stats { grid-template-columns: 1fr 1fr; }
  .report-modal .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .terminal-line { font-size: 12px; }
  #terminal-input { font-size: 13px; }
  #hud { padding: 8px 14px; font-size: 12px; }
  .hud-bar-container { width: 140px; }
  .ascii-art { font-size: 9px; }
  .os-selector { flex-direction: column; }
  #learning-panel { width: 0; border-left: none; }
  #learning-toggle.visible { display: block; }
  .results-stats { grid-template-columns: 1fr; }
  .results-buttons { flex-direction: column; }
}
