:root {
  color-scheme: light;
  --ink: #234f47;
  --muted: #607c76;
  --cream: #fffaf0;
  --line: #e4d5ad;
  --mint: #3d9f7f;
  --mint-dark: #25775f;
  --coral: #f47563;
  --yellow: #f6c44b;
  --shadow: 0 10px 0 rgba(107, 92, 52, .11);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 17px 17px, rgba(226, 199, 132, .22) 1.5px, transparent 1.6px) 0 0 / 34px 34px,
    #fbf5e5;
}

button, a { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 42px;
}

.game-head {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.game-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.game-brand > span:last-child { display: grid; gap: 2px; }
.game-brand strong { font-size: 1.05rem; }
.game-brand small { color: var(--muted); font-weight: 700; }

.brand-mark {
  width: 54px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--mint);
  box-shadow: 0 6px 0 var(--mint-dark);
  font-size: .76rem;
  font-weight: 900;
}

.age-pill,
.route-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--ink);
  background: #e5f4e9;
  font-weight: 900;
}

.screen { display: none; }
.screen.is-active { display: block; }

.hero,
.play-card,
.result-card {
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 42px;
  background: rgba(255, 252, 245, .98);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr);
  min-height: 530px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(44px, 7vw, 76px);
}

.eyebrow,
.stage-kicker {
  margin: 0 0 14px;
  color: #a85f30;
  font-family: Georgia, serif;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.hero h1 {
  max-width: 700px;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(3rem, 5.3vw, 4.65rem);
  line-height: .98;
  letter-spacing: -.035em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 650px;
  margin: 30px 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.7vw, 1.3rem);
  line-height: 1.55;
}

.primary,
.secondary,
.feedback button,
.play-actions button,
.hint-button {
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  padding: 14px 25px;
  cursor: pointer;
  font-weight: 900;
}

.primary {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 7px 0 #c95240;
}

.primary:hover { transform: translateY(-2px); }
.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #c95240; }

.hero-scene {
  position: relative;
  min-height: 530px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 19%, #ffd65e 0 28px, #ffeba9 29px 47px, transparent 48px),
    linear-gradient(160deg, #d6f0ec 0 57%, #a4cf90 57% 100%);
}

.hero-scene::before,
.hero-scene::after {
  content: "";
  position: absolute;
  bottom: 87px;
  border-radius: 50% 50% 0 0;
  background: #77ad70;
}

.hero-scene::before { left: -55px; width: 280px; height: 135px; transform: rotate(7deg); }
.hero-scene::after { right: -90px; width: 340px; height: 170px; transform: rotate(-8deg); }

.hero-shelf {
  position: absolute;
  z-index: 2;
  left: 7%;
  right: 7%;
  bottom: 62px;
  height: 40px;
  border: 7px solid #fff5d5;
  border-radius: 18px;
  background: #eab260;
  box-shadow: 0 14px 0 #bb7f3f;
}

.hero-toy {
  position: absolute;
  z-index: 3;
  bottom: 102px;
  width: 190px;
  height: 190px;
  object-fit: contain;
  transform-origin: center bottom;
  filter: drop-shadow(0 9px 6px rgba(56, 67, 40, .16));
}

.hero-toy--small { left: 4%; transform: scale(.48); }
.hero-toy--medium { left: 31%; transform: scale(.72); }
.hero-toy--large { right: 2%; transform: scale(1); }
.hero-dot { position: absolute; border-radius: 50%; background: rgba(255,255,255,.7); }
.hero-dot--one { width: 21px; height: 21px; left: 12%; top: 16%; }
.hero-dot--two { width: 13px; height: 13px; right: 31%; top: 29%; }

.rule-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 30px 0 64px;
  padding: 22px 28px;
  border: 2px dashed #d9c48d;
  border-radius: 26px;
  background: rgba(255, 252, 244, .87);
}

.rule-card > span {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: var(--mint);
  font-size: 1.5rem;
  font-weight: 900;
}

.rule-card strong { font-size: 1.08rem; }
.rule-card p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; }

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

.section-head h2,
.play-head h2,
.result-card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

.section-head > p { margin: 0 0 8px; color: var(--muted); }

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

.route-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 430px;
  border: 2px solid var(--line);
  border-radius: 30px;
  background: var(--route-color, #edf7ef);
  box-shadow: var(--shadow);
}

.route-card__visual {
  position: relative;
  height: 185px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding: 24px 12px 19px;
  background: rgba(255,255,255,.5);
}

.route-card__visual::after {
  content: "";
  position: absolute;
  left: 10%; right: 10%; bottom: 18px;
  height: 16px;
  border-radius: 50%;
  background: rgba(72, 76, 54, .1);
}

.route-card__visual img {
  position: relative;
  z-index: 1;
  width: 102px;
  height: 125px;
  object-fit: contain;
  transform: scale(var(--preview-scale, 1));
  transform-origin: center bottom;
}

.route-card__body { flex: 1; display: flex; flex-direction: column; padding: 24px; }
.route-card .eyebrow { margin-bottom: 10px; }
.route-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.72rem; line-height: 1.08; }
.route-card p:not(.eyebrow) { color: var(--muted); line-height: 1.45; }
.route-card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.route-card button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  color: #fff;
  background: var(--route-accent, var(--mint));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--route-accent, var(--mint)), #000 22%);
  cursor: pointer;
  font-weight: 900;
}

.play-card { padding: clamp(22px, 4vw, 42px); }
.play-head { display: grid; grid-template-columns: 1fr 190px; gap: 24px; align-items: end; margin-bottom: 28px; }
.round-progress { display: grid; gap: 8px; text-align: right; }
.round-progress span { overflow: hidden; height: 11px; border-radius: 999px; background: #e5ecd9; }
.round-progress i { display: block; width: 12.5%; height: 100%; border-radius: inherit; background: var(--mint); transition: width .25s ease; }
.round-progress b { color: var(--muted); }
.round-progress em { color: var(--ink); font-style: normal; }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: stretch; }
.size-stage,
.coach-card {
  border: 2px solid #cfe2d0;
  border-radius: 28px;
}

.size-stage { min-width: 0; padding: clamp(20px, 4vw, 36px); background: #f4fbf8; }
.size-stage h3 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 3.5vw, 2.7rem); line-height: 1.1; }
.stage-help { margin: 10px 0 22px; color: var(--muted); }
.stage-kicker { color: var(--mint-dark); }

.toy-options {
  display: grid;
  grid-template-columns: repeat(var(--option-count, 2), minmax(0, 1fr));
  gap: 16px;
}

.toy-choice {
  position: relative;
  min-width: 0;
  height: 245px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 3px solid #d9dec9;
  border-radius: 25px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 0 rgba(68, 85, 65, .12);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.toy-choice:hover { transform: translateY(-2px); border-color: #9bcdb6; }
.toy-choice img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  transform: scale(var(--toy-scale, 1));
  transform-origin: center;
  pointer-events: none;
  filter: drop-shadow(0 8px 5px rgba(49, 67, 56, .13));
}

.toy-choice.is-correct { border-color: var(--mint); background: #e3f6eb; }
.toy-choice.is-wrong { border-color: var(--coral); background: #fff0ec; animation: shake .25s linear; }
.toy-choice.is-hint { outline: 5px solid #ffd86b; outline-offset: -8px; }
.toy-choice.is-picked { opacity: .42; cursor: default; transform: none; }
.toy-choice:disabled { cursor: default; }
.toy-choice__label { position: absolute; right: 11px; bottom: 10px; padding: 6px 9px; border-radius: 999px; background: #f5f0df; color: var(--muted); font-size: .78rem; font-weight: 900; }

@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.order-board {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 20px;
  background: #e8f5ee;
}
.order-board > span { display: block; margin-bottom: 9px; font-size: .8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.order-board > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.order-slot { min-height: 76px; display: grid; place-items: center; border: 2px dashed #9fc8b3; border-radius: 15px; background: rgba(255,255,255,.62); }
.order-slot img { width: 66px; height: 66px; object-fit: contain; transform: scale(var(--slot-scale, 1)); }
.order-slot b { color: #7e9d91; }

.coach-card { display: flex; flex-direction: column; padding: 26px; background: #fff4cc; border-color: #ead28c; }
.coach-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 20px; color: #fff; background: #dda034; font-size: 1.8rem; font-weight: 900; }
.coach-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.7rem; }
.coach-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.hint-button { margin-top: auto; border: 2px solid #dfbd59; background: #fff9e8; box-shadow: 0 5px 0 rgba(173, 124, 35, .2); }

.feedback {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 17px;
  border: 2px solid #a9d9c3;
  border-radius: 23px;
  background: #e7f7ee;
}
.feedback.is-wrong { border-color: #f4ad9f; background: #fff0ec; }
.feedback > span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; background: #fff; font-size: 1.7rem; font-weight: 900; }
.feedback strong { font-size: 1.1rem; }
.feedback p { margin: 4px 0 0; color: var(--muted); }
.feedback button { min-height: 50px; color: #fff; background: var(--mint); }
.feedback.is-wrong button { background: var(--coral); }

.play-actions { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 20px; color: var(--muted); }
.play-actions button { min-height: 45px; border: 2px solid var(--line); background: #fff; }

.result-card { max-width: 880px; margin: 0 auto; padding: clamp(32px, 6vw, 66px); text-align: center; }
.result-star { width: 88px; height: 88px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 30px; color: #fff; background: var(--yellow); box-shadow: 0 8px 0 #d49b25; font-size: 2.6rem; }
.result-card > p:not(.eyebrow) { color: var(--muted); font-size: 1.16rem; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.result-stats > div { display: grid; gap: 4px; padding: 18px 10px; border-radius: 20px; background: #f1f6e9; }
.result-stats b { font-size: 1.6rem; }
.result-stats span { color: var(--muted); font-size: .88rem; }
.reward-note { display: flex; align-items: center; gap: 18px; padding: 18px; border: 2px solid #ecd480; border-radius: 23px; background: #fff7d9; text-align: left; }
.reward-note img { width: 82px; height: 82px; object-fit: contain; }
.reward-note div { display: grid; gap: 5px; }
.reward-note small { color: var(--muted); line-height: 1.4; }
.reward-note.is-unlocked { border-color: #8fd0b2; background: #e4f6ec; }
.result-actions { display: flex; justify-content: center; gap: 14px; margin-top: 28px; }
.secondary { border: 2px solid var(--line); background: #fff; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 50px 42px; }
  .hero-scene { min-height: 360px; }
  .hero h1 { font-size: clamp(2.8rem, 9vw, 4.2rem); }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 0; display: grid; grid-template-columns: 36% 1fr; }
  .route-card__visual { height: 100%; min-height: 260px; }
  .lesson-layout { grid-template-columns: 1fr; }
  .coach-card { min-height: 220px; }
  .play-head { grid-template-columns: 1fr; }
  .round-progress { text-align: left; }
}

@media (max-width: 620px) {
  .app { width: min(100% - 18px, 1120px); padding-top: 8px; }
  .game-head { min-height: 62px; margin-bottom: 10px; }
  .game-brand small { display: none; }
  .game-brand strong { max-width: 210px; font-size: .9rem; }
  .brand-mark { width: 46px; border-radius: 15px; }
  .age-pill { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
  .hero, .play-card, .result-card { border-radius: 27px; }
  .hero-copy { padding: 36px 24px 40px; }
  .hero h1 { font-size: clamp(2.55rem, 13vw, 3.45rem); }
  .hero-copy > p:not(.eyebrow) { margin: 23px 0; font-size: 1rem; }
  .hero-scene { min-height: 280px; }
  .hero-shelf { bottom: 38px; }
  .hero-toy { bottom: 79px; width: 138px; height: 138px; }
  .rule-card { align-items: flex-start; margin: 22px 0 42px; padding: 18px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .route-card { display: flex; }
  .route-card__visual { min-height: 185px; }
  .route-card__body { padding: 20px; }
  .play-card { padding: 18px 12px; }
  .play-head { padding: 0 7px; }
  .play-head h2 { font-size: 2.05rem; }
  .size-stage { padding: 20px 10px; border-radius: 22px; }
  .size-stage h3 { padding: 0 6px; font-size: 1.7rem; }
  .stage-kicker, .stage-help { margin-left: 6px; margin-right: 6px; }
  .toy-options { gap: 7px; }
  .toy-choice { height: 174px; padding: 5px; border-radius: 18px; }
  .toy-choice img { width: 124px; height: 124px; }
  .toy-choice__label { right: 6px; bottom: 6px; padding: 4px 6px; font-size: .68rem; }
  .coach-card { padding: 22px; border-radius: 22px; }
  .feedback { grid-template-columns: 48px 1fr; padding: 13px; }
  .feedback > span { width: 48px; height: 48px; }
  .feedback button { grid-column: 1 / -1; width: 100%; }
  .play-actions { align-items: flex-start; flex-direction: column; }
  .play-actions span { font-size: .82rem; }
  .result-card { padding: 34px 18px; }
  .result-stats { gap: 7px; }
  .result-stats > div { padding: 14px 5px; }
  .result-stats span { font-size: .72rem; }
  .reward-note { align-items: flex-start; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
}

@media (max-width: 390px) {
  .game-brand strong { max-width: 175px; }
  .age-pill { display: none; }
  .hero h1 { font-size: 2.45rem; }
  .toy-choice { height: 160px; }
  .toy-choice img { width: 110px; height: 110px; }
}

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