html {
  height: 100%;
  background: var(--gradient-bg); /* THE FIX: Apply background to the root element */
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  color: #f0f0f0;
  -webkit-font-smoothing: antialiased;
}

#app {
    min-height: 100vh; /* Use min-height with vh unit here for flexbox to work */
    display: flex;
    flex-direction: column;
}

:root {
  /* Gamified Colors & Effects */
  --neon-cyan: #00d4ff;
  --neon-purple: #a855f7;
  --neon-pink: #ec4899;
  --neon-green: #10b981;
  --neon-orange: #f59e0b;
  --neon-red: #ef4444;
  --gradient-bg: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  --gradient-neon: linear-gradient(45deg, var(--neon-cyan), var(--neon-purple));
  --gradient-success: linear-gradient(45deg, var(--neon-green), #34d399);
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.5);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.5);
  --glow-green: 0 0 20px rgba(16, 185, 129, 0.5);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  --glass-border: 1px solid rgba(255, 255, 255, 0.18);
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-display: 'Orbitron', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-base);
  background: var(--gradient-bg);
  color: #f0f0f0;
  -webkit-font-smoothing: antialiased;
}

/* --- BACKGROUND & MOUSE TRAIL --- */
.bg-animation { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; overflow: hidden; }
.particle { position: absolute; border-radius: 50%; opacity: 0.6; animation: float 8s ease-in-out infinite; }
.particle:nth-child(1) { width: 4px; height: 4px; background: var(--neon-cyan); top: 20%; left: 10%; }
.particle:nth-child(2) { width: 6px; height: 6px; background: var(--neon-purple); top: 60%; left: 80%; animation-delay: 2s; }
.particle:nth-child(3) { width: 3px; height: 3px; background: var(--neon-pink); top: 80%; left: 20%; animation-delay: 4s; }
.particle:nth-child(4) { width: 5px; height: 5px; background: var(--neon-green); top: 40%; left: 70%; animation-delay: 1s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
#mouse-trail-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; overflow: hidden; }
.trail-particle { position: absolute; border-radius: 50%; background: var(--neon-cyan); filter: drop-shadow(0 0 8px var(--neon-cyan)); will-change: transform; }

/* --- UI ELEMENTS (LEVEL, PROGRESS RING) --- */
.progress-ring { position: fixed; top: 30px; right: 30px; z-index: 1000; }
.progress-ring-svg { transform: rotate(-90deg); }
.progress-ring-background { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 4; }
.progress-ring-fill { fill: none; stroke: var(--neon-cyan); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; transition: stroke-dashoffset 0.5s; }
.progress-ring-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.progress-step { font-size: 24px; font-weight: bold; color: var(--neon-cyan); }
.progress-label { font-size: 12px; color: rgba(255, 255, 255, 0.7); }

.level-system { position: fixed; top: 30px; left: 30px; z-index: 1000; }
.level-badge { background: var(--gradient-card); backdrop-filter: blur(20px); border: var(--glass-border); border-radius: 20px; padding: 10px 20px; display: flex; align-items: center; gap: 10px; box-shadow: var(--glass-shadow); }
.level-number { font-size: 24px; font-weight: bold; color: var(--neon-purple); text-shadow: var(--glow-purple); font-family: var(--font-family-display); }
.level-title { font-size: 14px; color: rgba(255, 255, 255, 0.9); font-weight: 500; }
.xp-bar { margin-top: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 10px; height: 6px; position: relative; overflow: hidden; }
.xp-fill { height: 100%; background: var(--gradient-neon); border-radius: 10px; transition: width 0.5s; box-shadow: var(--glow-cyan); }

/* --- GENERAL LAYOUT & TYPOGRAPHY --- */
.step { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; flex-grow: 1; width: 100%; box-sizing: border-box; }
.step.hidden { display: none !important; }
.step-container.glass-card { width: 100%; max-width: 1000px; background: var(--gradient-card); backdrop-filter: blur(20px); border: var(--glass-border); border-radius: 30px; box-shadow: var(--glass-shadow); padding: 40px; position: relative; }
.step-header { text-align: center; margin-bottom: 40px; }
.step-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 10px; font-family: var(--font-family-display); }
.glow-text { background: var(--gradient-neon); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 30px rgba(0, 212, 255, 0.5); }
.step-subtitle { font-size: 1.2rem; color: rgba(255, 255, 255, 0.7); font-weight: 300; }
.btn-primary { position: relative; padding: 15px 35px; border: none; border-radius: 28px; font-size: 1.3rem; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; background: var(--gradient-neon); color: #0a0a0f; box-shadow: var(--glow-cyan); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow-cyan), 0 10px 25px rgba(0, 212, 255, 0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }
@keyframes pulseGlow { 0%, 100% { box-shadow: var(--glow-cyan); } 50% { box-shadow: var(--glow-cyan), 0 0 40px rgba(0, 212, 255, 0.6); } }

/* --- STEP 1: SPLASH SCREEN --- */
.splash-screen { justify-content: center; }
.video-background-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
#landing-video { width: 100%; height: 100%; object-fit: cover; }
.video-background-container::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(10, 10, 15, 0.6); }
.splash-container { position: relative; z-index: 2; text-align: center; }
.splash-header { margin-bottom: 40px; }
.splash-title { font-family: var(--font-family-display); font-size: 3.2rem; font-weight: 700; color: #fff; }
.title-accent { background: var(--gradient-neon); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: var(--glow-cyan); }
.splash-hook { margin-bottom: 40px; max-width: 700px; margin-left: auto; margin-right: auto; }
.hook-title { font-size: 2.2rem; font-weight: 700; margin-bottom: 20px; line-height: 1.3; color: var(--neon-cyan); }
.hook-text { font-size: 1.5rem; color: rgba(255, 255, 255, 0.9); line-height: 1.6; margin: 0; }
.splash-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; margin-top: 50px; max-width: 700px; margin-left: auto; margin-right: auto; }
.feature-item { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 15px; padding: 20px 15px; text-align: center; font-size: 1rem; font-weight: 600; color: rgba(255, 255, 255, 0.9); transition: all 0.3s; }
.feature-item:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.2); }
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; display: block; }

/* --- STEP 2: MODE SELECTION --- */
.mode-selection { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; margin-bottom: 40px; }
.mode-card { background: linear-gradient(145deg, rgba(25, 25, 40, 0.6) 0%, rgba(15, 15, 30, 0.6) 100%) !important; backdrop-filter: blur(5px); border: var(--glass-border); border-radius: 25px; padding: 30px; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; }
.mode-card.selected { background: linear-gradient(145deg, rgba(0, 212, 255, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%) !important; border-color: var(--neon-cyan); }
.mode-icon { font-size: 4rem; text-align: center; margin-bottom: 20px; }
.mode-title { font-size: 1.8rem; font-weight: bold; color: var(--neon-cyan); margin-bottom: 10px; font-family: var(--font-family-display); }
.mode-duration { font-size: 1rem; color: var(--neon-purple); margin-bottom: 15px; font-weight: 600; }
.mode-tests { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.test-badge { background: rgba(168, 85, 247, 0.2); color: var(--neon-purple); padding: 4px 12px; border-radius: 15px; font-size: 0.85rem; border: 1px solid rgba(168, 85, 247, 0.3); }
.mode-features .feature { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.95rem; color: rgba(255, 255, 255, 0.9); }
#step-2 .step-footer { display: flex; justify-content: center; width: 100%; margin-top: 25px; }

/* --- STEP 3: PROFILE SETUP --- */
#step-3 .glass-card { display: flex; flex-direction: column; max-height: calc(100vh - 3rem); }
#step-3 .profile-form { flex-grow: 1; overflow-y: auto; padding: 20px; margin: 0 -20px; background-color: rgba(10, 10, 15, 0.75); border-radius: 15px; }
#step-3 .form-group { margin-bottom: 30px; }
#step-3 .form-label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 1.1rem; color: var(--neon-cyan); text-shadow: var(--glow-cyan); }
#step-3 .glass-input { width: 100%; padding: 15px 20px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 15px; color: white; font-size: 1rem; }
select#age-group option { background: #1a1a2e; color: #f0f0f0; }
#step-3 .slider-input { width: 100%; height: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); outline: none; cursor: pointer; -webkit-appearance: none; }
#step-3 .slider-input::-webkit-slider-thumb { appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--gradient-neon); cursor: pointer; box-shadow: var(--glow-cyan); }
#step-3 .usage-display { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 20px; padding: 15px; background: rgba(255, 255, 255, 0.05); border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.1); }
#step-3 .usage-emoji { font-size: 2rem; }
#step-3 .platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
#step-3 .platform-card { position: relative; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 20px; padding: 25px 20px; text-align: center; cursor: pointer; }
#step-3 .platform-card.selected { border-color: var(--neon-cyan); background: linear-gradient(45deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1)); }
#step-3 .platform-card input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
#step-3 .platform-icon { font-size: 2.5rem; margin-bottom: 15px; }
.usage-slider {
  text-align: center;
}

.slider-track {
  position: relative;
  margin-bottom: 20px;
}

.slider-input {
  width: 100%;
  height: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-neon);
  cursor: pointer;
  box-shadow: var(--glow-cyan);
  transition: transform 0.2s ease-in-out;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.usage-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.usage-emoji {
  font-size: 2rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
#step-3 .btn-primary { flex-shrink: 0; margin-top: 20px; }

/* --- STEP 5: TEST ARENA --- */
/* .test-arena { display: flex; flex-direction: column; height: 100%; background: rgba(10, 10, 15, 0.85); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 25px; padding: 15px 25px; box-sizing: border-box; } */
.test-arena {
    display: flex;
    flex-direction: column;
    height: 100%;
    
    /* THE FIX: Use the main app gradient and ensure it is opaque */
    background: var(--gradient-bg); 
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 15px 25px;
    box-sizing: border-box;
}
.stimulus-arena { flex-grow: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 15px; min-height: 300px; }
.arena-header { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 20px; }
.gonogo-stimulus { font-size: 8rem; font-weight: bold; font-family: var(--font-family-display); text-shadow: var(--glow-cyan); }
.gonogo-stimulus.go { color: var(--neon-green); text-shadow: var(--glow-green); }
.gonogo-stimulus.nogo { color: var(--neon-red); }
.flanker-stimulus { font-size: 4rem; font-family: var(--font-family-display); letter-spacing: 0.5rem; }
.nback-stimulus { width: 300px; height: 300px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nback-cell { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
.nback-cell.active { background: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.task-cue { font-size: 2rem; font-weight: bold; color: var(--neon-purple); text-shadow: var(--glow-purple); margin-bottom: 20px; }
.task-stimulus { font-size: 6rem; font-weight: bold; font-family: var(--font-family-display); }
.feedback-display { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); min-height: 40px; }
.feedback-text { font-size: 1.2rem; font-weight: bold; padding: 8px 16px; border-radius: 20px; opacity: 0; transform: translateY(20px); transition: all 0.3s; }
.feedback-text.show { opacity: 1; transform: translateY(0); }
.feedback-text.correct { color: var(--neon-green); background: rgba(16, 185, 129, 0.2); }
.feedback-text.incorrect { color: var(--neon-red); background: rgba(239, 68, 68, 0.2); }
.feedback-text.too-slow { color: var(--neon-orange); background: rgba(245, 158, 11, 0.2); }
.trial-progress { flex-shrink: 0; text-align: center; }
.circular-progress { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.progress-svg { transform: rotate(-90deg); }
.progress-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 8; }
.progress-bar { fill: none; stroke: var(--neon-cyan); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 283; transition: stroke-dashoffset 0.3s; }
.progress-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-family-display); font-weight: bold; font-size: 1.5rem; color: var(--neon-cyan); }
#test-complete.achievement-card {
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff; /* Reset text color for this card */
}

#test-complete .achievement-content {
  color: #fff; /* Ensure content text is white */
}

#test-complete .achievement-title {
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

#test-complete .stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

#test-complete .stat-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 15px;
}

#test-complete .stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
}

#test-complete .stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  font-family: var(--font-family-display);
  color: var(--neon-cyan);
}
.arena-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 20px;
}

.test-info {
    display: flex;
    flex-direction: row; /* Explicitly set to row for desktop */
    align-items: center;
    gap: 20px;
}
.performance-panel {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.perf-item {
  text-align: center;
}

.perf-label {
  display: block;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
}

.perf-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  font-family: var(--font-family-display);
}
/* --- STEP 6: SURVEY --- */
.survey-container { max-width: 600px; margin: 0 auto; }
.survey-progress { margin-bottom: 40px; text-align: center; }
.survey-progress-bar { width: 100%; height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.survey-progress-fill { height: 100%; background: var(--gradient-neon); border-radius: 10px; transition: width 0.5s; }
.question-card { background: var(--gradient-card); border-radius: 25px; padding: 30px; margin-bottom: 20px; }
.question-text { font-size: 1.3rem; margin-bottom: 25px; line-height: 1.4; text-align: center; }
.emoji-scale { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.emoji-option { flex: 1; padding: 20px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 20px; text-align: center; cursor: pointer; transition: all 0.3s; }
.emoji-option.selected { background: var(--gradient-neon); color: #0a0a0f; border-color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.emoji-option .emoji { font-size: 2rem; display: block; margin-bottom: 8px; }
.survey-navigation { display: flex; justify-content: space-between; gap: 20px; }

/* --- STEP 7: RESULTS DASHBOARD --- */
.results-container { max-width: 1200px; width: 100%; padding: 20px; }
.results-dashboard { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; align-items: flex-start; }
.results-column-left, .results-column-right { display: flex; flex-direction: column; gap: 30px; }
.score-ring { width: 220px; height: 220px; position: relative; margin: 0 auto; }
.score-ring-svg { transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 12; }
.score-ring-progress { fill: none; stroke: var(--neon-cyan); stroke-width: 16; stroke-linecap: round; stroke-dasharray: 534; stroke-dashoffset: 534; transition: stroke-dashoffset 2s; }
.score-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; /* <-- Add this */
  text-align: center; /* <-- And add this */
}
.score-value { font-size: 3.5rem; font-weight: bold; font-family: var(--font-family-display); }
.score-label { font-size: 1rem; }
.score-category {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block; /* Ensures it doesn't try to take full width */
  margin-top: 5px;
}
.score-category { padding: 8px 16px; background: var(--gradient-card); border-radius: 20px; font-size: 0.9rem; font-weight: bold; border: 1px solid rgba(255, 255, 255, 0.2); }
.metrics-dashboard { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.metric-card { padding: 20px; background: var(--gradient-card); border-radius: 20px; }
.metric-icon { font-size: 2rem; margin-bottom: 10px; }
.metric-content h4 { font-size: 1rem; margin-bottom: 15px; text-align: center; }
.metric-bar-container { display: flex; align-items: center; gap: 15px; }
.metric-bar { flex: 1; height: 12px; background: rgba(255, 255, 255, 0.1); border-radius: 10px; overflow: hidden; }
.metric-fill { height: 100%; background: var(--gradient-neon); border-radius: 10px; transition: width 1.5s; }
.metric-score { font-family: var(--font-family-display); font-weight: bold; }
.category-info { padding: 30px; background: var(--gradient-card); border-radius: 25px; text-align: center; }
.category-mascot { font-size: 3rem; margin-bottom: 15px; }
.category-name { font-size: 1.8rem; font-family: var(--font-family-display); }
.category-description { font-size: 1rem; margin-bottom: 0; }
.results-actions { margin-top: auto; }
.recommendations-panel { background: var(--gradient-card); border-radius: 25px; padding: 30px; }
.recommendations-panel h3 { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; margin-bottom: 30px; font-size: 1.8rem; color: var(--neon-orange); }
#ai-analysis-content .loader { margin: 40px auto; border: 4px solid rgba(255, 255, 255, 0.2); border-left-color: var(--neon-cyan); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#ai-analysis-content p { line-height: 1.6; margin-bottom: 1rem; }
#ai-analysis-content p:last-child { margin-bottom: 0; }
.achievements-section { background: var(--gradient-card); border-radius: 25px; padding: 30px; margin-top: 40px; }
.achievements-section h3 { text-align: center; margin-bottom: 30px; font-size: 1.8rem; color: var(--neon-purple); }
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.achievement-item { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; padding: 20px; text-align: center; }
.achievement-item.unlocked { background: var(--gradient-success); border-color: var(--neon-green); color: #0a0a0f; box-shadow: var(--glow-green); }
.achievement-item-icon { font-size: 3rem; margin-bottom: 15px; }
.achievement-item-name { font-weight: bold; margin-bottom: 8px; }
.achievement-item-description { font-size: 0.9rem; opacity: 0.8; }

/* --- INSTRUCTION OVERLAY & EXAMPLES --- */
.instruction-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 10000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); }
.instruction-modal { background: var(--gradient-card); border-radius: 25px; max-width: 600px; width: 90%; max-height: 90vh; display: flex; flex-direction: column; }
.instruction-header { padding: 20px 30px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.instruction-header h3 { color: var(--neon-cyan); font-family: var(--font-family-display); }
.instruction-body { padding: 30px; overflow-y: auto; }
.instruction-footer { padding: 20px 30px; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center; }
.instruction-icon { font-size: 3rem; text-align: center; margin-bottom: 20px; }
.instruction-list { text-align: left; max-width: 500px; margin: 0 auto 20px; }
.instruction-item { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 15px; font-size: 1.1rem; }
#animated-example { background: rgba(0,0,0,0.2); border-radius: 15px; padding: 20px; min-height: 150px; display: flex; align-items: center; justify-content: center; margin-top: 20px; }
.example-container { display: flex; gap: 20px; justify-content: space-around; width: 100%; align-items: center; }
.example-container.vertical { flex-direction: column; }
.example-item { text-align: center; }
.example-stimulus { font-family: var(--font-family-display); font-weight: bold; font-size: 3rem; padding: 20px; border-radius: 15px; margin-bottom: 15px; min-width: 120px; }
.example-stimulus.go { color: var(--neon-green); border: 2px solid var(--neon-green); }
.example-stimulus.nogo { color: var(--neon-red); border: 2px solid var(--neon-red); }
.example-stimulus.flanker { font-size: 2.5rem; letter-spacing: 0.2em; }
.example-stimulus.flanker span { opacity: 0.4; }
.example-stimulus.flanker strong { color: var(--neon-cyan); }
.example-action { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.9rem; font-weight: 500; }
.action-icon { font-size: 1.2rem; }
.nback-example-grid { width: 120px; height: 120px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 0 auto 15px; }
.nback-cell-example { background: rgba(255, 255, 255, 0.1); border-radius: 5px; }
.nback-cell-example.two-back { background: rgba(255, 255, 255, 0.4); position: relative; }
.nback-cell-example.two-back::after { content: '2 back'; font-size: 10px; color: #fff; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.nback-cell-example.current { background: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.example-stimulus.task-switch { border: 2px solid; padding: 10px; }
.example-stimulus.task-switch.number { border-color: var(--neon-cyan); }
.example-stimulus.task-switch.size { border-color: var(--neon-purple); }
.task-cue-example { font-size: 1rem; font-weight: bold; margin-bottom: 10px; }
.task-stimulus-example { font-size: 2.5rem; }

/* --- NOTIFICATIONS --- */
.achievement-notification { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); z-index: 10000; pointer-events: none; }
.achievement-popup { background: var(--gradient-success); border-radius: 25px; padding: 30px; text-align: center; box-shadow: var(--glow-green), 0 20px 40px rgba(0, 0, 0, 0.3); transform: scale(0); animation: achievementPopup 3s; color: #0a0a0f; }
@keyframes achievementPopup { 0% { transform: scale(0) translateY(-50px); } 15% { transform: scale(1.2) translateY(0); } 30% { transform: scale(1) translateY(0); } 85% { transform: scale(1) translateY(0); } 100% { transform: scale(0) translateY(-50px); } }
.achievement-badge-icon { font-size: 4rem; margin-bottom: 15px; }
.achievement-name { font-size: 1.5rem; font-weight: bold; font-family: var(--font-family-display); }

/* --- UTILITIES --- */
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); }
::-webkit-scrollbar-thumb { background: var(--gradient-neon); border-radius: 10px; }

.site-footer {
    text-align: center;
    padding: 20px;
    width: 100%;
    z-index: 10;
    position: relative;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: var(--neon-cyan);
}

/* ==========================================================================
   FINAL MOBILE RESPONSIVE STYLES
   ========================================================================== */
@media (max-width: 768px) {

  /* --- CORE LAYOUT FIX --- */
  .step { padding: 1rem; display: flex; align-items: center; justify-content: center; min-height: 100vh; box-sizing: border-box; }
  .step-container.glass-card { width: 100%; max-height: calc(100vh - 2rem); overflow-y: auto; display: flex; flex-direction: column; padding: 20px; }
  .step-footer, #step-3 .btn-primary { flex-shrink: 0; margin-top: auto; padding-top: 20px; }
  .profile-form, .mode-selection, .survey-container, .results-main { flex-grow: 1; }
  
  /* --- GENERAL ELEMENT ADJUSTMENTS --- */
  .step-title { font-size: 2rem; }
  .step-subtitle { font-size: 1.1rem; }
  .btn-primary, .btn-secondary { font-size: 1.1rem; padding: 14px 28px; }
  .level-system, .progress-ring { display: none; }

  /* --- STEP 1: SPLASH SCREEN --- */
  .splash-title { font-size: 2.8rem; }
  .hook-title { font-size: 1.6rem; }
  .hook-text { font-size: 1.1rem; }
  .splash-features { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  
  /* --- STEP 2: MODE SELECTION --- */
  .mode-selection { grid-template-columns: 1fr; gap: 25px; }
  .mode-card { padding: 20px; }
  .mode-icon { font-size: 3rem; margin-bottom: 15px; }
  .mode-title { font-size: 1.5rem; }
  .mode-description p { font-size: 1rem; }

  .mode-selection {
    grid-template-columns: 1fr;
    gap: 20px; /* Reduced gap */
    margin-bottom: 20px; /* Reduced margin */
  }

  .mode-card {
      padding: 20px; /* Reduced padding */
  }

  .mode-icon {
      font-size: 2.5rem; /* Smaller icon */
      margin-bottom: 10px;
  }

  .mode-title {
      font-size: 1.4rem; /* Smaller title */
      margin-bottom: 5px;
  }

  .mode-duration {
      font-size: 0.9rem; /* Smaller duration text */
      margin-bottom: 10px;
  }

  .mode-description {
      margin-bottom: 15px; /* Reduced margin */
  }

  .mode-description p {
      font-size: 0.9rem; /* Smaller description text */
      line-height: 1.4;
      margin-bottom: 10px;
  }

  .mode-tests {
      margin-bottom: 15px; /* Reduced margin */
  }

  .mode-features {
      display: none; /* Hide the detailed feature list to save the most space */
  }

  /* --- STEP 3: PROFILE SETUP --- */
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* --- STEP 5: TEST ARENA --- */
  .test-arena { padding: 15px; }
  .arena-header { flex-direction: column; gap: 15px; justify-content: center; }
  .performance-panel { justify-content: center; }
  .test-info {
    /* The incorrect 'flex-direction: column;' is now removed */
    align-items: center;
    gap: 10px;
    justify-content: center; /* This helps center it nicely on mobile */
}
  .stimulus-arena { min-height: 280px; }
  .gonogo-stimulus { font-size: 6rem; }
  .flanker-stimulus { font-size: 2.5rem; }
  .nback-stimulus { width: 240px; height: 240px; }
  .task-stimulus { font-size: 5rem; }

  /* --- STEP 6: SURVEY --- */
  .emoji-scale, .survey-navigation { flex-direction: column; gap: 15px; }

    /* --- STEP 7: RESULTS DASHBOARD --- */
  .results-dashboard, .metrics-dashboard, .achievements-grid, .score-dashboard { grid-template-columns: 1fr; }
  .score-ring { width: 200px; height: 200px; }
  .score-value { font-size: 3rem; }
  .action-panel { flex-direction: column; align-items: center; }

  /* --- INSTRUCTION OVERLAY --- */
  .instruction-modal { padding: 15px; }
  .instruction-body { padding: 20px; }
  .instruction-item { font-size: 1rem; }
  .example-container { flex-direction: column; gap: 25px; }
}

@media (max-width: 480px) {
  .splash-title { font-size: 2.2rem; }
  .hook-title { font-size: 1.4rem; }
  .step-title { font-size: 1.8rem; }
  .perf-value { font-size: 1.1rem; }
  .stimulus-arena { min-height: 250px; }
}

.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 20px;
    box-sizing: border-box;
    pointer-events: none; /* Allows clicks to pass through the container */
}

.mobile-btn {
    pointer-events: all; /* Make the buttons themselves clickable */
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.mobile-btn:active {
    transform: scale(0.95);
    background: rgba(0, 212, 255, 0.3);
    border-color: var(--neon-cyan);
}

.mobile-btn svg {
    width: 40px;
    height: 40px;
    fill: var(--neon-cyan);
}

.results-dashboard {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Two-column layout */
    gap: 30px;
    align-items: flex-start;
}
.results-column-left, .results-column-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.score-ring { width: 220px; height: 220px; }
.score-value { font-size: 3.5rem; }
.score-label { font-size: 1rem; margin-bottom: 5px; }
.score-category { font-size: 0.8rem; padding: 6px 12px; }

.metrics-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2x2 grid for metrics */
    gap: 20px;
}
.metric-card { padding: 20px; }
.metric-icon { font-size: 2rem; margin-bottom: 10px; }
.metric-content h4 { font-size: 1rem; margin-bottom: 15px; }

.category-info { text-align: center; }
.category-mascot { font-size: 3rem; margin-bottom: 15px; }
.category-name { font-size: 1.8rem; }
.category-description { font-size: 1rem; margin-bottom: 0; }

.results-actions {
    margin-top: auto; /* Pushes buttons to the bottom */
    display: flex;
    gap: 15px;
    justify-content: center;
}
/* Restore Share Button Style */
.share-btn {
    background: transparent;
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
    padding: 15px 35px;
    font-size: 1.3rem;
}
.share-btn:hover {
    box-shadow: inset 300px 0 0 0 var(--neon-cyan);
    color: #0a0a0f;
    transform: translateY(-2px);
}

/* AI Coach Analysis Container FIX */
.recommendations-panel #ai-analysis-content {
    max-height: 250px; /* Fixed height */
    overflow-y: auto; /* Make content scrollable */
    padding-right: 10px; /* Space for scrollbar */
}
/* Personalized Quest Styles */
.recommendations-panel { background: var(--gradient-card); border-radius: 25px; padding: 30px; }
.recommendations-panel h3 { text-align: center; margin-bottom: 30px; font-size: 1.8rem; color: var(--neon-orange); }
.recommendations-list { display: grid; grid-template-columns: 1fr; gap: 20px; }
.recommendation-item { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 20px; padding: 25px; }
.recommendation-item h4 { color: var(--neon-orange); margin-bottom: 15px; }
.recommendation-difficulty { display: inline-block; padding: 4px 10px; background: rgba(245, 158, 11, 0.2); border-radius: 10px; font-size: 0.8rem; font-weight: bold; color: var(--neon-orange); }

.results-dashboard {
  grid-template-columns: 1fr; /* Stack columns on mobile */
}
.metrics-dashboard {
  grid-template-columns: repeat(2, 1fr); /* 2x2 grid for metrics on mobile */
  gap: 15px;
}
.metric-card {
    padding: 15px;
    text-align: center;
}
.metric-content h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
}
.results-actions {
    flex-direction: column;
}
.recommendations-panel #ai-analysis-content {
    max-height: 200px; /* Shorter height for mobile */
}

/* ==========================================================================
   ABOUT PAGE STYLES
   ========================================================================== */

.about-page .step-header {
    margin-bottom: 30px;
}

.about-content {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    line-height: 1.7;
}

.about-content p {
    margin-bottom: 1.5em;
}

.about-content strong {
    color: var(--neon-cyan);
    font-weight: 600;
}

.about-page .step-footer {
    margin-top: 20px;
    text-align: center;
}

/* style.css */

#blog-section .step-container {
    max-width: 1200px; /* Allow the blog section to be a bit wider */
}

.blog-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.blog-preview-grid .mode-card {
    text-decoration: none; /* Ensure link is not underlined */
    text-align: center;
}

.blog-preview-grid .mode-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.blog-preview-grid .test-badge {
    /* This reuses your existing badge style for a "Read More" button */
    display: inline-block;
    background: rgba(0, 212, 255, 0.2);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
}
