﻿:root {
  font-family: 'Fredoka', 'sans-serif';
  --sky-500: #4aa8d8;
  --sky-600: #3b8fba;
  --sky-700: #2c769c;
  --sunshine-500: #ffd93d;
  --leaf-500: #6bcf9d;
  --orange-500: #ff9f45;
  --lavender-500: #c8a2e0;
  --bg-cream: #fffdf7;
  --bg-sky: #e8f4f8;
  --border-dark: #2c3e50;
  --text-dark: #2c3e50;
  --text-muted: #6b7280;
  --crimson-500: #e74c3c;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --border-thick: 4px solid var(--border-dark);
}

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

body {
  font-family: 'Fredoka', 'sans-serif';
  background: var(--bg-cream);
  color: var(--text-dark);
  min-height: 100vh;
  user-select: none;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--sky-500);
  padding: 16px 32px;
  border-radius: var(--radius-xl);
  border: var(--border-thick);
  color: #fff;
}

.logo-mark span {
  font-size: 1.2rem;
  font-weight: 600;
}

.logo-mark small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.parent-gate {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: none;
  background: var(--text-muted);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  font-family: inherit;
}

.star-counter {
  background: #fff;
  border-radius: 24px;
  padding: 8px 16px;
  color: var(--text-dark);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.hero {
  background: var(--bg-sky);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  border: 3px solid var(--border-dark);
}

.hero-text h1 {
  font-size: 48px;
  line-height: 1.1;
  margin-bottom: 12px;
  font-family: 'Fredoka', 'sans-serif';
}

.cue {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-logo {
  width: 120px;
  height: auto;
  display: block;
}

.audio-button {
  width: 96px;
  height: 96px;
  border-radius: 9999px;
  border: 4px solid var(--border-dark);
  background: var(--sky-500);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease-out;
}

.audio-button:hover {
  transform: scale(1.05);
}

.audio-button.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}

.home-module {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  border: var(--border-thick);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease-out, background 0.2s ease-out;
}

.home-module:hover {
  transform: scale(1.03);
}

.home-module.module-pulse {
  animation: modulePulse 400ms ease-out;
}

.home-module span.module-icon {
  font-size: 3rem;
}

.sky {
  background: var(--sky-500);
}

.sunshine {
  background: var(--sunshine-500);
  color: #2c3e50;
}

.leaf {
  background: var(--leaf-500);
}

.orange {
  background: var(--orange-500);
}

.lavender {
  background: var(--lavender-500);
}

.lesson-highlight {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.lesson-card {
  flex: 1;
  min-width: 280px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border-dark);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
}

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

.lesson-icon {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  border: 3px solid var(--border-dark);
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.lesson-label {
  font-size: 1.25rem;
  font-weight: 600;
}

.lesson-description {
  font-size: 1rem;
  line-height: 1.4;
}

.lesson-actions {
  display: flex;
  gap: 12px;
}

.secondary {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 3px solid var(--border-dark);
  background: var(--bg-sky);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease-out;
}

.secondary:hover {
  transform: scale(1.02);
}

.secondary.ghost {
  background: transparent;
  border-color: rgba(44, 62, 80, 0.4);
}

.primary {
  background: var(--sunshine-500);
  border: none;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  cursor: pointer;
}

.audio-section {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border-dark);
  padding: 24px;
}

.audio-controls {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.dashboard {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 3px solid rgba(44, 62, 80, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
}

.dashboard-header h2 {
  margin-bottom: 8px;
}

.progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.progress p {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
}

.summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: 'Inter', sans-serif;
}

.dashboard-actions {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.parent-secondary {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-dark);
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: var(--radius-md);
  border: 3px solid var(--border-dark);
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toast.visible {
  opacity: 1;
}

.parent-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 24px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.parent-overlay[aria-hidden='false'] {
  opacity: 1;
  pointer-events: auto;
}

.parent-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(360px, 100%);
  border: 3px solid rgba(44, 62, 80, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parent-question {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text-dark);
}

.parent-modal form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parent-modal input {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-dark);
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.form-feedback {
  min-height: 1rem;
  color: var(--crimson-500, #e74c3c);
  font-family: 'Inter', sans-serif;
}

.parent-modal button {
  font-family: 'Inter', sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .audio-button,
  .home-module,
  .secondary,
  .parent-secondary,
  .primary {
    transition: none;
  }

  .audio-button.pulse {
    animation: none;
  }

  .toast {
    transition: none;
  }
}

@keyframes modulePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 32px 16px;
  }

  .hero {
    flex-direction: column;
  }

  .lesson-actions {
    flex-direction: column;
  }
}
