:root {
  --ink: #244d43;
  --muted: #6b7d77;
  --paper: #fffdf7;
  --line: #ded2b8;
  --green: #4c9b73;
  --dark: #2f7156;
  --coral: #e77761;
  --gold: #e8b34f;
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; background: linear-gradient(135deg, #e5f0df, #faf0dd); color: var(--ink); }
button, a { font: inherit; }
.app { width: min(1120px, calc(100% - 32px)); margin: 26px auto 36px; }
.game-bar { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 18px; min-height: 76px; border: 1px solid #dce3d3; border-radius: 21px; background: var(--paper); box-shadow: 0 10px 22px #66775516; margin-bottom: 18px; }
.game-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); padding: 5px 7px; margin: -5px -7px; border-radius: 15px; }
.game-brand:hover { background: #edf5e8; }
.game-brand:focus-visible, button:focus-visible { outline: 4px solid #4c9b7340; outline-offset: 3px; }
.game-brand > span:last-child { display: grid; }
.game-brand strong { font-size: 20px; }
.game-brand small { font-size: 11px; color: var(--muted); }
.game-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #e4f1e5; color: #568d70; }
.game-icon svg { width: 42px; height: 38px; fill: #fff1c4; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.game-icon path { fill: #82bd8c; }
.age-pill, .panel-head > span, .counter, .task-head > span { padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 800; white-space: nowrap; }
.screen { display: none; }
.screen.is-active { display: block; }
.hero, .panel, .play-card, .result { background: var(--paper); border: 2px solid var(--line); border-radius: 31px; overflow: hidden; box-shadow: 0 13px 0 #75683b18, 0 24px 38px #665e4017; }
.hero { display: grid; grid-template-columns: 1fr 1.06fr; }
.hero-art { min-height: 500px; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-copy { padding: 48px 48px 38px; align-self: center; }
.eyebrow { margin: 0 0 9px; color: #b96351; font: 800 13px Georgia, serif; letter-spacing: .08em; }
.hero h1, .panel h2, .play-head h2, .result h2 { font-family: Georgia, serif; line-height: 1; letter-spacing: -.03em; }
.hero h1 { font-size: 55px; margin: 0 0 20px; }
.hero-copy > p:not(.eyebrow) { font-size: 19px; line-height: 1.5; color: var(--muted); }
.facts { display: flex; gap: 9px; flex-wrap: wrap; margin: 20px 0 24px; }
.facts span { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; font-weight: 800; background: #fff; }
.primary, .secondary, .hint, .plain, .back, .route button { min-height: 50px; border: 0; border-radius: 14px; font-weight: 800; cursor: pointer; }
.primary { padding: 12px 23px; color: #fff; background: var(--green); box-shadow: 0 6px 0 var(--dark); }
.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--dark); }
.secondary { padding: 10px 15px; background: #fff; border: 2px solid #c3d6c5; color: var(--ink); }
.secondary:disabled { opacity: .45; }
.hint { padding: 10px 17px; background: #f5cf70; color: #614b1c; box-shadow: 0 5px 0 #c69b36; }
.plain { background: transparent; color: var(--ink); }
.steps { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.steps li { display: flex; gap: 12px; align-items: center; padding: 19px 21px; }
.steps li + li { border-left: 1px solid var(--line); }
.steps b { display: grid; place-items: center; flex: 0 0 43px; height: 43px; border-radius: 13px; background: var(--coral); color: #fff; font-size: 20px; }
.steps span { display: grid; gap: 2px; }
.steps small { color: var(--muted); }
.panel, .play-card { padding: 34px; }
.panel-head, .play-head, .task-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.panel-head h2, .play-head h2 { font-size: 42px; margin: 0; }
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 26px 0 20px; }
.route { --route: #4c9b73; display: flex; flex-direction: column; min-height: 388px; border: 1px solid var(--line); border-radius: 23px; overflow: hidden; background: #fff; box-shadow: 0 7px 0 #e4dbc8; }
.route-art { position: relative; height: 125px; display: grid; place-items: center; background: color-mix(in srgb, var(--route), white 84%); }
.route-art span { position: absolute; width: 74px; height: 74px; border: 3px solid var(--route); border-radius: 18px; transform: translate(-14px, -5px); opacity: .45; }
.route-art span:after { content: ""; position: absolute; width: 68px; height: 68px; border: 3px solid var(--route); border-radius: 18px; transform: translate(23px, 18px); }
.route-art img { z-index: 1; width: 83px; height: 83px; object-fit: contain; object-position: center; filter: drop-shadow(0 6px 5px #43534433); }
.route > p { margin: 20px 20px 4px; color: var(--route); font: 800 12px Georgia, serif; letter-spacing: .08em; }
.route h3 { font: 700 29px/1.05 Georgia, serif; margin: 0 20px 8px; }
.route > span { margin: 0 20px 17px; color: var(--muted); line-height: 1.4; }
.route-meta { margin: auto 20px 7px; display: flex; justify-content: space-between; }
.route-meta small { color: var(--muted); }
.route-bar { height: 8px; background: #eee7d7; margin: 0 20px 15px; border-radius: 9px; overflow: hidden; }
.route-bar i { display: block; height: 100%; background: var(--route); }
.route button { border-radius: 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; padding: 12px 20px; background: color-mix(in srgb, var(--route), white 91%); color: var(--ink); }
.play-head { justify-content: flex-start; }
.play-head > div { flex: 1; }
.back { width: 48px; background: #fff; border: 2px solid #d7e1d2; color: var(--ink); font-size: 21px; }
.progress { height: 8px; background: #e7e3d7; border-radius: 9px; overflow: hidden; margin: 22px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #dc8f45, var(--green)); width: 0; }
.task-head p { margin: 0 0 3px; color: #b96351; font: 800 12px Georgia, serif; }
.task-head h3 { margin: 0; font: 700 31px Georgia, serif; }
.task-head > span { background: #eaf3e5; border: 0; }
.prompt { text-align: center; color: var(--muted); font-weight: 700; margin: 18px 0; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; padding: 20px; border: 1px solid #e8dcc4; border-radius: 23px; background: #faf5e9; }
.dual-board { width: min(100%, 610px); aspect-ratio: 1; margin: auto; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr); gap: 5px; padding: 7px; position: relative; isolation: isolate; }
.garden-frame { z-index: 0; position: relative; border: 5px solid; border-radius: 23px; pointer-events: none; }
.garden-frame:before, .garden-frame:after { content: ""; position: absolute; opacity: .65; }
.garden-frame:before { left: calc(50% - 2px); top: 0; bottom: 0; border-left: 4px solid; }
.garden-frame:after { top: calc(50% - 2px); left: 0; right: 0; border-top: 4px solid; }
.garden-left { grid-area: 1 / 1 / 5 / 5; color: #6f9e78; background: #dfeeda; }
.garden-right { grid-area: 3 / 3 / 7 / 7; color: #6c91a5; background: #e1edf3; }
.cell { z-index: 2; min-width: 0; min-height: 0; border: 2px solid #aeb8a7; border-radius: 12px; background: #fffdf8; padding: 5px; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.cell.left { background: #f7fcf3; }
.cell.right { background: #f5faff; }
.cell.shared { background: #eff7d9; border-color: #789b5b; box-shadow: inset 0 0 0 3px #bfd69a; }
.cell.fixed { background: #fff4d7; }
.cell.selected { box-shadow: inset 0 0 0 5px var(--gold); z-index: 4; }
.cell.same:not(.selected) { box-shadow: inset 0 0 0 3px #4c9b7366; }
.cell.wrong { background: #ffe5dc; box-shadow: inset 0 0 0 5px var(--coral); }
.cell.guided { box-shadow: inset 0 0 0 5px var(--gold); animation: pulse 1.1s infinite; }
.symbol { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.symbol img { width: 72%; height: 72%; object-fit: contain; object-position: center; filter: drop-shadow(0 3px 3px #45534244); }
.symbol b { position: absolute; right: 1px; bottom: 1px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #fff2cf; color: #6d5229; font-size: 10px; }
.palette { display: flex; flex-direction: column; padding: 17px; border: 1px solid var(--line); border-radius: 19px; background: #fff; }
.palette > p { margin: 0; color: #b96351; font: 800 12px Georgia, serif; }
.palette h4 { margin: 4px 0 13px; font: 700 25px Georgia, serif; }
.palette > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 12px; }
.choice { min-height: 120px; border: 2px solid #dce5d9; border-radius: 15px; background: #f9fbf5; display: grid; grid-template-rows: 88px auto; place-items: center; padding: 5px; cursor: pointer; color: var(--ink); font-weight: 800; }
.choice:hover { border-color: var(--green); }
.choice.active { border-color: var(--gold); background: #fff8dc; }
.choice .symbol { width: 76px; height: 86px; }
.choice .symbol img { width: 82%; height: 82%; }
.choice .symbol b { display: none; }
.choice > span { font-size: 11px; }
.palette > .secondary { width: 100%; margin-top: 9px; }
.legend { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.legend i { width: 28px; height: 28px; border-radius: 8px; background: #eff7d9; border: 3px solid #789b5b; box-shadow: inset 0 0 0 3px #bfd69a; }
.feedback { min-height: 84px; margin-top: 18px; padding: 16px 18px; border-left: 6px solid #7ba58d; border-radius: 18px; background: #edf5e9; display: grid; align-content: center; gap: 5px; }
.feedback span { color: var(--muted); }
.feedback[data-tone="error"] { border-color: var(--coral); background: #fff0ea; }
.feedback[data-tone="hint"] { border-color: var(--gold); background: #fff5d9; }
.feedback[data-tone="success"] { border-color: var(--green); background: #e6f4e8; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; }
.actions .primary { margin-left: auto; }
.tabs { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.tabs button { width: 41px; height: 41px; border: 0; border-radius: 50%; font-weight: 800; }
.tabs .active { outline: 3px solid var(--gold); }
.tabs .done { background: var(--green); color: #fff; }
.result { display: grid; grid-template-columns: 1.15fr .85fr; min-height: 430px; background: linear-gradient(112deg, #fffdf7 0 56%, #dfeeda 56%); }
.result > div { padding: 55px; }
.result h2 { font-size: 55px; margin: 0; }
.result > div > p:not(.eyebrow) { color: var(--muted); font-size: 19px; line-height: 1.5; }
.result-stats { display: flex; gap: 12px; margin: 24px 0; }
.result-stats > * { padding: 9px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.result-actions { display: flex; gap: 12px; }
.result figure { display: grid; place-items: center; margin: 0; }
.result figure:before { content: ""; grid-area: 1 / 1; width: 270px; height: 270px; border-radius: 50%; background: #fff0c8; box-shadow: -65px -50px 0 #d7ebda; }
.result figure img { grid-area: 1 / 1; width: 245px; height: 245px; object-fit: contain; z-index: 1; filter: drop-shadow(0 10px 7px #52614244); }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 5px var(--gold), 0 0 0 5px #e8b34f33; } }

@media (max-width: 900px) {
  .hero-copy { padding: 36px 28px; }
  .hero h1 { font-size: 45px; }
  .panel, .play-card { padding: 24px; }
  .work { grid-template-columns: minmax(0, 1fr) 220px; }
  .route h3 { font-size: 25px; }
  .result > div { padding: 42px; }
  .result h2 { font-size: 45px; }
}
@media (max-width: 720px) {
  .app { width: calc(100% - 20px); margin-top: 12px; }
  .game-bar { min-height: 66px; padding: 8px 11px; }
  .game-icon { width: 42px; height: 42px; }
  .game-brand strong { font-size: 17px; }
  .game-brand small { font-size: 9px; }
  .age-pill { font-size: 12px; padding: 7px 10px; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 320px; }
  .hero-copy { padding: 30px 25px; }
  .steps { grid-template-columns: 1fr; }
  .steps li + li { border-left: 0; border-top: 1px solid var(--line); }
  .panel, .play-card { padding: 19px; }
  .panel-head h2, .play-head h2 { font-size: 32px; }
  .route-grid { grid-template-columns: 1fr; }
  .route { min-height: 0; display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto auto auto auto auto; }
  .route-art { grid-row: 1 / 6; height: auto; }
  .route button { grid-column: 1 / -1; }
  .work { grid-template-columns: 1fr; }
  .palette { display: grid; grid-template-columns: 1fr auto auto; gap: 9px; align-items: end; }
  .palette > p, .palette h4, .palette > div { grid-column: 1 / -1; }
  .palette > div { grid-template-columns: repeat(4, 1fr); margin: 0; }
  .choice { min-height: 93px; grid-template-rows: 68px auto; }
  .choice .symbol { width: 58px; height: 66px; }
  .palette > .secondary { margin: 0; }
  .result { grid-template-columns: 1fr; background: linear-gradient(160deg, #fffdf7 0 58%, #dfeeda 58%); }
  .result figure { padding: 20px 20px 38px; }
}
@media (max-width: 470px) {
  .app { width: calc(100% - 12px); }
  .game-brand strong { font-size: 14px; }
  .age-pill { font-size: 10px; }
  .hero-art { min-height: 245px; }
  .hero-copy { padding: 24px 17px; }
  .hero h1 { font-size: 36px; }
  .hero-copy > p:not(.eyebrow) { font-size: 16px; }
  .steps li { padding: 14px; }
  .panel, .play-card { padding: 13px; }
  .panel-head h2, .play-head h2 { font-size: 27px; }
  .panel-head > span, .counter, .task-head > span { font-size: 10px; padding: 6px 8px; }
  .route { grid-template-columns: 90px 1fr; }
  .route-art img { width: 64px; height: 64px; }
  .route-art span { width: 54px; height: 54px; }
  .route-art span:after { width: 49px; height: 49px; transform: translate(17px, 13px); }
  .route > p, .route h3, .route > span, .route-meta, .route-bar { margin-left: 12px; margin-right: 12px; }
  .play-head { gap: 8px; }
  .back { width: 40px; min-height: 40px; }
  .task-head h3 { font-size: 26px; }
  .prompt { font-size: 12px; margin: 12px 0; }
  .work { padding: 5px; }
  .dual-board { gap: 3px; padding: 4px; }
  .garden-frame { border-width: 3px; border-radius: 14px; }
  .garden-frame:before { border-left-width: 3px; }
  .garden-frame:after { border-top-width: 3px; }
  .cell { border-radius: 7px; padding: 1px; border-width: 1px; }
  .cell.shared { box-shadow: inset 0 0 0 2px #bfd69a; }
  .cell.selected, .cell.wrong, .cell.guided { box-shadow: inset 0 0 0 3px var(--gold); }
  .cell.wrong { box-shadow: inset 0 0 0 3px var(--coral); }
  .symbol img { width: 82%; height: 82%; }
  .symbol b { width: 13px; height: 13px; font-size: 8px; }
  .palette { grid-template-columns: 1fr 1fr; padding: 10px; }
  .palette > div { gap: 4px; }
  .choice { min-width: 0; min-height: 74px; grid-template-rows: 53px auto; padding: 2px; }
  .choice .symbol { width: 44px; height: 51px; }
  .choice > span { font-size: 8px; }
  .palette > .secondary { font-size: 11px; padding: 6px; }
  .legend { font-size: 11px; }
  .feedback { padding: 12px; min-height: 72px; }
  .actions button { font-size: 11px; padding: 8px; }
  .tabs { gap: 6px; }
  .tabs button { width: 35px; height: 35px; }
  .result > div { padding: 29px 18px; }
  .result h2 { font-size: 39px; }
  .result-actions { display: grid; }
}
