:root {
  --ink: #24334a;
  --paper: rgba(255, 255, 255, .95);
  --sky: #dff4ff;
  --blue: #3f83dc;
  --yellow: #ffd866;
  --green: #35ad75;
  --coral: #ec776b;
  --shadow: 0 14px 30px rgba(42, 71, 111, .16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); font-family: Fredoka, system-ui, sans-serif; background: linear-gradient(#aee4ff 0%, var(--sky) 58%, #c7eca8 100%); }
button, a { font: inherit; }
button { cursor: pointer; }
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop::before, .backdrop::after { position: absolute; content: ""; border-radius: 50%; }
.backdrop::before { width: 42vw; height: 42vw; top: -22vw; right: -8vw; background: rgba(255, 225, 104, .55); }
.backdrop::after { width: 65vw; height: 18vw; left: -8vw; bottom: -10vw; background: #75c66b; }
.topbar { width: min(1120px, calc(100% - 32px)); min-height: 76px; margin: 14px auto 8px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.home, .sound, .replay, .learn { display: grid; place-items: center; border: 0; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); text-decoration: none; }
.home, .sound { width: 58px; height: 58px; border-radius: 18px; font-size: 1.65rem; }
.sound { background: #fff8d9; }
.eyebrow { margin: 0; color: #3b79ca; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 2px 0; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1; }
.subtitle { margin: 0; color: #5f7087; font-size: clamp(.95rem, 2vw, 1.18rem); font-weight: 600; }
.actions { display: flex; gap: 9px; }
.learn { min-height: 58px; padding: 0 17px; border-radius: 18px; color: #295ea9; background: #e8f1ff; font-weight: 700; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 10px auto 24px; }
.prompt { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 13px; align-items: center; min-height: 86px; padding: 12px 16px; border: 2px solid rgba(255,255,255,.75); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.replay { width: 52px; height: 52px; border-radius: 16px; color: #235fb9; background: #dceaff; font-size: 1.4rem; }
.replay:disabled { opacity: .45; cursor: default; }
.round { margin: 0 0 2px; color: #687891; font-size: .88rem; font-weight: 700; }
.question { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 700; line-height: 1.14; }
.badge { min-width: 72px; padding: 9px 12px; border-radius: 15px; color: #704d0a; background: #fff1ad; font-size: 1rem; font-weight: 700; text-align: center; }
.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.choice { min-width: 0; padding: 8px; overflow: hidden; border: 4px solid rgba(255,255,255,.88); border-radius: 21px; color: var(--ink); background: var(--paper); box-shadow: 0 12px 22px rgba(42, 71, 111, .16); transition: transform .16s ease, filter .16s ease, border-color .16s ease; }
.choice:not(:disabled):active { transform: scale(.97); }
.choice:disabled { cursor: default; opacity: .72; filter: grayscale(.48) brightness(.88); }
.choice.correct { opacity: 1; filter: none; border-color: var(--green); background: #effbf4; }
.choice.retry { opacity: 1; filter: none; border-color: var(--coral); background: #fff1ef; }
.art { width: 100%; aspect-ratio: 1 / .76; overflow: hidden; border-radius: 14px; background: #e9f5ff; }
.art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.label { display: block; min-height: 1.75em; padding: 7px 3px 1px; font-size: clamp(.9rem, 1.8vw, 1.1rem); font-weight: 700; line-height: 1.05; text-align: center; }
.feedback { min-height: 1.5em; margin: 13px auto 0; color: #43546a; font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 700; text-align: center; }
.feedback.good { color: #187c53; }
.feedback.retry { color: #bf5147; }
.overlay { position: fixed; inset: 0; z-index: 4; display: none; place-items: center; padding: 20px; background: rgba(31, 48, 76, .43); }
.overlay.active { display: grid; }
.modal { position: relative; width: min(660px, 100%); padding: clamp(24px, 4vw, 40px); border: 3px solid rgba(255,255,255,.8); border-radius: 26px; background: #fffdf7; box-shadow: 0 24px 65px rgba(14, 32, 62, .34); text-align: center; }
.modal .close { position: absolute; top: 12px; right: 14px; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #64758d; background: #edf2f8; font-size: 1.7rem; }
.modal-icon { font-size: 3.3rem; }
.modal h2 { margin: 6px 0; font-size: clamp(1.65rem, 3.8vw, 2.35rem); }
.modal p { margin: 8px auto; color: #596b81; font-size: clamp(1.05rem, 2vw, 1.23rem); line-height: 1.28; }
.modal button:not(.close), .finish a { min-height: 50px; margin: 8px 4px 0; padding: 10px 18px; border: 0; border-radius: 15px; color: white; background: var(--blue); box-shadow: 0 8px 16px rgba(41, 100, 189, .2); font-weight: 700; text-decoration: none; }
.finish a { display: inline-flex; align-items: center; color: #2f619e; background: #e5efff; }

@media (max-width: 720px) {
  .topbar { width: min(100% - 20px, 1120px); grid-template-columns: 48px minmax(0, 1fr); gap: 10px; margin-top: 10px; }
  .actions { grid-column: 1 / -1; justify-content: flex-end; }
  .home, .sound { width: 48px; height: 48px; border-radius: 15px; font-size: 1.35rem; }
  .learn { min-height: 48px; padding: 0 13px; border-radius: 15px; }
  .shell { width: min(100% - 20px, 1120px); }
  .prompt { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 17px; }
  .badge { display: none; }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .choice { padding: 7px; border-width: 3px; border-radius: 17px; }
}

@media (min-width: 721px) and (max-width: 1366px) and (orientation: landscape) {
  html, body { height: 100dvh; overflow: hidden; }
  .topbar { margin: 8px auto 5px; min-height: 60px; }
  .home, .sound { width: 48px; height: 48px; font-size: 1.32rem; }
  .learn { min-height: 48px; }
  h1 { font-size: 1.8rem; }
  .shell { height: calc(100dvh - 122px); overflow: hidden; margin-top: 5px; }
  .prompt { min-height: 68px; padding: 9px 14px; }
  .choices { gap: 11px; margin-top: 11px; }
  .choice { padding: 7px; border-radius: 17px; }
  .art { aspect-ratio: 1 / .69; }
  .label { min-height: 1.5em; padding-top: 4px; font-size: .94rem; }
  .feedback { margin-top: 7px; }
}
