/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #06151a;
    --bg2: #0a1f28;
    --surface: #102a36;
    --surface2: #163a4a;
    --accent: #00c8e0;
    --accent2: #4dffff;
    --accent-glow: rgba(0, 200, 224, 0.4);
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --text: #e8f8ff;
    --text-dim: #8ab4c4;
    --text-muted: #5a8090;
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== SCREENS ===== */
.screen {
    position: absolute; inset: 0;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}
.screen.active { display: flex; }

/* ===== BUTTONS ===== */
.btn {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; padding: 16px 20px;
    border: none; border-radius: var(--radius);
    font-family: var(--font); font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    position: relative;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #d63384);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid rgba(232, 67, 147, 0.2);
}
.btn-secondary:active { background: var(--surface); }
.btn-text {
    background: none; color: var(--text-dim); font-size: 14px;
    padding: 12px; width: auto;
}
.btn-desc {
    font-size: 11px; font-weight: 300; opacity: 0.7; margin-top: 2px;
}
.btn-icon-left {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 20px;
}
.btn-icon {
    background: none; border: none; color: var(--text); font-size: 18px;
    padding: 8px; cursor: pointer;
}

/* ===== MENU SCREEN ===== */
.menu-content {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 24px; gap: 32px;
}
.logo-area { text-align: center; }
.logo-icon {
    font-size: 56px; color: var(--accent);
    filter: drop-shadow(0 0 20px var(--accent-glow));
    animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 20px var(--accent-glow)); }
    50% { filter: drop-shadow(0 0 35px var(--accent-glow)); }
}
.app-title {
    font-size: 32px; font-weight: 700;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.app-subtitle { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.menu-buttons { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 12px; }
.menu-stats {
    display: flex; gap: 32px; padding: 16px 24px;
    background: var(--surface); border-radius: var(--radius);
}
.stat-item { text-align: center; }
.stat-value { display: block; font-size: 24px; font-weight: 700; color: var(--accent2); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== TRAINING SCREEN ===== */
#screen-training { background: #06151a; }

.training-hud {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}
.hud-left { display: flex; align-items: center; gap: 8px; }
.hud-back {
    font-size: 24px;
    line-height: 1;
    color: var(--text);
    padding: 6px 10px;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
}
.hud-timer { font-size: 16px; font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.hud-score { font-size: 22px; font-weight: 700; color: var(--accent2); }
.hud-combo {
    font-size: 14px; font-weight: 700; color: var(--warning);
    margin-right: 8px; animation: combo-pop 0.3s ease;
}
@keyframes combo-pop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* Focus Meter */
.focus-meter {
    position: absolute; left: 8px; top: 60px; bottom: 80px;
    width: 24px; z-index: 10;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.focus-track {
    flex: 1; width: 8px; background: var(--surface2);
    border-radius: 4px; position: relative; overflow: hidden;
}
.focus-fill {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 0%; border-radius: 4px;
    background: linear-gradient(to top, var(--accent), #ff6b6b, #ffd93d);
    transition: height 0.15s ease;
}
.focus-peak-line {
    position: absolute; left: -4px; right: -4px; height: 2px;
    background: var(--warning); border-radius: 1px;
    bottom: 80%; opacity: 0.6;
}
.focus-label {
    font-size: 10px; color: var(--text-muted); font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Peak counter */
.peak-counter {
    position: absolute; right: 12px; top: 60px; z-index: 10;
    display: flex; flex-direction: column; align-items: center;
}
.peak-count {
    font-size: 28px; font-weight: 700;
    color: var(--accent); text-shadow: 0 0 20px var(--accent-glow);
}
.peak-label { font-size: 10px; color: var(--text-muted); }

/* Canvas - pointer-events off, events handled by touch-area overlay */
#training surface-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    touch-action: none;
    z-index: 1;
    pointer-events: none;
}
/* Invisible overlay for touch/mouse capture - above canvas, below HUD */
#touch-area {
    position: absolute; inset: 0;
    z-index: 3;
    touch-action: none;
    cursor: crosshair;
}

/* Peak flash */
.peak-flash {
    position: absolute; inset: 0;
    background: radial-gradient(circle, rgba(232,67,147,0.6), transparent 70%);
    opacity: 0; pointer-events: none; z-index: 5;
    transition: opacity 0.1s;
}
.peak-flash.active {
    animation: peak-flash-anim 1.5s ease-out forwards;
}
@keyframes peak-flash-anim {
    0% { opacity: 1; }
    30% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Live Coach: real-time feedback during training */
.live-coach {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 152px;
    z-index: 9;
    background: rgba(10, 5, 16, 0.78);
    border: 1px solid rgba(232, 67, 147, 0.4);
    border-radius: 10px;
    padding: 8px 14px;
    pointer-events: none;
    backdrop-filter: blur(2px);
    text-align: center;
}
.live-coach.success { border-color: rgba(0, 184, 148, 0.6); }
.live-coach.warning { border-color: rgba(253, 203, 110, 0.6); }
.live-coach.info { border-color: rgba(116, 185, 255, 0.6); }
.coach-msg {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.live-coach.success .coach-msg { color: #8de6c9; }
.live-coach.warning .coach-msg { color: #ffd47e; }
.live-coach.info .coach-msg { color: #9bcfff; }
.coach-targets {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

/* Focus curve (live time series) */
#focus-curve-container {
    position: absolute;
    left: 36px;
    right: 56px;
    bottom: 78px;
    height: 56px;
    z-index: 8;
    background: rgba(10, 5, 16, 0.55);
    border-radius: 10px;
    border: 1px solid rgba(232, 67, 147, 0.25);
    pointer-events: none;
    overflow: hidden;
}
#focus-curve-container.hidden { display: none; }
#focus-curve {
    width: 100%;
    height: 100%;
    display: block;
}

/* Bottom Metrics */
.training-metrics {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-around;
    padding: 10px 8px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    z-index: 10;
}
.metric { text-align: center; min-width: 60px; }
.metric-value {
    display: block; font-size: 18px; font-weight: 700; color: var(--text);
    font-variant-numeric: tabular-nums;
}
.metric-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }

/* Guide hint */
.guide-hint {
    position: absolute; top: 50px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.8); border: 1px solid var(--accent);
    border-radius: 20px; padding: 8px 20px; z-index: 15;
    font-size: 14px; color: var(--accent2); text-align: center;
    animation: hint-fade 0.5s ease;
}
@keyframes hint-fade { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* ===== RESULTS SCREEN ===== */
.results-content {
    flex: 1; display: flex; flex-direction: column;
    padding: 32px 24px; gap: 24px; overflow-y: auto;
}
.results-title { text-align: center; font-size: 20px; color: var(--text-dim); }

.score-display {
    text-align: center; padding: 24px;
    background: var(--surface); border-radius: var(--radius);
    position: relative;
}
.score-grade {
    display: inline-block; width: 48px; height: 48px;
    line-height: 48px; font-size: 24px; font-weight: 700;
    border-radius: 50%; margin-bottom: 8px;
    background: var(--accent); color: #fff;
}
.score-big { display: block; font-size: 48px; font-weight: 700; color: var(--accent2); }
.score-label { font-size: 14px; color: var(--text-muted); }

.results-breakdown {
    background: var(--surface); border-radius: var(--radius);
    padding: 4px 16px; overflow: hidden;
}
.result-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.result-row:last-child { border-bottom: none; }
.result-key { color: var(--text-dim); font-size: 14px; }
.result-val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Heatmap (results screen) */
.heatmap-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.heatmap-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}
.heatmap-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
#heatmap-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #0a0510;
    border-radius: 10px;
    border: 1px solid var(--surface2);
}

/* Coaching */
.coaching-section {
    background: var(--surface); border-radius: var(--radius); padding: 16px;
}
.coaching-section h3 { font-size: 16px; margin-bottom: 12px; }
.coaching-tips { display: flex; flex-direction: column; gap: 8px; }
.coaching-tip {
    padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5;
}
.coaching-tip.success { background: rgba(0,184,148,0.15); border-left: 3px solid var(--success); }
.coaching-tip.info { background: rgba(116,185,255,0.15); border-left: 3px solid #74b9ff; }
.coaching-tip.warning { background: rgba(253,203,110,0.15); border-left: 3px solid var(--warning); }
.coaching-loading { text-align: center; color: var(--text-muted); font-size: 13px; padding: 12px; }

.results-buttons { display: flex; gap: 12px; padding-bottom: 32px; }
.results-buttons .btn { flex: 1; }

/* ===== SETTINGS SCREEN ===== */
.settings-content {
    flex: 1; display: flex; flex-direction: column;
    padding: 48px 24px 32px; gap: 24px;
}
.settings-content h2 { font-size: 24px; }
.setting-group {
    background: var(--surface); border-radius: var(--radius);
    padding: 4px 16px; overflow: hidden;
}
.setting-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.setting-item:last-child { border-bottom: none; }
.setting-item label { font-size: 14px; color: var(--text); }
.setting-item select {
    background: var(--surface2); color: var(--text); border: none;
    padding: 8px 12px; border-radius: 8px; font-size: 14px; font-family: var(--font);
}
.input-text {
    background: var(--surface2); color: var(--text); border: 1px solid var(--surface2);
    padding: 8px 12px; border-radius: 8px; font-size: 13px;
    width: 160px; font-family: var(--font);
}
.input-text:focus { border-color: var(--accent); outline: none; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--surface2); border-radius: 24px; transition: 0.3s;
}
.toggle-slider::before {
    content: ""; position: absolute;
    height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: var(--text-dim); border-radius: 50%; transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ===== PROGRESS SCREEN ===== */
.progress-content {
    flex: 1; display: flex; flex-direction: column;
    padding: 16px 16px 32px; gap: 16px; overflow-y: auto;
}

.progress-hero {
    display: flex; align-items: center; gap: 16px;
    background: linear-gradient(135deg, var(--accent), #d63384);
    border-radius: var(--radius); padding: 20px;
    color: #fff; box-shadow: 0 4px 24px var(--accent-glow);
}
.hero-streak { text-align: center; min-width: 80px; }
.hero-num { font-size: 48px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.85; margin-top: 2px; }
.hero-divider { width: 1px; height: 56px; background: rgba(255,255,255,0.25); }
.hero-level { flex: 1; }
.hero-level-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.hero-level-bar { height: 6px; background: rgba(0,0,0,0.25); border-radius: 3px; overflow: hidden; }
.hero-level-fill { height: 100%; background: #fff; border-radius: 3px; transition: width 0.4s; }
.hero-level-next { font-size: 11px; opacity: 0.85; margin-top: 6px; }

.progress-totals {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.total-card {
    background: var(--surface); border-radius: 10px;
    padding: 12px 8px; text-align: center;
    border: 1px solid var(--surface2);
}
.total-num {
    font-size: 22px; font-weight: 700; color: var(--accent2);
    font-variant-numeric: tabular-nums;
}
.total-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.progress-records, .progress-course, .progress-charts {
    background: var(--surface); border-radius: var(--radius); padding: 14px 16px;
}
.records-title, .charts-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--accent2); font-weight: 700; margin-bottom: 10px;
}
.record-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.record-row:last-child { border-bottom: none; }
.record-key { font-size: 13px; color: var(--text-dim); }
.record-val { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.chart-block { margin-bottom: 14px; }
.chart-block:last-child { margin-bottom: 0; }
.chart-label {
    font-size: 11px; color: var(--text-dim); margin-bottom: 4px;
    display: flex; justify-content: space-between;
}
.trend-chart {
    display: block; width: 100%; height: 50px;
    background: rgba(0,0,0,0.2); border-radius: 6px;
}
.chart-summary {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.chart-summary .up { color: var(--success); font-weight: 700; }
.chart-summary .down { color: var(--danger); font-weight: 700; }

.course-bar {
    height: 10px; background: var(--surface2); border-radius: 5px; overflow: hidden;
    margin-bottom: 8px;
}
.course-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 5px;
    transition: width 0.4s;
    width: 0%;
}
.course-text { font-size: 13px; color: var(--text-dim); text-align: center; font-variant-numeric: tabular-nums; }

/* ===== EXERCISES SCREEN ===== */
.exercises-content {
    flex: 1; display: flex; flex-direction: column;
    padding: 16px 16px 32px; gap: 16px; overflow-y: auto;
}
.exercises-header {
    display: flex; align-items: center; gap: 12px; padding: 8px 0;
}
.exercises-header h2 { font-size: 22px; }

/* Guided session picker cards */
.guided-session-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--surface2);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.guided-session-card:active {
    background: var(--surface2);
    transform: scale(0.98);
}
.guided-session-icon {
    font-size: 28px;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(232, 67, 147, 0.18), rgba(253, 121, 168, 0.05));
    border-radius: 10px;
    border: 1px solid rgba(232, 67, 147, 0.2);
    flex-shrink: 0;
}
.guided-session-text { flex: 1; min-width: 0; }
.guided-session-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.guided-session-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}
.guided-session-arrow {
    font-size: 22px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Section headings (Course Run / Free Practice) */
.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 4px 8px;
    margin-top: 8px;
}
.section-heading .section-icon {
    font-size: 22px;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--surface2);
}
.section-heading .section-text { flex: 1; }
.section-heading .section-title {
    font-size: 16px; font-weight: 700; color: var(--text);
    letter-spacing: 0.2px;
}
.section-heading .section-subtitle {
    font-size: 11px; color: var(--text-muted);
    margin-top: 2px;
}

/* Free Practice flat grid */
.free-practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.free-exercise-card {
    background: var(--surface);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.free-exercise-card:active {
    background: var(--surface2);
    transform: scale(0.97);
}
.free-exercise-card.completed {
    border-color: rgba(0, 184, 148, 0.4);
    background: rgba(0, 184, 148, 0.08);
}
.free-exercise-tag {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent2);
    font-weight: 700;
    margin-bottom: 4px;
}
.free-exercise-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.2;
}
.free-exercise-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.35;
}
.free-exercise-card.completed .free-exercise-name { color: var(--success); }

/* Next-quest banner: highlights the next exercise to do */
.next-quest-banner {
    background: linear-gradient(135deg, var(--accent), #d63384);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 4px;
    text-align: left;
    box-shadow: 0 4px 20px var(--accent-glow);
    color: #fff;
}
.next-quest-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.85;
    font-weight: 700;
    margin-bottom: 4px;
}
.next-quest-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}
.next-quest-desc {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.5;
}
.next-quest-banner .btn {
    background: #fff;
    color: var(--accent);
    box-shadow: none;
}
.next-quest-foot {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 10px;
    line-height: 1.4;
    text-align: center;
}

/* Locked course state — truly locked (can't be tapped) */
.course-locked {
    opacity: 0.55;
}
.course-locked .exercise-list { display: none; }
.course-lock-hint {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.course-lock-hint strong { color: var(--accent2); }
.course-completed .course-progress {
    background: var(--success);
    color: #fff;
}

/* Locked exercises: not clickable */
.exercise-item.locked { opacity: 0.5; pointer-events: none; cursor: not-allowed; }
.exercise-item.locked .exercise-name { color: var(--text-muted); }

/* Mode picker modal */
.mode-picker-content {
    background: var(--surface);
    border: 1px solid var(--surface2);
    border-radius: var(--radius);
    padding: 24px 20px;
    max-width: 320px;
    width: 90%;
    margin: 0 auto;
}
.mode-picker-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent2);
    text-align: center;
    margin-bottom: 4px;
}
.mode-picker-desc {
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.4;
}
#exercise-mode-picker .btn {
    margin-bottom: 10px;
    padding: 14px 16px;
    font-size: 16px;
    text-align: center;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.mode-icon {
    font-size: 22px;
    margin-bottom: 4px;
    display: block;
}
.mode-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 4px;
    line-height: 1.3;
}

.tutorial-intro {
    background: linear-gradient(135deg, rgba(232, 67, 147, 0.12), rgba(253, 121, 168, 0.06));
    border: 1px solid rgba(232, 67, 147, 0.25);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 4px;
}
.tutorial-intro-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent2);
    font-weight: 700;
    margin-bottom: 8px;
}
.tutorial-intro p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 6px;
}
.tutorial-intro p:last-child { margin-bottom: 0; }
.tutorial-intro strong { color: var(--text); }

.course-card {
    background: var(--surface); border-radius: var(--radius);
    overflow: hidden;
}
.course-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.course-info h3 { font-size: 16px; font-weight: 700; }
.course-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.course-progress {
    font-size: 13px; font-weight: 600; color: var(--accent2);
    background: var(--surface2); border-radius: 16px; padding: 4px 12px;
    white-space: nowrap;
}

.exercise-list { display: flex; flex-direction: column; }
.exercise-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.exercise-item:last-child { border-bottom: none; }
.exercise-item:active { background: var(--surface2); }
.exercise-item.locked { opacity: 0.4; pointer-events: none; }

.exercise-num {
    width: 28px; height: 28px; line-height: 28px;
    border-radius: 50%; text-align: center; font-size: 13px; font-weight: 700;
    background: var(--surface2); color: var(--text-dim); flex-shrink: 0;
}
.exercise-item.completed .exercise-num { background: var(--success); color: #fff; }
.exercise-item.current .exercise-num { background: var(--accent); color: #fff; }

.exercise-info { flex: 1; min-width: 0; }
.exercise-name { display: block; font-size: 14px; font-weight: 600; }
.exercise-desc { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.exercise-status {
    width: 20px; height: 20px; flex-shrink: 0; text-align: center;
    font-size: 14px; line-height: 20px;
}

/* Exercise objective banner during training - large, prominent */
.exercise-objective {
    position: absolute;
    top: 56px; left: 16px; right: 16px;
    background: linear-gradient(135deg, rgba(232, 67, 147, 0.18), rgba(0, 0, 0, 0.88));
    border: 1.5px solid var(--accent);
    border-radius: 14px;
    padding: 14px 20px;
    z-index: 15;
    text-align: center;
    box-shadow: 0 4px 24px rgba(232, 67, 147, 0.35);
}
.exercise-objective-title {
    font-size: 11px; color: var(--accent2); font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.2px;
    margin-bottom: 6px;
}
.exercise-objective-text {
    font-size: 18px; color: #fff; margin-top: 2px; line-height: 1.35;
    font-weight: 600;
}
.exercise-objective-progress {
    margin-top: 12px; height: 6px; background: rgba(255,255,255,0.1);
    border-radius: 3px; overflow: hidden;
}
.exercise-objective-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 3px; transition: width 0.3s ease;
    width: 0%;
}

/* Exercise complete popup */
.exercise-complete-popup {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; animation: fade-in 0.3s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.exercise-complete-content {
    text-align: center; padding: 32px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.exercise-complete-icon { font-size: 48px; }
.exercise-complete-title { font-size: 22px; font-weight: 700; color: var(--success); }
.exercise-complete-subtitle { font-size: 14px; color: var(--text-dim); }

/* ===== OVERLAY ===== */
.overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
}
.overlay-content {
    text-align: center; display: flex; flex-direction: column;
    gap: 16px; min-width: 200px;
}
.overlay-content h2 { font-size: 28px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 2px; }

/* ===== SAFE AREA ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .training-hud { padding-top: calc(12px + env(safe-area-inset-top)); }
    .training-metrics { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
