/* Maev's Little World — styles. Bright, unisex, big touch targets. */
:root {
  --bg: #eef7f6;
  --ink: #102e3b;
  --navy: #0b2a4a;
  --navy-2: #163d63;
  --teal: #1c8f80;
  --teal-2: #146b60;
  --yellow: #ffcf3f;
  --yellow-2: #f2b62a;
  --orange: #f28a2e;
  --aqua: #8fdff0;
  --aqua-2: #5cc8de;
  --coral: #ff6f61;
  --purple: #8f74d4;
  --green: #4f9e42;
  --card: #ffffff;
  --border: #cfe0dc;
  --muted: #4c6470;
  --shadow: 0 10px 30px rgba(11, 42, 74, 0.12);
  --radius: 22px;
  --font: 'Segoe UI', 'Trebuchet MS', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}
a {
  color: var(--teal-2);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -1.2px;
  font-weight: 800;
}
h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.6px;
  font-weight: 800;
}
h3 {
  font-size: 18px;
  font-weight: 800;
}
small {
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
.defs {
  position: absolute;
  width: 0;
  height: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--teal-2);
}
.note {
  color: var(--muted);
  font-size: 14px;
}
.app {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 36px) 40px;
}

/* ---------- header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.brand-symbol {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--teal);
  display: grid;
  place-items: center;
  color: var(--yellow);
  box-shadow: var(--shadow);
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--muted);
  font-weight: 700;
}
.main-nav {
  display: flex;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px;
  flex-wrap: wrap;
}
.main-nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 100px;
  font-weight: 700;
  color: var(--muted);
  min-height: 44px;
}
.main-nav button[aria-current='page'] {
  background: var(--navy);
  color: #fff;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 1040px) {
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .main-nav button {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
  }
}
@media (max-width: 520px) {
  .brand span:not(.brand-symbol) {
    font-size: 18px;
  }
  .brand small {
    display: none;
  }
  .main-nav button {
    font-size: 13px;
    gap: 4px;
    padding: 8px 6px;
    white-space: nowrap;
    min-height: 40px;
  }
  .main-nav button svg.icon {
    width: 15px;
    height: 15px;
  }
}
.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--ink);
}
.icon-button[aria-pressed='true'] {
  background: var(--navy);
  color: #fff;
}
.parent-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  min-height: 46px;
  border-radius: 100px;
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 700;
}
svg.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 12px 26px;
  border-radius: 100px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 8px 0 var(--yellow-2);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 var(--yellow-2);
}
.btn-primary small {
  font-weight: 600;
  opacity: 0.75;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 100px;
  border: 2px solid var(--navy);
  color: var(--navy);
  font-weight: 700;
  background: #fff;
}
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  min-height: 40px;
}
.btn-danger {
  border-color: var(--coral);
  color: #b3362a;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- views ---------- */
.view {
  animation: fade 0.25s ease;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.view-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin: 8px 0 18px;
}
.view-description {
  color: var(--muted);
  margin-top: 6px;
  max-width: 60ch;
}
.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px 8px 8px;
  font-weight: 700;
  text-align: left;
}
.stage-badge b {
  display: block;
}
.stage-badge small {
  color: var(--muted);
  font-weight: 600;
}
.stage-spark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--yellow);
  display: grid;
  place-items: center;
  color: var(--navy);
}
.storage-note {
  background: #fff4dc;
  border: 1px solid #f2d18a;
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- play layout ---------- */
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) {
  .play-layout {
    grid-template-columns: 1fr;
  }
}
.scene-wrap {
  position: relative;
}
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 30px;
  overflow: hidden;
  background: radial-gradient(circle at 30% 12%, #1f5a8a 0, var(--navy) 55%, #071d33 100%);
  box-shadow: var(--shadow);
  display: block;
  color: #fff;
  text-align: left;
  isolation: isolate;
}
.scene-decor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scene-rays {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(143, 223, 240, 0.16) 0 8%, transparent 8% 20%, rgba(143, 223, 240, 0.1) 20% 26%, transparent 26%);
  pointer-events: none;
}
.scene-friend {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 60%;
  max-width: 460px;
  transform: translate(-50%, -50%);
  transform-origin: 50% 60%;
  pointer-events: none;
}
.scene-friend svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.scene-friend.motion-swim {
  animation: swim 1.3s ease-in-out;
}
.scene-friend.motion-bob {
  animation: bob 1.2s ease-in-out;
}
.scene-friend.motion-scuttle {
  animation: scuttle 1.1s ease-in-out;
}
.scene-friend.motion-dive {
  animation: dive 1.4s ease-in-out;
}
.scene-friend.motion-wiggle {
  animation: wiggle 1.1s ease-in-out;
}
.scene-friend.motion-leap {
  animation: leap 1.2s cubic-bezier(0.3, 0, 0.2, 1);
}
.scene-friend.motion-bounce {
  animation: bounce 1.1s cubic-bezier(0.3, 0, 0.2, 1);
}
.scene-friend.motion-tilt {
  animation: tilt 1.2s ease-in-out;
}
.scene-friend.motion-pulse {
  animation: pulse 1.1s ease-in-out;
}
.scene-friend.motion-wave {
  animation: wave 1.2s ease-in-out;
}
.scene-friend.motion-rise {
  animation: rise 1.4s ease-in-out;
}
.scene-friend.motion-ripple {
  animation: ripple 1.2s ease-in-out;
}
.scene-friend.motion-rock {
  animation: rock 1.4s ease-in-out;
}
.scene-friend.motion-drift {
  animation: drift 1.8s ease-in-out;
}
.scene-friend.motion-splash {
  animation: splash 1.1s ease-in-out;
}
.scene-friend.motion-sway {
  animation: sway 1.6s ease-in-out;
}
.scene-friend.motion-hop {
  animation: hop 1s cubic-bezier(0.3, 0, 0.2, 1);
}
@keyframes swim {
  0% { transform: translate(-50%, -50%) rotate(0); }
  30% { transform: translate(-42%, -54%) rotate(-6deg); }
  60% { transform: translate(-56%, -47%) rotate(5deg); }
  100% { transform: translate(-50%, -50%) rotate(0); }
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, -50%); }
  35% { transform: translate(-50%, -58%) rotate(-3deg); }
  70% { transform: translate(-50%, -46%) rotate(3deg); }
}
@keyframes scuttle {
  0%, 100% { transform: translate(-50%, -50%); }
  25% { transform: translate(-60%, -50%); }
  50% { transform: translate(-40%, -50%); }
  75% { transform: translate(-58%, -50%); }
}
@keyframes dive {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  40% { transform: translate(-46%, -40%) rotate(10deg); }
  70% { transform: translate(-54%, -58%) rotate(-8deg); }
}
@keyframes wiggle {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  20% { transform: translate(-50%, -50%) rotate(-7deg); }
  40% { transform: translate(-50%, -50%) rotate(7deg); }
  60% { transform: translate(-50%, -50%) rotate(-5deg); }
  80% { transform: translate(-50%, -50%) rotate(5deg); }
}
@keyframes leap {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  45% { transform: translate(-48%, -72%) rotate(-12deg); }
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(-50%, -62%) scale(1.04, 0.96); }
  55% { transform: translate(-50%, -48%) scale(0.98, 1.04); }
  75% { transform: translate(-50%, -54%) scale(1); }
}
@keyframes tilt {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  50% { transform: translate(-50%, -52%) rotate(-16deg); }
}
@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(-50%, -50%) scale(1.12); }
  60% { transform: translate(-50%, -50%) scale(0.97); }
}
@keyframes wave {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  25% { transform: translate(-50%, -50%) rotate(8deg); }
  50% { transform: translate(-50%, -50%) rotate(-8deg); }
  75% { transform: translate(-50%, -50%) rotate(6deg); }
}
@keyframes rise {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -68%); }
}
@keyframes ripple {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  40% { transform: translate(-50%, -50%) scale(1.08, 0.94); }
  70% { transform: translate(-50%, -50%) scale(0.96, 1.06); }
}
@keyframes rock {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  30% { transform: translate(-50%, -50%) rotate(-9deg); }
  70% { transform: translate(-50%, -50%) rotate(9deg); }
}
@keyframes drift {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-44%, -54%); }
}
@keyframes splash {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(-50%, -50%) scale(1.06, 0.92); }
  60% { transform: translate(-50%, -56%) scale(0.96, 1.06); }
}
@keyframes sway {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  30% { transform: translate(-50%, -50%) rotate(-5deg); }
  70% { transform: translate(-50%, -50%) rotate(5deg); }
}
@keyframes hop {
  0%, 100% { transform: translate(-50%, -50%); }
  30% { transform: translate(-50%, -60%); }
  50% { transform: translate(-50%, -50%); }
  75% { transform: translate(-50%, -58%); }
}
.scene-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-word {
  position: absolute;
  left: 22px;
  bottom: 22px;
  background: rgba(11, 42, 74, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  max-width: 70%;
}
.scene-word small {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: var(--aqua);
}
.scene-word strong {
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.scene-word em {
  font-style: normal;
  color: var(--yellow);
  font-weight: 700;
}
.scene-caption {
  position: absolute;
  right: 20px;
  top: 18px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.scene-bubbles span {
  position: absolute;
  bottom: -30px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(143, 223, 240, 0.7);
  background: rgba(143, 223, 240, 0.15);
  animation: float 9s linear infinite;
  pointer-events: none;
}
.scene-bubbles span:nth-child(1) { left: 12%; animation-delay: 0s; }
.scene-bubbles span:nth-child(2) { left: 28%; width: 9px; height: 9px; animation-delay: 3s; animation-duration: 11s; }
.scene-bubbles span:nth-child(3) { left: 66%; animation-delay: 1.5s; animation-duration: 10s; }
.scene-bubbles span:nth-child(4) { left: 82%; width: 20px; height: 20px; animation-delay: 5s; animation-duration: 13s; }
.scene-bubbles span:nth-child(5) { left: 48%; width: 7px; height: 7px; animation-delay: 7s; animation-duration: 12s; }
@keyframes float {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-120vh) translateX(20px); opacity: 0; }
}
.scene-switch {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.scene-switch button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
  color: var(--muted);
}
.scene-switch button[aria-pressed='true'] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.scene-response {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 100px;
  min-height: 46px;
}
.caregiver-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 30px;
  gap: 8px;
  color: #fff;
}
.caregiver-scene h2 {
  color: #fff;
  font-size: clamp(26px, 3.2vw, 40px);
}
.caregiver-scene p {
  color: var(--aqua);
  max-width: 44ch;
  margin: 0 auto;
}
.caregiver-scene span {
  color: var(--yellow);
  font-weight: 700;
  font-size: 14px;
}
.caregiver-scene .eyebrow {
  color: var(--yellow);
}
.meter {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 14px;
}
.meter-bar {
  flex: 1;
  height: 12px;
  border-radius: 100px;
  background: #e2eeeb;
  overflow: hidden;
}
.meter-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--aqua-2), var(--yellow));
  transition: width 0.08s linear;
}

/* ---------- lesson panel ---------- */
.lesson-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}
.lesson-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.word-stepper {
  display: flex;
  gap: 6px;
}
.word-stepper button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: #fff;
}
.routine-copy {
  color: var(--muted);
  font-size: 15px;
}
.four-languages {
  display: grid;
  gap: 8px;
}
.language-row {
  display: grid;
  grid-template-columns: 36px 84px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: left;
  background: #fff;
  min-height: 60px;
  transition: background 0.15s, border-color 0.15s;
}
.language-row.selected {
  border-color: var(--navy);
  background: #f3f8ff;
}
.language-row.speaking {
  background: #fff4dc;
  border-color: var(--yellow-2);
}
.language-row strong {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.language-row strong small {
  color: var(--muted);
  font-weight: 600;
}
.language-name {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.language-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.dot-es { background: var(--coral); }
.dot-en { background: var(--teal); }
.dot-zh { background: var(--orange); }
.dot-asl { background: var(--purple); }
.language-action {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.voice-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--yellow);
  color: var(--navy);
  border-radius: 100px;
  padding: 3px 8px;
}
.practice-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--teal-2);
  font-weight: 700;
  text-align: left;
}
.practice-link span {
  flex: 1;
}
.mini-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 420px) {
  .mini-actions {
    grid-template-columns: 1fr;
  }
}

/* ---------- session bar ---------- */
.session-bar {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.session-guidance {
  display: flex;
  align-items: center;
  gap: 12px;
}
.session-guidance p {
  font-weight: 700;
}
.session-guidance small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}
.connection-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffe6e3;
  color: var(--coral);
  display: grid;
  place-items: center;
}
.session-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.session-time {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}
.session-time span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.progress {
  height: 8px;
  border-radius: 100px;
  background: #e2eeeb;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--teal);
  transition: width 0.25s linear;
}
.session-status {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 600;
  min-height: 24px;
}

/* ---------- rest ---------- */
.rest-scene {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .rest-scene {
    grid-template-columns: 1fr;
  }
}
.rest-image {
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  min-height: 300px;
  box-shadow: var(--shadow);
}
.rest-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rest-message {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
.rest-emblem {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffe6e3;
  color: var(--coral);
  display: grid;
  place-items: center;
}
.rest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
}

/* ---------- teacher ---------- */
.teacher-card {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.teacher-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border);
}
.teacher-tabs button {
  padding: 10px 14px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-size: 14px;
}
.teacher-tabs button[aria-selected='true'] {
  color: var(--navy);
  border-bottom-color: var(--yellow);
}
.teacher-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #f4f7f9;
  position: relative;
}
.teacher-stage img,
.teacher-stage video,
.teacher-stage iframe {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  background: #000;
}
.teacher-stage img {
  background: #fff;
}
.teacher-stage video.mirror {
  position: absolute;
  inset: 0;
  transform: scaleX(-1);
  object-fit: cover;
}
.teacher-stage {
  overflow: hidden;
}
.teacher-play {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 24px;
  color: var(--navy);
  text-align: center;
}
.teacher-play b {
  font-size: 18px;
}
.teacher-play small {
  color: var(--muted);
}
.teacher-play .play-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--yellow);
  display: grid;
  place-items: center;
}
.teacher-play.poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 30%;
  color: #fff;
  align-content: end;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.teacher-play.poster b {
  color: #fff;
}
.teacher-play.poster small {
  color: var(--aqua);
}
.teacher-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  font-size: 13px;
}
.teacher-foot .model-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 12px;
  min-height: 38px;
}
.teacher-credit {
  color: var(--muted);
  font-weight: 600;
}
.media-fallback {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.media-fallback b {
  display: block;
  color: var(--navy);
  font-size: 18px;
  margin-bottom: 6px;
}
.teacher-guide {
  padding: 10px 14px 0;
  font-size: 14px;
  color: var(--muted);
}
.teacher-label {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  background: rgba(11, 42, 74, 0.8);
  color: #fff;
  padding: 5px 10px;
  border-radius: 100px;
}

/* ---------- words ---------- */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.category-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
  color: var(--muted);
}
.category-tabs button[aria-pressed='true'] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.category-tabs button span {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 100px;
  padding: 1px 8px;
  font-size: 12px;
}
.category-tabs button[aria-pressed='true'] span {
  background: rgba(255, 255, 255, 0.2);
}
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.tile.chosen {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--yellow);
}
.tile-art {
  background: radial-gradient(circle at 30% 20%, var(--navy-2), var(--navy));
  padding: 14px 24px;
  display: grid;
  place-items: center;
}
.tile-art svg {
  width: 100%;
  max-width: 130px;
  height: auto;
}
.tile-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tile-body strong {
  font-size: 19px;
  font-weight: 800;
}
.tile-meta {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal-2);
}
.tile-translations {
  color: var(--muted);
  font-size: 14px;
}
.tile-asl {
  font-size: 12px;
  color: var(--purple);
  font-weight: 700;
}
.chosen-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 100px;
}
.collection-count {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-weight: 700;
  color: var(--muted);
}
.collection-count b {
  color: var(--navy);
  font-size: 18px;
}

/* ---------- find ---------- */
.find-layout {
  display: grid;
  gap: 18px;
}
.find-prompt {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.find-prompt h2 {
  font-size: clamp(24px, 3vw, 36px);
}
.find-prompt .eyebrow {
  margin-bottom: 4px;
}
.find-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 640px) {
  .find-cards {
    grid-template-columns: 1fr;
  }
}
.find-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 30px;
  background: radial-gradient(circle at 30% 12%, #1f5a8a 0, var(--navy) 60%);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 8%;
  transition: transform 0.15s;
}
.find-card:active {
  transform: scale(0.98);
}
.find-card svg {
  width: 100%;
  height: auto;
  max-height: 100%;
}
.find-card .find-name {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: clamp(20px, 2.6vw, 30px);
  opacity: 0;
  transition: opacity 0.2s;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.find-card.named .find-name,
.find-card.found .find-name {
  opacity: 1;
}
.find-card.found {
  box-shadow: 0 0 0 6px var(--yellow), var(--shadow);
}
.find-card.found svg {
  animation: bounce-free 1s ease;
}
.find-card.named svg {
  animation: wiggle-free 0.9s ease;
}
@keyframes bounce-free {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-8%) scale(1.06); }
  60% { transform: translateY(0) scale(0.98); }
}
@keyframes wiggle-free {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}
.find-celebrate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.find-celebrate span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  animation: confetti 1s ease-out forwards;
}
@keyframes confetti {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
.find-hint {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- journey ---------- */
.journey-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
}
@media (max-width: 900px) {
  .journey-layout {
    grid-template-columns: 1fr;
  }
}
.journey-overview {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.journey-overview h2 {
  color: #fff;
}
.journey-overview p {
  color: var(--aqua);
}
.journey-orbit {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 4px solid var(--yellow);
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1;
}
.journey-orbit span {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--aqua);
}
.journey-orbit b {
  font-size: 30px;
}
.journey-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.journey-stat b {
  font-size: 34px;
}
.journey-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
}
.journey-overview .btn-text {
  color: var(--yellow);
}
.milestone-path {
  display: grid;
  gap: 12px;
}
.milestone {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
}
.milestone.current {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--yellow);
}
.milestone-node {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e2eeeb;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--navy);
}
.milestone.done .milestone-node {
  background: var(--teal);
  color: #fff;
}
.milestone.current .milestone-node {
  background: var(--yellow);
}
.milestone-title {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.milestone-title span {
  background: var(--yellow);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 100px;
}
.milestone p {
  color: var(--muted);
}
.milestone small {
  display: block;
  margin-top: 6px;
  color: var(--teal-2);
  font-weight: 600;
}
.evidence-details {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 20px;
}
.evidence-details summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 800;
  list-style: none;
}
.evidence-content {
  padding: 0 0 18px;
  display: grid;
  gap: 12px;
  color: var(--muted);
}
.evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.evidence span {
  background: #e2eeeb;
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.evidence span b {
  margin-left: 6px;
  color: var(--teal-2);
}

/* ---------- footer ---------- */
.app-footer {
  margin-top: 34px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.app-footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- dialog ---------- */
dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 640px);
  width: 100%;
  max-height: 92vh;
}
dialog.modal.wide {
  max-width: min(94vw, 900px);
}
dialog.modal::backdrop {
  background: rgba(7, 29, 51, 0.6);
  backdrop-filter: blur(4px);
}
.modal-inner {
  background: #fff;
  border-radius: 26px;
  padding: 24px 26px 26px;
  max-height: 92vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-head p {
  color: var(--muted);
  margin-top: 4px;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.setting label b {
  display: block;
}
.setting label small {
  color: var(--muted);
}
.setting select,
.answer {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 46px;
  background: #fff;
  font-weight: 700;
}
.answer {
  width: 120px;
  font-size: 20px;
  text-align: center;
}
.switch {
  position: relative;
  width: 56px;
  height: 32px;
  border-radius: 100px;
  background: #cfd9dd;
  flex: none;
  transition: background 0.2s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.switch[aria-checked='true'] {
  background: var(--teal);
}
.switch[aria-checked='true']::after {
  transform: translateX(24px);
}
.feedback {
  background: #f3f8ff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.credits-content p + p {
  margin-top: 10px;
}

/* ---------- voices ---------- */
.voices-langs {
  display: flex;
  gap: 8px;
}
.voices-langs button {
  flex: 1;
  min-height: 46px;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--muted);
}
.voices-langs button[aria-pressed='true'] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.voices-list {
  display: grid;
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}
.voice-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.voice-row.has {
  background: #fff9e6;
  border-color: var(--yellow-2);
}
.voice-row strong {
  display: block;
  font-size: 17px;
}
.voice-row small {
  color: var(--muted);
}
.voice-row button {
  min-height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.voice-row button.recording {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  animation: blink 1s infinite;
}
@keyframes blink {
  50% { opacity: 0.7; }
}
.voice-label {
  display: flex;
  gap: 10px;
  align-items: center;
}
.voice-label input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 46px;
}

/* ---------- baby mode ---------- */
.baby-mode {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: radial-gradient(circle at 30% 10%, #1f5a8a 0, var(--navy) 50%, #071d33 100%);
  color: #fff;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
}
.baby-friend {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(78vmin, 640px);
  transform: translate(-50%, -50%);
  transform-origin: 50% 60%;
  pointer-events: none;
}
.baby-friend svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.baby-friend.motion-swim { animation: swim 1.3s ease-in-out; }
.baby-friend.motion-bob { animation: bob 1.2s ease-in-out; }
.baby-friend.motion-scuttle { animation: scuttle 1.1s ease-in-out; }
.baby-friend.motion-dive { animation: dive 1.4s ease-in-out; }
.baby-friend.motion-wiggle { animation: wiggle 1.1s ease-in-out; }
.baby-friend.motion-leap { animation: leap 1.2s cubic-bezier(0.3, 0, 0.2, 1); }
.baby-friend.motion-bounce { animation: bounce 1.1s cubic-bezier(0.3, 0, 0.2, 1); }
.baby-friend.motion-tilt { animation: tilt 1.2s ease-in-out; }
.baby-friend.motion-pulse { animation: pulse 1.1s ease-in-out; }
.baby-friend.motion-wave { animation: wave 1.2s ease-in-out; }
.baby-friend.motion-rise { animation: rise 1.4s ease-in-out; }
.baby-friend.motion-ripple { animation: ripple 1.2s ease-in-out; }
.baby-friend.motion-rock { animation: rock 1.4s ease-in-out; }
.baby-friend.motion-drift { animation: drift 1.8s ease-in-out; }
.baby-friend.motion-splash { animation: splash 1.1s ease-in-out; }
.baby-friend.motion-sway { animation: sway 1.6s ease-in-out; }
.baby-friend.motion-hop { animation: hop 1s cubic-bezier(0.3, 0, 0.2, 1); }
.baby-tap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.baby-word {
  position: absolute;
  left: 50%;
  bottom: 8vh;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  padding: 0 20px;
}
.baby-word small {
  display: block;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
  color: var(--aqua);
  margin-bottom: 6px;
}
.baby-word strong {
  font-size: clamp(40px, 9vmin, 92px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.baby-word em {
  display: block;
  font-style: normal;
  color: var(--yellow);
  font-weight: 700;
  font-size: clamp(18px, 3vmin, 28px);
}
.baby-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(56px, 10vmin, 84px);
  height: clamp(110px, 24vmin, 200px);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  border-radius: 30px;
}
.baby-arrow svg.icon {
  width: 40px;
  height: 40px;
}
.baby-arrow.prev { left: 6px; }
.baby-arrow.next { right: 6px; }
.baby-lock {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid rgba(255, 255, 255, 0.3);
}
.baby-lock .ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  clip-path: inset(0 0 100% 0);
}
.baby-lock.holding .ring {
  animation: fillring 1.8s linear forwards;
}
@keyframes fillring {
  from { clip-path: inset(100% 0 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
.baby-hint {
  position: absolute;
  top: 24px;
  left: 20px;
  right: 96px;
  color: var(--aqua);
  font-weight: 700;
  font-size: 14px;
}
.baby-timer {
  position: absolute;
  top: 88px;
  right: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
}
.baby-rest {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 30%, #163d63, #071d33);
  padding: 30px;
}
.baby-rest h2 {
  color: #fff;
  font-size: clamp(30px, 6vmin, 56px);
}
.baby-rest p {
  color: var(--aqua);
  font-size: 18px;
}
.baby-bubbles span {
  position: absolute;
  bottom: -30px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(143, 223, 240, 0.6);
  background: rgba(143, 223, 240, 0.12);
  animation: float 12s linear infinite;
  pointer-events: none;
}
.baby-bubbles span:nth-child(1) { left: 10%; }
.baby-bubbles span:nth-child(2) { left: 26%; animation-delay: 4s; width: 10px; height: 10px; }
.baby-bubbles span:nth-child(3) { left: 60%; animation-delay: 2s; animation-duration: 14s; }
.baby-bubbles span:nth-child(4) { left: 78%; animation-delay: 7s; width: 22px; height: 22px; animation-duration: 16s; }
.baby-bubbles span:nth-child(5) { left: 44%; animation-delay: 9s; width: 8px; height: 8px; }
.baby-bubbles span:nth-child(6) { left: 90%; animation-delay: 5s; width: 12px; height: 12px; }

/* ---------- quiet / reduced motion ---------- */
.quiet .scene-friend,
.quiet .baby-friend,
.quiet .find-card svg {
  animation: none !important;
}
.quiet .scene-bubbles,
.quiet .baby-bubbles,
.quiet .find-celebrate {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .scene-friend,
  .baby-friend,
  .find-card svg,
  .view {
    animation: none !important;
  }
  .scene-bubbles,
  .baby-bubbles,
  .find-celebrate {
    display: none;
  }
}
@media (max-width: 640px) {
  .language-row {
    grid-template-columns: 34px 70px 1fr auto;
  }
  .modal-inner {
    padding: 18px;
  }
  .scene-word {
    left: 12px;
    bottom: 12px;
    padding: 8px 14px;
  }
}
