/* ============================================
   BLIND TYPEN - Main Styles
   ============================================ */

:root {
  --bg-primary: #0f0f2e;
  --bg-secondary: #1a1a4e;
  --bg-card: #252566;
  --text-primary: #ffffff;
  --text-secondary: #b8b8ff;
  --accent: #7c4dff;
  --accent-light: #b388ff;
  --success: #00e676;
  --warning: #ffab00;
  --error: #ff5252;
  --xp-color: #ffd740;
  --streak-color: #ff6d00;

  /* Finger colors */
  --finger-left-pinky: #ff6b6b;
  --finger-left-ring: #ffa726;
  --finger-left-middle: #66bb6a;
  --finger-left-index: #42a5f5;
  --finger-right-index: #42a5f5;
  --finger-right-middle: #66bb6a;
  --finger-right-ring: #ffa726;
  --finger-right-pinky: #ff6b6b;
  --finger-thumb: #ab47bc;
}

/* Theme: Onderzee */
[data-theme="onderzee"] {
  --bg-primary: #001f3f;
  --bg-secondary: #003366;
  --bg-card: #004080;
  --text-secondary: #80d4ff;
  --accent: #00bcd4;
  --accent-light: #4dd0e1;
}

/* Theme: Jungle */
[data-theme="jungle"] {
  --bg-primary: #1b2e1b;
  --bg-secondary: #2d4a2d;
  --bg-card: #3a5c3a;
  --text-secondary: #a5d6a7;
  --accent: #4caf50;
  --accent-light: #81c784;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Stars background */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration) ease-in-out infinite;
  opacity: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* Bubbles for underwater theme */
[data-theme="onderzee"] .bubble {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  animation: float-up var(--duration) ease-in infinite;
}

@keyframes float-up {
  0% { transform: translateY(100vh); opacity: 0.3; }
  100% { transform: translateY(-20px); opacity: 0; }
}

/* Leaves for jungle theme */
[data-theme="jungle"] .leaf {
  position: absolute;
  font-size: var(--size);
  animation: fall var(--duration) ease-in infinite;
  opacity: 0;
}

@keyframes fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0.5; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* ============================================
   HEADER
   ============================================ */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-light);
}

.header-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  background: transparent;
  border: 2px solid transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent-light);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.xp-display, .streak-display {
  font-weight: 700;
  font-size: 1rem;
}

.xp-display { color: var(--xp-color); }
.streak-display { color: var(--streak-color); }

.level-badge {
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
}

.header-auth-btn {
  white-space: nowrap;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

#app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.hidden { display: none !important; }

/* ============================================
   AUTH SCREENS
   ============================================ */

.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.auth-logo {
  font-size: 4rem;
  margin-bottom: 8px;
}

.auth-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.auth-box {
  background: var(--bg-card);
  padding: 32px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.auth-box h2 {
  margin-bottom: 20px;
  color: var(--accent-light);
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 2px solid var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-full { width: 100%; }
.btn-success { background: var(--success); color: #1a1a1a; }
.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent-light);
}
.btn-outline:hover {
  background: var(--accent);
  color: white;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.2rem;
  border-radius: 12px;
}

.auth-switch {
  margin-top: 16px;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent-light);
  cursor: pointer;
  text-decoration: underline;
}

.error-msg {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ============================================
   LESSON LIST
   ============================================ */

.view-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--accent-light);
}

.level-group {
  margin-bottom: 32px;
}

.level-group-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-card);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.lesson-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.lesson-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.lesson-card.locked {
  opacity: 0.5;
  cursor: pointer;
}

/* Confirmation modal */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.confirm-modal {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.confirm-modal h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.confirm-modal p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirm-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.lesson-card.completed {
  border-color: var(--success);
}

.lesson-card.completed::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.4rem;
  color: var(--success);
  font-weight: 900;
}

.lesson-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.lesson-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.lesson-card-keys {
  display: inline-block;
  background: var(--bg-primary);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--accent-light);
}

.lesson-card-stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.lesson-card-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   TYPING AREA
   ============================================ */

.typing-view {
  text-align: center;
}

.typing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.typing-header h2 {
  color: var(--accent-light);
}

.typing-stats-bar {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 20px;
}

.typing-stat {
  text-align: center;
}

.typing-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  display: block;
}

.typing-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.typing-text-container {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing-text {
  font-size: 1.6rem;
  font-family: 'Courier New', monospace;
  line-height: 2;
  letter-spacing: 1px;
  text-align: left;
  max-width: 100%;
  word-wrap: break-word;
}

.typing-text .char {
  position: relative;
  padding: 2px 0;
}

.typing-text .char.current {
  background: var(--accent);
  border-radius: 3px;
  animation: pulse-cursor 1s ease-in-out infinite;
}

.typing-text .char.correct {
  color: var(--success);
}

.typing-text .char.incorrect {
  color: var(--error);
  text-decoration: underline;
  text-decoration-color: var(--error);
}

.typing-text .char.pending {
  color: var(--text-secondary);
  opacity: 0.5;
}

@keyframes pulse-cursor {
  0%, 100% { background: var(--accent); }
  50% { background: var(--accent-light); }
}

.finger-hint {
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ============================================
   RESULTS SCREEN
   ============================================ */

.results-container {
  text-align: center;
  padding: 40px 0;
}

.results-emoji {
  font-size: 5rem;
  margin-bottom: 16px;
}

.results-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.results-title.passed { color: var(--success); }
.results-title.failed { color: var(--warning); }

.results-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
}

.result-stat {
  background: var(--bg-card);
  padding: 20px 28px;
  border-radius: 16px;
  min-width: 120px;
}

.result-stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  display: block;
}

.result-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.result-stat-value.accuracy-high { color: var(--success); }
.result-stat-value.accuracy-mid { color: var(--warning); }
.result-stat-value.accuracy-low { color: var(--error); }

.results-xp {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--xp-color);
  margin-bottom: 24px;
}

.results-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ============================================
   PROFILE
   ============================================ */

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  background: var(--bg-card);
  padding: 24px;
  border-radius: 16px;
}

.profile-avatar {
  font-size: 4rem;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 50%;
}

.profile-info h2 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.profile-info .profile-title {
  color: var(--accent-light);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
}

.stat-card-icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 800;
  display: block;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.achievements-section h3 {
  margin-bottom: 16px;
  color: var(--accent-light);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.achievement-card {
  background: var(--bg-card);
  padding: 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.achievement-card.locked {
  opacity: 0.4;
}

.achievement-card-icon {
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
}

.achievement-card-info h4 {
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.achievement-card-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.profile-advanced {
  margin-top: 20px;
}

.profile-advanced-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
}

.profile-advanced-panel summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  user-select: none;
}

.profile-layout-setting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.profile-layout-setting label {
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-layout-setting p {
  width: 100%;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.profile-layout-select {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-primary);
  font: inherit;
  padding: 8px 12px;
}

/* ============================================
   LEADERBOARD
   ============================================ */

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 12px 16px;
  text-align: left;
}

.leaderboard-table th {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 2px solid var(--bg-card);
}

.leaderboard-table tr:nth-child(even) {
  background: var(--bg-card);
}

.leaderboard-table tr:nth-child(odd) {
  background: var(--bg-secondary);
}

.leaderboard-rank {
  font-weight: 800;
  font-size: 1.2rem;
}

.leaderboard-rank.gold { color: #ffd700; }
.leaderboard-rank.silver { color: #c0c0c0; }
.leaderboard-rank.bronze { color: #cd7f32; }

/* ============================================
   THEME PICKER
   ============================================ */

.theme-picker {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.theme-option {
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-align: center;
  flex: 1;
}

.theme-option:hover, .theme-option.active {
  border-color: var(--accent);
}

.theme-option-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 4px;
}

.theme-option-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.theme-picker[style*="flex-wrap"] .theme-option {
  flex: 0 1 auto;
  min-width: 100px;
}

.theme-ruimte { background: #252566; }
.theme-onderzee { background: #004080; }
.theme-jungle { background: #3a5c3a; }

/* ============================================
   SPEED CHALLENGE
   ============================================ */

.speed-timer {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.speed-timer.warning { color: var(--warning); }
.speed-timer.danger { color: var(--error); }

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-bar-fill.xp {
  background: linear-gradient(90deg, var(--xp-color), #ffe082);
}

/* ============================================
   POPUPS
   ============================================ */

.achievement-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  animation: slide-in-right 0.5s ease;
}

.achievement-popup-content {
  background: var(--bg-card);
  border: 2px solid var(--xp-color);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  text-align: center;
  min-width: 240px;
}

.levelup-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.levelup-content {
  background: var(--bg-card);
  border: 3px solid var(--accent);
  border-radius: 24px;
  padding: 40px 60px;
  text-align: center;
  animation: scale-in 0.5s ease;
}

.levelup-number {
  font-size: 5rem;
  font-weight: 900;
  color: var(--xp-color);
  margin: 16px 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .header-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .header-right {
    flex-direction: column;
    gap: 10px;
  }

  .header-stats {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .typing-text {
    font-size: 1.2rem;
  }

  .results-stats {
    flex-direction: column;
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .personal-bests {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .voortgang-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .attempt-row .attempt-main {
    flex-wrap: wrap;
  }
}

/* ============================================
   LESSON PROGRESS BUTTON
   ============================================ */

.lesson-card {
  position: relative;
}

.lesson-progress-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.lesson-progress-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.15);
}

/* ============================================
   PERSONAL BESTS
   ============================================ */

.personal-bests {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.personal-best-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.personal-best-card.new-record {
  border: 2px solid #FFD700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}

.personal-best-card.new-record .pb-record {
  display: block;
}

.pb-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.pb-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
}

.pb-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.pb-record {
  display: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFD700;
  margin-top: 4px;
  animation: pulse-text 1s ease infinite;
}

.pb-note {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 2px;
  opacity: 0.7;
}

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

.pulse-glow {
  animation: pulse-glow-anim 1.5s ease infinite;
}

@keyframes pulse-glow-anim {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 32px rgba(255, 215, 0, 0.6); }
}

/* ============================================
   ATTEMPT DOTS
   ============================================ */

.attempt-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
}

.attempt-dot {
  min-width: 40px;
  height: 40px;
  border-radius: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: default;
}

.attempt-dot:hover {
  transform: scale(1.3);
  z-index: 1;
}

.attempt-dot-number {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

/* ============================================
   ATTEMPT HISTORY
   ============================================ */

.attempt-history {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
}

.attempt-history h4 {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.attempt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.attempt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.attempt-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.attempt-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
}

.attempt-details {
  flex: 1;
  min-width: 0;
}

.attempt-main {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
}

.attempt-acc {
  font-weight: 600;
  color: var(--text-primary);
}

.attempt-wpm {
  color: var(--text-secondary);
}

.attempt-time {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.attempt-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 2px;
}

.diff-up {
  color: #4CAF50;
  font-size: 0.75rem;
  font-weight: 600;
}

.diff-down {
  color: #F44336;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================================
   LESSON PROGRESS VIEW
   ============================================ */

.lesson-progress-view {
  max-width: 800px;
  margin: 0 auto;
}

.lp-header {
  margin-bottom: 24px;
}

.lp-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.improvement-streak {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b35, #ff4500);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 8px;
  animation: bounce-in 0.5s ease;
}

.chart-container {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
}

.chart-container h4 {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ============================================
   VOORTGANG (PROGRESS OVERVIEW) VIEW
   ============================================ */

.voortgang-view {
  max-width: 900px;
  margin: 0 auto;
}

.voortgang-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.voortgang-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.voortgang-stat {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.voortgang-stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
}

.voortgang-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.voortgang-section {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.voortgang-section h4 {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.improvement-banner {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(33, 150, 243, 0.15));
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 24px;
  font-size: 1rem;
  color: var(--text-primary);
}

/* ============================================
   LESSON MAP
   ============================================ */

.lesson-map h4 {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.map-group {
  margin-bottom: 12px;
}

.map-group-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.map-group-lessons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.map-lesson {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: transform 0.2s;
  cursor: default;
}

.map-lesson:hover {
  transform: scale(1.2);
}

.map-lesson-num {
  opacity: 0.8;
}

.mastery-none {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.mastery-red {
  background: rgba(244, 67, 54, 0.3);
  color: #F44336;
}

.mastery-yellow {
  background: rgba(255, 193, 7, 0.3);
  color: #FFC107;
}

.mastery-green {
  background: rgba(76, 175, 80, 0.3);
  color: #4CAF50;
}

.mastery-gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 165, 0, 0.3));
  color: #FFD700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* ============================================
   ACTIVITY HEATMAP
   ============================================ */

.heatmap h4 {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.heatmap-grid {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.heatmap-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-right: 4px;
}

.heatmap-label {
  width: 20px;
  height: 14px;
  font-size: 0.6rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-day {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  transition: transform 0.15s;
}

.heatmap-day:hover {
  transform: scale(1.5);
  z-index: 1;
}

.heatmap-day.empty {
  visibility: hidden;
}

.heatmap-day.level-0 {
  background: rgba(255, 255, 255, 0.06);
}

.heatmap-day.level-1 {
  background: rgba(76, 175, 80, 0.25);
}

.heatmap-day.level-2 {
  background: rgba(76, 175, 80, 0.45);
}

.heatmap-day.level-3 {
  background: rgba(76, 175, 80, 0.65);
}

.heatmap-day.level-4 {
  background: rgba(76, 175, 80, 0.9);
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.heatmap-legend .heatmap-day {
  width: 12px;
  height: 12px;
}
