:root{--ink:#244b43;--muted:#667b75;--paper:#fffdf6;--cream:#f7f0de;--line:#d9d4bb;--green:#4e9b78;--coral:#df745e;--gold:#efbb54;--shadow:0 18px 45px rgba(45,69,56,.14)}
*{box-sizing:border-box}
html{background:#edf2df;scroll-behavior:smooth}
body{margin:0;color:var(--ink);font-family:"Trebuchet MS","Segoe UI",sans-serif;background:radial-gradient(circle at 12% 8%,#fff7d8 0 16%,transparent 38%),linear-gradient(145deg,#eef4e4,#f8f1dd);min-width:320px}
button,a{font:inherit}
button{cursor:pointer}
.app{width:min(1120px,calc(100% - 32px));margin:28px auto 42px}
.game-bar{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 18px;background:rgba(255,253,246,.88);border:1px solid rgba(79,113,92,.18);border-radius:24px;box-shadow:0 8px 24px rgba(52,73,61,.08)}
.game-brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none;border-radius:16px;padding:4px 7px;transition:.2s ease}
.game-brand:hover{background:#edf5e8;transform:translateY(-1px)}
.game-brand:focus-visible,button:focus-visible{outline:4px solid rgba(239,187,84,.68);outline-offset:3px}
.game-brand>span:last-child{display:grid;gap:2px}.game-brand strong{font-size:20px}.game-brand small{color:var(--muted);font-size:13px}
.game-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:15px;background:#f7df9d}.game-icon svg{width:40px;height:40px}.icon-back{fill:#668caf}.icon-mid{fill:#e9ae44}.icon-top{fill:#df745e;stroke:#a84d3e;stroke-width:2}
.age-pill,.facts span{white-space:nowrap;padding:9px 14px;border-radius:999px;background:#fff;border:1px solid #dfe1ce;color:#355f54;font-weight:700}
.screen{display:none}.screen.is-active{display:block}
.hero,.panel,.play-card,.result{margin-top:22px;background:rgba(255,253,246,.94);border:1px solid rgba(91,110,76,.18);border-radius:34px;box-shadow:var(--shadow);overflow:hidden}
.hero{display:grid;grid-template-columns:minmax(0,46%) minmax(0,54%);align-items:center}
.hero-art{height:390px;background:#dfead6;overflow:hidden}.hero-art img{width:100%;height:100%;object-fit:cover;display:block}
.hero-copy{padding:38px 44px}.eyebrow{margin:0 0 8px;color:#b15a48;font-size:13px;font-weight:900;letter-spacing:.08em}.hero h1{font-size:clamp(38px,5vw,62px);line-height:1.02;margin:0 0 18px;letter-spacing:-.035em}.hero-copy>p:not(.eyebrow){font-size:20px;line-height:1.5;color:var(--muted);margin:0 0 22px}
.facts{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:25px}.facts span{font-size:15px;font-weight:600}
.primary,.secondary,.hint,.plain,.back{border:0;border-radius:16px;min-height:52px;padding:13px 22px;font-weight:900;color:#fff;background:var(--green);box-shadow:0 8px 18px rgba(48,119,87,.18);transition:.18s ease}.primary:hover,.route button:hover{background:#3d8565;transform:translateY(-2px)}.secondary{background:#e9eadc;color:var(--ink);box-shadow:none}.hint{background:#f3bd54;color:#513e19;box-shadow:none}.plain,.back{background:transparent;color:var(--ink);box-shadow:none;padding-inline:8px}.back{font-size:25px;width:48px}
.steps{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:14px;list-style:none;margin:0;padding:20px;background:#f4ead4;border-top:1px solid #ddd4b7}.steps li{display:flex;gap:12px;align-items:center;background:#fffdf7;border:1px solid #e2d8bc;border-radius:20px;padding:16px;min-width:0}.steps b{flex:0 0 42px;width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:var(--coral);color:#fff;font-size:21px}.steps span{display:grid;gap:3px;min-width:0}.steps small{color:var(--muted);line-height:1.3}
.panel,.play-card{padding:30px}.panel-head,.play-head,.task-head{display:flex;align-items:center;justify-content:space-between;gap:18px}.panel h2,.play-head h2,.result h2{font-size:clamp(28px,4vw,42px);margin:0}.panel-head>span,.counter,.task-head>span{background:#edf3e5;border-radius:999px;padding:9px 13px;font-weight:800;white-space:nowrap}
.route-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:25px 0 18px}.route{display:flex;flex-direction:column;min-width:0;padding:20px;border-radius:25px;background:#fff;border:1px solid #e0ddc9;border-top:7px solid var(--route)}.route-art{height:96px;display:grid;place-items:center}.route-art img{display:block;max-width:100px;max-height:92px;object-fit:contain}.route p{color:var(--route);font-size:12px;font-weight:900;letter-spacing:.06em;margin:12px 0 7px}.route h3{font-size:24px;margin:0 0 9px}.route>span{color:var(--muted);line-height:1.4;min-height:62px}.route-meta{display:flex;justify-content:space-between;align-items:center;margin-top:auto;padding-top:16px}.route-meta small{color:var(--muted)}.route-bar{height:8px;background:#edf0e5;border-radius:99px;overflow:hidden;margin:10px 0 14px}.route-bar i{display:block;height:100%;background:var(--route)}.route button{display:flex;justify-content:space-between;align-items:center;border:0;border-radius:14px;padding:13px 15px;color:#fff;background:var(--route);font-weight:900;transition:.18s ease}
.play-head{justify-content:flex-start}.play-head .counter{margin-left:auto}.progress{height:9px;background:#e8eadc;border-radius:99px;overflow:hidden;margin:18px 0 24px}.progress i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--coral),var(--gold));transition:width .25s}.task-head h3{font-size:30px;margin:0}.task-head p{margin:0 0 5px;color:#b15a48;font-weight:900;font-size:12px;letter-spacing:.08em}.prompt{font-size:18px;line-height:1.5;color:var(--muted);margin:12px 0 20px}
.work{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(310px,.8fr);gap:20px;align-items:stretch}.scene-panel,.choice-panel{border:1px solid #dedac6;border-radius:25px;background:#f9f5e8;padding:18px}.layer-scene{aspect-ratio:290/225;max-height:440px;display:grid;place-items:center}.layer-scene svg{display:block;width:100%;height:100%;overflow:visible}.scene-mat{fill:#e5eedc;stroke:#b7c7ad;stroke-width:3}.felt-piece{filter:url(#felt-shadow);stroke-width:3;stroke-linejoin:round}.felt-piece:not(.mini-piece){stroke-dasharray:2 5}.hint-ring{fill:none;stroke:#f7c64f;stroke-width:7;stroke-dasharray:7 5;filter:drop-shadow(0 2px 2px rgba(81,61,22,.2))}.scene-note{margin:10px 0 0;text-align:center;color:var(--muted);font-size:14px}.choice-panel h4{font-size:24px;margin:0 0 12px}.layer-options{display:grid;gap:10px}.layer-option{position:relative;display:grid;grid-template-columns:46px minmax(0,1fr);align-items:center;min-height:116px;border:2px solid #dad9c7;border-radius:19px;background:#fffdf8;color:var(--ink);padding:6px 12px;transition:.18s ease}.layer-option:hover{border-color:#94b29f;transform:translateY(-1px)}.layer-option.is-selected{border-color:var(--green);background:#edf7ef;box-shadow:0 0 0 3px rgba(78,155,120,.14)}.layer-option>b{width:37px;height:37px;display:grid;place-items:center;border-radius:12px;background:#f2c86f;color:#5d461c;font-size:19px}.layer-option svg{width:100%;height:96px}.layer-option>span{grid-column:1/-1;text-align:center;color:var(--muted);font-size:13px;margin-top:-11px}.layer-option i{font-style:normal;color:#3f7d63}.order-arrow{fill:none;stroke:#70917f;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.mini-piece{filter:url(#mini-shadow);stroke-width:3;stroke-linejoin:round}
.feedback{display:grid;gap:5px;border-radius:19px;padding:15px 18px;margin:18px 0;background:#eef3e7;border-left:7px solid #809d87}.feedback strong{font-size:18px}.feedback span{color:var(--muted);line-height:1.4}.feedback[data-tone="error"]{background:#fff0eb;border-color:#df745e}.feedback[data-tone="success"]{background:#e6f5e9;border-color:#4f9b72}.feedback[data-tone="hint"]{background:#fff5d9;border-color:#efbb54}.actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.tabs{display:flex;justify-content:center;gap:9px;margin-top:18px}.tabs button{width:43px;height:43px;border-radius:14px;border:2px solid #d9dac8;background:#fff;color:var(--ink);font-weight:900}.tabs button.active{border-color:var(--coral)}.tabs button.done{background:#dff0df;color:#2e7254}
.result{display:grid;grid-template-columns:1.25fr .75fr;align-items:center;padding:44px}.result>div>p:not(.eyebrow){font-size:20px;color:var(--muted);line-height:1.5}.result-stats{display:flex;gap:12px;flex-wrap:wrap;margin:22px 0}.result-stats>*{padding:10px 14px;border-radius:999px;background:#edf3e5}.result-actions{display:flex;gap:10px;flex-wrap:wrap}.result figure{margin:0;display:grid;place-items:center;min-height:220px}.result img{max-width:210px;max-height:200px;object-fit:contain}
@media(max-width:850px){.hero{grid-template-columns:1fr}.hero-art{height:330px}.hero-copy{padding:30px}.work{grid-template-columns:1fr}.layer-scene{max-height:390px}.layer-options{grid-template-columns:repeat(3,minmax(0,1fr))}.layer-option{grid-template-columns:1fr;padding:6px}.layer-option>b{position:absolute;top:8px;left:8px;z-index:2}.layer-option>span{margin-top:-6px}.result{grid-template-columns:1fr}.result figure{grid-row:1}}
@media(max-width:700px){.app{width:min(100% - 20px,1120px);margin-top:12px}.game-bar{padding:9px 11px}.game-brand small{display:none}.age-pill{padding:8px 10px}.hero-art{height:270px}.hero-copy{padding:24px}.hero h1{font-size:39px}.hero-copy>p:not(.eyebrow){font-size:18px}.steps{grid-template-columns:1fr}.route-grid{grid-template-columns:1fr}.route>span{min-height:0}.panel,.play-card{padding:20px}.panel-head,.task-head{align-items:flex-start;flex-direction:column}.panel-head>span{white-space:normal}.layer-options{grid-template-columns:1fr}.layer-option{grid-template-columns:46px minmax(0,1fr)}.layer-option>b{position:static}.layer-option>span{margin-top:-11px}.result{padding:28px}}
@media(max-width:430px){.game-brand strong{font-size:16px}.game-icon{width:42px;height:42px}.age-pill{font-size:13px}.hero h1{font-size:35px}.hero-art{height:230px}.facts span{font-size:13px;padding:8px 10px}.primary,.secondary,.hint{width:100%}.actions,.result-actions{display:grid;grid-template-columns:1fr;width:100%}.task-head h3{font-size:26px}.play-head{align-items:flex-start}.play-head .counter{font-size:12px;padding:7px 9px}.scene-panel,.choice-panel{padding:12px}.tabs{gap:6px}.tabs button{width:38px;height:38px}.result{padding:22px}.result figure{min-height:170px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
