/* ═══════════════════════════════════════════════════════════════════════════
   style.css — Hljóðæfingar  ·  Nordic Storybook redesign
   Mobile-first · playful · large touch targets · accessible
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Fonts ─────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700;800&family=Nunito:wght@400;600;700;800;900&display=swap');

/* ─── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Brand palette — Nordic landscape */
  --coral:       #FF6B5B;
  --coral-d:     #E5533F;
  --coral-l:     #FFAA9E;
  --coral-ll:    #FFF0EE;

  --sky:         #3FAADC;
  --sky-d:       #2B8DB8;
  --sky-l:       #90D4F5;
  --sky-ll:      #E8F7FF;

  --aurora:      #3EC98A;
  --aurora-d:    #28A86D;
  --aurora-l:    #8EECC4;
  --aurora-ll:   #EAFFF5;

  --sun:         #FFD04A;
  --sun-d:       #E8B520;
  --sun-l:       #FFE88A;
  --sun-ll:      #FFFBE8;

  --lava:        #FF8C42;
  --lava-l:      #FFB380;
  --lava-ll:     #FFF4ED;

  --violet:      #8B6FD4;
  --violet-l:    #BBA8EF;
  --violet-ll:   #F2EEFF;

  /* Neutrals */
  --ink:         #1E2044;   /* main text */
  --ink-mid:     #4A4D72;
  --ink-soft:    #8E92B4;
  --cloud:       #FFFFFF;   /* card surface */
  --mist:        #F0F4FF;   /* subtle bg tint */
  --border:      #DDE3F5;

  /* Background — painted sky */
  --bg-warm:     #FFF5EE;
  --bg-cool:     #EEF4FF;

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(30,32,68,.08);
  --shadow:      0 6px 24px rgba(30,32,68,.10);
  --shadow-lg:   0 12px 40px rgba(30,32,68,.14);
  --shadow-coral: 0 6px 20px rgba(255,107,91,.30);
  --shadow-sky:   0 6px 20px rgba(63,170,220,.30);
  --shadow-aurora:0 6px 20px rgba(62,201,138,.30);
  --shadow-sun:   0 6px 20px rgba(255,208,74,.35);

  /* Border radius — everything is chunky and round */
  --r-sm:  12px;
  --r:     20px;
  --r-lg:  28px;
  --r-xl:  40px;
  --r-pill:999px;

  /* Typography */
  --font-display: 'Baloo 2', 'Nunito', sans-serif;
  --font-body:    'Nunito', sans-serif;

  /* Spacing */
  --gap:      16px;
  --pad:      20px;
  --min-tap:  56px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* Living painted-sky background */
  background:
    radial-gradient(ellipse 80% 50% at 15% 10%, rgba(255,208,74,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 5%,  rgba(63,170,220,.15) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 50% 95%, rgba(255,107,91,.12) 0%, transparent 65%),
    radial-gradient(ellipse 50% 45% at 90% 70%, rgba(62,201,138,.12) 0%, transparent 55%),
    linear-gradient(170deg, #FFF8F2 0%, #F0F6FF 55%, #EBF9F4 100%);
  background-attachment: fixed;
}

/* Floating blob shapes behind everything */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: .06;
}
body::before {
  width: 420px; height: 420px;
  background: var(--coral);
  top: -120px; left: -100px;
  animation: blobA 18s ease-in-out infinite;
}
body::after {
  width: 500px; height: 500px;
  background: var(--sky);
  bottom: -180px; right: -140px;
  animation: blobB 22s ease-in-out infinite;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: var(--r);
}
img { max-width: 100%; display: block; }

/* ─── App container ──────────────────────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── Splash loader ──────────────────────────────────────────────────────────── */
.splash-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 18px;
}
.splash-emoji {
  font-size: 80px;
  animation: splashBounce 1.2s cubic-bezier(.28,.84,.42,1) infinite;
  filter: drop-shadow(0 8px 16px rgba(255,107,91,.3));
}
.splash-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--coral) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.splash-dots { display: flex; gap: 10px; }
.splash-dots span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--coral-l);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.splash-dots span:nth-child(1) { background: var(--coral-l);  animation-delay: 0s; }
.splash-dots span:nth-child(2) { background: var(--sky-l);    animation-delay: .2s; }
.splash-dots span:nth-child(3) { background: var(--aurora-l); animation-delay: .4s; }

/* ─── Screen wrapper ─────────────────────────────────────────────────────────── */
.screen {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  animation: screenIn .35s cubic-bezier(.22,1,.36,1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 4px;
}
.header-back {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--cloud);
  box-shadow: var(--shadow-sm), 0 0 0 3px var(--border);
  font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .18s, box-shadow .18s;
  color: var(--ink-mid);
}
.header-back:active { transform: scale(.88); box-shadow: var(--shadow-sm); }

.header-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  flex: 1;
}
.header-stars {
  display: flex; align-items: center; gap: 5px;
  background: var(--sun-ll);
  border: 2px solid var(--sun-l);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: .9rem;
  color: #7a5000;
}

/* ─── Welcome hero ───────────────────────────────────────────────────────────── */
.welcome-hero {
  text-align: center;
  padding: 20px 0 4px;
  position: relative;
}
.welcome-mascot {
  font-size: 96px;
  animation: heroFloat 3.5s ease-in-out infinite;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.12));
}
.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--coral) 0%, var(--violet) 60%, var(--sky) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-sub {
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.5;
  font-weight: 600;
}

/* ─── HUD (stars / coins) ────────────────────────────────────────────────────── */
.hud {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.hud-item {
  background: var(--cloud);
  border-radius: var(--r);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
  border: 2.5px solid var(--border);
  transition: transform .2s;
}
.hud-item:first-child { border-color: var(--sun-l); }
.hud-item:last-child  { border-color: var(--sky-l); }
.hud-item .hud-icon { font-size: 1.3rem; }

/* ─── Big choice cards ───────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.card-grid.single { grid-template-columns: 1fr; }

.big-card {
  background: var(--cloud);
  border-radius: var(--r-lg);
  padding: 26px 18px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 130px;
  position: relative;
  overflow: hidden;
}
.big-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .2s;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.6) 0%, transparent 70%);
}
.big-card:active  { transform: scale(.94) translateY(2px); box-shadow: var(--shadow-sm); }
.big-card:active::before { opacity: 1; }

.big-card.selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-ll), var(--shadow-coral);
}
.big-card .card-emoji {
  font-size: 52px; line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.12));
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.big-card:active .card-emoji { transform: scale(1.18) rotate(-5deg); }
.big-card .card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}
.big-card .card-desc {
  font-size: .82rem;
  color: var(--ink-mid);
  line-height: 1.45;
  font-weight: 600;
}

/* Card colour themes */
.big-card.purple  { background: linear-gradient(145deg, var(--violet-ll), #FAF8FF); border-color: var(--violet-l); }
.big-card.orange  { background: linear-gradient(145deg, var(--lava-ll),   #FFF9F5); border-color: var(--lava-l);  }
.big-card.green   { background: linear-gradient(145deg, var(--aurora-ll), #F4FFFA); border-color: var(--aurora-l);}
.big-card.blue    { background: linear-gradient(145deg, var(--sky-ll),    #F5FBFF); border-color: var(--sky-l);   }
.big-card.purple.selected { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-ll), var(--shadow); }
.big-card.green.selected  { border-color: var(--aurora); box-shadow: 0 0 0 4px var(--aurora-ll), var(--shadow-aurora); }

/* ─── Mascot picker ──────────────────────────────────────────────────────────── */
.mascot-grid {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.mascot-btn {
  background: var(--cloud);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  min-width: 115px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 3px solid var(--border);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.mascot-btn .m-emoji {
  font-size: 56px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.12));
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.mascot-btn .m-name  { font-weight: 800; font-size: 1rem; color: var(--ink); }
.mascot-btn.selected {
  border-color: var(--coral);
  background: var(--coral-ll);
  box-shadow: 0 0 0 4px var(--coral-ll), var(--shadow-coral);
}
.mascot-btn:active { transform: scale(.9); }
.mascot-btn:active .m-emoji { transform: scale(1.2) rotate(8deg); }

/* ─── Sound selector ─────────────────────────────────────────────────────────── */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sound-pill {
  background: var(--cloud);
  border-radius: var(--r);
  padding: 13px 6px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--border);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .15s, background .15s;
  min-height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
}
.sound-pill .sp-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}
.sound-pill .sp-emoji { font-size: 1.35rem; }
.sound-pill.selected {
  border-color: var(--sky);
  background: var(--sky-ll);
  box-shadow: 0 0 0 3px var(--sky-ll), var(--shadow-sky);
  transform: scale(1.06);
}
.sound-pill:active { transform: scale(.9); }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 18px 28px;
  border-radius: var(--r-xl);
  background: linear-gradient(155deg, var(--coral) 0%, var(--coral-d) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  /* Layered "puffy pillow" shadow */
  box-shadow:
    0 6px 0 var(--coral-d),
    0 8px 20px rgba(255,107,91,.40);
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s;
  min-height: var(--min-tap);
  letter-spacing: .01em;
}
.btn-primary:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 var(--coral-d),
    0 4px 10px rgba(255,107,91,.25);
}
.btn-primary:disabled {
  opacity: .4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--r-xl);
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 0 var(--border), var(--shadow-sm);
  border: 2.5px solid var(--border);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  min-height: var(--min-tap);
}
.btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

.btn-green {
  background: linear-gradient(155deg, var(--aurora) 0%, var(--aurora-d) 100%);
  box-shadow: 0 6px 0 var(--aurora-d), 0 8px 20px rgba(62,201,138,.40);
  color: #fff;
}
.btn-green:active {
  box-shadow: 0 2px 0 var(--aurora-d), 0 4px 10px rgba(62,201,138,.25);
}

.btn-orange {
  background: linear-gradient(155deg, var(--lava) 0%, #E0711E 100%);
  box-shadow: 0 6px 0 #C0611A, 0 8px 20px rgba(255,140,66,.40);
  color: #fff;
}

.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }

/* ─── Practice card ──────────────────────────────────────────────────────────── */
.practice-card {
  background: var(--cloud);
  border-radius: var(--r-lg);
  padding: 32px 22px 26px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  border: 3px solid var(--border);
  /* Subtle inner glow */
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255,208,74,.06) 0%, transparent 70%),
    var(--cloud);
}

.practice-image {
  font-size: 112px;
  line-height: 1;
  animation: imageIn .5s cubic-bezier(.22,1,.36,1);
  min-height: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.10));
}
.practice-image img {
  width: 140px; height: 140px;
  object-fit: contain;
  border-radius: var(--r);
}
@keyframes imageIn {
  from { opacity: 0; transform: scale(.6) rotate(-8deg); }
  to   { opacity: 1; transform: none; }
}

.practice-word {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 3.6rem);
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  border-radius: var(--r);
  padding: 4px 16px;
  transition: background .15s, transform .15s;
  background: transparent;
}
.practice-word:active {
  background: var(--sun-ll);
  transform: scale(.95);
}

.practice-level-badge {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--sun-ll);
  border: 2px solid var(--sun-l);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 800;
  color: #7a5000;
}
.position-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: var(--sky-ll);
  border: 2px solid var(--sky-l);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 800;
  color: var(--sky-d);
}

/* ─── Complexity ladder ──────────────────────────────────────────────────────── */
.ladder {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.ladder-step {
  background: var(--mist);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 800;
  color: var(--ink-soft);
  transition: background .25s, color .25s, transform .25s, border-color .25s;
}
.ladder-step.active {
  background: var(--sky);
  border-color: var(--sky-d);
  color: white;
  transform: scale(1.08) translateY(-2px);
  box-shadow: var(--shadow-sky);
}
.ladder-step.done {
  background: var(--aurora-ll);
  border-color: var(--aurora-l);
  color: var(--aurora-d);
}

/* ─── Placement cue card ─────────────────────────────────────────────────────── */
.cue-card {
  background: linear-gradient(135deg, var(--lava-ll), var(--sun-ll));
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 2px solid var(--lava-l);
  box-shadow: var(--shadow-sm);
  animation: screenIn .3s cubic-bezier(.22,1,.36,1);
}
.cue-card .cue-icon { font-size: 2.2rem; flex-shrink: 0; }
.cue-card .cue-tip  { font-weight: 700; font-size: .92rem; color: var(--ink); line-height: 1.5; }

/* ─── Recording area ─────────────────────────────────────────────────────────── */
.record-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.mic-btn {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(155deg, #FF4E4E, #D42020);
  color: white;
  font-size: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 6px 0 #A81818,
    0 10px 30px rgba(239,68,68,.45);
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
  position: relative;
}
.mic-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(239,68,68,.25);
  animation: micRing 2.5s ease-in-out infinite;
  opacity: 0;
}
.mic-btn:not(.recording)::after { animation: none; }
.mic-btn.recording {
  background: linear-gradient(155deg, #FF2020, #B01010);
  box-shadow: 0 6px 0 #8B0D0D, 0 10px 30px rgba(239,68,68,.6);
  animation: none;
}
.mic-btn.recording::after { opacity: 1; }
.mic-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #A81818, 0 4px 12px rgba(239,68,68,.3);
}
.mic-btn:disabled { opacity: .3; cursor: default; transform: none; box-shadow: none; }

.mic-label {
  font-weight: 700;
  color: var(--ink-mid);
  font-size: .88rem;
  text-align: center;
}

.play-back-btn {
  background: linear-gradient(155deg, var(--sky), var(--sky-d));
  color: white;
  border-radius: var(--r-xl);
  padding: 13px 28px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--sky-d), var(--shadow-sky);
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; gap: 8px;
}
.play-back-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--sky-d), var(--shadow-sm);
}
.play-back-btn:disabled { opacity: .35; cursor: default; box-shadow: none; transform: none; }

/* ─── Hear buttons ───────────────────────────────────────────────────────────── */
.hear-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.hear-btn {
  background: var(--cloud);
  color: var(--ink);
  border-radius: var(--r-xl);
  padding: 12px 20px;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  border: 2.5px solid var(--border);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .15s, background .15s;
  display: flex; align-items: center; gap: 7px;
  min-height: var(--min-tap);
  box-shadow: var(--shadow-sm);
}
.hear-btn:active {
  transform: scale(.93);
  background: var(--mist);
  border-color: var(--sky-l);
}

/* ─── Judge buttons (adult mode) ─────────────────────────────────────────────── */
.judge-row { display: flex; gap: 12px; width: 100%; }
.judge-btn {
  flex: 1;
  padding: 17px 12px;
  border-radius: var(--r);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  min-height: var(--min-tap);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.judge-btn.correct {
  background: linear-gradient(155deg, var(--aurora), var(--aurora-d));
  color: white;
  box-shadow: 0 5px 0 var(--aurora-d), var(--shadow-aurora);
}
.judge-btn.retry {
  background: linear-gradient(155deg, var(--lava), #CC6518);
  color: white;
  box-shadow: 0 5px 0 #B05512, 0 6px 20px rgba(255,140,66,.35);
}
.judge-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 currentColor; }

/* ─── "Ég sagði það!" button ─────────────────────────────────────────────────── */
.alone-confirm-btn {
  background: linear-gradient(155deg, var(--aurora), var(--aurora-d));
  color: white;
  border-radius: var(--r-xl);
  padding: 20px 32px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--aurora-d), var(--shadow-aurora);
  transition: transform .15s, box-shadow .15s;
  min-height: var(--min-tap);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  letter-spacing: .01em;
}
.alone-confirm-btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--aurora-d), 0 4px 10px rgba(62,201,138,.25);
}
.alone-confirm-btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }

/* ─── Sentence practice ──────────────────────────────────────────────────────── */
.sentence-text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 6vw, 2.1rem);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.6;
  cursor: pointer;
  border-radius: var(--r);
  padding: 6px 10px;
  transition: background .15s;
}
.sentence-text .word-highlight {
  background: var(--sun-ll);
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  padding: 1px 5px;
  transition: background .2s, border-color .2s;
}
.sentence-text .word-active {
  background: var(--sun-l);
  border-color: var(--sun);
  border-radius: var(--r-sm);
  padding: 1px 5px;
  color: #5a3800;
}

.symbol-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 6px 0;
}
.symbol-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--cloud);
  border-radius: var(--r);
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
  min-width: 64px;
  cursor: pointer;
  border: 2.5px solid var(--border);
  transition: border-color .15s, transform .2s cubic-bezier(.34,1.56,.64,1), background .15s;
}
.symbol-item.sym-active {
  border-color: var(--sun);
  background: var(--sun-ll);
  transform: scale(1.1) translateY(-3px);
  box-shadow: var(--shadow-sun);
}
.symbol-item .sym-emoji { font-size: 2rem; }
.symbol-item .sym-word  { font-size: .7rem; font-weight: 800; color: var(--ink-mid); }

/* Story grid */
.story-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.story-frame {
  background: var(--cloud);
  border-radius: var(--r);
  padding: 16px 14px 12px;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 90px; flex: 1; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2.5px solid var(--border);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.story-frame:active { transform: scale(.94); }
.story-frame .sf-num {
  background: linear-gradient(135deg, var(--sky), var(--sky-d));
  color: white;
  border-radius: 50%;
  width: 26px; height: 26px;
  font-size: .82rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sky);
}
.story-frame .sf-emoji  { font-size: 2.8rem; }
.story-frame .sf-caption { font-size: .72rem; color: var(--ink-mid); font-weight: 700; line-height: 1.3; }

/* Mountain level tabs */
.mountain-tabs {
  display: flex;
  background: var(--mist);
  border-radius: var(--r);
  border: 2px solid var(--border);
  padding: 4px;
  gap: 4px;
}
.mountain-tab {
  flex: 1;
  padding: 10px 6px;
  border-radius: 14px;
  font-weight: 800;
  font-size: .85rem;
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  transition: background .2s, color .2s, transform .2s cubic-bezier(.34,1.56,.64,1);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.mountain-tab.active {
  background: var(--cloud);
  color: var(--coral);
  box-shadow: var(--shadow-sm);
  transform: scale(1.04);
}
.mountain-tab .mt-emoji { font-size: 1.3rem; }

/* ─── Journey map ────────────────────────────────────────────────────────────── */
.journey-wrap { position: relative; overflow-x: auto; padding: 18px 0 8px; }
.journey-path {
  display: flex;
  align-items: center;
  min-width: max-content;
  padding: 0 24px;
}
.journey-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  z-index: 1;
}
.journey-stop .stop-num {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--cloud);
  border: 3px solid var(--border);
  color: var(--ink-soft);
  font-weight: 800;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.journey-stop.done    .stop-num { background: var(--aurora-ll); border-color: var(--aurora); color: var(--aurora-d); }
.journey-stop.current .stop-num {
  background: linear-gradient(135deg, var(--coral), var(--coral-d));
  border-color: var(--coral-d);
  color: white;
  box-shadow: 0 0 0 5px var(--coral-ll), var(--shadow-coral);
  animation: currentPulse 2s ease-in-out infinite;
}
.journey-stop .stop-star { font-size: .85rem; opacity: 0; transition: opacity .4s; }
.journey-stop.done .stop-star { opacity: 1; }
.journey-connector {
  width: 30px; height: 5px;
  background: var(--border);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background .3s;
}
.journey-connector.done { background: linear-gradient(90deg, var(--aurora-l), var(--aurora)); }

/* ─── Mascot ─────────────────────────────────────────────────────────────────── */
.mascot-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mascot-emoji {
  font-size: 68px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.10));
  transition: transform .3s;
}
.mascot-emoji.happy    { animation: mascotHappy .7s cubic-bezier(.34,1.56,.64,1); }
.mascot-emoji.encourage{ animation: mascotShake .5s ease; }
.mascot-bubble {
  background: var(--cloud);
  border-radius: 20px 20px 20px 5px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: .88rem;
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 2.5px solid var(--border);
  max-width: 230px;
  text-align: center;
  opacity: 0;
  transform: scale(.75) translateY(8px);
  transition: opacity .3s, transform .3s cubic-bezier(.34,1.56,.64,1);
}
.mascot-bubble.show { opacity: 1; transform: scale(1) translateY(0); }
.mascot-hat {
  font-size: 1.6rem;
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* ─── Progress bar ───────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--mist);
  border-radius: var(--r-pill);
  height: 14px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral) 0%, var(--violet) 50%, var(--sky) 100%);
  border-radius: var(--r-pill);
  transition: width .5s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 2s ease-in-out infinite;
}

/* ─── Reward overlay ─────────────────────────────────────────────────────────── */
.reward-overlay {
  position: fixed; inset: 0;
  background: rgba(238,244,255,.93);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  animation: fadeIn .25s ease;
  padding: var(--pad);
}
.reward-emoji {
  font-size: 96px;
  animation: rewardPop .6s cubic-bezier(.22,1,.36,1);
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.12));
}
.reward-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 8vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}
.reward-earned { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.reward-badge {
  background: var(--sun-ll);
  border: 2.5px solid var(--sun-l);
  border-radius: var(--r);
  padding: 12px 22px;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex; align-items: center; gap: 8px;
  animation: slideUp .4s .1s both;
}

/* ─── Sticker book ───────────────────────────────────────────────────────────── */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.sticker-item {
  aspect-ratio: 1;
  border-radius: var(--r);
  background: var(--mist);
  border: 2.5px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  font-size: 1.9rem;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.sticker-item.unlocked {
  background: linear-gradient(145deg, var(--sun-ll), #FFF9E8);
  border-color: var(--sun-l);
  box-shadow: var(--shadow-sun);
  transform: scale(1.05);
}
.sticker-item.unlocked:active { transform: scale(.92); }
.sticker-item.locked   { opacity: .25; }
.sticker-item .sk-name { font-size: .62rem; font-weight: 800; color: var(--ink-mid); }

/* ─── Shop ───────────────────────────────────────────────────────────────────── */
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shop-item {
  background: var(--cloud);
  border-radius: var(--r);
  padding: 18px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer;
  border: 2.5px solid var(--border);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), border-color .15s, box-shadow .15s;
}
.shop-item:active { transform: scale(.93); }
.shop-item.owned   { border-color: var(--aurora-l); background: var(--aurora-ll); }
.shop-item.equipped {
  border-color: var(--coral);
  background: var(--coral-ll);
  box-shadow: 0 0 0 3px var(--coral-ll), var(--shadow-coral);
}
.shop-item .sh-emoji { font-size: 2.4rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,.1)); }
.shop-item .sh-name  { font-size: .76rem; font-weight: 800; color: var(--ink); }
.shop-item .sh-cost  {
  background: var(--sun-ll);
  border: 2px solid var(--sun-l);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 800;
  color: #7a5000;
  display: flex; align-items: center; gap: 4px;
}

/* ─── End screen ─────────────────────────────────────────────────────────────── */
.end-screen { text-align: center; gap: 22px; }
.end-fireworks {
  font-size: 4.5rem;
  display: block;
  animation: heroFloat 2.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.12));
}
.end-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 3.6rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--sun) 0%, var(--coral) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.end-earned {
  background: var(--cloud);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--border);
  display: flex; flex-direction: column; gap: 13px;
  text-align: left;
}
.end-earned-row { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 1.05rem; }
.end-earned-row .er-icon { font-size: 1.7rem; }

/* ─── Grown-ups dashboard ────────────────────────────────────────────────────── */
.dashboard-section {
  background: var(--cloud);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 2.5px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.ds-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.progress-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.progress-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--sky-ll);
  color: var(--sky-d);
  font-weight: 800;
}
.progress-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--ink); }
.progress-table tr:last-child td { border-bottom: none; }

.accuracy-bar { background: var(--mist); border-radius: var(--r-pill); height: 9px; overflow: hidden; min-width: 60px; border: 1.5px solid var(--border); }
.accuracy-fill { height: 100%; border-radius: var(--r-pill); background: var(--aurora); transition: width .5s; }
.accuracy-fill.mid { background: var(--sun); }
.accuracy-fill.low { background: var(--coral); }

/* ─── Grown-ups gate overlay ─────────────────────────────────────────────────── */
.gate-overlay {
  position: fixed; inset: 0;
  background: rgba(14,18,48,.8);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: var(--pad);
}
.gate-card {
  background: var(--cloud);
  border-radius: var(--r-xl);
  padding: 36px 30px;
  text-align: center;
  max-width: 390px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 18px;
  animation: rewardPop .35s cubic-bezier(.34,1.56,.64,1);
  border: 3px solid var(--border);
}
.gate-emoji  { font-size: 3.8rem; filter: drop-shadow(0 6px 12px rgba(0,0,0,.1)); }
.gate-title  { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.gate-desc   { font-size: .9rem; color: var(--ink-mid); line-height: 1.55; font-weight: 600; }
.gate-sum    { display: flex; gap: 12px; align-items: center; justify-content: center; }
.gate-num    {
  width: 54px; height: 54px;
  border-radius: var(--r);
  background: var(--sky-ll);
  border: 2.5px solid var(--sky-l);
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800;
  color: var(--sky-d);
  display: flex; align-items: center; justify-content: center;
}
.gate-op     { font-size: 1.3rem; font-weight: 900; color: var(--ink-mid); }
.gate-result {
  width: 54px; height: 54px;
  border-radius: var(--r);
  background: var(--cloud);
  border: 3px solid var(--coral-l);
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800;
  color: var(--coral);
  display: flex; align-items: center; justify-content: center;
}
.gate-input {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  padding: 14px;
  border: 3px solid var(--border);
  border-radius: var(--r);
  color: var(--ink);
  width: 100%;
  background: var(--mist);
  outline: none;
  transition: border-color .2s;
}
.gate-input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-ll); }

/* ─── Mic unavailable notice ─────────────────────────────────────────────────── */
.mic-unavailable {
  background: var(--lava-ll);
  border: 2.5px solid var(--lava-l);
  border-radius: var(--r);
  padding: 14px 18px;
  font-size: .86rem;
  font-weight: 600;
  color: #7a3800;
  display: flex; gap: 12px; align-items: flex-start;
}
.mic-unavailable .mu-icon { font-size: 1.5rem; flex-shrink: 0; }

/* ─── Floating controls (sound toggle + grownups) ────────────────────────────── */
.sound-toggle, .grownups-btn {
  position: fixed;
  /* Top-right corner so they never overlap the bottom action buttons
     ("Rétt" / "Reyna aftur" / record). Header text is padded clear of them. */
  top: calc(8px + env(safe-area-inset-top, 0px));
  z-index: 50;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow), 0 0 0 2px var(--border);
  border: none;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .15s;
}
.sound-toggle  { right: 16px; }
.grownups-btn  { right: 72px; }
.sound-toggle:active, .grownups-btn:active { transform: scale(.84); box-shadow: var(--shadow-sm); }

/* ─── Confetti canvas ────────────────────────────────────────────────────────── */
#confettiCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: .88rem;
  opacity: 0;
  transition: opacity .25s, transform .25s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
  z-index: 500;
  max-width: 330px;
  text-align: center;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Privacy note ───────────────────────────────────────────────────────────── */
.privacy-note {
  background: var(--aurora-ll);
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: .76rem;
  font-weight: 700;
  color: #1a6644;
  display: flex; gap: 10px; align-items: flex-start;
  border: 2px solid var(--aurora-l);
}

/* ─── Section title ──────────────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}

/* ─── Keyframes ─────────────────────────────────────────────────────────────── */
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30%       { transform: translateY(-10px) rotate(-3deg); }
  70%       { transform: translateY(-6px) rotate(2deg); }
}
@keyframes splashBounce {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-20px) scale(1.08); }
  60%  { transform: translateY(-18px) scale(1.06); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes dotPulse {
  0%, 100% { opacity: .3; transform: scale(.75); }
  50%       { opacity: 1;  transform: scale(1.2); }
}
@keyframes blobA {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(60px, 40px) scale(1.1); }
  66%       { transform: translate(-30px, 80px) scale(.9); }
}
@keyframes blobB {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(-80px,-50px) scale(1.15); }
  66%       { transform: translate(40px,-90px) scale(.85); }
}
@keyframes currentPulse {
  0%, 100% { box-shadow: 0 0 0 5px var(--coral-ll), var(--shadow-coral); }
  50%       { box-shadow: 0 0 0 9px rgba(255,107,91,.15), var(--shadow-coral); }
}
@keyframes micRing {
  0%   { transform: scale(1);   opacity: .8; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}
@keyframes rewardPop {
  0%   { opacity: 0; transform: scale(.5) rotate(-10deg); }
  60%  { transform: scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes mascotHappy {
  0%   { transform: scale(1)    rotate(0);    }
  20%  { transform: scale(1.3)  rotate(-10deg); }
  40%  { transform: scale(1.25) rotate(10deg); }
  60%  { transform: scale(1.15) rotate(-5deg); }
  80%  { transform: scale(1.05) rotate(3deg); }
  100% { transform: scale(1)    rotate(0); }
}
@keyframes mascotShake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-10px) rotate(-4deg); }
  35%       { transform: translateX(10px)  rotate(4deg); }
  55%       { transform: translateX(-6px)  rotate(-2deg); }
  75%       { transform: translateX(6px)   rotate(2deg); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-16px); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-9px); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 360px) {
  :root { --pad: 14px; --gap: 12px; }
  .sound-grid { grid-template-columns: repeat(3, 1fr); }
  .sticker-grid { grid-template-columns: repeat(4, 1fr); }
  .welcome-mascot { font-size: 72px; }
}

@media (min-width: 480px) {
  .sound-grid { grid-template-columns: repeat(5, 1fr); }
  .practice-image { font-size: 130px; min-height: 150px; }
  .practice-word { font-size: 3.2rem; }
  .mascot-emoji { font-size: 80px; }
}

@media (min-width: 680px) {
  :root { --pad: 28px; }
  .card-grid { gap: 20px; }
  .sound-grid { grid-template-columns: repeat(6, 1fr); }
  .shop-grid { grid-template-columns: repeat(4, 1fr); }
  .practice-image { font-size: 150px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .practice-card { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  .practice-image { font-size: 72px; min-height: 80px; }
  .screen { gap: 10px; }
  .welcome-mascot { font-size: 56px; }
}

/* Keep header text clear of the top-right floating controls (phones/tablets) */
@media (max-width: 900px) {
  .header { padding-right: 116px; }
}

/* Compact the practice screens so they fit a phone screen without scrolling */
@media (max-width: 600px) {
  #screen-word-practice, #screen-sentence-practice { gap: 9px; }
  #screen-word-practice .practice-card,
  #screen-sentence-practice .practice-card { padding: 16px 16px 14px; gap: 10px; }
  #screen-word-practice .practice-image { font-size: 76px; min-height: 0; }
  #screen-word-practice .practice-image img { width: 96px; height: 96px; }
  #screen-word-practice .practice-word { font-size: clamp(1.7rem, 7.5vw, 2.3rem); padding: 2px 12px; }
  #screen-word-practice .ladder, #screen-sentence-practice .ladder { gap: 5px; }
  #screen-word-practice .mascot-emoji,
  #screen-sentence-practice .mascot-emoji { font-size: 46px; }
  #screen-word-practice .mascot-display,
  #screen-sentence-practice .mascot-display { gap: 4px; }
  #screen-word-practice .hear-row, #screen-sentence-practice .hear-row { gap: 8px; }
  #screen-word-practice .hear-btn, #screen-sentence-practice .hear-btn { padding: 9px 14px; }
  #screen-word-practice .record-area, #screen-sentence-practice .record-area { gap: 8px; }
  #screen-word-practice .mic-label, #screen-sentence-practice .mic-label { font-size: .78rem; }
  #screen-word-practice .mic-btn, #screen-sentence-practice .mic-btn { width: 70px; height: 70px; font-size: 1.8rem; }
  #screen-word-practice .play-back-btn, #screen-sentence-practice .play-back-btn { padding: 10px 20px; }
}

@media print {
  .sound-toggle, .grownups-btn, #confettiCanvas,
  #toast, .btn-primary, .btn-secondary, .header-back,
  body::before, body::after { display: none !important; }
  body { background: white; }
  .screen { max-width: 100%; padding: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE PICKER
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hero area on picker screen */
.profile-picker-hero {
  text-align: center;
  padding: 16px 0 4px;
}

/* Grid of profile cards */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

/* Individual profile card */
.profile-card {
  position: relative;
  background: var(--cloud);
  border-radius: var(--r-lg);
  padding: 22px 14px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 3px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s, border-color .2s;
  /* reset button defaults */
  font-family: var(--font-body);
  color: inherit;
  text-align: center;
}
.profile-card:active {
  transform: scale(.93) translateY(2px);
  box-shadow: var(--shadow-sm);
}

/* Cycle through accent colours for variety */
.profile-card:nth-child(4n+1) { border-color: var(--coral-l);  background: linear-gradient(145deg, var(--coral-ll),  var(--cloud)); }
.profile-card:nth-child(4n+2) { border-color: var(--sky-l);    background: linear-gradient(145deg, var(--sky-ll),    var(--cloud)); }
.profile-card:nth-child(4n+3) { border-color: var(--aurora-l); background: linear-gradient(145deg, var(--aurora-ll), var(--cloud)); }
.profile-card:nth-child(4n+4) { border-color: var(--sun-l);    background: linear-gradient(145deg, var(--sun-ll),    var(--cloud)); }

.profile-avatar {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.12));
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.profile-card:active .profile-avatar { transform: scale(1.18) rotate(-6deg); }

.profile-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.2;
}

.profile-stars {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-mid);
  background: var(--sun-ll);
  border: 1.5px solid var(--sun-l);
  border-radius: var(--r-pill);
  padding: 3px 10px;
}

/* Delete ✕ button — top-right corner */
.profile-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  border: 2px solid var(--border);
  font-size: .75rem;
  font-weight: 900;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
  line-height: 1;
  padding: 0;
}
.profile-delete-btn:active {
  background: var(--coral-ll);
  color: var(--coral);
  border-color: var(--coral-l);
  transform: scale(.85);
}

/* "Add profile" dashed card */
.profile-add-card {
  background: transparent !important;
  border: 3px dashed var(--border) !important;
  color: var(--ink-soft);
  transition: border-color .2s, color .2s, transform .2s cubic-bezier(.34,1.56,.64,1);
}
.profile-add-card:active {
  border-color: var(--coral-l) !important;
  color: var(--coral);
  transform: scale(.96);
}
.profile-add-icon {
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
  color: inherit;
}

/* ── Profile chip on welcome screen ──────────────────────────────────────── */
.welcome-profile-row {
  display: flex;
  justify-content: flex-end;
  padding: 4px 0 0;
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--cloud);
  border: 2.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 14px 7px 10px;
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .15s;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-chip span:first-child { font-size: 1.25rem; flex-shrink: 0; }
.profile-chip:active { transform: scale(.92); border-color: var(--coral-l); }

/* ── Avatar picker grid inside the add-profile modal ────────────────────── */
.profile-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.avatar-pick-btn {
  font-size: 2rem;
  padding: 10px;
  border-radius: var(--r);
  background: var(--mist);
  border: 3px solid var(--border);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), border-color .15s, background .15s;
  line-height: 1;
}
.avatar-pick-btn:active { transform: scale(.88); }
.avatar-pick-btn.selected {
  border-color: var(--coral);
  background: var(--coral-ll);
  transform: scale(1.1);
  box-shadow: var(--shadow-coral);
}

/* Responsive: narrow phones stack to 2 columns */
@media (max-width: 360px) {
  .profiles-grid { grid-template-columns: repeat(2, 1fr); }
}
