@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700;800&display=swap');


:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-border: #e2e8f0;
  --surface-hover: #f1f5f9;
  
  /* Primary blue and secondary dark */
  --primary: #0d6efd;
  --primary-glow: rgba(13, 110, 253, 0.2);
  --primary-dark: #0b5ed7;
  
  --accent: #dc3545;
  --accent-glow: rgba(220, 53, 69, 0.2);
  
  --accent-2: #198754;
  --accent-2-glow: rgba(25, 135, 84, 0.2);
  
  --text: #0f172a;
  --text-muted: #64748b;
  
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --font-sans: "Inter", system-ui, sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-border);
  border-radius: 6px;
  
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Typography & Layout Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-muted);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text);
  border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
  border-color: var(--surface-border);
  background-color: var(--surface-hover);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.tag {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
  background: #f1f5f9;
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}

.tag-primary {
  color: var(--primary);
  background: rgba(13, 110, 253, 0.07);
  border-color: rgba(13, 110, 253, 0.2);
}

.tag-accent {
  color: var(--accent);
  background: rgba(220, 53, 69, 0.07);
  border-color: rgba(220, 53, 69, 0.2);
}

.tag-accent-2 {
  color: var(--accent-2);
  background: rgba(25, 135, 84, 0.07);
  border-color: rgba(25, 135, 84, 0.2);
}

/* Background Particles Canvas */
#particles-canvas {
  display: none !important;
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

/* Scanline Effect overlay */
.scanlines {
  display: none !important;
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 1000;
  border-bottom: 1px solid var(--surface-border);
  background: #ffffff;
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--surface-border);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.05em;
  
}

.logo span {
  color: var(--primary);
  
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a:not(.btn) {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a:not(.btn):hover, .nav-links a:not(.btn).active {
  color: var(--primary);
}

.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--primary);
  transition: width var(--transition-fast);
  
}

.nav-links a:not(.btn):hover::after, .nav-links a:not(.btn).active::after {
  width: 100%;
}

.xp-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border: 1px solid var(--surface-border);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.xp-indicator span.label {
  color: var(--text-muted);
}

.xp-indicator span.value {
  color: var(--primary);
  font-weight: 700;

}

/* ====== Navbar widget group: divider + agent/streak/lives/actions ====== */
.navbar-divider {
  width: 1px;
  height: 26px;
  background: var(--surface-border);
  flex-shrink: 0;
}

.agent-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.agent-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.35;
}

.agent-name {
  color: var(--primary);
  white-space: nowrap;
  text-decoration: none;
  font-weight: 700;
}

.agent-name:hover {
  text-decoration: underline;
}

.agent-name #widget-username {
  font-weight: 800;
}

.agent-rank {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.lives-widget {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  background: rgba(220, 53, 69, 0.08);
  border: 1px solid rgba(220, 53, 69, 0.25);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
}

.lives-widget:hover {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.4);
}

.lives-widget .lives-heart {
  font-size: 0.8rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nav-action {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-nav-logout {
  border-color: rgba(220, 53, 69, 0.3);
  color: var(--accent);
}

.xp-progress-mini {
  width: 60px;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  
  overflow: hidden;
}

.xp-progress-mini-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sections General */
section {
  padding: 80px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px auto;
}

.section-subtitle {
  font-family: var(--font-mono);
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  display: block;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

/* Hero Section */
.hero {
  padding-top: 140px;
  padding-bottom: 80px;
  min-height: 90vh;
  display: flex;
  align-items: center;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13, 110, 253, 0.07);
  border: 1px solid rgba(13, 110, 253, 0.2);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.hero-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title span {
  display: block;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, #00b4d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.hero-desc {
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 540px;
}

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

/* Hero Visual Console */
.hero-visual {
  position: relative;
}

.console-mockup {
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.console-mockup:hover {
  border-color: rgba(0, 245, 160, 0.3);
}

.console-header {
  height: 38px;
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--surface-border);
  justify-content: space-between;
}

.console-dots {
  display: flex;
  gap: 0.4rem;
}

.console-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.console-dot.red { background-color: #ff5f56; }
.console-dot.yellow { background-color: #ffbd2e; }
.console-dot.green { background-color: #27c93f; }

.console-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.console-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--primary);
}

.console-body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

.console-line {
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(5px);
  animation: slideUpFade 0.3s forwards;
}

.console-line.success { color: var(--accent-2); }
.console-line.error { color: var(--accent); }
.console-line.warning { color: #d97706; }
.console-line.info { color: #2563eb; }
.console-line.input { color: var(--text); }

.console-line.delay-1 { animation-delay: 0.4s; }
.console-line.delay-2 { animation-delay: 1.2s; }
.console-line.delay-3 { animation-delay: 2.2s; }
.console-line.delay-4 { animation-delay: 3.2s; }
.console-line.delay-5 { animation-delay: 4.5s; }

/* Stats Strip */
.stats-strip {
  background: #f8f9fa;
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  padding: 2.5rem 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, var(--text) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* How It Works Section */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  padding: 2.5rem 2rem;
  position: relative;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.step-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 245, 160, 0.25);
  
}

.step-card:hover::before {
  opacity: 1;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(0, 0, 0, 0.04);
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  transition: color var(--transition-normal);
}

.step-card:hover .step-num {
  color: rgba(13, 110, 253, 0.08);
}

.step-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  
  background: transparent;
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-size: 1.25rem;
  transition: all var(--transition-normal);
}

.step-card:hover .step-icon-wrapper {
  color: var(--text-dark);
  background: var(--primary);
  
  border-color: var(--primary);
}

.step-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.step-desc {
  font-size: 0.9rem;
}

/* Roadmap/Progression Section */
.roadmap {
  background: #ffffff;
}

.roadmap-container {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.roadmap-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Roadmap SVG Tree */
.roadmap-tree-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  min-height: 480px;
}

.roadmap-svg-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.roadmap-node {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 150px;
}

.node-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  
  transition: all var(--transition-normal);
  position: relative;
}

.node-label {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition-normal);
  background: #f1f5f9;
  border: 1px solid var(--surface-border);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Node States */
.roadmap-node.completed .node-circle {
  border-color: var(--primary);
  color: var(--text-dark);
  background: var(--primary);
  
}

.roadmap-node.completed .node-label {
  color: var(--primary);
}

.roadmap-node.active .node-circle {
  border-color: var(--accent-2);
  color: var(--text);
  background: rgba(123, 47, 255, 0.2);
  
  animation: nodePulse 2.5s infinite;
}

.roadmap-node.active .node-label {
  color: var(--accent-2);
  
}

.roadmap-node.locked {
  cursor: not-allowed;
}

.roadmap-node.locked .node-circle {
  opacity: 0.5;
}

.roadmap-node:hover:not(.locked) .node-circle {
  transform: scale(1.1);
}

.roadmap-node.active:hover .node-circle {
  background: var(--accent-2);
  color: var(--text-dark);
}

.node-details-card {
  margin-top: 30px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  padding: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(15px);
  transition: all var(--transition-normal);
  display: none;
}

.node-details-card.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.node-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 0.5rem;
}

.node-details-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text);
}

.node-details-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.node-details-footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.node-details-xp {
  color: var(--primary);
}

/* Day Accordions Section */
.curriculum-days {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.day-accordion {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  overflow: hidden;
  transition: all var(--transition-normal);
}

.day-accordion.active {
  border-color: rgba(123, 47, 255, 0.4);
  
}

.day-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: var(--surface);
  transition: background var(--transition-fast);
}

.day-header:hover {
  background: var(--surface-hover);
}

.day-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.day-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  
  min-width: 80px;
  text-align: center;
}

.day-badge.d1 { background: rgba(220, 53, 69, 0.07); border: 1px solid rgba(220, 53, 69, 0.3); color: var(--accent); }
.day-badge.d2 { background: rgba(13, 110, 253, 0.07); border: 1px solid rgba(13, 110, 253, 0.3); color: var(--primary); }
.day-badge.d3 { background: rgba(25, 135, 84, 0.07); border: 1px solid rgba(25, 135, 84, 0.3); color: var(--accent-2); }
.day-badge.d4 { background: rgba(13, 110, 253, 0.07); border: 1px solid rgba(13, 110, 253, 0.3); color: var(--primary); }
.day-badge.d5 { background: rgba(123, 47, 255, 0.07); border: 1px solid rgba(123, 47, 255, 0.3); color: #7b2fff; }

.day-title-info h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.day-title-info p {
  font-size: 0.8rem;
}

.day-header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.day-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.day-chevron {
  font-size: 0.8rem;
  transition: transform var(--transition-normal);
  color: var(--text-muted);
}

.day-accordion.active .day-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.day-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out;
  border-top: 0 solid var(--surface-border);
}

.day-accordion.active .day-content {
  max-height: 800px; /* high enough limit */
  border-top-width: 1px;
}

.day-content-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--surface);
}

.module-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 6px;
  
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: all var(--transition-fast);
}

.module-row:hover {
  border-color: var(--surface-border);
  background: var(--surface-hover);
}

.module-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.module-type-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.module-type-icon.theory { background: rgba(13, 110, 253, 0.07); color: var(--primary); border: 1px solid rgba(13, 110, 253, 0.2); }
.module-type-icon.lab { background: rgba(25, 135, 84, 0.07); color: var(--accent-2); border: 1px solid rgba(25, 135, 84, 0.2); }
.module-type-icon.ctf { background: rgba(220, 53, 69, 0.07); color: var(--accent); border: 1px solid rgba(220, 53, 69, 0.2); }

.module-details h4 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  font-family: var(--font-sans);
}

.module-details p {
  font-size: 0.75rem;
}

.module-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

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

.module-xp {
  color: var(--primary);
  font-weight: 700;
}

/* Simulator Section */
.simulator {
  background: #ffffff;
}

.simulator-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
}

.sim-info h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.sim-info p {
  margin-bottom: 1.5rem;
}

.attack-templates {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.template-btn {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: left;
}

.template-btn span.tag {
  margin-right: 0.5rem;
}

.template-btn:hover {
  border-color: var(--primary);
  color: var(--text);
  background: var(--surface-hover);
  transform: translateX(4px);
}

.template-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(13, 110, 253, 0.05);
}

/* Interactive Simulator Terminal */
.sim-terminal {
  display: flex;
  flex-direction: column;
  height: 480px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.terminal-header {
  height: 40px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--surface-border);
  justify-content: space-between;
}

.terminal-tabs {
  display: flex;
  gap: 0.5rem;
}

.terminal-tab {
  padding: 0.25rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
}

.terminal-tab.active {
  color: var(--primary);
  background: #ffffff;
  border-color: var(--surface-border);
}

.terminal-content {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--surface-border);
  padding: 0.75rem 1rem;
  background: #f8f9fa;
}

.terminal-prompt {
  color: #2563eb;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.terminal-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
}

.terminal-send-btn {
  background: transparent;
  border: none;
  color: #2563eb;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.terminal-send-btn:hover {
  color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

.fade-in {
  animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-out {
  animation: fadeOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Comparison Section */
.comparison-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  overflow: hidden;
  
  max-width: 900px;
  margin: 0 auto;
}

table.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th, .comparison-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
}

.comparison-table th {
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-table th:first-child, .comparison-table td:first-child {
  font-weight: 600;
  color: var(--text);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table td.highlight {
  background: rgba(0, 245, 160, 0.02);
  color: var(--primary);
  font-weight: 600;
}

.comparison-table td .check-icon {
  color: var(--primary);
  font-weight: 700;
}

.comparison-table td .cross-icon {
  color: var(--accent);
  font-weight: 700;
}

/* FAQ Section */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  overflow: hidden;
}

.faq-question {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: #f8f9fa;
  transition: background var(--transition-fast);
}

.faq-question:hover {
  background: var(--surface-hover);
}

.faq-question h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
}

.faq-chevron {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out;
}

.faq-item.active .faq-answer {
  max-height: 200px;
  border-top: 1px solid var(--surface-border);
}

.faq-answer p {
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
}

/* Call To Action */
.cta-section {
  text-align: center;
  padding: 100px 0;
}

.cta-box {
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 4.5rem 2rem;
  position: relative;
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}

.cta-box::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 30%;
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.cta-box h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-box p {
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
  font-size: 1.1rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--surface-border);
  background: #f8f9fa;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  width: 100%;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem 0;
  flex-wrap: wrap;
}

.footer-col-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-col-brand .logo {
  font-size: 0.9rem;
}

.footer-col-brand p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-col {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.footer-col h4 { display: none; }

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
}

.footer-links a {
  transition: color var(--transition-fast);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: none;
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Animations & Keyframes */
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1;  }
  100% { transform: scale(0.9); opacity: 0.5; }
}

@keyframes nodePulse {
  0% {  }
  50% {  }
  100% {  }
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Reveal (for JS interaction) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive styles */
@media (max-width: 992px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-content {
    align-items: center;
    text-align: center;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .how-it-works-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
  .simulator-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}


@media (max-width: 768px) {
  .hero-title {
    font-size: 2.75rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .roadmap-container {
    padding: 2rem 1rem;
  }
  .nav-links {
    display: none; /* simple mobile nav */
  }
  .footer-grid {
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem 0;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Lab View Styles */
.lab-split-pane {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: stretch;
}

.lab-instructions-panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.markdown-body h3 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 0.25rem;
}

.markdown-body h3:first-of-type {
  margin-top: 0;
}

.markdown-body p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: #f1f5f9;
  border: 1px solid var(--surface-border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--primary);
}

.markdown-body pre {
  background: #f1f3f5;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.markdown-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
}

.markdown-body ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.markdown-body li {
  margin-bottom: 0.25rem;
}

.error-shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
  border-color: var(--accent) !important;
  
}

/* Roadmap Selected Node Node Glow */
.roadmap-node.selected-node .node-circle {
  border-color: var(--primary);
  color: var(--primary);
  
  transform: scale(1.15);
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@media (max-width: 992px) {
  .lab-split-pane {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Quiz panel styles */
.lab-quiz-panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  
  
}

.quiz-question-text {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
}

.quiz-option:hover {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(13, 110, 253, 0.04);
}

.quiz-option input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
}

.quiz-option.selected {
  border-color: var(--primary);
  background: rgba(13, 110, 253, 0.05);
  color: var(--text);
}

/* Auth Styles */
#auth-username:focus, #auth-password:focus {
  border-color: var(--primary) !important;
  
}

#auth-tab-login:hover, #auth-tab-register:hover {
  color: var(--text) !important;
}


.challenge-item {
  background: #f8f9fa !important;
  border: 1px solid var(--surface-border) !important;
}

/* --- ART ACADEMY IMMERSIVE FORMAT STYLES --- */

/* Hook Screen */
.hook-screen {
  background-color: #ffffff;
  color: var(--text);
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  border-radius: 12px;
  border: 1px solid rgba(13, 110, 253, 0.3);
  box-shadow: 0 0 40px rgba(13, 110, 253, 0.1);
}

.hook-screen h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hook-screen p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

/* Story/Narrative */
.story-container {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  padding: 2.5rem 3rem;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.story-text {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.story-text p {
  margin-bottom: 1.4rem;
  line-height: 1.85;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.story-text strong {
  color: var(--text-dark);
}

.story-text em {
  color: var(--text);
}

.markdown-body p {
  margin-bottom: 1.3rem;
  line-height: 1.8;
}

.markdown-body p:last-child {
  margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.3rem;
}

.markdown-body li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.story-text.quote {
  font-style: italic;
  color: var(--text-muted);
  border-left: 3px solid var(--surface-border);
  padding-left: 1.5rem;
  margin-left: 1rem;
}

/* Lab Chat Interface */
.lab-chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.lab-objective-box {
  background: rgba(13, 110, 253, 0.05);
  border-bottom: 1px solid var(--surface-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lab-objective-box i {
  color: var(--primary);
  font-size: 1.5rem;
}

.lab-objective-text {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.lab-chat-messages {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
}

.chat-message {
  max-width: 80%;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: slideUpFade 0.3s forwards;
}

.chat-message.system {
  align-self: center;
  background: #e2e8f0;
  color: #475569;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.chat-message.agent {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  color: var(--text);
  border-bottom-left-radius: 0;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 0;
}

.chat-message.error {
  align-self: flex-start;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.lab-chat-controls {
  padding: 1rem;
  background: #ffffff;
  border-top: 1px solid var(--surface-border);
}

.variant-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.variant-btn {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
  color: var(--text);
}

.variant-btn:hover {
  border-color: var(--primary);
  background: rgba(13, 110, 253, 0.05);
  transform: translateY(-2px);
}

.variant-btn-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--primary);
  display: block;
}

.variant-btn-desc {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Flag Capture */
.flag-capture-container {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.flag-capture-container h3 {
  color: #f8fafc;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.flag-capture-container p {
  color: #94a3b8;
  margin-bottom: 2rem;
}

.flag-input-group {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  gap: 0.5rem;
}

.flag-input {
  flex-grow: 1;
  background: #1e293b;
  border: 1px solid #475569;
  padding: 1rem;
  border-radius: 6px;
  color: #22c55e;
  font-family: var(--font-mono);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.flag-input:focus {
  border-color: #22c55e;
}

.flag-submit {
  background: #22c55e;
  color: #ffffff;
  border: none;
  padding: 0 1.5rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.flag-submit:hover {
  background: #16a34a;
}

.flag-captured-anim {
  animation: flagSuccess 1s ease-out forwards;
}

@keyframes flagSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(34, 197, 94, 0.4); border-color: #22c55e; }
  100% { transform: scale(1); box-shadow: 0 0 20px rgba(34, 197, 94, 0.2); border-color: #22c55e; }
}

/* ====== NEW COMPONENTS (Mod 0-2 Redesign) ====== */

/* Interactive Flip Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.flip-card {
  background-color: transparent;
  height: 250px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid var(--surface-border);
}

.flip-card-front {
  background-color: #ffffff;
  color: var(--text);
}

.flip-card-front i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.flip-card-front h4 {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  margin: 0;
}

.flip-card-back {
  background-color: var(--surface-hover);
  color: var(--text);
  transform: rotateY(180deg);
  border-color: var(--primary);
  overflow-y: auto;
}

.flip-card-back p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

/* Conversation Demo */
.conversation-demo {
  background-color: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  overflow: hidden;
  margin: 2rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.conversation-demo-sys {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-demo-sys-badge {
  background-color: #e2e8f0;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.conversation-demo-sys-text {
  color: #334155;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.conversation-demo-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
}

.convo-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  position: relative;
}

.convo-msg.user {
  align-self: flex-end;
  background-color: var(--primary);
  color: white;
  border-radius: 12px 12px 0 12px;
}

.convo-msg.assistant {
  align-self: flex-start;
  background-color: #f1f5f9;
  color: #1e293b;
  border-radius: 12px 12px 12px 0;
}

.convo-msg.assistant .agent-name {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.convo-msg.assistant.error {
  background-color: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
}


/* ====== OPTIMIZACIONES DE LECTURA (GRANDES MONITORES) ====== */
/* Limitar el ancho de las líneas de texto (70-80 caracteres es el estándar ergonómico) */
p, .markdown-body p, .story-text, .lab-instructions-panel p, .node-details-desc {
  max-width: 80ch;
}

/* Reducir fatiga visual en los laboratorios aumentando ligeramente el tamaño y el espaciado de línea */
.markdown-body {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Espaciado entre párrafos dentro de los pasos de lección */
#lab-step-content p,
#lab-step-content li,
.lab-step-content p,
.lab-step-content li {
  line-height: 1.75;
  margin-bottom: 1.2rem;
  font-size: 1rem;
  color: var(--text);
}

#lab-step-content p:last-child,
.lab-step-content p:last-child {
  margin-bottom: 0;
}

/* Separación visual entre secciones de contenido dentro de un paso */
#lab-step-content hr,
.lab-step-content hr {
  border: none;
  border-top: 1px solid var(--surface-border);
  margin: 2rem 0;
}

/* Encabezados dentro del contenido de lección */
#lab-step-content h3,
#lab-step-content h4,
.lab-step-content h3,
.lab-step-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

/* Bloques <strong> destacados como mini-titulos */
#lab-step-content strong,
.lab-step-content strong {
  color: var(--text-dark);
}

/* Espaciado de párrafos en todos los paneles de lección */
.lab-instructions-panel p {
  margin-bottom: 1.3rem;
  line-height: 1.8;
  color: var(--text);
}

.lab-instructions-panel p:last-child {
  margin-bottom: 0;
}

.lab-instructions-panel ul,
.lab-instructions-panel ol {
  padding-left: 1.5rem;
  margin-bottom: 1.3rem;
}

.lab-instructions-panel li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

.lab-instructions-panel hr {
  border: none;
  border-top: 1px solid var(--surface-border);
  margin: 2rem 0;
}

/* Evitar que el panel central de los laboratorios se estire de lado a lado en monitores grandes */
#lab-step-content {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ====== DASHBOARD LAYOUT (CENTERED MAIN CONTENT) ====== */
.dashboard-main-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  padding-top: 100px;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.dashboard-spacer-left {
  display: none;
}

#dashboard-view {
  flex: 1;
  min-width: 0;
  width: 100%;
}

#gamification-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}

@media (max-width: 1400px) {
  .dashboard-spacer-left {
    display: none;
  }
}

@media (max-width: 768px) {
  .dashboard-main-layout {
    flex-direction: column;
  }
  #gamification-sidebar {
    width: 100%;
    position: static;
  }
}

/* ====== BLOQUE 2: ANIMACION DE XP GANADO ====== */
.xp-float-badge {
  position: absolute;
  z-index: 9999;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: #198754;
  text-shadow: 0 0 10px rgba(25, 135, 84, 0.4);
  pointer-events: none;
  animation: xp-float 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  white-space: nowrap;
}

@keyframes xp-float {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  30% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(0.8);
  }
}

@keyframes xp-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--accent-2); }
}
.xp-indicator.pulse { animation: xp-pulse 0.4s ease; }

/* ====== BLOQUE 3: STREAK VISIBLE Y PROMINENTE ====== */
.streak-widget {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(253, 126, 20, 0.08);
  border: 1px solid rgba(253, 126, 20, 0.25);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: default;
  transition: all 0.2s;
}
.streak-widget:hover {
  background: rgba(253, 126, 20, 0.15);
  border-color: rgba(253, 126, 20, 0.4);
}
.streak-fire { font-size: 1rem; }
.streak-count {
  font-weight: 800;
  color: #fd7e14;
  font-size: 0.95rem;
}
.streak-label { color: var(--text-muted); font-size: 0.7rem; }
.streak-widget.streak-zero { opacity: 0.4; }

/* ====== BLOQUE 4: PANTALLA DE RESUMEN AL TERMINAR LECCION ====== */
.lesson-complete-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: none; /* Controlled by JS */
  align-items: center;
  justify-content: center;
  animation: fade-in 0.3s ease;
}

.lesson-complete-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 40px 80px rgba(0,0,0,0.2);
  animation: slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lc-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.lc-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.lc-lesson-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary);
  margin-bottom: 2rem;
}

.lc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--surface-hover);
  border-radius: 10px;
  border: 1px solid var(--surface-border);
}

.lc-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.lc-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.lc-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.75rem;
  background: rgba(25, 135, 84, 0.06);
  border: 1px solid rgba(25, 135, 84, 0.15);
  border-radius: 6px;
  font-family: var(--font-mono);
}

/* ====== BLOQUE 5: INDICADOR DE TIEMPO ESTIMADO ====== */
.lab-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface-hover);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
  margin-right: 0.5rem;
  display: inline-block;
}

/* ====== BLOQUE 8.2: CONTROL DE ACCESO PREMIUM ====== */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none; /* Controlled by JS */
  align-items: center;
  justify-content: center;
  animation: fade-in 0.3s ease;
}

.paywall-card {
  background: #0f172a;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(251, 191, 36, 0.1);
  color: #f8fafc;
  position: relative;
  animation: slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.paywall-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}
.paywall-close:hover {
  color: #f8fafc;
}

.paywall-crown {
  font-size: 3.5rem;
  color: #fbbf24;
  margin-bottom: 1rem;
  animation: crown-pulse 2s infinite ease-in-out;
}

@keyframes crown-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.2)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.6)); }
}

.paywall-title {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fbbf24;
  letter-spacing: -0.025em;
}

.paywall-subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.paywall-benefits {
  text-align: left;
  margin-bottom: 2.5rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 1.5rem;
}

.paywall-benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}
.paywall-benefit-item:last-child {
  margin-bottom: 0;
}
.paywall-benefit-item i {
  color: #fbbf24;
  margin-top: 0.2rem;
}

.paywall-btn-buy {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  font-weight: 800;
  font-family: var(--font-mono);
  border: none;
  padding: 1rem;
  border-radius: 8px;
  width: 100%;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.paywall-btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
}

/* ====== BLOQUE 7: MODO EXAMEN ====== */
.exam-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-left: 4px solid var(--accent);
  transition: all var(--transition-fast);
  margin-top: 1rem;
}

.exam-row:hover {
  background: var(--surface-hover);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.05);
}

.exam-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.exam-card {
  background: #090d16;
  border: 2px solid var(--accent);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  padding: 2.5rem;
  box-shadow: 0 0 50px rgba(220, 53, 69, 0.3);
  position: relative;
  animation: scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.exam-timer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.exam-timer {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.exam-timer.urgent {
  color: #ef4444;
  animation: urgent-pulse 1s infinite alternate;
}

@keyframes urgent-pulse {
  0% { transform: scale(1); text-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.1); text-shadow: 0 0 20px rgba(239, 68, 68, 1); }
}

.exam-progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.exam-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
}

.exam-question {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.exam-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exam-option-btn {
  text-align: left;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.exam-option-btn:hover {
  background: rgba(220, 53, 69, 0.05);
  border-color: rgba(220, 53, 69, 0.3);
  color: #ffffff;
}

.exam-option-btn.selected {
  background: rgba(220, 53, 69, 0.15);
  border-color: var(--accent);
  color: #ffffff;
}







/* ============================================================
   MOBILE RESPONSIVE — Android / small screens
   Breakpoints: 768px (tablet), 480px (phone)
   ============================================================ */

/* ── Navbar general ── */
@media (max-width: 768px) {
  .navbar {
    height: auto;
    min-height: 56px;
    padding: 0.5rem 0;
  }
  .navbar .container {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem;
  }
  .logo {
    font-size: 1rem;
  }
  .nav-links {
    display: none;
  }
  /* Auth page buttons in navbar */
  .navbar .btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.9rem;
  }
}

/* ── index.html hero ── */
@media (max-width: 768px) {
  .hero {
    padding-top: 100px;
    padding-bottom: 60px;
    min-height: unset;
  }
  .hero .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-content {
    align-items: center;
    text-align: center;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-desc {
    font-size: 0.95rem;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.75rem;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  /* hide terminal mockup on very small screens */
  .hero-visual {
    display: none;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .section-title {
    font-size: 1.6rem;
  }
  section {
    padding: 50px 0;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.7rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ── auth.html ── */
@media (max-width: 480px) {
  .auth-card,
  .console-mockup {
    padding: 1.5rem 1.2rem;
    margin: 0 0.5rem;
  }
}

/* ── Dashboard layout ── */
@media (max-width: 900px) {
  .dashboard-main-layout {
    flex-direction: column;
    padding-top: 80px;
    padding-left: 1rem;
    padding-right: 1rem;
    gap: 1.5rem;
  }
  #gamification-sidebar {
    width: 100%;
    position: static;
    top: unset;
  }
  #dashboard-view {
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Dashboard tab buttons */
  .dashboard-tabs {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .dashboard-tab-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }
  /* Module cards */
  .module-card {
    padding: 1rem;
  }
  /* Leaderboard table */
  .leaderboard-table td,
  .leaderboard-table th {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* ── lab.html navbar — many widgets in a row ── */
@media (max-width: 768px) {
  /* Wrap the right side of the lab navbar — padding-top managed by fitLabPadding() JS */
  .navbar .container > div:last-child {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
  }
  /* Hide "TU PROGRESO" label, keep value */
  .xp-indicator .label {
    display: none;
  }
  .xp-indicator {
    padding: 0.3rem 0.5rem;
  }
  /* Shrink streak widget */
  .streak-widget {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  .streak-label {
    display: none;
  }
  /* Shrink lives widget */
  #user-lives {
    padding: 0.25rem 0.45rem !important;
    font-size: 0.8rem !important;
  }
  /* "Volver al Dashboard" — icon only on mobile */
  .navbar a.btn-secondary span,
  .navbar .btn-secondary span {
    display: none;
  }
  #user-profile-widget {
    gap: 0.5rem !important;
  }
  /* Hide agent username on very small screens */
  #user-profile-widget > span:first-child {
    display: none;
  }
}

@media (max-width: 480px) {
  /* padding-top managed by fitLabPadding() JS */
  .navbar a.btn-secondary { min-width: 44px; min-height: 44px; padding: 0.5rem; }
  .navbar {
    height: auto;
    min-height: 50px;
  }
  .navbar .container {
    padding: 0.4rem 0.75rem;
  }
  .logo {
    font-size: 0.9rem;
  }
}

/* ── Lives panel — reposition on mobile ── */
@media (max-width: 768px) {
  #lives-timer-panel {
    right: 0.5rem !important;
    top: 110px !important;
    width: calc(100vw - 1rem) !important;
    max-width: 320px !important;
  }
}

/* ── Lab step content ── */
@media (max-width: 768px) {
  .lab-split-pane {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .lab-instructions-panel {
    padding: 1.25rem;
    min-height: unset;
  }
  #lab-step-content {
    max-width: 100%;
  }
  .lab-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  #lab-title {
    font-size: 1.3rem !important;
  }
  /* Step indicators */
  #lab-step-indicator {
    flex-wrap: wrap;
  }
  /* Navigation buttons */
  .lab-nav-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .lab-nav-row .btn {
    width: 100%;
    justify-content: center;
  }
  /* Quiz options */
  .quiz-option {
    font-size: 0.88rem;
    padding: 0.7rem 0.85rem;
  }
  /* Terminal mockup */
  .console-mockup pre,
  .terminal-output {
    font-size: 0.72rem;
    padding: 0.75rem;
  }
  /* Scenario buttons */
  #scenario-decisions button {
    font-size: 0.85rem;
    padding: 0.7rem 1rem;
  }
  /* Cards grid */
  .cards-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  #lab-container {
    /* padding-top managed by fitLabPadding() JS */
    padding-bottom: 40px;
  }
  .lab-instructions-panel {
    padding: 1rem;
  }
  #lab-title {
    font-size: 1.1rem !important;
  }
  .btn {
    font-size: 0.85rem;
    padding: 0.55rem 1rem;
  }
}

/* ── Modals and overlays ── */
@media (max-width: 480px) {
  .lesson-complete-card {
    padding: 1.75rem 1.25rem;
    border-radius: 12px;
  }
  .lc-title {
    font-size: 1.2rem;
  }
  .lc-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 1rem;
  }
  .lc-stat-value {
    font-size: 1.1rem;
  }
  .paywall-card {
    padding: 2rem 1.25rem;
  }
  .paywall-title {
    font-size: 1.3rem;
  }
  .exam-card {
    padding: 1.5rem 1.1rem;
  }
  .exam-question {
    font-size: 0.95rem;
  }
  /* No-lives overlay */
  #no-lives-overlay .console-mockup {
    padding: 1.75rem 1.25rem;
  }
}

/* ── Roadmap ── */
@media (max-width: 768px) {
  .roadmap-container {
    padding: 1.5rem 0.5rem;
    overflow-x: auto;
  }
  .roadmap-track {
    min-width: 600px;
  }
  .node-circle {
    width: 48px !important;
    height: 48px !important;
    font-size: 0.8rem !important;
  }
  .node-label {
    font-size: 0.65rem;
  }
}

/* ── Footer ── */
@media (max-width: 768px) {
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0;
  }
  .footer-links {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .footer-copyright {
    font-size: 0.7rem;
  }
}

/* ── General touch/readability improvements ── */
@media (max-width: 768px) {
  /* Larger tap targets */
  .btn {
    min-height: 44px;
  }
  input, textarea, select {
    font-size: 16px !important; /* Prevents Android zoom on focus */
    min-height: 44px;
  }
  /* Waitlist & filter inputs/buttons */
  .lw-form input, .waitlist-form-row input { font-size: 16px !important; min-height: 44px; }
  .lw-form button, .waitlist-form-row button { min-height: 44px; }
  /* pw-toggle: increase tap target */
  .pw-toggle {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* Auth tabs */
  .auth-tab { padding: 0.65rem; min-height: 44px; }
  /* Node details btn */
  .node-details-footer .btn { min-height: 44px; font-size: 0.82rem; }
  /* Lab modal scroll */
  #custom-modal-overlay { align-items: flex-start; padding: 1rem; overflow-y: auto; }
  #custom-modal-card { max-height: 90vh; overflow-y: auto; }
  /* Back button in lab navbar */
  .navbar a.btn-secondary { min-width: 44px; min-height: 44px; }
  /* Drawer links */
  .drawer-link { padding: 0.75rem 0.85rem; }
  /* Prevent long words breaking layout */
  p, li, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-break: break-word;
  }
  /* Remove hover transforms on touch */
  .btn:hover,
  .module-card:hover,
  .day-accordion:hover {
    transform: none;
  }
}

@media (max-width: 768px) {
  .nav-back-label { display: none; }
}

/* Fix leaderboard table columns on mobile */
@media (max-width: 480px) {
  #leaderboard-table th:nth-child(3),
  #leaderboard-table td:nth-child(3) {
    display: none; /* hide RANGO column, keep position/name/XP */
  }
  #leaderboard-table th,
  #leaderboard-table td {
    width: auto !important;
    padding: 0.6rem 0.4rem !important;
  }
}

/* ============================================================
   MOBILE v2 — Hamburger menu, drawer, and comprehensive fixes
   ============================================================ */

/* ── Dashboard navbar desktop/mobile split ── */
.dash-nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.dash-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
.dash-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── Mobile drawer ── */
.dash-mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
}
.dash-mobile-drawer.open {
  display: block;
}
.dash-drawer-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--surface, #fff);
  border-left: 1px solid var(--surface-border);
  padding: 1.25rem;
  overflow-y: auto;
  animation: drawer-slide-in 0.25s ease;
}
@keyframes drawer-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.dash-drawer-close {
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.drawer-link:hover, .drawer-link:active {
  background: var(--surface-hover);
  border-color: var(--surface-border);
  color: var(--primary);
}

/* ── Show hamburger, hide desktop nav on mobile ── */
@media (max-width: 768px) {
  .dash-nav-desktop { display: none; }
  .dash-hamburger   { display: flex; }
}

/* ── index.html: hero fixes ── */
@media (max-width: 480px) {
  .hero { padding-top: 80px; padding-bottom: 50px; }
  .hero-title { font-size: 1.65rem; line-height: 1.15; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; font-size: 0.9rem; }
  .hero-stats {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center;
  }
  .hero-stats > * { flex: 0 0 auto; }
  /* hide separator pipes on mobile */
  .hero-stats .hero-stat-sep { display: none; }
}

/* ── index.html: temario items ── */
@media (max-width: 768px) {
  .temario-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem;
  }
  .temario-meta {
    white-space: normal !important;
    font-size: 0.8rem !important;
  }
  .temario-item { padding: 1rem 1.1rem !important; }
}

/* ── Dashboard module rows ── */
@media (max-width: 600px) {
  .module-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
  .module-stats {
    width: 100%;
    justify-content: space-between;
  }
  /* Lesson rows inside modules */
  .lesson-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.4rem;
  }
  .lesson-row .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.82rem !important;
  }
}

/* ── Day accordion headers ── */
@media (max-width: 600px) {
  .day-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .day-header-title {
    font-size: 0.82rem;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }
  .day-header-right { margin-left: auto; }
}

/* ── Lesson complete overlay stats ── */
@media (max-width: 420px) {
  .lc-stats {
    grid-template-columns: 1fr !important;
    gap: 0.6rem;
  }
}

/* ── Paywall card ── */
@media (max-width: 480px) {
  .paywall-card { padding: 1.75rem 1.1rem; }
  .paywall-title { font-size: 1.2rem; }
  .paywall-crown { font-size: 2.75rem; }
}

/* ── Exam card ── */
@media (max-width: 480px) {
  .exam-card { padding: 1.25rem 1rem; }
  .exam-question { font-size: 0.9rem; }
  .exam-timer { font-size: 1.2rem; }
}

/* ── story-container padding ── */
@media (max-width: 600px) {
  .story-container { padding: 1.5rem 1.25rem !important; }
  .story-text { font-size: 0.92rem; }
}

/* ── flag-input-group ── */
@media (max-width: 480px) {
  .flag-input-group {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .flag-submit { width: 100%; justify-content: center; }
}

/* ── variant-btn-grid ── */
@media (max-width: 600px) {
  .variant-btn-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Lab chat container height ── */
@media (max-width: 768px) {
  .lab-chat-container { height: 380px !important; }
  .sim-terminal { height: 320px !important; }
}

/* ── lab-top-bar wrap ── */
@media (max-width: 600px) {
  .lab-top-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.4rem;
  }
  #lab-title { font-size: 1.15rem !important; }
}

/* ── profile.html header wrap ── */
@media (max-width: 480px) {
  #profile-fullname { font-size: 1.2rem !important; }
  #profile-avatar { width: 52px !important; height: 52px !important; font-size: 1.3rem !important; }
}

/* ── profile info rows — long dates ── */
@media (max-width: 480px) {
  .profile-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
}

/* ── Fix minimum font sizes globally ── */
@media (max-width: 768px) {
  .streak-label,
  .lc-stat-label,
  .lab-time,
  .section-subtitle {
    font-size: 0.75rem !important;
  }
  /* Buttons "Entrar" in module rows */
  .lesson-btn, .module-enter-btn, .btn-lesson-enter {
    font-size: 0.85rem !important;
    padding: 0.6rem 1rem !important;
    min-height: 44px !important;
  }
  /* Profile badges and labels */
  .profile-role-badge,
  .profile-stat-lbl,
  #user-rank,
  .node-label {
    font-size: 0.72rem !important;
  }
}

/* ── Leaderboard: scroll indicator ── */
@media (max-width: 600px) {
  .leaderboard-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
  }
  .leaderboard-table-wrap::after {
    content: '← desliza →';
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.3rem;
    font-family: var(--font-mono);
  }
}

/* ── No-lives overlay ── */
@media (max-width: 480px) {
  #no-lives-overlay > div {
    padding: 1.75rem 1.1rem !important;
    width: 94% !important;
  }
}

/* ── Global: prevent horizontal scroll without hiding content ── */
html, body {
  max-width: 100vw;
}

/* ── Landing page mobile nav ── */
.landing-mobile-nav {
  display: none;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 768px) {
  .landing-mobile-nav { display: flex; }
  #landing-nav-links   { display: none !important; }
}

/* ============================================================
   MOBILE v3 — Roadmap, accordions, profile, dashboard fixes
   ============================================================ */

/* ── Dashboard hero buttons ── */
.dash-hero-btn {
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
}
@media (max-width: 600px) {
  .dash-hero-btn {
    font-size: 0.88rem;
    padding: 0.7rem 1.1rem;
    width: 100%;
    justify-content: center;
  }
  .dash-cert-label { display: none; }
  .dashboard-header .btn-group,
  .dashboard-header div[style*="display: flex"] {
    flex-direction: column;
    width: 100%;
  }
}

/* ── Roadmap: scrollable on mobile ── */
@media (max-width: 768px) {
  .roadmap-container {
    padding: 1.25rem 0.75rem;
    overflow: visible;
  }
  .roadmap-tree-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    min-height: 340px;
    padding-bottom: 0.5rem;
  }
  /* Make the absolute-positioned SVG and nodes scroll together */
  .roadmap-tree-wrapper > * {
    min-width: 520px;
  }
  .node-circle {
    width: 46px !important;
    height: 46px !important;
    font-size: 0.8rem;
  }
  .node-label {
    font-size: 0.65rem;
    white-space: nowrap;
    padding: 0.15rem 0.35rem;
  }
  .roadmap-node {
    width: 120px;
  }
  /* Scroll hint */
  .roadmap-container::after {
    content: '← desliza el mapa →';
    display: block;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    opacity: 0.7;
  }
}

/* ── Day accordion: header compacto ── */
@media (max-width: 768px) {
  .day-header {
    padding: 1rem 0.85rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .day-header-left {
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
  }
  .day-badge {
    min-width: 54px;
    font-size: 0.68rem;
    padding: 0.25rem 0.45rem;
    flex-shrink: 0;
  }
  .day-title-info h3 {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }
  .day-title-info p { display: none; }
  .day-header-right { gap: 0.6rem; flex-shrink: 0; }
  .day-meta { display: none; }
  /* Increase max-height for long content */
  .day-accordion.active .day-content { max-height: 9999px; }
  .day-content-inner { padding: 0.85rem; gap: 0.6rem; }
}

/* ── Module rows: stack on mobile ── */
@media (max-width: 600px) {
  .module-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem;
  }
  .module-info { width: 100%; }
  .module-details h4 { font-size: 0.88rem; }
  .module-stats {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
  }
  .module-time { display: none; }
  .module-stats .btn {
    padding: 0.35rem 0.85rem !important;
    font-size: 0.78rem !important;
    margin-left: 0 !important;
  }
}

/* ── Profile page: comprehensive ── */

/* Header: wrap on small screens */
@media (max-width: 520px) {
  #profile-header-row {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  #profile-fullname { font-size: 1.15rem !important; }
  #profile-avatar {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
  }
}

/* Stats: 2x2 always on mobile, readable labels */
@media (max-width: 520px) {
  #profile-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
  }
  .profile-stat-card { padding: 0.85rem 0.6rem; }
  .profile-stat-val { font-size: 1.25rem; }
  .profile-stat-lbl { font-size: 0.72rem !important; }
}

/* Two-column form grid → single column */
@media (max-width: 700px) {
  #profile-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Account info rows: stack when date is long */
@media (max-width: 480px) {
  .profile-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
  }
  .profile-info-row:last-child { border-bottom: none; }
  .profile-info-val { word-break: break-word; }
}

/* Form inputs: big enough for mobile tap */
@media (max-width: 768px) {
  .profile-field input {
    font-size: 16px !important; /* prevent iOS/Android zoom */
    min-height: 44px;
  }
  .profile-section-card { padding: 1.1rem; }
  .profile-save-btn { min-height: 44px; }
}

/* Profile role badge: readable size */
#profile-role-badge {
  font-size: 0.72rem;
}

/* ── index.html: hero title + section titles ── */
@media (max-width: 400px) {
  .hero-title { font-size: 1.5rem; }
  .section-title { font-size: 1.4rem; }
  .hero-desc { font-size: 0.88rem; }
}

/* ── auth.html: inputs big tap targets ── */
@media (max-width: 768px) {
  .auth-card input,
  .auth-card select {
    min-height: 44px;
    font-size: 16px !important;
  }
  .auth-card .btn { min-height: 44px; width: 100%; justify-content: center; }
}

/* ── lab.html: content padding ── */
@media (max-width: 480px) {
  /* padding-top managed by fitLabPadding() JS */
  .lab-instructions-panel { padding: 0.85rem !important; }
  .markdown-body p, .story-text p { font-size: 0.9rem; }
}

/* ── Fix overflow-x without hiding content ── */
@media (max-width: 768px) {
  .container { padding: 0 0.85rem; }
  .leaderboard-section.container { padding-left: 0.85rem; padding-right: 0.85rem; }
}

/* ── Roadmap scroll container ── */
.roadmap-scroll-outer {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .roadmap-scroll-outer {
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    background: var(--surface-hover);
    padding: 0.5rem 0;
  }
  .roadmap-tree-wrapper {
    min-width: 520px;
    min-height: 310px !important;
  }
  .roadmap-container { padding: 1.25rem 0.75rem; }
  /* Remove the pseudo-element scroll hint from the container, put it on outer */
  .roadmap-container::after { display: none; }
  .roadmap-scroll-outer::after {
    content: '← desliza para ver el mapa completo →';
    display: block;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
    opacity: 0.75;
  }
}

/* ── Accordion title max-width responsive ── */
@media (max-width: 400px) {
  .day-title-info h3 { max-width: 130px; font-size: 0.82rem; }
  .day-badge { min-width: 46px; font-size: 0.65rem; }
}
@media (min-width: 401px) and (max-width: 600px) {
  .day-title-info h3 { max-width: 160px; }
}
@media (min-width: 601px) and (max-width: 768px) {
  .day-title-info h3 { max-width: 240px; white-space: normal; overflow: visible; text-overflow: unset; }
}

/* ── Profile: main padding ── */
@media (max-width: 480px) {
  #profile-stats { margin-bottom: 1.25rem !important; }
  .profile-section-card { border-radius: 8px; }
  #profile-grid { gap: 1rem !important; }
}

/* ── lab.html: nav bar padding-top correction ── */
@media (max-width: 480px) {
  #lab-container { padding-left: 0.6rem !important; padding-right: 0.6rem !important; }
}

/* ============================================================
   LAB CONTENT MOBILE — All lesson step types
   ============================================================ */

@media (max-width: 768px) {

  /* ── General lab container ── */
  #lab-container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* ── Hook screen (intro de lección) ── */
  .hook-screen {
    padding: 2rem 1.25rem;
    min-height: 50vh;
  }
  .hook-screen h1 {
    font-size: 1.8rem;
    letter-spacing: 0.02em;
  }
  .hook-screen p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  /* ── Story / narrative slides ── */
  .story-container {
    padding: 1.25rem 1rem;
  }
  .story-text {
    font-size: 0.92rem;
    line-height: 1.7;
  }
  .story-text p { margin-bottom: 1rem; }

  /* ── Lab instructions panel ── */
  .lab-instructions-panel {
    padding: 1.1rem !important;
    min-height: unset !important;
  }
  .lab-instructions-panel p,
  .markdown-body p {
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 0.9rem;
  }

  /* ── Navigation buttons row ── */
  .lab-nav-row,
  div[style*="display: flex"][style*="justify-content: space-between"]:has(.btn) {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  /* Make CONTINUAR always full-width on mobile */
  #lab-step-content .btn-primary[onclick*="advanceStep"],
  #lab-step-content button[onclick*="advanceStep"] {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
  }

  /* ── Step indicator dots ── */
  #lab-step-indicator {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  #lab-step-indicator > * {
    flex-shrink: 0;
  }

  /* ── Cards grid (flip cards) ── */
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  .flip-card { height: 200px; }

  /* ── Quiz options ── */
  .quiz-option {
    padding: 0.65rem 0.8rem;
    font-size: 0.86rem;
    line-height: 1.4;
  }
  .quiz-question-text { font-size: 0.9rem; }

  /* ── Mini-quiz options (inline buttons) ── */
  #lab-step-content .mini-quiz-options,
  #lab-step-content div[style*="display: flex; flex-direction: column; gap"] {
    gap: 0.5rem !important;
  }

  /* ── Flag capture ── */
  .flag-capture-container {
    padding: 1.5rem 1rem;
  }
  .flag-capture-container h3 { font-size: 1.1rem; }
  .flag-input-group {
    flex-direction: column !important;
    max-width: 100%;
  }
  .flag-submit { width: 100% !important; justify-content: center; }

  /* ── Variant selector (choose mode buttons) ── */
  .variant-btn-grid {
    grid-template-columns: 1fr !important;
  }
  .variant-btn { padding: 0.85rem 1rem; }
  .variant-btn-title { font-size: 0.9rem; }
  .variant-btn-desc { font-size: 0.78rem; }

  /* ── Scenario decisions ── */
  #scenario-decisions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  #scenario-decisions button {
    font-size: 0.84rem !important;
    padding: 0.7rem 0.9rem !important;
    text-align: left;
    white-space: normal !important;
    line-height: 1.4;
  }

  /* ── Conversation demo ── */
  .conversation-demo { font-size: 0.86rem; }
  .conversation-demo-sys-text { font-size: 0.8rem; }

  /* ── Deep analysis / document panels ── */
  #lab-step-content div[style*="border:1px solid"][style*="padding:1.5rem"] {
    padding: 1rem !important;
    font-size: 0.84rem;
  }
  pre, code {
    font-size: 0.74rem !important;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }

  /* ── Write report fields ── */
  #lab-step-content textarea {
    font-size: 0.88rem;
    padding: 0.6rem 0.75rem;
  }

  /* ── General inline-style large paddings inside step content ── */
  #lab-step-content [style*="padding: 2rem"],
  #lab-step-content [style*="padding: 2.5rem"],
  #lab-step-content [style*="padding: 3rem"] {
    padding: 1.1rem !important;
  }

  /* ── Debriefing / lesson complete card ── */
  .lesson-complete-card { padding: 1.5rem 1rem; }

  /* ── Lab top bar ── */
  .lab-top-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.35rem;
    margin-bottom: 1.25rem !important;
  }
  #lab-title { font-size: 1.1rem !important; line-height: 1.3; }
  #lab-subtitle { font-size: 0.72rem; }
}

@media (max-width: 480px) {
  .hook-screen h1 { font-size: 1.45rem; }
  .story-text { font-size: 0.88rem; }
  .lab-instructions-panel p { font-size: 0.85rem; }
  .quiz-option { font-size: 0.82rem; }
  /* Prevent any text overflow */
  #lab-step-content * {
    max-width: 100%;
    box-sizing: border-box;
  }
  #lab-step-content img {
    width: 100%;
    height: auto;
  }
}

/* ===== BETA BADGE ===== */
.beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.38rem;
  background: rgba(13,110,253,0.1);
  border: 1px solid rgba(13,110,253,0.28);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  margin-left: 0.45rem;
  position: relative;
  top: -1px;
}

/* ═══════════════════════════════════════════════════════
   MOBILE ANDROID — fixes de audit (junio 2026)
   ═══════════════════════════════════════════════════════ */

/* Botones "Entrar" en listas de lecciones del dashboard */
@media (max-width: 768px) {
  .module-stats .btn,
  .lesson-item .btn,
  .day-content .btn {
    min-height: 44px !important;
    font-size: 0.85rem !important;
    padding: 0.6rem 1rem !important;
  }
}

/* Chat y terminal: altura flexible para no superar la pantalla */
@media (max-width: 768px) {
  .lab-chat-container { height: min(380px, 52vh) !important; }
  .sim-terminal       { height: min(320px, 45vh) !important; }
}

/* Filtros del glosario: touch targets accesibles */
@media (max-width: 768px) {
  .gloss-filter-btn {
    padding: 0.5rem 0.75rem !important;
    min-height: 40px !important;
    font-size: 0.78rem !important;
  }
}

/* Input de búsqueda del glosario: 16px explícito */
@media (max-width: 768px) {
  #gloss-search { font-size: 16px !important; }
}

/* Glosario hero: padding-top seguro aunque navbar crezca */
@media (max-width: 768px) {
  .gloss-hero { padding-top: 90px !important; }
}

/* Profile: stats a 2 cols antes en pantallas más amplias */
@media (max-width: 700px) {
  #profile-stats { grid-template-columns: 1fr 1fr !important; }
  .profile-stat-lbl { font-size: 0.78rem; }
}

/* Roadmap: node-label mínimo legible */
.node-label { font-size: max(0.65rem, 10.5px); }

/* ── Lab page: inline padding override for mobile ── */
/* Inline styles on step panels beat class rules, so use !important here */
@media (max-width: 768px) {
  /* All step panels — reduce inner padding */
  #lab-step-content > div,
  #lab-step-content .lab-instructions-panel,
  #lab-step-content .console-mockup {
    padding: 1.25rem !important;
  }
  /* Make top bar more compact */
  .lab-top-bar {
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
  }
  /* Mini quiz options: less padding */
  .mini-quiz-option {
    padding: 0.75rem 0.9rem !important;
    font-size: 0.88rem;
  }
  /* Step indicator dots — smaller */
  #lab-step-indicator span {
    width: 10px !important;
    height: 10px !important;
  }
  /* Briefing icon: smaller */
  #lab-step-content .console-mockup > i:first-child {
    font-size: 2.5rem !important;
    margin-bottom: 1rem !important;
  }
  /* Scenario buttons */
  .scenario-option-btn {
    font-size: 0.85rem !important;
    padding: 0.7rem 0.9rem !important;
  }
  /* Complete-the-attack chat history: limit height on mobile */
  #lab-step-content [style*="max-height: 350px"] {
    max-height: 200px !important;
  }
  /* Deep analysis document panel */
  #lab-step-content [style*="border-radius:8px"][style*="background:#f8fafc"] {
    padding: 1rem !important;
  }
}

@media (max-width: 480px) {
  #lab-step-content > div,
  #lab-step-content .lab-instructions-panel,
  #lab-step-content .console-mockup {
    padding: 1rem !important;
  }
  /* Nav-back button: just icon */
  .nav-back-label { display: none !important; }
  /* XP indicator: hide entirely to save navbar space */
  .xp-indicator { display: none !important; }
  /* Navbar padding tighter */
  .navbar .container { padding: 0.35rem 0.75rem !important; }
  /* Story/theory content font size */
  #lab-step-content p { font-size: 0.92rem; line-height: 1.65; }
  /* Reduce heading size in panels */
  #lab-step-content h2 { font-size: 1.25rem !important; }
  #lab-step-content h3 { font-size: 1rem !important; }
}
