:root {
  /* Apple-Inspired Minimalist Palette */
  --primary: #0066cc;
  /* Apple Blue */
  --primary-glow: rgba(0, 102, 204, 0.15);
  --secondary: #ff3b30;
  /* Apple Red */
  --accent: #ff9500;
  /* Apple Orange */
  --background: #f5f5f7;
  /* Apple Grey Background */
  --surface: #ffffff;
  /* Pure White Surface */
  --surface-hover: #fcfcfd;
  --sidebar-bg: #fbfbfd;
  --top-bar-bg: rgba(255, 255, 255, 0.72);
  --text: #1d1d1f;
  /* Apple High-Contrast Text */
  --text-muted: #86868b;
  /* Apple Muted Text */
  --success: #34c759;
  /* Apple Green */
  --error: #ff3b30;
  --warning: #ffcc00;
  /* Apple Yellow */
  --border: #d2d2d7;
  /* Apple Border Color */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  /* Sophisticated, soft shadow */
  --sidebar-width: 280px;

  /* Animation Easing */
  --ease-apple: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --background: #000000;
  --surface: #1c1c1e;
  --surface-hover: #2c2c2e;
  --sidebar-bg: #161617;
  --top-bar-bg: rgba(0, 0, 0, 0.72);
  --text: #f5f5f7;
  --text-muted: #86868b;
  --border: #38383a;
  --primary: #0a84ff;
  --primary-glow: rgba(10, 132, 255, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #000000;
    --surface: #1c1c1e;
    --surface-hover: #2c2c2e;
    --sidebar-bg: #161617;
    --top-bar-bg: rgba(0, 0, 0, 0.72);
    --text: #f5f5f7;
    --text-muted: #86868b;
    --border: #38383a;
    --primary: #0a84ff;
    --primary-glow: rgba(10, 132, 255, 0.3);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

/* Reward System Styles */
.user-rewards-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(251, 191, 36, 0.15);
  color: #d97706;
  /* Darker amber for readability */
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(251, 191, 36, 0.3);
  animation: pulse-star 2s infinite;
}

.history-star {
  color: #fbbf24;
  font-size: 1.2rem;
  margin-left: 8px;
  text-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
}

@keyframes pulse-star {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes score-bounce {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.score-bounce-animate {
  animation: score-bounce 0.4s var(--ease-apple);
}


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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.47059;
  /* Apple's specific line height */
  font-weight: 400;
  letter-spacing: -0.022em;
  min-height: 100dvh;
  /* Use dynamic viewport height */
  overflow-x: hidden;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100dvh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease-apple), background 0.3s var(--ease-apple);
  z-index: 1000;
  /* Increased for mobile layering */
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100dvh;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling for iOS */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar-header {
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.03em;
}

/* Mastery Ring Styles */
.mastery-ring-container {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mastery-ring {
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
  opacity: 0.3;
}

.ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  /* 2 * PI * r (26) */
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 0.6s var(--ease-apple), stroke 0.6s var(--ease-apple);
}

.mastery-ring-container .value {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.sidebar-nav {
  padding: 1rem;
  flex: 1 0 auto;
  /* Allow to grow and shrink, prevents squishing on small screens */
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #000;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-apple);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
  background: rgba(0, 102, 204, 0.1);
  color: var(--primary);
}

.nav-divider {
  padding: 1.5rem 1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  /* Ensures footer doesn't squash */
}

/* Player Stats Sidebar */
.player-stats-sidebar {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stats-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.level-badge {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.streak-icon {
  font-size: 1rem;
}

.xp-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.xp-progress {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #0a84ff, #0066cc);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.xp-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
}

/* Progress Report Screen Redesign */
#report-screen {
  padding: 2rem;
  background: var(--bg-color);
}

.report-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.report-top-header .header-main h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.report-top-header .header-main p {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.report-content-container {
  max-width: 1000px;
  margin: 0 auto;
}

.report-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.report-stat-card {
  background: white;
  padding: 1.25rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s var(--ease-apple), box-shadow 0.3s var(--ease-apple);
}

.report-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.report-insights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1.5rem;
  margin-bottom: 1.5rem;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: white;
}

.insight-item.highlight {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.01), rgba(52, 199, 89, 0.08));
  border-color: rgba(52, 199, 89, 0.15);
}

.insight-item.focus {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.01), rgba(255, 149, 0, 0.08));
  border-color: rgba(255, 149, 0, 0.15);
}

.insight-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.insight-text strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.insight-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.report-trend {
  margin: 0 1.5rem 1.5rem;
  background: white;
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.report-trend h4 {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  height: 140px;
  padding: 0 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.trend-bar-wrapper {
  flex: 1;
  max-width: 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem;
}

.trend-percent {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
}

.trend-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--primary), var(--primary-glow));
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 4px 10px var(--primary-glow);
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.trend-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}

.trend-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  margin-top: -0.25rem;
}

.trend-labels span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Empty State Premium */
.no-data-premium {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.no-data-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  filter: grayscale(0.5);
  opacity: 0.7;
}

.no-data-premium h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.no-data-premium p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.5;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.secondary-btn {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.secondary-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.print-btn-premium {
  padding: 0.8rem 1.5rem !important;
  font-size: 1rem !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.print-btn-premium:hover {
  background: var(--surface-hover) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

@media print {

  .sidebar,
  .nav-item,
  .modal-footer,
  .close-btn {
    display: none !important;
  }

  .modal {
    position: static;
    display: block;
    background: white;
  }

  .report-modal-content {
    width: 100%;
    max-width: none;
    box-shadow: none;
  }
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--background);
  min-height: 100dvh;
}

.top-bar {
  height: 52px;
  /* Slimmer, more balanced */
  background: var(--top-bar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

#toggle-sidebar {
  display: none;
}

/* Show on mobile */

.search-container {
  flex: 1;
  max-width: 500px;
}

.search-container input {
  width: 100%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: all 0.2s var(--ease-apple);
  font-size: 0.9rem;
}

.search-container input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--primary);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-footer-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  flex-wrap: wrap;
  /* Helps on very tight screens */
  position: relative;
}

.sidebar-avatar {
  width: 42px;
  height: 42px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.avatar-option {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-apple);
  background: var(--surface);
}

.avatar-option:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.avatar-option.selected {
  background: var(--primary-glow);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.user-footer-side .user-select {
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  pointer-events: auto !important;
}

.nav-icon-button {
  background: var(--primary);
  color: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.nav-icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px var(--primary-glow);
}

.content-body {
  flex: 1;
  padding: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.header h1,
.header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header .description {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Screens */
.screen {
  display: none;
  animation: fadeIn 0.4s ease;
  width: 100%;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Dashboard Enhancements */
.dashboard-hero {
  background: var(--surface);
  /* Pure Apple feel */
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  color: var(--text);
  margin-bottom: 3.5rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.05) 0%, rgba(10, 132, 255, 0.05) 100%);
  border-radius: 50%;
}

.dashboard-hero h2 {
  font-size: 3rem;
  font-weight: 700;
  /* Apple uses 700 for heavy titles */
  margin-bottom: 0.75rem;
  letter-spacing: -0.04em;
  color: #000;
}

.dashboard-hero p {
  font-size: 1.3rem;
  color: var(--text-muted);
  max-width: 650px;
  line-height: 1.4;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.recommendation-card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.4s var(--ease-apple);
  position: relative;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.recommendation-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 1.5rem;
}

.recommendation-card h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #000;
  letter-spacing: -0.02em;
}

.recommendation-card p {
  color: var(--text-muted);
  font-size: 1.05rem;
  flex-grow: 1;
  line-height: 1.4;
}

.start-card-btn {
  margin-top: 2rem;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: 20px;
  /* Pill shape */
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  width: fit-content;
}

.start-card-btn:hover {
  background: #0077ed;
  transform: scale(1.05);
}

/* Quests Styles */
/* Parental Insights / Report Styles */
.report-section {
  margin-top: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.report-section h4 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Activity Heatmap */
.activity-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 150px;
  padding: 0 1rem;
  background: var(--background);
  border-radius: var(--radius-md);
  gap: 8px;
}

.activity-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.activity-bar {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s var(--ease-apple);
  min-height: 4px;
}

.activity-day {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mistakes Pills */
.mistakes-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mistake-pill {
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s var(--ease-apple);
}

.mistake-pill:hover {
  background: rgba(255, 59, 48, 0.12);
  transform: translateY(-2px);
}

.mistake-pill .skill-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.mistake-pill .mistake-count {
  background: #ff3b30;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.empty-msg {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* Data Buttons */
.secondary-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-apple);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.secondary-btn:hover {
  background: var(--background);
  border-color: var(--primary);
  color: var(--primary);
}

.dashboard-quests {
  margin-bottom: 2.5rem;
}

.dashboard-quests h3 {
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.quests-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.quest-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: all 0.3s var(--ease-apple);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.quest-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-glow);
}

.quest-icon {
  font-size: 1.8rem;
  width: 52px;
  height: 52px;
  background: var(--background);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quest-info {
  flex: 1;
}

.quest-info h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.quest-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.quest-progress-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.8rem;
}

.quest-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.6s var(--ease-apple);
}

.quest-card.completed {
  border-color: rgba(52, 199, 89, 0.3);
  background: linear-gradient(135deg, var(--surface), rgba(52, 199, 89, 0.03));
}

.quest-card.completed .quest-progress-fill {
  background: var(--success);
}

.quest-card.completed .quest-icon {
  background: var(--success);
  color: white;
}

/* Dashboard Rewards Section */
.dashboard-rewards {
  margin-top: 2rem;
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.dashboard-rewards h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.rewards-summary {
  display: flex;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.reward-stat {
  display: flex;
  flex-direction: column;
}

.reward-stat .stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.reward-stat .stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
}

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

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  background: #fbfbfd;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.badge-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.badge-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.empty-rewards-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-style: italic;
  border: 1px dashed var(--border);
}

/* Selection Screens (Subject & Year/Topic) */
.subject-selection,
.year-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  perspective: 1000px;
}

.subject-button,
.year-button {
  background: #ffffff;
  padding: 3rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.4s var(--ease-apple);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  font-family: inherit;
}

.subject-button:hover,
.year-button:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  background: var(--surface-hover);
}

.subject-icon {
  font-size: 4rem;
  transition: transform 0.3s var(--ease-apple);
}

.subject-button:hover .subject-icon {
  transform: scale(1.1) rotate(5deg);
}

.subject-name,
.year-button {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-align: center;
}

.year-button {
  padding: 2.5rem 2rem;
  min-height: 180px;
}

/* Back Button styling in selection screens */
.back-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.8rem 2rem;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.back-button:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text);
}

/* Skill List Tree */
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.skill-category {
  margin-bottom: 2rem;
}

.skill-category h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
  padding-bottom: 0.25rem;
}

.skill-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease-apple);
}

.skill-item:hover {
  background: var(--surface);
  border-color: #86868b;
  transform: scale(1.005);
}

.skill-id {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  min-width: 45px;
}

.skill-name {
  flex: 1;
  font-weight: 500;
  font-size: 1.1rem;
}

.skill-score {
  background: #f5f5f7;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.skill-score[style*="background: var(--accent)"] {
  background: var(--primary) !important;
  color: white !important;
  border: none !important;
}

/* Quiz Styles (IXL Style) */
.quiz-top-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quiz-status {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.score-display-mini {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.score-display-mini .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.score-display-mini .value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.counter-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.timer-display {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-apple);
}

.timer-display.timer-low {
  color: var(--error);
  border-color: var(--error);
  background: rgba(255, 59, 48, 0.05);
  animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

.question-container {
  background: #ffffff;
  padding: 4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
  min-height: 320px;
  position: relative;
}

.question-label {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  line-height: 1.3;
  color: #000;
  letter-spacing: -0.03em;
}

.tts-button {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 1rem;
  right: 1rem;
  transition: all 0.2s;
}

.tts-button:hover {
  background: var(--primary);
  color: white;
}

.choices-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.choice-item {
  background: #f5f5f7;
  border: 1px solid transparent;
  padding: 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.2s var(--ease-apple);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text);
}

.choice-item:hover {
  background: #e8e8ed;
  transform: scale(1.01);
}

.choice-item.selected {
  background: var(--primary);
  color: white;
}

.choice-letter {
  font-weight: 700;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.choice-item.selected .choice-letter {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Navigation Buttons */
.button-group {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.submit-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 2.5rem;
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s var(--ease-apple);
  min-height: 48px;
  /* Touch friendly */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.submit-button:hover {
  background: #0077ed;
  transform: scale(1.03);
}

.back-to-start-btn,
.nav-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 2.5rem;
  border-radius: 24px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s var(--ease-apple);
  min-height: 48px;
  /* Touch friendly */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-to-start-btn:hover,
.nav-button:hover {
  background: #f5f5f7;
  border-color: var(--text);
}

/* History Modal Specifics */
.history-modal .modal-content {
  max-width: 600px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

#history-list {
  flex: 1;
  overflow-y: auto;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.5rem;
}

.history-entry {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s;
}

.history-entry:hover {
  border-color: var(--primary);
  background: white;
  box-shadow: var(--shadow-sm);
}

.history-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.history-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-subject {
  font-weight: 700;
  font-size: 1.1rem;
}

.history-score {
  background: var(--surface);
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid var(--primary-glow);
}

.modal-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

/* Stat Summary in Results */
.score-summary {
  display: flex;
  gap: 3rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.score-summary .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 3rem;
  font-weight: 900;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat.highlight .stat-value {
  color: var(--accent);
}

/* Progress bar overwrite */
.progress-bar {
  width: 100%;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  border: none;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 90%;
  max-width: 450px;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
}

.form-group input,
.form-group select {
  background: var(--background);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
}

/* Results Screen Layout */
.results-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

#score-message {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid var(--border);
  color: #000;
  letter-spacing: -0.04em;
}

#score-message:empty {
  display: none;
}

#score-message.excellent {
  color: var(--success);
}

#score-message.great {
  color: var(--primary);
}

#score-message.good {
  color: var(--accent);
}

#score-message.okay {
  color: var(--warning);
}

/* Results Screen Review Section */
.answers-review {
  margin-top: 3rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
  margin-bottom: 3rem;
}

.answers-review h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 2rem;
  color: var(--text);
  border-bottom: 2px solid var(--primary-glow);
  padding-bottom: 0.75rem;
  display: inline-block;
}

#answers-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.answer-item {
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.answer-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 25px rgba(14, 165, 233, 0.1);
}

.answer-item.correct {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(to right, rgba(34, 197, 94, 0.05), #ffffff 50%);
}

.answer-item.incorrect {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(to right, rgba(239, 68, 68, 0.05), #ffffff 50%);
}

.answer-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 100%;
}

.answer-item.correct::before {
  background-color: var(--success);
}

.answer-item.incorrect::before {
  background-color: var(--error);
}

.answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.answer-number {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.answer-status {
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

.answer-item.correct .answer-status {
  background-color: var(--success);
  color: white;
}

.answer-item.incorrect .answer-status {
  background-color: var(--error);
  color: white;
}

.answer-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 1.05rem;
}

.answer-content p {
  line-height: 1.5;
  margin: 0;
}

.answer-content strong {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 0.5rem;
  display: inline-block;
  min-width: 140px;
}

.answer-content .explanation {
  margin-top: 1rem;
  padding: 1.25rem;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Responsive */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 52px;
    /* Matches top-bar height */
    left: 0;
    height: calc(100vh - 52px);
    transform: translateX(-100%);
    width: 280px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    /* Already has overflow-y: auto from main declaration */
  }

  .sidebar-footer {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    /* Extra space for mobile browser bars and safe areas */
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .top-bar {
    padding: 0 1rem;
  }

  #toggle-sidebar {
    display: flex;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
  }

  .main-content {
    min-height: 100dvh;
  }

  .content-body {
    padding: 1.5rem 1rem 4rem;
    /* Added bottom padding for mobile navigation space */
  }

  .header h1,
  .header h2 {
    font-size: 2rem;
    /* Slightly smaller headers */
  }

  .dashboard-hero {
    padding: 2rem 1.5rem;
  }

  .dashboard-hero h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 600px) {
  .question-container {
    padding: 1.5rem 1rem;
    min-height: auto;
    /* Remove fixed min-height */
  }

  .question-label {
    font-size: 1.5rem;
    /* Smaller question text on mobile */
    margin-bottom: 2rem;
  }

  .choices-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .choice-item {
    padding: 1.2rem;
    font-size: 1.05rem;
  }

  .score-summary {
    gap: 1.5rem;
  }

  .stat-value {
    font-size: 2.5rem;
  }

  .dashboard-rewards {
    padding: 1.5rem;
  }

  .rewards-summary {
    gap: 1.5rem;
  }

  .reward-stat .stat-value {
    font-size: 2rem;
  }

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

}

/* Audio-Visual Animations */
.shake-animation {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@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); }
}

.floating-text {
  position: absolute;
  font-weight: 800;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 10000;
  animation: floatUp 1s ease-out forwards;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  20% { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1); }
}

/* Mascot Animations */
.mascot-wrapper {
  position: absolute;
  top: -40px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.mascot-character {
  font-size: 3.5rem;
  transition: transform 0.3s;
}

.mascot-character.happy {
  animation: mascotBounce 0.5s ease;
}

.mascot-character.sad {
  animation: mascotShake 0.5s ease;
}

.mascot-bubble {
  background: white;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  margin-bottom: 5px;
  transition: opacity 0.3s;
  color: var(--text);
}

@keyframes mascotBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes mascotShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px) rotate(-5deg); }
  75% { transform: translateX(5px) rotate(5deg); }
}

/* Shop Modal */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.shop-balance {
  font-size: 1.25rem;
  font-weight: bold;
  background: var(--background);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: var(--text);
}

.shop-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.shop-tab {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.shop-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.shop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.shop-grid:not(.active) {
  display: none;
}

.shop-item {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1 1 100px;
  max-width: 120px;
  color: var(--text);
}

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

.shop-item.equipped {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.shop-item-preview {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.shop-item-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.shop-item-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Themes */
body.theme-space {
  --background: #1e1e2f;
  --surface: #2b2b3d;
  --text: #ffffff;
  --text-muted: #a0a0b5;
  --primary: #8a2be2;
  --border: #3d3d5c;
  background-color: var(--background);
  color: var(--text);
}

body.theme-jungle {
  --background: #f0fdf4;
  --surface: #dcfce7;
  --primary: #16a34a;
  --border: #bbf7d0;
  background-color: var(--background);
}

/* Quests */
.quests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.quest-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quest-info h4 { margin: 0 0 0.25rem 0; font-size: 1.05rem; }
.quest-info p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.quest-reward { font-weight: bold; color: var(--accent); }
.quest-item.completed { opacity: 0.6; }
/* Header Mascot Styles */
.header-mascot-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1.5rem;
  cursor: pointer;
}

.header-mascot-sprite {
  font-size: 2.2rem;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.header-mascot-wrapper:hover .header-mascot-sprite {
  transform: scale(1.2) rotate(10deg);
}

.header-mascot-bubble {
  position: absolute;
  top: 110%;
  right: 0;
  background: white;
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.3s var(--ease-apple);
  border: 1px solid var(--border);
  z-index: 100;
}

.header-mascot-bubble::after {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 15px;
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent white transparent;
}

.header-mascot-wrapper:hover .header-mascot-bubble {
  opacity: 1;
  transform: translateY(0);
}

/* Emotions */
.header-mascot-sprite.happy { animation: mascotBounce 0.5s ease; }
.header-mascot-sprite.sad { animation: mascotShake 0.5s ease; }
