/* Kids English AI — Parent App (Premium UI v2)
 * AIDesigner v2 (run f7023f28) ベース → vanilla CSS 移植
 * 4 sections: Onboarding / Home / Play / Progress
 * Mobile-first, tablet/desktop responsive
 */

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;800;900&family=Plus+Jakarta+Sans:wght@500;700;800;900&display=swap');

:root {
  /* v3 palette: もう少し暖かく彩度を上げ、子供向けに親しみやすく */
  --bg: #fef9f3;             /* cream slightly warmer */
  --bg-warm: #fbf2e7;
  --primary: #ff8a65;
  --primary-dark: #d84315;
  --primary-soft: #ffccbc;
  --accent: #66bb6a;
  --accent-dark: #4ca050;
  --accent-light: #a5d6a7;
  --accent-pale: #c8e6c9;
  --gold: #ffd54f;
  --gold-dark: #f57f17;
  --gold-pale: #fff3c4;
  --sky: #81d4fa;            /* 新: 空色 (variety) */
  --pink: #f8bbd0;           /* 新: ピンク (family theme) */
  --text: #3e2723;
  --text-light: #5d4037;
  --muted: #8d6e63;
  --card: #ffffff;
  --border: #ffccbc;
  --pink-bg: #fff0f5;
  --yellow-bg: #fffbe7;
  --green-bg: #f0fdf4;
  --sky-bg: #e3f2fd;
  --shadow-card: 0 8px 0 #e8dfd2;
  --shadow-coral: 0 8px 0 var(--primary-dark);
  --shadow-mint: 0 8px 0 var(--accent-dark);
  --shadow-gold: 0 8px 0 var(--gold-dark);
}

* { box-sizing: border-box; }
*:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  font-family: 'Plus Jakarta Sans', 'M PLUS Rounded 1c', -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body {
  background-image:
    radial-gradient(circle at 15% 8%, rgba(165, 214, 167, 0.18) 0%, transparent 35%),
    radial-gradient(circle at 85% 90%, rgba(255, 213, 79, 0.12) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(255, 138, 101, 0.06) 0%, transparent 70%);
}

/* decor-float は廃止 (3-6 歳児向けの集中環境としてはノイズだった) */
.decor-float { display: none !important; }
.app-shell { position: relative; z-index: 1; }

/* ────────────────────────────────────────────────────────── */
/* Typography                                                  */
/* ────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
.en { font-family: 'Plus Jakarta Sans', sans-serif; }
.ja { font-family: 'M PLUS Rounded 1c', sans-serif; }

/* ────────────────────────────────────────────────────────── */
/* Layout                                                      */
/* ────────────────────────────────────────────────────────── */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 110px;  /* room for 84px bottom nav + breathing space */
}

.view { display: none; flex: 1; flex-direction: column; padding: 20px 20px 32px; }
.view.active { display: flex; }

/* ────────────────────────────────────────────────────────── */
/* Top header (greeting)                                       */
/* ────────────────────────────────────────────────────────── */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 24px 16px;
}
.app-header-greet {
  font-size: 0.95rem; font-weight: 700; color: var(--text-light);
  margin-bottom: 2px;
}
.app-header-name {
  font-size: 1.75rem; font-weight: 900;
  margin: 0;
}
.app-header-btn {
  width: 56px; height: 56px;
  border-radius: 22px;
  background: white;
  box-shadow: 0 4px 0 #e8dfd2;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  border: none; cursor: pointer;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 10px;
  overflow: hidden;  /* アイコン画像内の装飾が枠を超えても clip */
}
.app-header-btn img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-header-btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }

/* ────────────────────────────────────────────────────────── */
/* Bottom navigation (after onboarding)                        */
/* ────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 90px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(62,39,35,0.06);
  align-items: stretch; justify-content: space-around;
  padding: 8px 4px 16px;
  z-index: 50;
  display: none;
}
.bottom-nav.visible { display: flex; }
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; color: var(--text-light);
  font-size: 0.72rem; font-weight: 800;
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.15s;
  padding: 4px 2px 0;
}
.nav-btn .icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  border-radius: 16px;
  background: rgba(255,255,255,0.65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(0,0,0,0.04);
}
.nav-btn .icon img {
  width: 100%; height: 100%; object-fit: contain;
  display: block;
  filter: saturate(0.55) brightness(0.95);
  transition: filter 0.2s;
}
.nav-btn.active { opacity: 1; color: var(--accent-dark); }
.nav-btn.active .icon {
  transform: scale(1.04);
  background: white;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.9), 0 4px 8px rgba(0,0,0,0.1);
}
.nav-btn.active .icon img { filter: saturate(1.2); }
.nav-btn:active { transform: scale(0.95); }

/* Highlight the unified Play tab (primary action) */
.nav-btn-play .icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 16px;
  padding: 9px;
  box-shadow: 0 4px 8px rgba(255,99,71,0.35), inset 0 2px 0 rgba(255,255,255,0.3);
  overflow: hidden;
}
.nav-btn-play .icon img { filter: brightness(0) invert(1) !important; }
.nav-btn-play { opacity: 1; }

.app-shell:has(.bottom-nav.visible) { padding-bottom: 100px; }

/* ────────────────────────────────────────────────────────── */
/* 3D buttons                                                  */
/* ────────────────────────────────────────────────────────── */
.btn {
  font-family: inherit;
  font-weight: 800;
  border: none;
  cursor: pointer;
  border-radius: 24px;
  padding: 18px 28px;
  font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}
.btn.primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-coral), inset 0 3px 0 rgba(255,255,255,0.3);
  text-shadow: 0 2px 0 rgba(0,0,0,0.1);
}
.btn.mint {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-mint), inset 0 3px 0 rgba(255,255,255,0.25);
  text-shadow: 0 2px 0 rgba(0,0,0,0.1);
}
.btn.white {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-card), inset 0 3px 0 rgba(255,255,255,0.9);
}
.btn.gold {
  background: var(--gold);
  color: var(--text);
  box-shadow: var(--shadow-gold), inset 0 3px 0 rgba(255,255,255,0.3);
}
.btn.lg { padding: 22px 32px; font-size: 1.25rem; min-height: 68px; }
.btn:active {
  transform: translateY(8px);
  box-shadow: 0 0 0 transparent !important;
}
.btn:disabled {
  background: #ccc;
  box-shadow: 0 8px 0 #bbb;
  cursor: not-allowed; opacity: 0.6;
}
.btn.full { width: 100%; }

/* ────────────────────────────────────────────────────────── */
/* Cards & forms                                               */
/* ────────────────────────────────────────────────────────── */
.card {
  background: white;
  border: 2px solid white;
  border-radius: 28px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  margin-bottom: 16px;
}
.card-title {
  font-size: 1.25rem; font-weight: 900;
  margin: 0 0 12px;
}
.card-sub { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  background: white;
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 16px 20px;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 4px 0 rgba(0,0,0,0.03), inset 0 2px 0 rgba(255,255,255,0.8);
  transition: border-color 0.15s;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
}
.field input::placeholder { color: rgba(62,39,35,0.3); }
.field-hint { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }

/* Age picker grid */
.age-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.age-tile {
  height: 76px;
  border-radius: 22px;
  background: white;
  border: 3px solid transparent;
  box-shadow: 0 6px 0 #e0e0e0;
  font-family: inherit; font-weight: 900;
  font-size: 1.75rem;
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 2px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.age-tile small { font-size: 0.8rem; font-weight: 800; opacity: 0.6; }
.age-tile:active { transform: translateY(6px); box-shadow: 0 0 0 transparent; }
.age-tile.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--text);
}

/* Chips (favorites / personality) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  background: white;
  border: 3px solid white;
  box-shadow: 0 5px 0 var(--shadow-card, #e8dfd2);
  font-family: inherit; font-weight: 800; font-size: 0.95rem;
  color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.2s;
}
.chip:active { transform: translateY(5px); box-shadow: 0 0 0 transparent; }
.chip.selected {
  background: var(--accent-light);
  border-color: var(--accent);
  box-shadow: 0 5px 0 var(--accent-dark);
}
.chip-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chip-icon img { width: 100%; height: 100%; object-fit: contain; }

/* Checkbox row */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.04);
}
.toggle-row-text { flex: 1; }
.toggle-row-title { font-weight: 800; font-size: 1rem; }
.toggle-row-sub { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.toggle-switch {
  appearance: none;
  width: 56px; height: 32px;
  background: #e0e0e0;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 24px; height: 24px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: left 0.2s;
}
.toggle-switch:checked { background: var(--accent); }
.toggle-switch:checked::after { left: 28px; }

/* ────────────────────────────────────────────────────────── */
/* View: Onboarding (single-page polished form)                */
/* ────────────────────────────────────────────────────────── */
.onboarding {
  align-items: stretch;
  padding-top: 0;
}
.onboarding-hero {
  text-align: center;
  padding: 48px 24px 24px;
}
.onboarding-hero .puku {
  width: 140px; height: 140px;
  margin: 0 auto 16px;
  animation: float 3s ease-in-out infinite;
}
.onboarding-hero .puku img { width: 100%; height: 100%; object-fit: contain; }
.onboarding-hero h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin-bottom: 6px;
}
.onboarding-hero p { color: var(--text-light); font-weight: 700; font-size: 1rem; margin: 0; }

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

/* ────────────────────────────────────────────────────────── */
/* View: Home (dashboard)                                      */
/* ────────────────────────────────────────────────────────── */
.home-hero-card {
  position: relative;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  border-radius: 32px;
  padding: 20px 20px 16px;
  margin: 8px 4px 16px;
  box-shadow: 0 12px 24px rgba(76,160,80,0.25);
  overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer;
  border: none; text-align: left;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.home-hero-card:active {
  transform: translateY(4px);
  box-shadow: 0 4px 12px rgba(76,160,80,0.2);
}
.home-hero-card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.home-hero-card-tag {
  display: inline-flex;
  background: rgba(255,255,255,0.25);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 800;
  align-self: flex-start;
  backdrop-filter: blur(8px);
}
.home-hero-card-icon {
  width: 110px; height: 110px;
  margin: 4px auto 0;
  z-index: 2; position: relative;
  background: rgba(255,255,255,0.92);
  border-radius: 26px;
  padding: 10px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15), inset 0 2px 0 rgba(255,255,255,0.5);
}
.home-hero-card-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.home-hero-card-text { z-index: 2; position: relative; text-align: center; }
.home-hero-card-action {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.95);
  color: var(--accent-dark);
  padding: 10px 18px 10px 10px;
  border-radius: 999px;
  margin-top: 4px;
  z-index: 2; position: relative;
  box-shadow: 0 4px 8px rgba(0,0,0,0.12), inset 0 2px 0 rgba(255,255,255,0.5);
}
.home-hero-card-action-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.home-hero-card-action-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.home-hero-card-action-label {
  flex: 1;
  font-size: 1.05rem; font-weight: 900;
  text-align: center;
  letter-spacing: -0.01em;
}
.home-hero-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem; font-weight: 900;
  margin: 4px 0 2px;
  letter-spacing: -0.02em;
}
.home-hero-card-sub { font-size: 0.95rem; font-weight: 700; opacity: 0.9; }

/* (home-play-cta deprecated — replaced by hero-card-action) */

.home-stats {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 16px 20px;
  display: flex; justify-content: space-around; align-items: center;
  margin-bottom: 8px;
}
.home-stat { text-align: center; }
.home-stat-label { font-size: 0.7rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.home-stat-value { font-size: 1.4rem; font-weight: 900; }
.home-stat-value.gold { color: var(--gold-dark); display: inline-flex; align-items: center; gap: 4px; }
.home-stats-divider { width: 1px; height: 28px; background: rgba(62,39,35,0.1); }

/* ────────────────────────────────────────────────────────── */
/* View: Play (Free Talk)                                      */
/* ────────────────────────────────────────────────────────── */
.play-warmup {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; padding: 40px 24px;
  text-align: center;
}
.play-warmup .puku {
  width: 180px; height: 180px;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}
.play-warmup .puku img { width: 100%; height: 100%; object-fit: contain; }
.play-warmup h2 { font-size: 1.6rem; margin-bottom: 24px; line-height: 1.4; }

.play-live { display: flex; flex-direction: column; gap: 12px; }
.play-cam-wrap {
  position: relative;
  width: 100%; aspect-ratio: 4 / 3;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.play-cam-wrap video, .play-cam-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.play-cam-wrap video { transform: scaleX(-1); }
.play-cam-wrap canvas { transform: scaleX(-1); background: transparent; }
.play-cam-wrap.idle::before {
  content: '🎤 マイクとカメラを許可してください';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.95rem; font-weight: 800;
  z-index: 5;
  text-align: center;
}

.play-stats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 4px 0;
}
.play-stat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: white;
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 800;
  box-shadow: 0 2px 0 rgba(0,0,0,0.04);
}
.play-stat-chip-label { color: var(--muted); font-weight: 600; }
.play-stat-chip-value { color: var(--accent-dark); }
/* Phase 2: context_mode 表示 chip — モードに応じて色変化 */
.play-mode-chip {
  display: inline-flex; align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 900;
  color: white;
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
  transition: background 0.3s;
}
.play-mode-chip[data-mode="lesson_track"] { background: var(--accent); }
.play-mode-chip[data-mode="chat_drift"]   { background: var(--primary); }
.play-mode-chip[data-mode="bridge"]        { background: #ffb74d; color: #4e342e; }

.transcript-feed {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.transcript-msg {
  padding: 12px 16px;
  border-radius: 18px;
  background: white;
  border-left: 4px solid var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(0,0,0,0.04);
}
.transcript-msg.user { border-color: var(--primary); background: var(--pink-bg); }
.transcript-msg.puku { border-color: var(--accent); background: var(--green-bg); }
.transcript-msg.err { border-color: #e57373; background: #ffebee; }

/* ────────────────────────────────────────────────────────── */
/* View: Progress                                              */
/* ────────────────────────────────────────────────────────── */
.progress-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.progress-tile {
  background: white;
  border-radius: 20px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.04);
}
.progress-tile-icon {
  display: flex; align-items: center; justify-content: center;
  height: 56px; margin-bottom: 6px;
  overflow: hidden;
}
.progress-tile-icon img { width: 40px; height: 40px; object-fit: contain; display: block; }
.progress-tile-value { font-size: 1.4rem; font-weight: 900; color: var(--text); }
.progress-tile-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); margin-top: 2px; }

.mastered-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mastered-word {
  background: white;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0,0,0,0.04);
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.mastered-word img { width: 60%; height: 60%; object-fit: contain; }
.mastered-word-label { font-size: 0.78rem; font-weight: 800; margin-top: 4px; }

/* ────────────────────────────────────────────────────────── */
/* View: Profile (auto-populated child summary)                */
/* ────────────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.profile-grid .item {
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.04);
}
.profile-grid .item .label { font-size: 0.7rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.profile-grid .item .value { font-size: 1.1rem; font-weight: 800; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list .tag {
  background: var(--accent-light);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 700;
}

/* ────────────────────────────────────────────────────────── */
/* Status / toast                                              */
/* ────────────────────────────────────────────────────────── */
.status-line {
  padding: 12px 16px;
  border-radius: 14px;
  border-left: 4px solid var(--accent);
  background: var(--green-bg);
  margin: 8px 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.status-line.user { border-color: var(--primary); background: var(--pink-bg); }
.status-line.puku { border-color: var(--accent); background: var(--green-bg); }
.status-line.err { border-color: #e57373; background: #ffebee; color: var(--text); }
.muted { color: var(--muted); font-size: 0.9rem; }

/* ────────────────────────────────────────────────────────── */
/* Footer                                                      */
/* ────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 24px 16px 100px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ────────────────────────────────────────────────────────── */
/* Hidden helper                                               */
/* ────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ────────────────────────────────────────────────────────── */
/* Responsive (tablet / desktop)                                */
/* ────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .app-shell { max-width: 640px; }
  .onboarding-hero h1 { font-size: 2.5rem; }
  .home-hero-card { aspect-ratio: 16 / 9; padding: 32px; }
  .home-hero-card-title { font-size: 2.4rem; }
  .home-action { height: 140px; }
  .progress-summary { gap: 16px; }
  .mastered-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 1024px) {
  .app-shell { max-width: 800px; }
}
