:root {
  --ink:#214b43;
  --muted:#667a73;
  --paper:#fffdf7;
  --line:#dfd2b7;
  --green:#438f69;
  --green-dark:#2d7054;
  --coral:#df735d;
  --route-color:#b67b3f;
  font-family:"Trebuchet MS","Segoe UI",sans-serif;
  color:var(--ink);
  background:#ece8d7;
}
*{box-sizing:border-box}
html,body{margin:0;min-width:0;overflow-x:clip}
body{min-height:100%;background:radial-gradient(circle at 10% 8%,rgba(255,255,255,.78),transparent 28rem),linear-gradient(145deg,#e4edd9,#f4ead7 53%,#e2e8d8)}
button,a{font:inherit}
button{color:inherit}
img{display:block;max-width:100%}
.app{width:min(1120px,calc(100% - 32px));margin:24px auto 34px;background:rgba(255,253,247,.97);border:1px solid rgba(205,190,155,.72);border-radius:34px;box-shadow:0 24px 60px rgba(70,76,54,.15);overflow:hidden}
.game-bar{min-height:86px;padding:14px 24px;display:flex;align-items:center;justify-content:space-between;gap:18px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.65)}
.game-brand{min-width:0;display:inline-flex;align-items:center;gap:13px;color:inherit;text-decoration:none;border-radius:18px;padding:4px 8px 4px 4px;transition:.18s}
.game-brand:hover{background:#eef5e7;transform:translateY(-1px)}
.game-brand:focus-visible,button:focus-visible{outline:4px solid rgba(67,143,105,.3);outline-offset:3px}
.game-brand>span:last-child{display:grid;gap:2px;min-width:0}
.game-brand strong{font-size:clamp(18px,2.3vw,25px);line-height:1.05}
.game-brand small{color:var(--muted);font-size:13px}
.game-icon{flex:0 0 54px;width:54px;height:54px;display:grid;place-items:center;border-radius:17px;background:#eadbb8;box-shadow:inset 0 -4px 0 rgba(121,81,47,.13)}
.game-icon svg{width:47px;height:47px;fill:#fff8df;stroke:#775538;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.age-pill,.counter{flex:0 0 auto;padding:10px 15px;border:1px solid var(--line);border-radius:999px;background:#fff;font-weight:900}
.screen{display:none}
.screen.is-active{display:block}
.eyebrow{margin:0 0 8px;color:var(--route-color);font-size:12px;font-weight:900;letter-spacing:.12em}
h1,h2,h3,p{overflow-wrap:anywhere}
h1,h2,h3{margin-top:0}
.home-screen{position:relative;grid-template-columns:minmax(0,1.03fr) minmax(380px,.97fr);gap:24px 36px;padding:52px 48px 36px;background:linear-gradient(110deg,rgba(246,238,217,.98) 0 51%,rgba(226,241,218,.92) 51%)}
.home-screen.is-active{display:grid}
.hero-copy{align-self:center;min-width:0}
.hero-copy h1{margin-bottom:18px;font-size:clamp(39px,5vw,63px);line-height:.98;letter-spacing:-.04em}
.hero-copy>p:not(.eyebrow){margin:0;color:var(--muted);font-size:clamp(18px,2vw,22px);line-height:1.46}
.hero-facts,.result-facts{display:flex;flex-wrap:wrap;gap:9px;margin:24px 0}
.hero-facts span,.result-facts span{padding:9px 14px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.86);font-weight:900}
.primary-button,.secondary-button,.route-button,.hint-button,.run-button,.next-button{min-height:54px;border:0;border-radius:17px;padding:13px 24px;cursor:pointer;font-weight:900;transition:.17s}
.primary-button,.run-button,.next-button{color:#fff;background:var(--green);box-shadow:0 8px 0 #2f7658}
.primary-button:hover,.run-button:hover,.next-button:hover{background:var(--green-dark);transform:translateY(-2px)}
.primary-button:active,.run-button:active,.next-button:active{transform:translateY(4px);box-shadow:0 4px 0 #2f7658}
.hero-scene{position:relative;min-height:390px;align-self:center;overflow:hidden;border:1px solid #d8cda9;border-radius:36px;background:linear-gradient(#d9ebcd 0 53%,#eee3bd 53%);box-shadow:inset 0 -12px 20px rgba(106,83,47,.08)}
.hero-scene>svg{position:absolute;inset:8%;width:84%;height:84%;overflow:visible}
.hero-scene path,.result-scene path{fill:none;stroke:#76945f;stroke-width:8;stroke-linecap:round;stroke-linejoin:round}
.hero-animal{position:absolute;z-index:3;width:29%;height:36%;object-fit:contain;filter:drop-shadow(0 6px 5px rgba(44,48,30,.18))}
.hero-animal--start{left:6%;bottom:4%}
.hero-animal--goal{right:2%;bottom:12%;transform:scaleX(-1)}
.hero-commands{position:absolute;z-index:4;left:34%;top:9%;display:flex;gap:6px;transform:rotate(-3deg)}
.hero-commands i{width:48px;height:57px;display:grid;place-items:center;border:2px solid #c59b5d;border-radius:12px;background:#fff3cf;box-shadow:0 5px 0 rgba(119,82,45,.17);font-style:normal;font-size:29px;font-weight:900}
.how-strip{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:8px;position:relative;z-index:2}
.how-strip article{min-width:0;min-height:122px;display:flex;align-items:center;gap:14px;padding:18px;border:1px solid var(--line);border-radius:24px;background:rgba(255,253,247,.98)}
.how-strip article>b{flex:0 0 54px;height:54px;display:grid;place-items:center;border-radius:17px;color:#fff;background:var(--coral);font-size:24px}
.how-strip article span{min-width:0;display:grid;gap:4px}
.how-strip strong{font-size:17px}
.how-strip small{color:var(--muted);font-size:14px;line-height:1.35}
.routes-screen,.play-screen,.result-screen{padding:38px 42px 44px}
.section-title,.task-head{display:flex;justify-content:space-between;align-items:center;gap:20px}
.section-title h2,.task-head h2{margin-bottom:0;font-size:clamp(28px,4vw,44px);line-height:1.06}
.section-title>p{flex:0 0 auto;color:var(--muted);font-weight:900}
.route-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:28px;align-items:stretch}
.route-card{min-width:0;display:flex;flex-direction:column;padding:14px;border:1px solid var(--line);border-radius:25px;background:#fff;box-shadow:0 12px 28px rgba(72,66,47,.09)}
.route-art{position:relative;height:166px;overflow:hidden;border-radius:18px;background-position:center;background-size:cover}
.route-art:after{content:"";position:absolute;inset:0;background:rgba(255,250,223,.16)}
.route-art svg{position:absolute;inset:18%;z-index:1;width:64%;height:64%}
.route-art path{fill:none;stroke:#6f895b;stroke-width:7;stroke-linecap:round;stroke-linejoin:round}
.route-art img{position:absolute;z-index:2;object-fit:contain;filter:drop-shadow(0 4px 3px rgba(0,0,0,.18))}
.route-art .route-hero{left:1%;bottom:2%;width:36%;height:65%}
.route-art .route-friend{right:0;top:4%;width:36%;height:65%;transform:scaleX(-1)}
.route-art .route-command{left:43%;top:29%;width:50px;height:58px;display:grid;place-items:center;border:2px solid #c39755;border-radius:12px;background:#fff1ca;color:#765233;font-size:28px;font-weight:900;box-shadow:0 4px 0 rgba(94,68,39,.18)}
.route-number{margin:17px 0 7px;color:var(--route-color);font-size:12px;font-weight:900;letter-spacing:.09em}
.route-card h3{min-height:50px;margin-bottom:8px;font-size:22px;line-height:1.12}
.route-card>p:not(.route-number){min-height:62px;margin:0;color:var(--muted);line-height:1.38}
.route-meta{display:flex;justify-content:space-between;gap:8px;margin-top:auto;padding-top:16px;color:var(--muted);font-size:13px;font-weight:900}
.route-progress{height:8px;margin:9px 0 16px;overflow:hidden;border-radius:99px;background:#e8e4d7}
.route-progress i{display:block;width:var(--progress);height:100%;border-radius:inherit;background:var(--route-color)}
.route-button{width:100%;display:flex;justify-content:space-between;align-items:center;color:#fff;background:var(--route-color);box-shadow:0 7px 0 color-mix(in srgb,var(--route-color),#333 24%)}
.back-link{margin-top:26px;border:0;background:transparent;cursor:pointer;color:var(--green-dark);font-weight:900}
.task-head{justify-content:flex-start}
.task-head>div{min-width:0;flex:1}
.round-button{flex:0 0 48px;width:48px;height:48px;border:1px solid var(--line);border-radius:50%;background:#fff;cursor:pointer;font-size:23px;font-weight:900}
.route-progress-line{height:8px;margin:19px 0 20px;overflow:hidden;border-radius:99px;background:#e7e4d7}
.route-progress-line i{display:block;width:0;height:100%;border-radius:inherit;background:var(--route-color);transition:width .25s}
.mission-strip{display:grid;grid-template-columns:78px minmax(0,1fr) 120px;align-items:center;gap:17px;min-height:112px;padding:14px 20px;border:1px solid var(--line);border-radius:22px;background:#f8f3e7}
.mission-strip>img{width:78px;height:78px;object-fit:contain}
.mission-strip h3{margin:0 0 5px;font-size:23px}
.mission-strip p{margin:0;color:var(--muted)}
.mission-strip span{color:var(--route-color);font-size:11px;font-weight:900;letter-spacing:.1em}
.mission-strip>b{text-align:center;padding:10px;border-radius:14px;background:#fff;border:1px solid var(--line)}
.play-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;margin-top:18px;align-items:start}
.map-card,.program-card{border:1px solid var(--line);border-radius:25px;background:#fff}
.map-card{min-width:0;padding:14px}
.trail-board{position:relative;width:100%;aspect-ratio:1.42/1;min-height:430px;overflow:hidden;border:8px solid #607a51;border-radius:19px;background-color:#e7ddb8;background-image:linear-gradient(rgba(255,255,255,.25),rgba(255,255,255,.25)),var(--board-bg);background-size:cover;background-position:center;box-shadow:inset 0 0 0 2px rgba(255,255,255,.35)}
.trail-network{position:absolute;inset:0;z-index:1;width:100%;height:100%;overflow:visible}
.trail-edge{stroke:#c5a16b;stroke-width:6;stroke-linecap:round}
.trail-edge.is-walked{stroke:#4c946c}
.trail-node{position:absolute;z-index:2;width:clamp(36px,7.5%,54px);aspect-ratio:1;border:3px solid #d8c393;border-radius:50%;background:#fff7dc;box-shadow:0 4px 0 rgba(111,89,53,.18);transform:translate(-50%,-50%)}
.trail-node.is-start{border-color:#2d7355;background:#dcf0dc}
.trail-node.is-goal{border-style:dashed;border-color:#ce765a;background:#fff0dc}
.trail-node.is-current{z-index:5;box-shadow:0 0 0 6px rgba(65,145,104,.22),0 4px 0 rgba(40,95,70,.2)}
.trail-node img{position:absolute;left:50%;top:50%;width:125%;height:125%;max-width:none;object-fit:contain;transform:translate(-50%,-50%);filter:drop-shadow(0 3px 2px rgba(0,0,0,.18))}
.trail-node .friend-image{transform:translate(-50%,-50%) scaleX(-1)}
.heading-arrow{position:absolute;z-index:4;width:31px;height:31px;display:grid;place-items:center;border:3px solid #fff;border-radius:50%;color:#fff;background:#2f815e;box-shadow:0 3px 0 #246248;font-size:22px;font-weight:900;transform:translate(-50%,-50%) rotate(var(--heading))}
.landmark{position:absolute;z-index:3;width:clamp(30px,7%,50px);height:clamp(30px,7%,50px);object-fit:contain;filter:drop-shadow(0 3px 2px rgba(0,0,0,.16));transform:translate(-50%,-50%)}
.map-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:15px;padding:13px 2px 1px;color:var(--muted);font-size:13px;font-weight:900}
.map-legend span{display:inline-flex;align-items:center;gap:7px}
.map-legend i{width:22px;height:22px;display:grid;place-items:center;font-style:normal}
.legend-arrow{border-radius:50%;color:#fff;background:#2f815e}
.legend-object{border-radius:7px;background:#dca45a}
.program-card{padding:19px}
.program-card h3{margin-bottom:8px;font-size:24px}
.program-card>div:first-child>p:last-child{margin:0;color:var(--muted);line-height:1.42}
.program-slots{display:grid;grid-template-columns:repeat(5,minmax(38px,1fr));gap:6px;margin-top:16px}
.program-slot{aspect-ratio:1;display:grid;place-items:center;border:2px dashed #d3c5a8;border-radius:12px;background:#faf7ed;color:#846c4a;font-size:24px;font-weight:900}
.program-slot.is-filled{border-style:solid;border-color:var(--route-color);background:#fff2cf}
.program-slot.is-active{box-shadow:0 0 0 4px rgba(67,143,105,.22)}
.program-slot small{font-size:10px}
.command-palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:12px}
.command-palette button{min-width:0;min-height:78px;display:grid;place-items:center;align-content:center;gap:2px;padding:7px 2px;border:1px solid var(--line);border-radius:14px;background:#fff;cursor:pointer}
.command-palette button:hover{background:#eef7eb;transform:translateY(-1px)}
.command-palette button:disabled{opacity:.45;cursor:default;transform:none}
.command-palette span{font-size:29px;font-weight:900;line-height:1}
.command-palette b{font-size:11px}
.small-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:8px}
.small-actions button{min-height:40px;padding:7px;border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer;font-size:12px;font-weight:900}
.small-actions button:disabled{opacity:.45;cursor:default}
.feedback{min-height:94px;display:grid;align-content:center;gap:4px;margin-top:13px;padding:12px 14px;border:1px solid #e2ded1;border-radius:17px;background:#f3f1e8}
.feedback b{font-size:16px}
.feedback span{color:var(--muted);font-size:13px;line-height:1.35}
.feedback[data-tone=good]{background:#e3f2df;border-color:#b8d7af}
.feedback[data-tone=soft]{background:#fff0e4;border-color:#f1c4a6}
.feedback[data-tone=success]{background:#dcefe4;border-color:#9fcbb0}
.control-actions{display:grid;gap:8px;margin-top:10px}
.hint-button{color:var(--green-dark);border:2px solid #91bea2;background:#eef8ef}
.run-button,.next-button{width:100%}
.run-button:disabled{opacity:.5;cursor:default;transform:none;box-shadow:0 5px 0 #2f7658}
.task-tabs{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-top:12px}
.task-tabs button{min-height:38px;border:1px solid var(--line);border-radius:11px;background:#fff;cursor:pointer;font-size:12px;font-weight:900}
.task-tabs button.is-current{color:#fff;border-color:var(--route-color);background:var(--route-color)}
.task-tabs button.is-done:not(.is-current){color:var(--green-dark);background:#e4f1df}
.result-screen.is-active{display:grid;grid-template-columns:minmax(340px,.95fr) minmax(0,1.05fr);gap:38px;align-items:center;min-height:560px}
.result-scene{position:relative;min-height:390px;overflow:hidden;border:1px solid var(--line);border-radius:30px;background:linear-gradient(#dfeecd 0 54%,#eee3bd 54%)}
.result-scene svg{position:absolute;inset:8%;width:84%;height:84%}
.result-hero,.result-friend,.result-item{position:absolute;z-index:2;object-fit:contain;filter:drop-shadow(0 5px 4px rgba(0,0,0,.2))}
.result-hero{left:4%;bottom:10%;width:35%;height:45%}
.result-friend{right:2%;top:8%;width:35%;height:45%;transform:scaleX(-1)}
.result-item{left:43%;top:37%;width:25%;height:28%}
.result-copy h2{margin-bottom:15px;font-size:clamp(34px,5vw,57px);line-height:1}
.result-copy>p:not(.eyebrow){color:var(--muted);font-size:19px;line-height:1.5}
.result-actions{display:flex;flex-wrap:wrap;gap:13px}
.secondary-button{color:var(--green-dark);border:2px solid #92bca3;background:#fff}

@media(max-width:900px){
  .home-screen{grid-template-columns:1fr;padding:42px 36px 30px}
  .hero-scene{min-height:340px}
  .play-layout{grid-template-columns:1fr}
  .program-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,.75fr);gap:0 16px}
  .program-slots,.command-palette,.small-actions,.feedback,.control-actions,.task-tabs{grid-column:2}
  .program-slots{grid-row:1/span 2;margin-top:0;align-self:start}
  .program-card>div:first-child{grid-row:1/span 6}
}
@media(max-width:720px){
  .app{width:min(1120px,calc(100% - 16px));margin:8px auto 20px;border-radius:24px}
  .game-bar{min-height:76px;padding:10px 13px}
  .game-icon{flex-basis:46px;width:46px;height:46px;border-radius:14px}
  .game-icon svg{width:40px;height:40px}
  .game-brand small{display:none}
  .age-pill{padding:8px 10px;font-size:13px}
  .home-screen{padding:30px 16px 20px}
  .hero-copy h1{font-size:clamp(35px,10vw,52px)}
  .hero-scene{min-height:280px;border-radius:26px}
  .hero-commands i{width:39px;height:47px;font-size:24px}
  .how-strip{grid-template-columns:1fr;gap:9px}
  .how-strip article{min-height:94px}
  .routes-screen,.play-screen,.result-screen{padding:28px 16px 32px}
  .section-title{align-items:flex-start;flex-direction:column}
  .section-title>p{margin:0}
  .route-grid{grid-template-columns:1fr}
  .route-card h3,.route-card>p:not(.route-number){min-height:0}
  .route-art{height:190px}
  .mission-strip{grid-template-columns:62px minmax(0,1fr) 82px;padding:12px;gap:10px}
  .mission-strip>img{width:62px;height:62px}
  .mission-strip h3{font-size:19px}
  .mission-strip>b{font-size:12px;padding:8px 4px}
  .trail-board{min-height:0;aspect-ratio:1/1;border-width:6px}
  .program-card{display:block}
  .program-slots{margin-top:16px}
  .result-screen.is-active{min-height:0}
  .result-scene{min-height:285px}
}
@media(max-width:430px){
  .game-brand{gap:8px}
  .game-brand strong{font-size:16px}
  .age-pill{display:none}
  .hero-copy>p:not(.eyebrow){font-size:17px}
  .hero-facts span{padding:8px 10px;font-size:13px}
  .primary-button{width:100%}
  .hero-scene{min-height:245px}
  .hero-commands{left:33%;top:6%}
  .hero-commands i{width:34px;height:41px;font-size:21px}
  .how-strip article{padding:13px}
  .how-strip article>b{flex-basis:46px;height:46px}
  .task-head{gap:10px}
  .task-head h2{font-size:25px}
  .counter{padding:7px 9px;font-size:12px}
  .mission-strip{grid-template-columns:50px minmax(0,1fr) 66px}
  .mission-strip>img{width:50px;height:50px}
  .mission-strip p{font-size:14px}
  .map-card{padding:8px}
  .trail-node{width:34px;border-width:2px}
  .heading-arrow{width:25px;height:25px;border-width:2px;font-size:17px}
  .map-legend{gap:8px;font-size:11px}
  .program-slots{grid-template-columns:repeat(5,minmax(35px,1fr));gap:5px}
  .program-slot{font-size:21px}
  .result-actions{display:grid}
  .result-actions button{width:100%}
}
