:root {
  --neon-green: #00ff41;
  --neon-green-dim: #00cc33;
  --neon-red: #ff4136;
  --neon-amber: #ffb000;
  --primary: var(--neon-green);
  --primary-hover: var(--neon-green-dim);
  --success: var(--neon-green);
  --error: var(--neon-red);
  --bg: #0a0a0f;
  --bg-alt: #111118;
  --bg-panel: #16161f;
  --text: #e0e0e0;
  --text-light: #8b8b9a;
  --border: rgba(0, 255, 65, 0.25);
  --sidebar-width: 250px;
  --terminal-font: ui-monospace, 'JetBrains Mono', 'Fira Code', monospace;
  --danger: var(--neon-red);
  --warning: var(--neon-amber);
  --font-mono: var(--terminal-font);
}

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

body {
  font-family: var(--terminal-font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* Layout */
#sidebar-container {
  width: var(--sidebar-width);
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: fixed;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 100;
}

#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  width: 100%;
}

#main-content > * {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Header / Hamburger */
#mobile-header {
  display: none;
  padding: 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.75rem;
  transition: background 0.2s, border-color 0.2s;
}

.hamburger:hover {
  background: rgba(0, 255, 65, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

/* Sidebar Styles */
.sidebar-header-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.sidebar-header-link:hover .sidebar-header {
  background: rgba(0, 255, 65, 0.05);
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 1.1rem;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.progress-summary {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 255, 65, 0.15);
  border-radius: 3px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  box-shadow: 0 0 6px var(--success);
  transition: width 0.3s ease;
}

.sidebar-nav {
  padding: 1rem 0;
}

.chapter-title {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s, background 0.2s;
}

.chapter-title:hover {
  color: var(--primary);
  background: rgba(0, 255, 65, 0.05);
}

.chapter-toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  color: var(--text-light);
}

.chapter-title.expanded .chapter-toggle-icon {
  transform: rotate(90deg);
  color: var(--primary);
}

.chapter-modules {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.chapter-modules.collapsed {
  max-height: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem 0.5rem 2rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}

.nav-link:hover {
  background: rgba(0, 255, 65, 0.08);
}

.nav-link.active {
  background: rgba(0, 255, 65, 0.12);
  color: var(--primary);
  font-weight: 500;
  border-right: 3px solid var(--primary);
}

.nav-link.completed {
  background: rgba(0, 255, 65, 0.08);
  color: var(--success);
}

.nav-link.completed .status-icon.completed {
  color: var(--success);
  font-weight: 700;
}

.nav-link.disabled {
  color: var(--text-light);
  cursor: not-allowed;
  pointer-events: none;
}

.status-icon {
  margin-left: auto;
  font-size: 0.875rem;
}

.status-icon.completed {
  color: var(--success);
}

/* Content Styles */
dl { margin-bottom: 1.5rem; }

dt {
  font-weight: 700;
  color: var(--primary);
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

dt a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
  transition: color 0.2s, border-color 0.2s;
}

dt a:hover {
  color: var(--primary-hover);
  border-bottom: 1px solid var(--primary);
}

dd {
  margin-left: 0;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin: 1.5rem 0 1rem; }
p { margin-bottom: 1rem; }
pre {
  background: #0d0d12;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  overflow-x: auto;
  margin-bottom: 1rem;
  color: var(--text);
}
code {
  font-family: var(--terminal-font);
  font-size: 0.875em;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.btn:hover { background: var(--primary-hover); }
.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(0, 255, 65, 0.12); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.command-ordering-item:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.hamburger:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Exercises */
.exercise-container {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}
.exercise-title {
  font-weight: 600;
  margin-bottom: 1rem;
}
.exercise-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.exercise-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.exercise-input {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 100%;
  min-height: 200px;
  margin-bottom: 1rem;
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
  resize: vertical;
}
.exercise-feedback {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
  display: none;
}
.exercise-feedback.success {
  display: block;
  background: #dcfce7;
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.exercise-feedback.error {
  display: block;
  background: #fee2e2;
  color: var(--error);
  border: 1px solid #fecaca;
}

.command-ordering-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.command-ordering-item {
  padding: 0.5rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  color: var(--text);
}
.command-ordering-item:hover {
  background: rgba(0, 255, 65, 0.1);
  border-color: var(--primary);
}
.command-ordering-item.selected {
  background: rgba(0, 255, 65, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}
.command-ordering-item.misplaced {
  background: rgba(255, 65, 54, 0.15);
  border-color: var(--error);
  color: var(--error);
}
.command-ordering-sequence {
  margin-bottom: 1rem;
  font-family: ui-monospace, monospace;
}

/* Progress Controls */
.progress-controls {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}

/* Responsive */
@media (max-width: 960px) {
  #sidebar-container {
    transform: translateX(-100%);
  }
  #sidebar-container.open {
    transform: translateX(0);
  }
  #main-content {
    margin-left: 0;
    padding: 1rem;
  }
  #mobile-header {
    display: flex;
  }
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99;
  }
  .overlay.active {
    display: block;
  }
  body {
    flex-direction: column;
  }
}

/* === Gamification & Rebel Theme Extensions === */

/* Fun Fact — reward box after T4 completion */
.fun-fact {
  background: var(--bg-panel);
  border: 1px dashed var(--neon-amber);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  position: relative;
  box-shadow: 0 0 12px rgba(255, 176, 0, 0.08);
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.fun-fact.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fun-fact::before {
  content: "★";
  position: absolute;
  top: -0.6rem;
  left: 1rem;
  background: var(--bg);
  color: var(--neon-amber);
  font-size: 1rem;
  padding: 0 0.4rem;
  line-height: 1;
}

.fun-fact-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--neon-amber);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.2);
}

.fun-fact-body {
  color: var(--text);
  line-height: 1.6;
}

.fun-fact-body code {
  color: var(--primary);
  background: rgba(0, 255, 65, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* XP display in sidebar header */
.xp-display {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.level-badge {
  font-size: 0.875rem;
  color: var(--neon-green);
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

.xp-bar-container {
  height: 6px;
  background: rgba(0, 255, 65, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  background: var(--neon-green);
  border-radius: 3px;
  box-shadow: 0 0 6px var(--neon-green);
  transition: width 0.3s ease;
}

.xp-text {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  text-align: right;
}

/* Tier dots in sidebar */
.tier-dots {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--neon-green);
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

.tier-dot.completed {
  background: var(--neon-green);
  box-shadow: 0 0 4px var(--neon-green);
}

.tier-dot.active {
  background: rgba(0, 255, 65, 0.35);
}

.tier-dot.locked {
  border-color: var(--text-light);
  background: transparent;
  opacity: 0.35;
}

/* Exercise tier header */
.exercise-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.exercise-tier-header .tier-label {
  font-weight: 700;
  color: var(--neon-green);
  letter-spacing: 0.05em;
}

.exercise-tier-header .tier-xp {
  font-size: 0.875rem;
  color: var(--neon-amber);
}

/* Locked tier overlay */
.tier-locked-overlay {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-light);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.tier-locked-overlay .lock-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Hint button */
.hint-btn {
  background: var(--bg-alt);
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.hint-btn:hover:not(:disabled) {
  background: rgba(0, 255, 65, 0.08);
  border-color: var(--primary);
  color: var(--text);
}

.hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint-content {
  padding: 0.75rem;
  background: rgba(255, 176, 0, 0.1);
  border-left: 3px solid var(--neon-amber);
  border-radius: 4px;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Reveal button */
.reveal-btn {
  display: none;
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--text-light);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.reveal-btn:hover {
  background: rgba(139, 139, 154, 0.15);
}

/* Timer display */
.timer-display {
  font-family: var(--terminal-font);
  font-size: 1.5rem;
  color: var(--neon-green);
  margin-bottom: 1rem;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

.timer-display.timer-urgent {
  color: var(--neon-red);
  animation: pulse 1s infinite;
  text-shadow: 0 0 6px rgba(255, 65, 54, 0.5);
}

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

/* Broken YAML display */
.broken-yaml pre {
  background: #0d0d12;
  border-color: var(--neon-red);
  color: var(--text);
}

/* Achievement toast */
.achievement-toast {
  position: fixed;
  top: 20px;
  right: -320px;
  width: 280px;
  background: var(--bg-panel);
  border: 1px solid var(--neon-green);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.2);
  transition: right 0.35s ease;
  z-index: 1000;
}

.achievement-toast.show {
  right: 20px;
}

.achievement-toast.level-up {
  border-color: var(--neon-amber);
  box-shadow: 0 0 16px rgba(255, 176, 0, 0.2);
}

.toast-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.toast-title {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.toast-name {
  font-weight: 700;
  color: var(--neon-green);
  margin-bottom: 0.25rem;
}

.level-up .toast-name {
  color: var(--neon-amber);
}

.toast-desc {
  font-size: 0.875rem;
  color: var(--text);
}

/* Feedback theming */
.exercise-feedback {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
  display: none;
}

.exercise-feedback.success {
  display: block;
  background: rgba(0, 255, 65, 0.1);
  color: var(--neon-green);
  border: 1px solid rgba(0, 255, 65, 0.35);
}

.exercise-feedback.error {
  display: block;
  background: rgba(255, 65, 54, 0.1);
  color: var(--neon-red);
  border: 1px solid rgba(255, 65, 54, 0.35);
}

.exercise-feedback.info {
  display: block;
  background: rgba(255, 176, 0, 0.1);
  color: var(--neon-amber);
  border: 1px solid rgba(255, 176, 0, 0.35);
}

/* Homepage */
.hero-section {
  text-align: center;
  padding: 3rem 1rem 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 2.5rem;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.3);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.hero-cta {
  padding: 0.75rem 2rem;
  font-size: 1.125rem;
  text-decoration: none;
  display: inline-block;
}

.section-title {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.course-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.course-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.course-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.course-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.course-card h3 {
  font-size: 1.125rem;
  color: var(--primary);
  margin: 0;
}

.course-card p {
  font-size: 0.9375rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.course-card-link {
  color: var(--neon-amber);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.course-card-link:hover {
  color: var(--primary);
}

.getting-started {
  margin-bottom: 2rem;
}

/* === Dashboard === */
.dashboard-section {
  margin-bottom: 2.5rem;
}

.dashboard-section h2 {
  font-size: 1.25rem;
  color: var(--neon-amber);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.dashboard-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

/* XP Card */
.xp-card {
  max-width: 600px;
}

.xp-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.level-badge-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.level-title {
  font-size: 1.125rem;
  color: var(--text);
  font-weight: 600;
}

.xp-bar-container-large {
  height: 10px;
  background: rgba(0, 255, 65, 0.15);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.xp-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Module Cards */
.module-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.module-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.15);
  transform: translateY(-2px);
}

.module-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.tier-dots-large {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tier-dots-large .tier-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--neon-green);
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

.tier-dots-large .tier-dot.completed {
  background: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green);
}

.tier-dots-large .tier-dot.active {
  background: rgba(0, 255, 65, 0.35);
  border-color: var(--neon-amber);
}

.tier-dots-large .tier-dot.locked {
  border-color: var(--text-light);
  background: transparent;
  opacity: 0.35;
}

/* Achievement Shelf */
.achievement-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.achievement-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.achievement-card.unlocked {
  border-color: var(--neon-green);
}

.achievement-card.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.12);
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(100%);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.achievement-name {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.achievement-desc {
  font-size: 0.8125rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* Streak Calendar */
.streak-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 480px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s, background 0.2s;
}

.calendar-day.active {
  border-color: var(--neon-green);
  background: rgba(0, 255, 65, 0.12);
  color: var(--neon-green);
  font-weight: 600;
}

/* Weak Point Radar */
.radar-container {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.radar-empty {
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  padding: 2rem 1rem;
}

.radar-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.radar-bar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.radar-bar-label {
  width: 120px;
  font-size: 0.875rem;
  color: var(--text);
  text-transform: capitalize;
  flex-shrink: 0;
}

.radar-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 255, 65, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.radar-bar-fill {
  height: 100%;
  background: var(--neon-red);
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(255, 65, 54, 0.4);
  transition: width 0.4s ease;
}

.radar-bar-value {
  width: 48px;
  font-size: 0.875rem;
  color: var(--neon-red);
  text-align: right;
  flex-shrink: 0;
}

/* Sim History Table */
.sim-history-table {
  overflow-x: auto;
}

.sim-empty {
  color: var(--text-light);
  font-style: italic;
  text-align: center;
  padding: 2rem 1rem;
}

.sim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.sim-table th,
.sim-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.sim-table th {
  color: var(--neon-amber);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.sim-table td {
  color: var(--text);
}

.sim-table tr:hover td {
  background: rgba(0, 255, 65, 0.05);
}

/* === Ambush Run === */
.sim-view {
  display: none;
}

.sim-view.active {
  display: block;
}

.sim-container {
  padding: 1rem 0;
}

.sim-intro {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.sim-settings {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 420px;
  padding: 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sim-settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.sim-settings select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  min-width: 160px;
  font-family: var(--font-mono);
}

.sim-run {
  padding: 0.5rem 0;
}

.sim-hud {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sim-timer {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
  font-family: var(--font-mono);
}

.sim-timer.urgent {
  color: var(--danger);
  animation: pulse 1s infinite;
}

.sim-lives {
  font-size: 1.25rem;
  letter-spacing: 0.1em;
}

.sim-life {
  color: var(--danger);
  filter: drop-shadow(0 0 4px rgba(255, 65, 65, 0.4));
}

.sim-life.lost {
  opacity: 0.25;
  filter: grayscale(100%);
}

.sim-combo {
  font-size: 0.95rem;
  color: var(--warning);
  font-weight: 600;
}

.sim-counter {
  font-size: 0.95rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  margin-left: auto;
}

.sim-question-timer {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.sim-question {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.sim-question-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.sim-question-desc {
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.sim-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sim-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sim-option:hover {
  background: rgba(0, 255, 65, 0.05);
  border-color: var(--primary);
}

.sim-option input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--primary);
}

.sim-placeholder,
.sim-broken-yaml {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.sim-input,
.sim-textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.sim-input:focus,
.sim-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.15);
}

.sim-ordering-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sim-ordering-item {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.sim-ordering-item:hover {
  background: rgba(0, 255, 65, 0.05);
  border-color: var(--primary);
}

.sim-ordering-item.selected {
  background: rgba(0, 255, 65, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

.sim-ordering-sequence {
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  min-height: 1.5em;
}

.sim-actions {
  display: flex;
  gap: 1rem;
}

.sim-results {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
}

.sim-results h2 {
  margin-top: 0;
  color: var(--primary);
}

.sim-result-reason {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

.sim-result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-light);
}

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

.sim-result-row strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.sim-casualty {
  margin-top: 1.5rem;
  color: var(--danger);
}

.sim-casualty h3 {
  margin-top: 0;
  color: var(--danger);
}

.sim-casualty ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.sim-result-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.sim-review {
  margin-top: 1.5rem;
}

.sim-review-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-review-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
}

.sim-review-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.sim-review-desc {
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.sim-review-answer {
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.sim-btn {
  margin-top: 1rem;
}

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