:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  --ink: #294e4c;
  --muted: #6c807d;
  --paper: #fffdf8;
  --line: #d9d3b9;
  --green: #5a9a7b;
  --blue: #568da3;
  --gold: #dfa84a;
  --coral: #d87869;
  --purple: #8772a7;
  --shadow: 0 20px 46px rgba(51, 74, 69, .14);
}

* { box-sizing: border-box; }
.animal-portrait { display: block; width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 7px 7px rgba(49, 73, 65, .15)); }
html { min-width: 320px; min-height: 100%; background: #f2f8f2; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 7%, rgba(223, 168, 74, .22) 0 150px, transparent 152px),
    radial-gradient(circle at 96% 92%, rgba(86, 141, 163, .15) 0 190px, transparent 192px),
    linear-gradient(145deg, #f1f8f1, #fffaf0 58%, #f1eef8);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .12;
  background-image: radial-gradient(#527873 1px, transparent 1px);
  background-size: 27px 27px;
  content: "";
}
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(223, 168, 74, .78); outline-offset: 4px; }
h1, h2, p { margin-top: 0; }

.app { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; padding: 22px 0 48px; }
.topbar,
.brand,
.top-actions,
.section-heading,
.game-heading,
.place-label,
.decision-heading,
.feedback,
.result-actions { display: flex; align-items: center; }
.topbar { min-height: 66px; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { gap: 12px; min-width: 0; padding: 0; text-align: left; background: none; border: 0; }
.brand-mark {
  position: relative;
  display: grid;
  width: 58px;
  height: 54px;
  flex-shrink: 0;
  place-items: center;
  color: #fff;
  background: var(--green);
  border: 5px solid #dcefe5;
  border-radius: 18px;
  box-shadow: 0 7px 16px rgba(67, 87, 78, .13);
  transform: rotate(-3deg);
}
.brand-mark i { font: 900 25px/1 Georgia, serif; font-style: normal; }
.brand-mark b { position: absolute; right: 0; bottom: 0; display: grid; width: 23px; height: 23px; place-items: center; color: var(--coral); font: 900 15px/1 Georgia, serif; background: #fff; border: 2px solid #dcd4bb; border-radius: 50%; }
.brand strong,
.brand small { display: block; }
.brand strong { font-size: 25px; font-weight: 900; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.top-actions { gap: 10px; }
.quiet-badge,
.back-button { min-height: 49px; flex-shrink: 0; font-weight: 900; background: rgba(255, 253, 248, .94); border: 2px solid var(--line); border-radius: 17px; }
.quiet-badge { display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; color: var(--muted); font-size: 13px; }
.quiet-badge > span { color: var(--green); font-size: 20px; }
.back-button { width: 49px; min-width: 49px; padding: 0; font-size: 22px; }
.top-spark { display: grid; width: 46px; height: 46px; place-items: center; color: var(--gold); font-size: 25px; }
.eyebrow { margin: 0 0 8px; color: #39765f; font-family: Georgia, serif; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.primary-button,
.secondary-button,
.next-button,
.hint-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 8px; padding: 0 21px; font-weight: 900; border-radius: 17px; }
.primary-button,
.next-button { color: #fff; background: var(--green); border: 0; box-shadow: 0 7px 0 #3e735b; }
.secondary-button,
.hint-button { background: #fff8dd; border: 2px solid #e4c66d; }

.hero {
  display: grid;
  min-height: 500px;
  align-items: center;
  grid-template-columns: 1fr 1fr;
  gap: clamp(34px, 5vw, 62px);
  padding: clamp(38px, 5.5vw, 68px);
  overflow: hidden;
  background: rgba(255, 253, 248, .97);
  border: 3px solid var(--line);
  border-radius: 46px;
  box-shadow: var(--shadow);
}
.hero h1 { margin-bottom: 18px; font-size: clamp(47px, 5.8vw, 68px); font-weight: 900; letter-spacing: -.05em; line-height: .98; }
.hero-copy > p:not(.eyebrow) { margin-bottom: 27px; color: var(--muted); font-size: 18px; font-weight: 800; line-height: 1.52; }
.hero-board {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: linear-gradient(150deg, #e2f3e9, #fff0bc);
  border: 8px solid #fff;
  border-radius: 38px;
  box-shadow: 0 20px 38px rgba(57, 75, 70, .18);
}
.hero-label { position: absolute; top: 20px; left: 22px; z-index: 5; padding: 8px 12px; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; background: var(--green); border-radius: 999px; }
.hero-animal { position: absolute; bottom: -5px; width: 52%; }
.hero-animal svg,
.level-preview svg,
.animal svg,
.result-animal svg { display: block; width: 100%; height: auto; }
.hero-left { left: -9px; }
.hero-right { right: -9px; transform: scaleX(-1); }
.hero-zigzag { position: absolute; top: 78px; left: 50%; z-index: 4; color: var(--coral); font-size: 42px; transform: translateX(-50%); }
.hero-step { position: absolute; left: 50%; z-index: 5; display: flex; min-width: 185px; align-items: center; gap: 8px; padding: 9px 12px; color: #fff; font-size: 16px; font-weight: 900; background: var(--blue); border-radius: 16px; transform: translateX(-50%); }
.hero-step small { font-size: 10px; text-transform: uppercase; }
.step-one { top: 134px; }
.step-two { top: 184px; background: var(--green); }
.hero-peace { position: absolute; top: 239px; left: 50%; z-index: 5; display: flex; align-items: center; gap: 9px; padding: 8px 13px; color: var(--green); font: 900 21px/1 Georgia, serif; background: #fff; border: 3px solid #d8d0b7; border-radius: 999px; transform: translateX(-50%); }
.hero-peace b { color: var(--coral); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero-facts > span { display: flex; min-height: 47px; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); background: #f1f3ec; border-radius: 15px; }
.hero-facts strong { color: var(--ink); font-size: 19px; }
.hero-facts small { font-size: 11px; font-weight: 900; }

.how-section,
.levels-section { margin-top: 48px; }
.section-heading { justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(32px, 4vw, 45px); font-weight: 900; }
.section-heading > p { max-width: 460px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 800; line-height: 1.45; text-align: right; }
.steps-grid,
.levels-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps-grid > article { display: grid; min-height: 132px; align-items: center; grid-template-columns: 62px 1fr; gap: 15px; padding: 21px; background: var(--paper); border: 2px solid var(--line); border-radius: 25px; }
.steps-grid > article > b { display: grid; width: 60px; height: 60px; place-items: center; color: #fff; font: 900 27px/1 Georgia, serif; background: var(--coral); border: 5px solid #f6ded8; border-radius: 50%; }
.steps-grid > article:nth-child(2) > b { background: var(--blue); border-color: #dcebf1; }
.steps-grid > article:nth-child(3) > b { background: var(--green); border-color: #dceee5; }
.steps-grid strong,
.steps-grid small { display: block; }
.steps-grid strong { margin-bottom: 7px; font-size: 18px; }
.steps-grid small { color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }

.level-card { min-width: 0; min-height: 370px; padding: 24px; overflow: hidden; text-align: left; background: var(--paper); border: 3px solid var(--line); border-radius: 29px; box-shadow: 0 8px 0 #d8d0b7; transition: transform .18s ease, border-color .18s ease; }
.level-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.level-top,
.level-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.level-top > b { color: var(--accent); font: 900 38px/1 Georgia, serif; }
.level-top > small { color: var(--gold); font-size: 12px; font-weight: 900; }
.level-preview { position: relative; display: grid; height: 116px; align-items: end; grid-template-columns: 1fr 48px 1fr; margin: 17px 0; overflow: hidden; background: color-mix(in srgb, var(--accent) 12%, white); border-radius: 20px; }
.level-preview > span { width: 108px; max-width: 100%; }
.level-preview > span:last-child { transform: scaleX(-1); }
.level-preview > i { align-self: center; color: var(--accent); font-size: 28px; font-style: normal; text-align: center; }
.level-copy,
.level-copy > small,
.level-copy > strong,
.level-copy > span { display: block; }
.level-copy > small { color: var(--accent); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.level-copy > strong { margin: 6px 0; font-size: 22px; line-height: 1.1; }
.level-copy > span { min-height: 58px; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.level-footer { margin-top: 17px; font-size: 11px; font-weight: 900; }
.level-footer > b { color: var(--accent); }
.parent-note { display: flex; align-items: center; gap: 15px; margin-top: 20px; padding: 17px 20px; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; background: rgba(255, 253, 248, .85); border: 2px dashed var(--line); border-radius: 22px; }
.parent-note > span { font-size: 25px; }
.parent-note p { margin: 0; }

.game-shell,
.result-card { padding: clamp(22px, 4vw, 45px); background: var(--paper); border: 3px solid var(--line); border-radius: 42px; box-shadow: var(--shadow); }
.game-heading { justify-content: space-between; gap: 20px; }
.game-heading h1 { margin-bottom: 7px; font-size: clamp(34px, 4.5vw, 50px); font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.game-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); font-weight: 900; }
.round-badge { display: grid; min-width: 82px; height: 82px; place-items: center; align-content: center; color: #fff; font-family: Georgia, serif; background: var(--accent); border: 6px solid color-mix(in srgb, var(--accent) 25%, white); border-radius: 50%; }
.round-badge strong { font-size: 29px; line-height: 1; }
.round-badge small { margin-top: 4px; font-size: 10px; }
.progress-track { height: 12px; margin: 22px 0 15px; overflow: hidden; background: #ece9df; border-radius: 999px; }
.progress-track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.stage-tabs { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 15px; }
.stage-tabs > span { display: inline-flex; min-height: 43px; align-items: center; gap: 7px; padding: 0 13px; color: var(--muted); font-size: 11px; font-weight: 900; background: #f1f0e9; border: 2px solid #dfddd3; border-radius: 999px; }
.stage-tabs > span b { display: grid; width: 25px; height: 25px; place-items: center; color: #fff; background: #aaa; border-radius: 50%; }
.stage-tabs > span.active { color: var(--ink); background: color-mix(in srgb, var(--accent) 13%, white); border-color: var(--accent); }
.stage-tabs > span.active b { background: var(--accent); }
.stage-tabs > span.done b { background: var(--green); }
.stage-tabs > i { color: var(--gold); font-style: normal; font-weight: 900; }
.play-layout { display: grid; align-items: stretch; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 17px; }
.conflict-card,
.decision-card { min-width: 0; padding: 21px; border: 2px solid var(--line); border-radius: 29px; }
.conflict-card { background: #f0f7f2; }
.decision-card { background: #fffcf5; }
.place-label { gap: 11px; min-height: 62px; padding: 10px 13px; background: #fff; border-radius: 18px; }
.place-label > span { display: grid; min-width: 42px; height: 42px; place-items: center; font-size: 22px; background: #f1eee4; border-radius: 13px; }
.place-label small,
.place-label strong { display: block; }
.place-label small { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.place-label strong { margin-top: 3px; font-size: 14px; }
.conflict-stage { position: relative; display: grid; min-height: 405px; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; overflow: hidden; background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 12%, white), #fff0c8); border-radius: 24px; }
.character-side { position: relative; min-width: 0; }
.character-side .animal { position: absolute; bottom: -4px; width: 105%; }
.side-a .animal { left: -8px; }
.side-b .animal { right: -8px; transform: scaleX(-1); }
.character-side blockquote { position: absolute; top: 22px; z-index: 4; width: 93%; margin: 0; padding: 13px 11px; text-align: center; background: #fff; border: 3px solid #d9d2b9; box-shadow: 0 7px 16px rgba(55, 76, 71, .12); }
.side-a blockquote { left: 7px; border-radius: 18px 18px 18px 6px; }
.side-b blockquote { right: 7px; border-radius: 18px 18px 6px 18px; }
.character-side blockquote small,
.character-side blockquote strong { display: block; }
.character-side blockquote small { margin-bottom: 5px; color: var(--accent); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.character-side blockquote strong { font-size: 12px; line-height: 1.35; }
.conflict-flash { position: absolute; top: 128px; left: 50%; z-index: 5; color: var(--coral); font-size: 36px; transform: translateX(-50%); }
.decision-heading { align-items: flex-start; justify-content: space-between; gap: 13px; }
.decision-heading h2 { margin: 0; font-size: 22px; line-height: 1.15; }
.decision-heading > span { display: grid; min-width: 52px; height: 48px; place-items: center; font-size: 23px; background: color-mix(in srgb, var(--accent) 18%, white); border: 2px solid color-mix(in srgb, var(--accent) 55%, white); border-radius: 16px; }
.choices-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
.choice-card { display: grid; min-width: 0; min-height: 112px; align-items: center; grid-template-columns: 42px minmax(0, 1fr) 29px; gap: 9px; padding: 12px; text-align: left; background: #fff; border: 3px solid #ddd7c6; border-radius: 20px; box-shadow: 0 5px 0 #d8d1c0; }
.choice-card:nth-child(odd):last-child { grid-column: 1 / -1; }
.choice-card:hover:not(:disabled) { border-color: var(--accent); }
.choice-icon { display: grid; width: 42px; height: 42px; place-items: center; font-size: 20px; background: #f3f1e8; border-radius: 13px; }
.choice-card strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.32; }
.choice-card b { display: grid; width: 29px; height: 29px; place-items: center; color: var(--muted); background: #efede5; border-radius: 50%; }
.choice-card.wrong { opacity: .62; border-color: #dda69e; box-shadow: 0 5px 0 #c98e84; }
.choice-card.wrong b { color: #fff; background: var(--coral); }
.choice-card.hinted { background: #fff8d8; border-color: var(--gold); animation: glow 1.2s ease-in-out infinite alternate; }
.choice-card.correct { background: #edf8f0; border-color: var(--green); box-shadow: 0 5px 0 #76a98e; }
.choice-card.correct b { color: #fff; background: var(--green); }
@keyframes glow { to { box-shadow: 0 0 0 6px rgba(223, 168, 74, .22); } }

.feedback { min-height: 85px; gap: 12px; margin-top: 17px; padding: 12px; background: #f2f3ed; border: 2px solid #dcdbd2; border-radius: 21px; }
.feedback.success { background: #edf8f0; border-color: #9fc7ac; }
.feedback.retry { background: #fff2ee; border-color: #e5b1a8; }
.feedback.hint { background: #fff8d9; border-color: #ead079; }
.feedback-icon { display: grid; min-width: 47px; height: 47px; place-items: center; font-size: 22px; background: #fff; border-radius: 14px; }
.feedback > div { min-width: 0; flex: 1; }
.feedback strong,
.feedback small,
.feedback em { display: block; }
.feedback strong { font-size: 14px; }
.feedback small { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.35; }
.feedback em { margin-top: 6px; color: #39765f; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.feedback .hint-button,
.feedback .next-button { min-width: 124px; flex-shrink: 0; padding: 0 14px; font-size: 12px; }

.result-card { display: grid; min-height: 590px; align-items: center; grid-template-columns: .9fr 1.1fr; gap: clamp(30px, 5vw, 65px); }
.result-art { position: relative; min-height: 410px; overflow: hidden; background: linear-gradient(150deg, #e1f3e9, #fff0be); border: 7px solid #fff; border-radius: 35px; box-shadow: 0 18px 35px rgba(57, 75, 70, .17); }
.result-animal { position: absolute; bottom: 17px; width: 57%; }
.result-one { left: -8px; }
.result-two { right: -7px; transform: scaleX(-1); }
.result-plan { position: absolute; top: 43px; left: 50%; z-index: 3; width: max-content; max-width: 80%; padding: 11px 17px; text-align: center; font-size: 12px; font-weight: 900; background: #fff; border: 3px solid #d7d0b7; border-radius: 999px; transform: translateX(-50%); }
.result-heart { position: absolute; top: 104px; left: 50%; z-index: 3; color: var(--coral); font: 900 50px/1 Georgia, serif; transform: translateX(-50%); }
.result-copy h1 { margin-bottom: 13px; font-size: clamp(40px, 5vw, 58px); line-height: 1; letter-spacing: -.045em; }
.result-copy > p { color: var(--muted); font-weight: 800; line-height: 1.5; }
.result-stars { margin: 18px 0; color: var(--gold); font-size: 39px; letter-spacing: 5px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.result-stats span { padding: 13px 8px; text-align: center; background: #f1f2eb; border-radius: 17px; }
.result-stats strong,
.result-stats small { display: block; }
.result-stats strong { font-size: 24px; }
.result-stats small { color: var(--muted); font-size: 10px; font-weight: 900; }
.result-copy blockquote { margin: 17px 0; padding: 13px 16px; color: #39765f; font-weight: 900; line-height: 1.35; background: #eef7f1; border-left: 5px solid var(--green); border-radius: 10px 17px 17px 10px; }
.result-actions { flex-wrap: wrap; gap: 11px; }
.error-card { margin-top: 100px; padding: 30px; text-align: center; background: var(--paper); border: 3px solid var(--line); border-radius: 30px; }
.error-card > span { display: block; font: 900 55px/1 Georgia, serif; }
.error-card strong,
.error-card small { display: block; margin-top: 10px; }

@media (max-width: 930px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-board { width: min(540px, 100%); margin: 0 auto; }
  .hero-facts { justify-content: center; }
  .steps-grid { grid-template-columns: 1fr; }
  .levels-grid { grid-template-columns: repeat(2, 1fr); }
  .level-card:last-child { grid-column: 1 / -1; }
  .play-layout { grid-template-columns: 1fr; }
  .result-card { grid-template-columns: 1fr; }
  .result-art { width: min(480px, 100%); margin: 0 auto; }
}

@media (max-width: 680px) {
  .app { width: min(100% - 20px, 1120px); padding-top: 12px; }
  .topbar { min-height: 53px; margin-bottom: 13px; }
  .brand-mark { width: 48px; height: 45px; border-width: 4px; border-radius: 15px; }
  .brand strong { font-size: 19px; }
  .brand small { display: none; }
  .quiet-badge { width: 47px; min-width: 47px; min-height: 46px; justify-content: center; padding: 0; font-size: 0; }
  .hero { min-height: auto; padding: 33px 20px; border-radius: 31px; }
  .hero h1 { font-size: clamp(42px, 13vw, 54px); }
  .hero-board { min-height: 310px; }
  .hero-step { min-width: 170px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-heading > p { text-align: left; }
  .levels-grid { grid-template-columns: 1fr; }
  .level-card:last-child { grid-column: auto; }
  .game-shell,
  .result-card { padding: 20px 14px; border-radius: 29px; }
  .game-heading { align-items: flex-start; }
  .round-badge { min-width: 64px; height: 64px; border-width: 4px; }
  .round-badge strong { font-size: 23px; }
  .stage-tabs { gap: 5px; }
  .stage-tabs > span { padding: 0 8px; font-size: 10px; }
  .conflict-card,
  .decision-card { padding: 15px; border-radius: 23px; }
  .conflict-stage { min-height: 375px; }
  .character-side blockquote { top: 17px; padding: 11px 8px; }
  .character-side blockquote strong { font-size: 11px; }
  .choices-grid { grid-template-columns: 1fr; }
  .choice-card:nth-child(odd):last-child { grid-column: auto; }
  .choice-card { min-height: 88px; }
  .feedback { align-items: stretch; flex-wrap: wrap; }
  .feedback > div { min-width: calc(100% - 62px); }
  .feedback .hint-button,
  .feedback .next-button { width: 100%; }
  .result-art { min-height: 340px; }
  .result-copy { text-align: center; }
  .result-copy blockquote { text-align: left; }
  .result-actions { flex-direction: column; }
  .result-actions button { width: 100%; }
}

@media (max-width: 390px) {
  .game-heading h1 { font-size: 30px; }
  .game-heading p:not(.eyebrow) { font-size: 13px; }
  .stage-tabs > span { flex: 1; justify-content: center; }
  .stage-tabs > i { display: none; }
  .conflict-stage { min-height: 360px; }
  .character-side blockquote strong { font-size: 10px; }
  .choice-card { grid-template-columns: 40px minmax(0, 1fr) 28px; padding: 10px; }
  .choice-icon { width: 40px; height: 40px; }
}

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