/* ==========================================================================
   Dunia Ceria — app edutainment untuk kanak-kanak 1–4 tahun
   ========================================================================== */

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/baloo2-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/baloo2-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  --bg: #fff9f0;
  --bg-deep: #f8efdf;
  --paper: #ffffff;
  --ink: #332b25;
  --ink-soft: #786b5f;
  --ink-faint: #a99b8e;
  --coral: #ff7a59;
  --coral-deep: #d84a2b;
  --yellow: #ffc83d;
  --blue: #4c8dff;
  --green: #4dbe77;
  --purple: #a875f5;
  --pink: #ff7fa8;
  --line: rgba(51, 43, 37, 0.09);
  --shadow-sm: 0 2px 6px rgba(98, 67, 32, 0.06), 0 8px 24px rgba(98, 67, 32, 0.06);
  --shadow-md: 0 3px 8px rgba(98, 67, 32, 0.05), 0 18px 44px rgba(98, 67, 32, 0.1);
  --shadow-lg: 0 4px 12px rgba(98, 67, 32, 0.06), 0 28px 70px rgba(98, 67, 32, 0.15);
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 34px;
  --radius-xl: 46px;
  --topbar-h: 78px;
  --font: "Baloo 2", "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 220, 151, 0.36), transparent 32rem),
    radial-gradient(circle at 92% 18%, rgba(178, 222, 255, 0.34), transparent 30rem),
    radial-gradient(circle at 80% 100%, rgba(255, 190, 190, 0.25), transparent 34rem),
    var(--bg);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(127, 91, 52, 0.08) 1.3px, transparent 1.3px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%);
}

::selection {
  color: var(--ink);
  background: #ffe08a;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

p {
  line-height: 1.5;
}

:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 1.35em;
  height: 1.35em;
  flex: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* --------------------------------------------------------------------------
   App frame & top bar
   -------------------------------------------------------------------------- */

.app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 118px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: max(10px, env(safe-area-inset-top)) 18px 8px;
  background: linear-gradient(to bottom, rgba(255, 249, 240, 0.96) 55%, rgba(255, 249, 240, 0));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.topbar-inner {
  width: min(1120px, 100%);
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 17px;
  background: linear-gradient(145deg, #ff9b67, var(--coral));
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 5px 0 #dc5435, 0 10px 22px rgba(216, 74, 43, 0.25);
  transform: rotate(-5deg);
}

.brand-mark > span {
  transform: translateY(-1px);
}

.brand-name {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
  white-space: nowrap;
}

.brand-name small {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1.5px solid rgba(51, 43, 37, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.icon-btn:active {
  transform: translateY(1px) scale(0.97);
}

.icon-btn .icon {
  width: 23px;
  height: 23px;
}

.icon-btn.is-muted {
  color: var(--ink-faint);
  background: #f4eee5;
}

.icon-btn--back {
  background: rgba(255, 255, 255, 0.95);
}

.star-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 1.5px solid rgba(226, 165, 18, 0.22);
  border-radius: 999px;
  background: #fff4c9;
  color: #785000;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}

.star-pill .icon {
  width: 22px;
  height: 22px;
  color: #e9a400;
}

.star-pill.bump {
  animation: pill-bump 0.42s ease;
}

.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.mini-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 22px;
}

.topbar-context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-context-copy {
  min-width: 0;
}

.topbar-context-copy strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-context-copy span {
  display: block;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Shared layout
   -------------------------------------------------------------------------- */

.view {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 10px 0 30px;
  animation: view-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.view--narrow {
  width: min(940px, calc(100% - 36px));
}

.section {
  margin-top: 42px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
}

.section-head p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--coral-deep);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-kicker::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.7;
}

.btn {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(2px) scale(0.98);
}

.btn--primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 5px 0 var(--coral-deep), 0 12px 26px rgba(216, 74, 43, 0.24);
}

.btn--primary:hover {
  box-shadow: 0 7px 0 var(--coral-deep), 0 18px 32px rgba(216, 74, 43, 0.28);
}

.btn--dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 5px 0 #16110d, 0 12px 24px rgba(51, 43, 37, 0.18);
}

.btn--soft {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.btn--ghost {
  min-height: 46px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
}

.btn--sm {
  min-height: 46px;
  padding: 0 18px;
  font-size: 0.9rem;
}

.btn--wide {
  width: 100%;
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill--accent {
  border-color: rgba(255, 122, 89, 0.2);
  background: #fff0ea;
  color: var(--coral-deep);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 22px;
}

.page-head-copy h1 {
  font-size: clamp(2rem, 5.2vw, 3.2rem);
  line-height: 0.98;
}

.page-head-copy p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crumbs span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* --------------------------------------------------------------------------
   Home — hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 380px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  align-items: center;
  gap: 24px;
  padding: clamp(26px, 4.5vw, 54px);
  overflow: hidden;
  border: 2px solid rgba(210, 132, 45, 0.13);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.55) 0 5.4rem, transparent 5.5rem),
    radial-gradient(circle at 83% 25%, rgba(255, 224, 132, 0.78) 0 7.4rem, transparent 7.5rem),
    linear-gradient(128deg, #fff4d8 0%, #ffe8cf 53%, #ffddc9 100%);
  box-shadow: 0 4px 10px rgba(128, 84, 31, 0.05), 0 30px 60px rgba(128, 84, 31, 0.12);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto auto -55px -35px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 22px solid rgba(255, 255, 255, 0.27);
}

.hero::after {
  content: "✦";
  position: absolute;
  right: 42%;
  top: 13%;
  color: rgba(255, 255, 255, 0.9);
  font-size: 2.2rem;
  animation: twinkle 3.2s ease-in-out infinite;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #a3521d;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.hero-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(77, 190, 119, 0.18);
}

.hero h1 {
  max-width: 9.5ch;
  font-size: clamp(2.85rem, 6.6vw, 5.25rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.hero h1 .highlight {
  position: relative;
  display: inline-block;
  color: var(--coral-deep);
}

.hero h1 .highlight::after {
  content: "";
  position: absolute;
  left: 2%;
  right: -4%;
  bottom: 0.03em;
  z-index: -1;
  height: 0.22em;
  border-radius: 999px;
  background: rgba(255, 216, 93, 0.72);
  transform: rotate(-1.4deg);
}

.hero-copy > p {
  max-width: 38ch;
  margin-top: 18px;
  color: #70533d;
  font-size: clamp(0.96rem, 1.6vw, 1.08rem);
  font-weight: 600;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8b6a4f;
  font-size: 0.79rem;
  font-weight: 700;
}

.hero-note .icon {
  width: 17px;
  height: 17px;
}

.hero-art {
  position: relative;
  z-index: 2;
  min-height: 300px;
  display: grid;
  place-items: center;
}

.hero-art::before {
  content: "";
  position: absolute;
  width: min(315px, 88%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.mascot-wrap {
  position: relative;
  z-index: 2;
  width: min(340px, 83%);
  filter: drop-shadow(0 22px 26px rgba(139, 78, 21, 0.18));
  animation: float 4.6s ease-in-out infinite;
}

.mascot {
  width: 100%;
  height: auto;
  overflow: visible;
}

.mascot .arm-wave {
  transform-origin: 80px 130px;
  animation: wave 2.7s ease-in-out infinite;
}

.mascot .mascot-blink {
  transform-origin: center;
  animation: blink 4.6s infinite;
}

.float-tile {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(130, 78, 27, 0.15);
  font-weight: 800;
  font-size: 1.9rem;
  animation: float 5s ease-in-out infinite;
}

.float-tile--a {
  top: 6%;
  left: 5%;
  color: #d84a2b;
  transform: rotate(-10deg);
  animation-delay: -1.2s;
}

.float-tile--two {
  top: 17%;
  right: 3%;
  color: #2568d8;
  transform: rotate(8deg);
  animation-delay: -2s;
}

.float-tile--cat {
  left: 1%;
  bottom: 10%;
  background: #fff1cf;
  transform: rotate(6deg);
  animation-delay: -3.2s;
}

.float-tile--star {
  right: 3%;
  bottom: 6%;
  background: #ffe7a8;
  color: #b87900;
  transform: rotate(-7deg);
  animation-delay: -0.6s;
}

/* --------------------------------------------------------------------------
   Home — topic grid
   -------------------------------------------------------------------------- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
}

.topic-card {
  position: relative;
  min-height: 166px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  padding: 15px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: var(--cat-soft);
  color: var(--cat-deep);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(51, 43, 37, 0.04), var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.topic-card::after {
  content: "";
  position: absolute;
  top: -32px;
  right: -32px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--cat-color);
  opacity: 0.1;
  transition: transform 0.25s ease;
}

.topic-card:hover {
  transform: translateY(-5px) rotate(-0.4deg);
  box-shadow: inset 0 0 0 1px rgba(51, 43, 37, 0.04), var(--shadow-md);
}

.topic-card:hover::after {
  transform: scale(1.2);
}

.topic-card:active {
  transform: translateY(1px) scale(0.985);
}

.topic-icon {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--cat-deep);
  font-size: 2.05rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7);
}

.topic-icon.is-word {
  font-size: 1.28rem;
  letter-spacing: -0.05em;
}

.topic-title {
  position: relative;
  z-index: 1;
  margin-top: 70px;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topic-sub {
  position: relative;
  z-index: 1;
  color: var(--cat-deep);
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.62;
}

.topic-count {
  position: absolute;
  top: 17px;
  right: 15px;
  color: var(--cat-deep);
  font-size: 0.64rem;
  font-weight: 800;
  opacity: 0.52;
}

/* --------------------------------------------------------------------------
   Home — games / footer
   -------------------------------------------------------------------------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 25px;
  padding: 24px;
  overflow: hidden;
  border-radius: 31px;
  color: #fff;
  text-align: left;
  box-shadow: 0 5px 0 var(--game-shadow), 0 20px 40px rgba(70, 48, 24, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.game-card:hover {
  transform: translateY(-5px) rotate(0.35deg);
  box-shadow: 0 8px 0 var(--game-shadow), 0 26px 48px rgba(70, 48, 24, 0.18);
}

.game-card:active {
  transform: translateY(2px) scale(0.985);
  box-shadow: 0 3px 0 var(--game-shadow), 0 10px 24px rgba(70, 48, 24, 0.12);
}

.game-card--quiz {
  --game-shadow: #bd3f22;
  background: linear-gradient(145deg, #ff9975, #f16a49);
}

.game-card--count {
  --game-shadow: #2457b8;
  background: linear-gradient(145deg, #75a7ff, #3b7bf0);
}

.game-card--trace {
  --game-shadow: #24794a;
  background: linear-gradient(145deg, #71d396, #34a964);
}

.game-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -25px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, 0.13);
}

.game-card::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: 40px;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(12deg);
}

.game-emoji {
  position: relative;
  z-index: 1;
  font-size: 3.1rem;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.12));
}

.game-copy {
  position: relative;
  z-index: 1;
}

.game-copy h3 {
  font-size: 1.5rem;
}

.game-copy p {
  max-width: 22ch;
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.85;
}

.game-play {
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.19);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.game-play .icon {
  width: 21px;
  height: 21px;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 46px 0 10px;
  padding: 22px 4px 4px;
  border-top: 1.5px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-weight: 700;
}

.home-footer p {
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-footer .heart {
  color: var(--coral);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  transition: background 0.15s ease;
}

.footer-link:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* --------------------------------------------------------------------------
   Bottom dock
   -------------------------------------------------------------------------- */

.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(51, 43, 37, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 4px 10px rgba(98, 67, 32, 0.08), 0 18px 50px rgba(98, 67, 32, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.nav-item {
  position: relative;
  min-width: 78px;
  height: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item .icon {
  width: 22px;
  height: 22px;
}

.nav-item:hover {
  color: var(--ink-soft);
  background: #faf5ed;
}

.nav-item.is-active {
  color: var(--coral-deep);
  background: #fff0e8;
}

.nav-item:active {
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   Learn deck
   -------------------------------------------------------------------------- */

.learn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.deck-card {
  position: relative;
  min-height: 505px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-xl);
  background: var(--cat-soft);
  box-shadow: inset 0 0 0 1.5px rgba(51, 43, 37, 0.04), var(--shadow-md);
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.18s ease;
}

.deck-card::before,
.deck-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--cat-color);
  opacity: 0.09;
}

.deck-card::before {
  width: 220px;
  height: 220px;
  top: -100px;
  right: -75px;
}

.deck-card::after {
  width: 160px;
  height: 160px;
  bottom: -78px;
  left: -56px;
}

.deck-card:hover {
  transform: translateY(-3px);
}

.deck-card:active {
  transform: scale(0.996);
}

.deck-card.is-changing {
  animation: card-swap 0.35s ease;
}

.speaker-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--cat-deep);
  box-shadow: 0 6px 16px rgba(51, 43, 37, 0.08);
}

.speaker-badge .icon {
  width: 22px;
  height: 22px;
}

.deck-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--cat-deep);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.deck-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.deck-emoji {
  font-size: clamp(7rem, 15vw, 10rem);
  line-height: 1;
  filter: drop-shadow(0 14px 16px rgba(58, 40, 22, 0.15));
  animation: item-bob 4s ease-in-out infinite;
}

.deck-word {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--cat-deep);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.deck-fact {
  position: relative;
  z-index: 1;
  max-width: 38ch;
  margin-top: 12px;
  color: var(--cat-deep);
  font-size: clamp(0.98rem, 1.8vw, 1.15rem);
  font-weight: 600;
  opacity: 0.78;
}

.deck-tap-hint {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--cat-deep);
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.7;
}

.deck-tap-hint .icon {
  width: 16px;
  height: 16px;
}

/* Letter card */
.letter-display {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 30px);
}

.letter-box {
  min-width: 1.2em;
  padding: 0.02em 0.1em 0.1em;
  border-radius: 22px;
  color: var(--cat-deep);
  font-size: clamp(7.2rem, 16vw, 11.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.07em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.letter-box--small {
  min-width: 0.86em;
  padding: 0.02em 0.08em 0.1em;
  font-size: clamp(4.8rem, 10vw, 7.1rem);
  opacity: 0.62;
  background: transparent;
  box-shadow: none;
}

.letter-example {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.letter-example .emoji {
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  line-height: 1;
}

.letter-example .word {
  color: var(--cat-deep);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
}

.letter-example .word small {
  display: block;
  color: var(--cat-deep);
  font-size: 0.58em;
  font-weight: 700;
  opacity: 0.6;
}

/* Number card */
.number-display {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}

.number-display .numeral {
  color: var(--cat-deep);
  font-size: clamp(8rem, 18vw, 13rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.065em;
}

.number-display .number-word {
  color: var(--cat-deep);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  text-transform: lowercase;
  opacity: 0.62;
}

.ten-frame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(330px, 74vw);
  margin-top: 24px;
  padding: 10px;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
}

.ten-frame span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--cat-color);
  font-size: clamp(1rem, 2.5vw, 1.45rem);
  font-weight: 800;
  line-height: 1;
}

.ten-frame span.is-filled {
  background: var(--cat-color);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.number-example {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--cat-deep);
  font-size: 0.92rem;
  font-weight: 700;
}

.number-example .emoji {
  font-size: 1.7rem;
}

/* Color card */
.color-swatch {
  position: relative;
  z-index: 1;
  width: min(250px, 55vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 9px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 18px 34px rgba(51, 43, 37, 0.16), inset 0 -12px 30px rgba(0, 0, 0, 0.08);
}

.color-swatch .emoji {
  font-size: clamp(4.4rem, 9vw, 6.5rem);
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.18));
}

.color-example {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--cat-deep);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Shape card */
.shape-svg {
  position: relative;
  z-index: 1;
  width: min(230px, 52vw);
  height: min(230px, 52vw);
  filter: drop-shadow(0 16px 16px rgba(51, 43, 37, 0.15));
  animation: item-bob 4s ease-in-out infinite;
}

/* Deck controls */
.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.deck-arrow {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.deck-arrow:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.deck-arrow:active {
  transform: scale(0.95);
}

.deck-arrow .icon {
  width: 25px;
  height: 25px;
}

.deck-arrow--main {
  width: 68px;
  height: 68px;
  background: var(--cat-color);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 5px 0 var(--cat-deep), 0 14px 24px rgba(51, 43, 37, 0.15);
}

.deck-arrow--main:hover {
  box-shadow: 0 7px 0 var(--cat-deep), 0 18px 30px rgba(51, 43, 37, 0.2);
}

.deck-counter {
  min-width: 96px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.deck-counter strong {
  display: block;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.1;
}

/* Side panel */
.deck-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-card {
  padding: 20px;
  border: 1.5px solid rgba(51, 43, 37, 0.07);
  border-radius: 27px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}

.side-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.side-card h3 .icon {
  width: 19px;
  height: 19px;
  color: var(--cat-deep);
}

.side-card p {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.side-card .btn {
  margin-top: 14px;
}

.thumb-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-height: 262px;
  overflow: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.thumb {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: #faf6ef;
  color: var(--ink-soft);
  font-size: 1.35rem;
  font-weight: 800;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.thumb:hover {
  transform: translateY(-2px);
  background: #fff;
}

.thumb.is-active {
  border-color: var(--cat-color);
  background: var(--cat-soft);
  color: var(--cat-deep);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.thumb--letter {
  font-size: 1.05rem;
}

.thumb--number {
  font-size: 1.02rem;
}

/* --------------------------------------------------------------------------
   Read view
   -------------------------------------------------------------------------- */

.read-card {
  position: relative;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  border: 2.5px solid #fff;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(to bottom, transparent 0 41px, #e9e1d5 42px);
  box-shadow: 0 20px 50px rgba(98, 67, 32, 0.11);
  text-align: center;
}

.read-card::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  width: 170px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 208, 102, 0.5);
  transform: translateX(-50%) rotate(-2deg);
  box-shadow: 0 3px 5px rgba(98, 67, 32, 0.06);
}

.read-emoji {
  font-size: clamp(5rem, 12vw, 8rem);
  line-height: 1;
  filter: drop-shadow(0 12px 14px rgba(51, 43, 37, 0.12));
  animation: item-bob 4.2s ease-in-out infinite;
}

.read-syllables {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.syllable {
  min-width: 1.8em;
  padding: 0.04em 0.17em 0.12em;
  border-radius: 16px;
  background: #fff1e9;
  border: 2px solid #ffd7c7;
  color: #a83a1e;
  font-size: clamp(2.8rem, 7.4vw, 5.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  box-shadow: 0 4px 0 #ffd7c7;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.syllable:nth-child(2n) {
  background: #eaf2ff;
  border-color: #cadcff;
  color: #2055b5;
  box-shadow: 0 4px 0 #cadcff;
}

.syllable:nth-child(3n) {
  background: #e9f9e9;
  border-color: #c8ebc9;
  color: #22703a;
  box-shadow: 0 4px 0 #c8ebc9;
}

.syllable:hover {
  transform: translateY(-3px) rotate(-1deg);
}

.syllable:active {
  transform: translateY(2px) scale(0.97);
}

.syllable.is-speaking {
  transform: translateY(-5px) scale(1.06);
  background: var(--yellow);
  border-color: #e8aa1b;
  color: #704700;
  box-shadow: 0 5px 0 #d29a13;
}

.read-word {
  margin-top: 14px;
  color: var(--ink);
  font-size: clamp(1.5rem, 3.3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.read-sentence {
  max-width: 35ch;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 600;
}

.read-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.read-actions .btn {
  min-height: 50px;
}

.read-tip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  color: var(--ink-faint);
  font-size: 0.74rem;
  font-weight: 700;
}

.read-tip .icon {
  width: 16px;
  height: 16px;
}

.word-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 5px 2px 12px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.word-chip {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  scroll-snap-align: center;
}

.word-chip.is-active {
  background: #ffe6dc;
  border-color: #ffc4b1;
  color: #a83a1e;
}

/* --------------------------------------------------------------------------
   Quiz
   -------------------------------------------------------------------------- */

.game-shell {
  width: min(950px, 100%);
  margin: 0 auto;
}

.game-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.game-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.progress-dot {
  width: 28px;
  height: 9px;
  border-radius: 999px;
  background: #eadfce;
  transition: background 0.2s ease, width 0.2s ease;
}

.progress-dot.is-done {
  background: var(--green);
}

.progress-dot.is-current {
  width: 44px;
  background: var(--coral);
}

.game-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8a5a00;
  font-size: 0.84rem;
  font-weight: 800;
}

.game-score .icon {
  width: 19px;
  height: 19px;
  color: #e9a400;
}

.quiz-prompt {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 105px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1.5px solid rgba(51, 43, 37, 0.07);
  border-radius: 29px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.prompt-mascot {
  width: 74px;
  flex: none;
  filter: drop-shadow(0 8px 10px rgba(139, 78, 21, 0.15));
}

.prompt-copy {
  min-width: 0;
  flex: 1;
}

.prompt-copy small {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-faint);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prompt-copy h1 {
  font-size: clamp(1.45rem, 3.5vw, 2.2rem);
  line-height: 1.08;
}

.prompt-speak {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: #fff2cc;
  color: #8a5a00;
  border: 1.5px solid #f4dda0;
}

.prompt-speak .icon {
  width: 22px;
  height: 22px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.answer-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px;
  overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  box-shadow: inset 0 0 0 1.5px rgba(51, 43, 37, 0.05), var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.answer-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #fff4db;
  opacity: 0.65;
}

.answer-card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1.5px rgba(51, 43, 37, 0.05), var(--shadow-md);
}

.answer-card:active {
  transform: scale(0.98);
}

.answer-card .answer-emoji {
  position: relative;
  z-index: 1;
  font-size: clamp(4.3rem, 9vw, 6rem);
  line-height: 1;
  filter: drop-shadow(0 9px 9px rgba(51, 43, 37, 0.1));
}

.answer-card .answer-label {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 800;
}

.answer-card--letter .answer-large,
.answer-card--number .answer-large {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: clamp(4.9rem, 11vw, 7.3rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.answer-card--number .answer-large {
  color: #2055b5;
}

.answer-card--letter .answer-large {
  color: #9a5b00;
}

.answer-swatch {
  position: relative;
  z-index: 1;
  width: min(115px, 36vw);
  aspect-ratio: 1;
  border: 6px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 8px 18px rgba(51, 43, 37, 0.16), inset 0 -7px 16px rgba(0, 0, 0, 0.08);
}

.answer-card--shape .shape-svg {
  width: min(120px, 37vw);
  height: min(120px, 37vw);
  animation: none;
}

.answer-card.is-correct {
  border-color: var(--green);
  background: #effbf2;
  box-shadow: 0 0 0 4px rgba(77, 190, 119, 0.16), var(--shadow-md);
}

.answer-card.is-wrong {
  border-color: #ff8c8c;
  background: #fff2f2;
  animation: shake 0.38s ease;
}

.answer-card.is-muted {
  opacity: 0.48;
  transform: scale(0.97);
}

.answer-card .answer-status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.answer-card .answer-status .icon {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.answer-card.is-correct .answer-status {
  opacity: 1;
  transform: scale(1);
}

.quiz-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
  color: var(--ink-faint);
  font-size: 0.77rem;
  font-weight: 700;
}

.quiz-footnote .icon {
  width: 17px;
  height: 17px;
  color: var(--coral);
}

/* Game complete */
.complete-card {
  position: relative;
  max-width: 660px;
  margin: 10px auto;
  padding: clamp(32px, 6vw, 54px) 26px 34px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 236, 179, 0.9), transparent 16rem),
    #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.complete-card::before,
.complete-card::after {
  content: "✦";
  position: absolute;
  color: #f4c63e;
  animation: twinkle 2.6s ease-in-out infinite;
}

.complete-card::before {
  top: 48px;
  left: 54px;
  font-size: 2.1rem;
}

.complete-card::after {
  top: 88px;
  right: 58px;
  font-size: 1.5rem;
  animation-delay: -1.2s;
}

.complete-mascot {
  width: min(190px, 45vw);
  margin: 0 auto 10px;
  filter: drop-shadow(0 16px 18px rgba(139, 78, 21, 0.18));
  animation: float 4s ease-in-out infinite;
}

.complete-card h1 {
  font-size: clamp(2.4rem, 6vw, 3.7rem);
  color: var(--coral-deep);
}

.complete-card > p {
  max-width: 36ch;
  margin: 8px auto 0;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 600;
}

.complete-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 22px 0 6px;
}

.complete-stars .icon {
  width: 43px;
  height: 43px;
  color: #f1b400;
  filter: drop-shadow(0 4px 0 #d29a13);
  animation: star-pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.complete-stars .icon:nth-child(2) { animation-delay: 0.08s; }
.complete-stars .icon:nth-child(3) { animation-delay: 0.16s; }
.complete-stars .icon:nth-child(4) { animation-delay: 0.24s; }
.complete-stars .icon:nth-child(5) { animation-delay: 0.32s; }
.complete-stars .icon:nth-child(6) { animation-delay: 0.4s; }

.complete-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff4c9;
  color: #795000;
  font-size: 0.85rem;
  font-weight: 800;
}

.complete-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Counting
   -------------------------------------------------------------------------- */

.count-stage {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 242, 204, 0.8), transparent 15rem),
    #fff;
  box-shadow: var(--shadow-md);
}

.count-objects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 10px);
  max-width: 700px;
}

.count-object {
  position: relative;
  width: clamp(53px, 9vw, 82px);
  height: clamp(53px, 9vw, 82px);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 22px;
  background: #fff8e8;
  font-size: clamp(2.1rem, 4.8vw, 3.5rem);
  line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(51, 43, 37, 0.04);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.18s ease, background 0.18s ease;
}

.count-object:hover {
  transform: rotate(0) translateY(-3px);
  background: #fff2cf;
}

.count-object:active {
  transform: scale(0.9);
}

.count-object.is-counted {
  background: #e9fbee;
  animation: pop 0.3s ease;
}

.count-object.is-counted::after {
  content: attr(data-count);
  position: absolute;
  top: -7px;
  right: -7px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(24, 96, 47, 0.25);
}

.count-helper {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  min-height: 45px;
  padding: 0 17px;
  border-radius: 999px;
  background: #eef4ff;
  border: 1.5px solid #d7e5ff;
  color: #2556b4;
  font-size: 0.8rem;
  font-weight: 800;
}

.count-helper .icon {
  width: 18px;
  height: 18px;
}

.answer-grid--numbers {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.answer-card--number {
  min-height: 145px;
}

/* --------------------------------------------------------------------------
   Trace
   -------------------------------------------------------------------------- */

.trace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.trace-paper {
  position: relative;
  padding: 16px;
  border: 2px solid rgba(51, 43, 37, 0.06);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.trace-paper::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 2;
  width: 140px;
  height: 30px;
  border-radius: 5px;
  background: rgba(255, 218, 102, 0.58);
  transform: translateX(-50%) rotate(-1.6deg);
  box-shadow: 0 2px 5px rgba(98, 67, 32, 0.05);
}

.trace-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.88;
  overflow: hidden;
  border-radius: 28px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(to bottom, transparent 0 49px, #e7e0d6 50px);
}

#traceCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.trace-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-soft);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.trace-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.trace-tool {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.15s ease;
}

.trace-tool:hover {
  transform: translateY(-2px);
  background: #fffaf2;
}

.trace-tool:active {
  transform: scale(0.96);
}

.trace-tool .icon {
  width: 18px;
  height: 18px;
}

.trace-tool--primary {
  background: var(--green);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 0 #24794a, 0 10px 20px rgba(36, 121, 74, 0.2);
}

.trace-tool--primary:hover {
  background: #45b16c;
}

.trace-side {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 999px;
  background: #f4ede3;
}

.mode-switch button {
  min-height: 42px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-switch button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  max-height: 244px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.char-chip {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: #faf6ef;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 800;
}

.char-chip:hover {
  background: #fff;
}

.char-chip.is-active {
  background: #e9fbee;
  border-color: var(--green);
  color: #22703a;
}

.trace-tip {
  display: flex;
  gap: 9px;
  padding: 14px;
  border-radius: 19px;
  background: #fff7e5;
  color: #7c5b12;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
}

.trace-tip .icon {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

/* --------------------------------------------------------------------------
   Parent gate & parent page
   -------------------------------------------------------------------------- */

.gate-wrap {
  width: min(520px, 100%);
  margin: 40px auto;
  padding: clamp(28px, 6vw, 46px) 26px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.gate-icon {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 28px;
  background: #eef4ff;
  color: #2556b4;
  transform: rotate(-4deg);
}

.gate-icon .icon {
  width: 38px;
  height: 38px;
}

.gate-wrap h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
}

.gate-wrap > p {
  max-width: 36ch;
  margin: 8px auto 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

.hold-btn {
  position: relative;
  width: 100%;
  min-height: 62px;
  margin-top: 25px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 5px 0 #16110d, 0 14px 26px rgba(51, 43, 37, 0.18);
}

.hold-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ffb43c, #ff7a59);
  transform: scaleX(0);
  transform-origin: left;
  transition: none;
}

.hold-btn .hold-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hold-btn .hold-label .icon {
  width: 19px;
  height: 19px;
}

.hold-btn.is-holding::before {
  transform: scaleX(1);
  transition: transform 2s linear;
}

.hold-btn.is-holding {
  background: var(--ink);
}

.gate-footnote {
  margin-top: 16px;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 600;
}

.parent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.parent-card {
  padding: 24px;
  border: 1.5px solid rgba(51, 43, 37, 0.07);
  border-radius: 29px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.parent-card--wide {
  grid-column: 1 / -1;
}

.parent-card h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.25rem;
}

.parent-card h2 .icon {
  width: 21px;
  height: 21px;
  color: var(--coral-deep);
}

.parent-card > p {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.field-label {
  display: block;
  margin: 18px 0 7px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.text-input {
  width: 100%;
  min-height: 54px;
  padding: 0 17px;
  border: 2px solid #eadfce;
  border-radius: 16px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(76, 141, 255, 0.13);
}

.field-row {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.field-row .btn {
  flex: none;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1.5px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.setting-row:first-of-type {
  margin-top: 10px;
  padding-top: 0;
}

.setting-copy strong {
  display: block;
  font-size: 0.92rem;
}

.setting-copy span {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 0.73rem;
  font-weight: 600;
}

.switch {
  position: relative;
  width: 58px;
  height: 34px;
  flex: none;
  border-radius: 999px;
  background: #e9e0d4;
  transition: background 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(51, 43, 37, 0.2);
  transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.55, 1);
}

.switch[aria-checked="true"] {
  background: var(--green);
}

.switch[aria-checked="true"]::after {
  transform: translateX(24px);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 18px;
}

.stat-box {
  padding: 15px 10px;
  border-radius: 20px;
  background: #fff8eb;
  text-align: center;
}

.stat-box strong {
  display: block;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-box span {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1.5px solid var(--line);
}

.danger-zone p {
  color: var(--ink-soft);
  font-size: 0.77rem;
  font-weight: 600;
}

.btn--danger {
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid #ffc9c9;
  border-radius: 999px;
  background: #fff4f4;
  color: #b32d2d;
  font-size: 0.76rem;
  font-weight: 800;
}

.parent-tip {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  padding: 19px;
  border-radius: 22px;
  background: #fff6de;
  color: #735217;
}

.parent-tip .parent-tip-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 14px;
  background: #ffe8a8;
  font-size: 1.2rem;
}

.parent-tip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.9rem;
}

.parent-tip p {
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.45;
}

.parent-about {
  color: var(--ink-faint);
  font-size: 0.74rem;
  font-weight: 600;
}

.parent-about strong {
  color: var(--ink-soft);
}

.install-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #f2f7ff;
}

.install-box p {
  color: #33557f;
  font-size: 0.76rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Toast, modal, confetti
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 13px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(51, 43, 37, 0.94);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 14px 32px rgba(51, 43, 37, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(0.95);
  transition: opacity 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(45, 33, 24, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade-in 0.2s ease both;
}

.modal-card {
  width: min(430px, 100%);
  padding: 28px;
  border-radius: 30px;
  background: #fffdf9;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: modal-in 0.28s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

.modal-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 20px;
  background: #fff0f0;
  color: #b32d2d;
}

.modal-icon .icon {
  width: 28px;
  height: 28px;
}

.modal-card h2 {
  font-size: 1.65rem;
}

.modal-card p {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 11px;
  height: 17px;
  border-radius: 3px;
  animation: confetti-fall var(--dur) cubic-bezier(0.2, 0.7, 0.3, 1) var(--delay) forwards;
}

.confetti-piece.is-round {
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.burst-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  animation: burst-out 0.72s ease-out forwards;
}

/* --------------------------------------------------------------------------
   Boot screen
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  animation: boot-out 0.5s ease 0.65s forwards;
}

.boot-logo {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: linear-gradient(145deg, #ff9b67, var(--coral));
  color: #fff;
  font-size: 43px;
  box-shadow: 0 8px 0 #dc5435, 0 18px 32px rgba(216, 74, 43, 0.25);
  animation: boot-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.boot-name {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.boot-dots {
  display: flex;
  gap: 6px;
}

.boot-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  animation: dot-bounce 0.9s ease-in-out infinite;
}

.boot-dots span:nth-child(2) { animation-delay: 0.12s; }
.boot-dots span:nth-child(3) { animation-delay: 0.24s; }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes item-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.88) rotate(0); }
  50% { opacity: 1; transform: scale(1.1) rotate(8deg); }
}

@keyframes wave {
  0%, 70%, 100% { transform: rotate(0); }
  76% { transform: rotate(-18deg); }
  82% { transform: rotate(9deg); }
  88% { transform: rotate(-12deg); }
  94% { transform: rotate(6deg); }
}

@keyframes blink {
  0%, 44%, 50%, 100% { transform: scaleY(1); }
  47% { transform: scaleY(0.08); }
}

@keyframes pill-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.13) rotate(-2deg); }
  70% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

@keyframes card-swap {
  0% { opacity: 0.4; transform: translateY(8px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-1deg); }
  40% { transform: translateX(7px) rotate(1deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

@keyframes pop {
  0% { transform: scale(0.86) rotate(var(--tilt, 0deg)); }
  55% { transform: scale(1.08) rotate(0); }
  100% { transform: scale(1) rotate(var(--tilt, 0deg)); }
}

@keyframes star-pop {
  from { opacity: 0; transform: scale(0.2) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes confetti-fall {
  0% { opacity: 1; transform: translate3d(0, -20px, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate3d(var(--drift), 105vh, 0) rotate(var(--spin)); }
}

@keyframes burst-out {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(var(--bx), var(--by)) scale(0.3) rotate(var(--br)); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes boot-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.7) rotate(-8deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes dot-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-5px); opacity: 1; }
}

@keyframes boot-out {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* --------------------------------------------------------------------------
   Small additions: banners, help, trace states
   -------------------------------------------------------------------------- */

.read-banner {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 20px 22px;
  border: 2px solid #ffe1d5;
  border-radius: 28px;
  background: linear-gradient(120deg, #fff5ee, #ffe9df);
  box-shadow: var(--shadow-sm);
}

.read-banner-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 19px;
  background: #fff;
  color: var(--coral-deep);
  box-shadow: 0 6px 14px rgba(168, 58, 30, 0.1);
}

.read-banner-icon .icon {
  width: 27px;
  height: 27px;
}

.read-banner-copy {
  flex: 1;
  min-width: 0;
}

.read-banner-copy h2 {
  font-size: 1.35rem;
}

.read-banner-copy p {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.help-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  text-align: left;
}

.help-list p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 13px;
  background: #faf6ef;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.help-list strong {
  color: var(--ink);
}

.complete-stars .icon.is-empty {
  color: #eadfce;
  fill: #eadfce;
  filter: none;
}

.trace-paper.is-done {
  border-color: rgba(77, 190, 119, 0.55);
  box-shadow: 0 0 0 5px rgba(77, 190, 119, 0.11), var(--shadow-md);
}

.trace-paper.is-shaking {
  animation: shake 0.4s ease;
}

.mascot-wrap {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.answer-card:disabled {
  cursor: default;
}

.mini-brand-name {
  display: inline;
}

@media (max-width: 620px) {
  .read-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 17px;
    border-radius: 23px;
  }

  .read-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .read-banner-copy h2 {
    font-size: 1.15rem;
  }

  .read-banner .btn {
    width: 100%;
  }

  .topbar-context-copy {
    display: none;
  }

  .mini-brand-name {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1020px) {
  .topic-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .learn-layout,
  .trace-grid {
    grid-template-columns: 1fr;
  }

  .deck-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .thumb-strip {
    grid-template-columns: repeat(8, 1fr);
    max-height: none;
  }

  .trace-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .trace-side .side-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 30px 24px 24px;
  }

  .hero::after {
    right: 12%;
    top: 9%;
  }

  .hero-copy {
    text-align: center;
  }

  .hero h1 {
    max-width: 12ch;
    margin: 0 auto;
  }

  .hero-copy > p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-art {
    min-height: 235px;
    margin-top: 10px;
  }

  .mascot-wrap {
    width: min(255px, 64%);
  }

  .hero-art::before {
    width: min(240px, 67%);
  }

  .float-tile {
    width: 53px;
    height: 53px;
    border-radius: 17px;
    font-size: 1.45rem;
  }

  .float-tile--a { left: 9%; }
  .float-tile--two { right: 6%; }
  .float-tile--cat { left: 5%; }
  .float-tile--star { right: 5%; }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card {
    min-height: 170px;
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }

  .game-copy {
    flex: 1;
  }

  .game-play {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
  }

  .game-card::after {
    right: 9px;
    bottom: -14px;
  }

  .parent-grid {
    grid-template-columns: 1fr;
  }

  .parent-card--wide {
    grid-column: auto;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .page-head-actions {
    width: 100%;
  }

  .answer-grid {
    gap: 9px;
  }

  .answer-card {
    min-height: 160px;
    border-radius: 23px;
    padding: 10px;
  }

  .answer-card--number {
    min-height: 120px;
  }

  .read-card,
  .deck-card {
    min-height: 440px;
  }
}

@media (max-width: 620px) {
  .app {
    padding-bottom: 104px;
  }

  .topbar {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar-inner {
    min-height: 52px;
    gap: 8px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 22px;
    box-shadow: 0 4px 0 #dc5435, 0 8px 18px rgba(216, 74, 43, 0.2);
  }

  .brand-name {
    font-size: 1.18rem;
  }

  .brand-name small {
    display: none;
  }

  .icon-btn {
    width: 43px;
    height: 43px;
  }

  .icon-btn .icon {
    width: 21px;
    height: 21px;
  }

  .star-pill {
    min-height: 43px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .star-pill .icon {
    width: 19px;
    height: 19px;
  }

  .view,
  .view--narrow {
    width: calc(100% - 24px);
    padding-top: 4px;
  }

  .learn-page .page-head-actions .pill {
    display: none;
  }

  .count-page .page-head,
  .trace-page .page-head {
    margin: 2px 0 12px;
    gap: 0;
  }

  .count-page .page-head .crumbs,
  .trace-page .page-head .crumbs,
  .count-page .page-head p,
  .trace-page .page-head p,
  .count-page .page-head-actions,
  .trace-page .page-head-actions {
    display: none;
  }

  .count-page .page-head h1,
  .trace-page .page-head h1 {
    font-size: 1.5rem;
  }

  .section {
    margin-top: 32px;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .topic-card {
    min-height: 140px;
    border-radius: 22px;
  }

  .topic-icon {
    width: 51px;
    height: 51px;
    border-radius: 16px;
    font-size: 1.65rem;
  }

  .topic-icon.is-word {
    font-size: 1.05rem;
  }

  .topic-title {
    margin-top: 55px;
    font-size: 1rem;
  }

  .topic-sub {
    font-size: 0.68rem;
  }

  .topic-count {
    top: 14px;
    right: 12px;
  }

  .hero {
    border-radius: 34px;
    padding: 28px 18px 20px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 12vw, 3.5rem);
  }

  .hero-eyebrow {
    margin-bottom: 13px;
    font-size: 0.59rem;
  }

  .hero-actions {
    gap: 9px;
  }

  .hero-actions .btn {
    min-height: 51px;
    padding: 0 20px;
    font-size: 0.94rem;
  }

  .hero-note {
    display: none;
  }

  .hero-art {
    min-height: 210px;
  }

  .mascot-wrap {
    width: min(220px, 63%);
  }

  .hero-art::before {
    width: min(210px, 65%);
  }

  .float-tile {
    width: 43px;
    height: 43px;
    border-radius: 14px;
    font-size: 1.18rem;
  }

  .section-head {
    margin-bottom: 13px;
  }

  .section-head h2 {
    font-size: 1.48rem;
  }

  .section-head p {
    font-size: 0.82rem;
  }

  .home-footer {
    margin-top: 34px;
    font-size: 0.69rem;
    gap: 8px;
  }

  .bottom-dock {
    width: calc(100% - 24px);
    justify-content: space-between;
    gap: 2px;
  }

  .nav-item {
    flex: 1;
    min-width: 0;
    height: 52px;
  }

  .deck-card {
    min-height: 408px;
    padding: 24px 16px;
    border-radius: 34px;
  }

  .deck-emoji {
    font-size: clamp(6rem, 27vw, 8.5rem);
  }

  .deck-word {
    font-size: clamp(2.1rem, 10vw, 3rem);
  }

  .letter-box {
    font-size: clamp(6.2rem, 28vw, 8.8rem);
  }

  .letter-box--small {
    font-size: clamp(3.8rem, 18vw, 5.5rem);
  }

  .number-display .numeral {
    font-size: clamp(7rem, 35vw, 10rem);
  }

  .number-display .number-word {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  .ten-frame {
    margin-top: 18px;
  }

  .deck-controls {
    gap: 10px;
    margin-top: 13px;
  }

  .deck-arrow {
    width: 50px;
    height: 50px;
  }

  .deck-arrow--main {
    width: 60px;
    height: 60px;
  }

  .deck-counter {
    min-width: 78px;
    font-size: 0.76rem;
  }

  .deck-side {
    grid-template-columns: 1fr;
  }

  .thumb-strip {
    grid-template-columns: repeat(7, 1fr);
  }

  .read-card {
    min-height: 420px;
    border-radius: 34px;
  }

  .read-syllables {
    gap: 5px;
  }

  .syllable {
    font-size: clamp(2.4rem, 14vw, 3.8rem);
    border-radius: 13px;
  }

  .read-actions .btn {
    min-height: 46px;
    padding: 0 16px;
    font-size: 0.84rem;
  }

  .game-topline {
    gap: 8px;
    margin-bottom: 12px;
  }

  .game-progress {
    gap: 4px;
  }

  .progress-dot {
    width: 20px;
    height: 8px;
  }

  .progress-dot.is-current {
    width: 30px;
  }

  .quiz-prompt {
    min-height: 92px;
    gap: 10px;
    padding: 13px;
    border-radius: 24px;
  }

  .prompt-mascot {
    width: 55px;
  }

  .prompt-copy h1 {
    font-size: clamp(1.3rem, 6vw, 1.7rem);
  }

  .prompt-speak {
    width: 42px;
    height: 42px;
  }

  .answer-card {
    min-height: 142px;
    border-radius: 20px;
  }

  .answer-card .answer-emoji {
    font-size: clamp(3rem, 13vw, 4.4rem);
  }

  .answer-card .answer-label {
    font-size: 0.72rem;
  }

  .answer-card--letter .answer-large,
  .answer-card--number .answer-large {
    font-size: clamp(3.8rem, 18vw, 5.4rem);
  }

  .answer-swatch {
    width: min(88px, 24vw);
    border-width: 5px;
  }

  .answer-card--shape .shape-svg {
    width: min(86px, 24vw);
    height: min(86px, 24vw);
  }

  .complete-card {
    border-radius: 34px;
  }

  .complete-stars .icon {
    width: 34px;
    height: 34px;
  }

  .count-stage {
    min-height: 220px;
    border-radius: 32px;
    padding: 14px;
  }

  .count-object {
    width: clamp(43px, 14vw, 62px);
    height: clamp(43px, 14vw, 62px);
    border-radius: 17px;
    font-size: clamp(1.7rem, 7vw, 2.6rem);
  }

  .count-helper {
    margin-top: 16px;
  }

  .answer-grid--numbers {
    margin-top: 12px;
  }

  .answer-card--number {
    min-height: 118px;
  }

  .trace-paper {
    padding: 10px;
    border-radius: 32px;
  }

  .trace-canvas-wrap {
    border-radius: 23px;
  }

  .trace-toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .trace-tool {
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.72rem;
    justify-content: center;
  }

  .trace-toolbar [data-action="trace-prev"] {
    grid-column: 1;
    grid-row: 1;
  }

  .trace-toolbar [data-action="trace-speak"] {
    grid-column: 2 / span 2;
    grid-row: 1;
  }

  .trace-toolbar [data-action="trace-next"] {
    grid-column: 4;
    grid-row: 1;
  }

  .trace-toolbar [data-action="trace-clear"] {
    grid-column: 1 / span 2;
    grid-row: 2;
  }

  .trace-toolbar [data-action="trace-done"] {
    grid-column: 3 / span 2;
    grid-row: 2;
  }

  .trace-side {
    grid-template-columns: 1fr;
  }

  .trace-side .side-card:last-child {
    grid-column: auto;
  }

  .char-grid {
    grid-template-columns: repeat(8, 1fr);
    max-height: 190px;
  }

  .gate-wrap {
    margin-top: 16px;
    border-radius: 34px;
  }

  .parent-card {
    padding: 20px;
    border-radius: 25px;
  }

  .stat-grid {
    gap: 6px;
  }

  .stat-box {
    padding: 13px 5px;
    border-radius: 16px;
  }

  .stat-box strong {
    font-size: 1.5rem;
  }

  .stat-box span {
    font-size: 0.55rem;
  }

  .danger-zone {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .star-pill {
    padding: 0 10px;
  }

  .brand-name {
    display: none;
  }

  .answer-grid {
    gap: 6px;
  }

  .answer-card {
    min-height: 125px;
  }

  .answer-card .answer-label {
    font-size: 0.65rem;
  }

  .count-object {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .bottom-dock,
  .toast,
  .confetti-layer {
    display: none !important;
  }
}
