@font-face {
  font-family: Nunito;
  src: url(assets/fonts/nunito-cyrillic.woff2) format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Nunito;
  src: url(assets/fonts/nunito-latin.woff2) format('woff2');
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  color: #403446;
  background: #faeef2;
  font-family: Nunito, system-ui, sans-serif;
  font-synthesis: none;
  --purple: #795299;
  --purple-dark: #62427d;
  --lilac: #eadcf4;
  --paper: #fffbf3;
  --muted: #695a6c;
  --button-shadow: 0 5px 0 #e2d3e1, 0 8px 14px #64477614;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, p { margin: 0; }
img { display: block; max-width: 100%; }
button, select, summary { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button, select, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
button { border: 0; }
:focus-visible { outline: 3px solid #795299; outline-offset: 5px; }
h1:focus { outline: none; }

.world {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at 80% 50%, #fff0e7ad 0, transparent 57%),
      linear-gradient(122deg, #f7eaf5 0, #fbeef2 48%, #ffece9 100%);
}

.decorations { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sparkle { position: absolute; color: #bba3cc; font-size: clamp(16px, 2vw, 27px); opacity: .64; }
.sparkle-one { top: 18%; left: 3.2%; }
.sparkle-two { top: 25%; right: 3.6%; color: #d8a47c; }
.sparkle-three { top: 31%; right: 8%; }
.sparkle-four { bottom: 7%; left: 49%; }
.meadow {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: clamp(32px, 7.6vh, 86px);
  background: #dce5ce;
  border-radius: 15% 61% 0 0 / 38% 45% 0 0;
}
.meadow::after {
  content: '';
  position: absolute;
  inset: 19% -4% 0 30%;
  background: #e3eacf;
  border-radius: 63% 34% 0 0 / 56% 47% 0 0;
}
.meadow-flower {
  --stem: #8ea780;
  position: absolute;
  bottom: 9px;
  z-index: 1;
  width: 2px;
  height: 31px;
  background: var(--stem);
}
.meadow-flower::before {
  content: '✿';
  position: absolute;
  inset: -22px auto auto -11px;
  font-size: 23px;
  color: var(--bloom);
}
.meadow-flower::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 3px;
  width: 9px;
  height: 5px;
  border-radius: 100% 8% 100% 0;
  background: #a2b18a;
  transform: rotate(-27deg);
}
.meadow-flower-pink { --bloom: #e6a3b6; left: 4%; }
.meadow-flower-purple { --bloom: #b99acd; left: 6%; height: 21px; }
.meadow-flower-peach { --bloom: #d5abd5; right: 6%; height: 37px; }

.topbar {
  width: min(100%, 1290px);
  align-self: center;
  min-height: 92px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(4%, env(safe-area-inset-right)) 10px max(4%, env(safe-area-inset-left));
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: clamp(15px, 1.7vw, 21px);
  font-weight: 850;
  line-height: 1.15;
}
.brand-flower, .game-card-icon { color: var(--purple); }
.brand-flower { font-size: 34px; }
.icon-button, .small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 49px;
  padding: 9px 19px;
  background: var(--paper);
  border-radius: 19px;
  font-size: clamp(16px, 1.75vw, 20px);
  font-weight: 850;
  box-shadow: 0 3px 0 #e2d6dc;
}
.icon-button {
  width: 49px;
  padding: 0;
  font-size: 34px;
  line-height: 1;
}
button:active:not(:disabled), summary:active { transform: translateY(2px); }
.sound-settings { position: relative; justify-self: end; grid-column: 3; }
.sound-settings summary { list-style: none; user-select: none; }
.sound-settings summary::-webkit-details-marker { display: none; }
.sound-settings summary span { font-weight: 900; font-size: 1.2em; }
.sound-settings.muted summary span { opacity: .58; }
.sound-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(282px, 85vw);
  display: grid;
  gap: 11px;
  padding: 18px;
  border: 1px solid #e4d5e6;
  border-radius: 21px;
  background: var(--paper);
  box-shadow: 0 12px 30px #6e437e2c;
  font-size: 17px;
  font-weight: 800;
}
.sound-toggle { display: flex; align-items: center; gap: 9px; min-height: 38px; }
.sound-toggle input { inline-size: 20px; block-size: 20px; accent-color: var(--purple); }
.music-credit {
  color: var(--muted);
  font-size: .75em;
  line-height: 1.4;
}
.music-credit a { color: inherit; }
.music-credit span { display: block; }
.progress {
  display: grid;
  grid-auto-flow: column;
  gap: clamp(4px, .75vw, 12px);
  align-items: center;
  justify-content: center;
  padding-bottom: 8px;
}
.flower {
  position: relative;
  display: block;
  width: clamp(20px, 3.45vw, 44px);
  height: clamp(30px, 4.5vw, 58px);
  text-align: center;
  color: #d4c6d8;
  line-height: 1.1;
}
.flower > span { display: inline-block; position: relative; z-index: 1; font-size: clamp(22px, 3.7vw, 48px); }
.flower::after {
  content: '';
  position: absolute;
  left: calc(50% - 1px);
  top: 62%;
  height: 34%;
  width: 2px;
  background: #c5c9b8;
  transform: rotate(-11deg);
}
.flower.bloomed { color: var(--flower-color); }
.flower.bloomed > span { animation: bloom .48s cubic-bezier(.16,.73,.41,1.24); }
.flower.bloomed::after { background: #9aad85; }

main {
  display: grid;
  flex: 1;
  width: min(100%, 1240px);
  padding: clamp(16px, 4vh, 42px) max(4.8%, env(safe-area-inset-right)) clamp(60px, 11vh, 122px) max(4.8%, env(safe-area-inset-left));
  align-self: center;
  align-items: center;
}
.screen { animation: enter .23s ease-out both; }
.welcome {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(16px, 5vw, 64px);
  padding-inline: clamp(0px, 2.3vw, 36px);
}
.welcome-copy { position: relative; z-index: 1; }
.eyebrow {
  color: var(--muted);
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 26px);
  margin-bottom: 9px;
}
.welcome h1 {
  font-size: clamp(57px, 8.1vw, 96px);
  line-height: .98;
  font-weight: 900;
  letter-spacing: -.045em;
}
.finish h1 { font-size: clamp(51px, 6.3vw, 82px); }
.finish-copy {
  color: var(--muted);
  font-size: clamp(19px, 2.55vw, 29px);
  line-height: 1.37;
  font-weight: 650;
  margin-block: clamp(15px, 2.5vh, 26px);
}
.mascot-stage {
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
}
.mascot-stage::before {
  content: '';
  position: absolute;
  width: 91%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e5d5f0bb;
  z-index: -1;
  translate: 0 -1%;
}
.mascot-stage img { position: relative; width: min(100%, 505px); height: auto; }
.celebration-art {
  display: grid;
  width: min(100%, 505px);
  transform-origin: 50% 85%;
  animation: unicorn-celebration 2.5s ease-out both;
}
.celebration-art img { grid-area: 1 / 1; width: 100%; }
.celebration-wink {
  opacity: 0;
  mask-image: radial-gradient(ellipse 25% 16% at 57% 39%, #000 62%, transparent);
  animation: unicorn-wink 2.5s ease both;
}
.fireworks { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.firework {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: .68em;
  height: .68em;
  border-radius: 50%;
  font-size: clamp(6px, 1.07vw, 12px);
  opacity: 0;
  background: #f8c974;
  box-shadow:
    0 -4.5em 0 -.04em var(--burst-color),
    2.7em -3.7em 0 #f8c974,
    4.3em -1.4em 0 -.06em var(--burst-color),
    4.3em 1.4em 0 #ef9dab,
    2.7em 3.7em 0 -.04em var(--burst-color),
    0 4.5em 0 #f8c974,
    -2.7em 3.7em 0 -.04em var(--burst-color),
    -4.3em 1.4em 0 #ef9dab,
    -4.3em -1.4em 0 -.06em var(--burst-color),
    -2.7em -3.7em 0 #f8c974,
    1.35em -1.35em 0 -.11em #f8c974,
    -1.6em 1.05em 0 -.10em var(--burst-color);
  animation: finish-firework 1.25s cubic-bezier(.18, .60, .32, 1) var(--delay) both;
}
.firework::after {
  content: '✦';
  position: absolute;
  top: -1.1em;
  left: 1.25em;
  color: var(--burst-color);
  font-size: 1.5em;
}
@keyframes unicorn-celebration {
  0% { transform: translateY(12px) scale(.94) rotate(-3deg); }
  22% { transform: translateY(-9px) scale(1.02) rotate(2deg); }
  47% { transform: translateY(1px) rotate(-1.5deg); }
  63% { transform: translateY(-3px) rotate(.75deg); }
  83%, 100% { transform: none; }
}
@keyframes unicorn-wink {
  0%, 24%, 60%, 100% { opacity: 0; }
  32%, 51% { opacity: 1; }
}
@keyframes finish-firework {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.1); }
  22% { opacity: .92; }
  65% { opacity: .72; }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(1.15); }
}
.game-list { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: clamp(22px, 4.5vh, 44px); }
.game-card, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 65px;
  padding: 13px 25px;
  border-radius: 26px;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 5px 0 var(--purple-dark);
  font-size: clamp(19px, 2.5vw, 28px);
  font-weight: 900;
  white-space: nowrap;
}
.game-card { gap: 13px; padding: 12px 20px 12px 13px; }
.game-card-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: #f2e5fa;
  font-weight: 900;
}
.card-arrow { font-size: 29px; line-height: 1; }
.finish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; }

.progress-screen { width: 100%; min-width: 0; align-self: start; }
.progress-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.progress-heading h1 { font-size: clamp(32px, 5.3vw, 58px); font-weight: 900; line-height: 1.1; }
.progress-note { color: var(--muted); font-size: clamp(13px, 1.55vw, 16px); }
.progress-heading .progress-note { margin-top: 5px; }
.progress-range { display: grid; gap: 4px; font-size: 14px; font-weight: 850; }
.progress-range select {
  min-height: 43px;
  padding: 6px 10px;
  border: 1px solid #ddcbe4;
  border-radius: 12px;
  background: var(--paper);
}
.progress-status:not(:empty) { padding: 17px; border-radius: 17px; background: var(--paper); margin-bottom: 15px; }
.progress-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin: 0; }
.progress-totals > div,
.progress-card { padding: clamp(12px, 2.1vw, 24px); border-radius: 20px; background: var(--paper); box-shadow: 0 3px 0 #e8dce7; }
.progress-totals dt { color: var(--muted); font-size: clamp(13px, 1.55vw, 16px); }
.progress-totals dd { margin: 5px 0 0; font-size: clamp(21px, 3.7vw, 37px); font-weight: 900; line-height: 1.15; }
.progress-totals #progress-first { font-size: clamp(15px, 2.3vw, 25px); }
.progress-outcomes { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-block: 14px; color: var(--muted); font-size: 14px; }
.progress-outcomes strong { color: var(--purple-dark); margin-left: 4px; }
.progress-card { margin-top: 14px; }
.progress-card h2 { margin: 0 0 6px; font-size: clamp(18px, 2.65vw, 28px); font-weight: 900; }
.progress-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(3px, 1.1vw, 13px);
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.progress-chart li {
  display: grid;
  grid-template-rows: auto 78px auto;
  justify-items: center;
  gap: 4px;
  font-size: clamp(10px, 1.45vw, 14px);
}
.progress-chart-value { font-weight: 850; white-space: nowrap; }
.progress-chart-bar {
  align-self: end;
  width: min(85%, 48px);
  height: max(2px, var(--score));
  border-radius: 7px 7px 2px 2px;
  background: #a982c0;
}
.progress-chart-date { color: var(--muted); }
.progress-table { width: 100%; border-collapse: collapse; font-size: clamp(12px, 1.5vw, 16px); }
.progress-table :is(th, td) { padding: 7px 5px; text-align: left; border-bottom: 1px solid #ebe0ec; }
.progress-table thead th { color: var(--muted); font-weight: 800; vertical-align: bottom; }
.progress-table tbody th { color: var(--purple-dark); font-weight: 900; }
.progress-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.progress-mistakes { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.progress-mistakes li { padding: 4px 9px; border-radius: 9px; background: var(--lilac); font-weight: 850; }

@media (max-width: 700px) {
  .progress-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .progress-table :is(th, td) { padding-inline: 3px; }
}


@media (max-width: 380px) {
  .progress-table { font-size: 11px; }
  .progress-table :is(th, td) { padding-inline: 2px; }
}

.round {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: start;
  gap: clamp(23px, 4.45vw, 66px);
}
.picture-card {
  --unicorn-size: clamp(63px, 11.8vw, 137px);
  --unicorn-overhang: 11%;
  --unicorn-walker-scale: .72;
  --unicorn-walker-bottom: calc(var(--unicorn-size) * -.63);
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  width: 100%;
  min-height: 0;
  height: clamp(290px, 44.5vh, 500px);
  padding: clamp(14px, 2.9vw, 37px) clamp(10px, 2vw, 25px) clamp(13px, 2vw, 30px);
  background: var(--paper);
  border-radius: clamp(26px, 4.3vw, 50px);
  box-shadow: 0 6px 0 #e7dae3, 0 12px 25px #83657812;
}
.word-art {
  display: grid;
  place-items: center;
  position: relative;
  width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-radius: .75rem;
  isolation: isolate;
}
.word-art:disabled { cursor: default; }
.word-sound-icon {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: clamp(28px, 3.8vw, 42px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--lilac);
  font-size: clamp(14px, 1.8vw, 20px);
}
.word-art:disabled .word-sound-icon { opacity: .45; }
.word-art::before {
  content: '';
  position: absolute;
  width: min(82%, 260px);
  height: 95%;
  max-height: 267px;
  border-radius: 48% 52% 45% 55%;
  background: #e0f0f4;
  z-index: -1;
}
.word-art:has(img:not([src$="whale.webp"]))::before { background: #f2e6f4; }
.word-art img {
  width: min(100%, 370px);
  height: 100%;
  min-height: 0;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.word-art img[src$="whale.webp"] { mix-blend-mode: normal; }
.word {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(57px, 8.6vw, 97px);
  font-weight: 900;
  font-size: clamp(39px, 6vw, 72px);
  line-height: 1;
  letter-spacing: .045em;
  white-space: nowrap;
}
.word.long-word {
  font-size: clamp(29px, 4.1vw, 50px);
  letter-spacing: .025em;
}
@media (min-width: 701px) {
  .word.very-long-word { font-size: clamp(22px, 3.1vw, 40px); }
}
.word strong {
  background: var(--lilac);
  color: var(--purple);
  padding: .045em .10em .055em .15em;
  border-radius: .26em;
  margin-right: .065em;
  line-height: 1.05;
}
.little-unicorn {
  position: absolute;
  width: var(--unicorn-size);
  height: auto;
  right: calc(-1 * var(--unicorn-overhang));
  bottom: -16%;
  z-index: 1;
  pointer-events: none;
  transition: opacity .16s ease;
}
.unicorn-stroll:not([hidden]) + .little-unicorn { opacity: 0; }
.unicorn-stroll {
  position: absolute;
  inset-inline: 0;
  bottom: var(--unicorn-walker-bottom);
  z-index: 1;
  pointer-events: none;
  animation: unicorn-stroll var(--unicorn-stroll-duration) linear both;
}
.unicorn-walker {
  position: absolute;
  right: calc(var(--unicorn-size) * (1 - var(--unicorn-walker-scale)) / 2 - var(--unicorn-overhang));
  bottom: 0;
  width: calc(var(--unicorn-size) * var(--unicorn-walker-scale));
  aspect-ratio: 208 / 221;
  background: url(assets/unicorn-walk.webp) 0 0 / 600% 100% no-repeat;
  animation: unicorn-steps var(--unicorn-walk-cycle) steps(6) infinite,
    unicorn-bob calc(var(--unicorn-walk-cycle) / 2) ease-in-out infinite,
    unicorn-turn var(--unicorn-stroll-duration) steps(1, end) both;
}
@keyframes unicorn-stroll {
  0%, 100% { transform: translateX(0); opacity: 0; }
  2%, 98% { opacity: 1; }
  50% { transform: translateX(calc(-100% + var(--unicorn-size) - var(--unicorn-overhang))); }
}
/* Each 20% shifts the six-frame strip by one sprite width. */
@keyframes unicorn-steps { to { background-position: 120% 0; } }
@keyframes unicorn-bob { 50% { translate: 0 -2%; } }
@keyframes unicorn-turn {
  0% { transform: scaleX(1); }
  50%, 100% { transform: scaleX(-1); }
}
.question-area { padding-top: 3px; min-width: 0; }
.question-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.question-area h1 {
  font-weight: 900;
  font-size: clamp(26px, 3.2vw, 44px);
  letter-spacing: -.017em;
  line-height: 1.16;
}
.task-help {
  position: relative;
  flex: 0 0 auto;
  width: 53px;
  min-height: 49px;
}
.task-help span {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--purple-dark);
  color: white;
  font-size: 17px;
  font-weight: 900;
}
.task-help:disabled,
.picture-preview:disabled { opacity: .55; cursor: default; }
.round[data-task="picture"] .picture-card,
.round[data-task="pair"] .picture-card {
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
}
.round[data-task="picture"] .picture-card { background: #f9edfc; }
.round[data-task="pair"] .picture-card { background: #fff4e7; }
.target-letter {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 1.25em;
  padding: .05em .16em;
  border-radius: .26em;
  background: var(--lilac);
  color: var(--purple-dark);
  font-size: clamp(64px, 12vw, 150px);
  font-weight: 900;
  line-height: 1.15;
}
.letter-speaker {
  position: absolute;
  top: -.3rem;
  right: -.3rem;
  display: grid;
  place-items: center;
  width: clamp(28px, 3.8vw, 42px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  font-size: clamp(14px, 1.8vw, 20px);
}
.target-letter:disabled { cursor: default; }
.target-letter:disabled .letter-speaker { opacity: .45; }
.pair-guide { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 1.15vw, 14px); }
.pair-slot {
  display: grid;
  place-items: center;
  width: clamp(55px, 9vw, 108px);
  aspect-ratio: 1;
  border: 2px dashed #aa83b9;
  border-radius: 19px;
  background: #fffaf5;
}
.pair-slot:has(img:not([hidden])) { border-style: solid; }
.pair-slot img { width: 90%; height: 90%; object-fit: contain; mix-blend-mode: multiply; }
.pair-plus { color: var(--purple-dark); font-size: clamp(24px, 3.6vw, 45px); font-weight: 900; }
.picture-answers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.35vw, 16px);
  margin-top: clamp(14px, 2.9vh, 28px);
  align-items: start;
}
.picture-option { display: grid; justify-items: center; min-width: 0; }
.picture-answer {
  display: grid;
  justify-items: center;
  width: 100%;
  min-width: 0;
  padding: clamp(4px, .8vw, 10px);
  background: var(--paper);
  border-radius: clamp(13px, 1.9vw, 23px);
  box-shadow: var(--button-shadow);
}
.picture-answer img { width: 100%; aspect-ratio: 1; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.picture-name { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(10px, 1.65vw, 17px); font-weight: 900; }
.picture-answer[aria-pressed="true"] { outline: 3px solid var(--purple); background: var(--lilac); }
.picture-answer.correct { outline: 3px solid #57986b; background: #d3efdc; }
.picture-answer.wrong { outline: 3px solid #ba6885; background: #f8dce5; }
.picture-answer:disabled { cursor: default; }
.picture-preview {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  margin-top: 5px;
  padding: 0;
  border-radius: 14px;
  background: var(--lilac);
  font-size: 18px;
}
.listen-hint {
  margin-top: .6rem;
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 750;
  line-height: 1.35;
}
.voice-credit {
  display: inline-block;
  margin-inline-start: .35em;
  font-size: .8em;
}
.letters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(9px, 1.85vw, 24px);
  margin-top: clamp(18px, 3.8vh, 42px);
}
.letters.four-letters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.letters.four-letters .letter { font-size: clamp(40px, 7.15vw, 88px); }
.letter {
  position: relative;
  width: 100%;
  height: clamp(80px, 14vw, 157px);
  padding: 2px;
  background: #fffafc;
  color: #43354c;
  border-radius: clamp(17px, 2.45vw, 28px);
  font-size: clamp(48px, 9.4vw, 108px);
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--button-shadow);
}
.letter:disabled { opacity: .58; cursor: default; }
.letter.correct {
  opacity: 1;
  color: #235842;
  background: #d3efdc;
  box-shadow: 0 5px 0 #acd0ba, 0 8px 14px #305f4919;
  animation: jump .40s ease-out;
}
.letter.wrong {
  color: #882e50;
  background: #f8d4df;
  box-shadow: 0 5px 0 #e7b5c6;
}
.letter.correct::after, .letter.wrong::after {
  position: absolute;
  inset: 9px 9px auto auto;
  display: grid;
  place-items: center;
  width: clamp(19px, 2.5vw, 28px);
  aspect-ratio: 1;
  color: white;
  border-radius: 50%;
  font-size: clamp(13px, 1.7vw, 19px);
  font-family: system-ui, sans-serif;
}
.letter.correct::after { content: '✓'; background: #2d6649; }
.letter.wrong::after { content: '×'; background: #a94b68; }
.feedback {
  min-height: 58px;
  padding-block: clamp(12px, 2vh, 19px) 7px;
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 900;
  text-align: center;
}
.feedback.right { color: #235842; }

@keyframes enter { from { opacity: .1; translate: 0 6px; } to { opacity: 1; translate: 0; } }
@keyframes jump { 0%, 100% { transform: translateY(0); } 44% { transform: translateY(-12px); } }
@keyframes bloom { from { transform: scale(.74); opacity: .65; } to { transform: scale(1); opacity: 1; } }

@media (min-width: 701px) and (max-height: 700px) {
  .topbar { min-height: 70px; }
  main { padding-top: 11px; padding-bottom: 45px; }
  .welcome h1 { font-size: clamp(43px, 11vh, 78px); }
  .mascot-stage img { max-height: 60vh; width: auto; }
  .celebration-art { width: min(100%, 60vh, 505px); }
  .question-area h1 { font-size: clamp(24px, 4.6vh, 35px); }
  .picture-card { height: clamp(230px, 54vh, 365px); }
  .letter { height: clamp(64px, 20vh, 124px); font-size: clamp(39px, 14vh, 90px); }
  .letters { margin-top: 16px; }
  .word { min-height: 59px; }
}

@media (max-width: 700px) {
  .topbar { min-height: 70px; gap: 6px; padding-inline: max(14px, env(safe-area-inset-left)); }
  .brand { font-size: 14px; gap: 6px; }
  .brand-flower { font-size: 26px; }
  .icon-button { width: 38px; min-height: 38px; font-size: 27px; border-radius: 12px; }
  .small-button { min-height: 43px; padding: 6px 13px; border-radius: 14px; font-size: 15px; }
  .progress { grid-template-columns: repeat(5, max-content); grid-auto-flow: row; row-gap: 0; padding-bottom: 0; }
  .flower { width: 19px; height: 24px; }
  .flower > span { font-size: 19px; }
  main { padding-inline: max(18px, env(safe-area-inset-left)); padding-top: 10px; padding-bottom: 46px; }
  .welcome { grid-template-columns: 1fr; gap: 15px; text-align: center; padding: 0; }
  .welcome h1 { font-size: clamp(47px, 11vw, 68px); }
  .welcome h1 { max-width: 13ch; margin-inline: auto; }
  .game-list, .finish-actions { justify-content: center; }
  .game-list { margin-top: 17px; }
  .mascot-stage > img,
  .celebration-art { width: min(68vw, 285px); }
  .mascot-stage::before { width: min(62vw, 258px); }
  .finish-copy { margin-block: 11px 15px; }
  .round { grid-template-columns: 1fr; gap: 14px; }
  .picture-card {
    --unicorn-size: 65px;
    --unicorn-overhang: 6px;
    --unicorn-walker-scale: .58;
    --unicorn-walker-bottom: -30px;
    width: min(100%, 440px);
    justify-self: center;
    height: clamp(155px, 28svh, 270px);
    padding: 10px;
  }
  .word { min-height: 45px; font-size: clamp(34px, 9vw, 49px); }
  .word.long-word { font-size: clamp(26px, 7vw, 40px); }
  .word-art::before { width: min(56%, 215px); }
  .little-unicorn { bottom: -10%; }
  .question-area { text-align: center; }
  .question-heading { justify-content: center; align-items: center; gap: 9px; }
  .question-area h1 { font-size: clamp(22px, 5.6vw, 32px); }
  .round[data-task="picture"] .picture-card,
  .round[data-task="pair"] .picture-card {
    --unicorn-size: 48px;
    --unicorn-walker-bottom: -24px;
    height: auto;
    padding-block: 9px;
  }
  .picture-answers { width: min(100%, 400px); margin-inline: auto; }
  .letters { width: min(100%, 440px); margin: 12px auto 0; }
  .letter { min-height: 66px; height: auto; aspect-ratio: 1.3; font-size: clamp(44px, 12vw, 68px); }
  .feedback { min-height: 46px; padding-block: 10px 5px; }
}

@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  .round { row-gap: 34px; }
  .round[data-task="picture"], .round[data-task="pair"] { row-gap: 28px; }
}

@media (max-width: 365px) {
  .brand #brand-name { display: none; }
  .topbar { grid-template-columns: 1fr auto 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
  .little-unicorn { transition: none; }
}
