:root{--paper:#fffbed;--ink:#24453e;--green:#2d7864;--line:#c4ceba;--gold:#b58947;--blue:#526e9d;font-family:'IBM Plex Sans Thai',sans-serif;color:var(--ink);background:#e7ecdc}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 30% 20%,#f5f1db,#dce8da)}button,input,select{font:inherit;color:inherit}button,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button{cursor:pointer;min-height:44px;border:1px solid var(--line);border-radius:12px;padding:8px 13px;background:var(--paper)}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #9a542a;outline-offset:3px}a{color:inherit;text-decoration:none}[hidden]{display:none!important}#game{min-height:100svh;max-width:1300px;margin:auto;padding:24px 28px max(28px,env(safe-area-inset-bottom))}header{display:flex;align-items:center;justify-content:space-between;gap:15px}.brand{display:flex;align-items:center;gap:10px}.brand b{background:var(--green);color:var(--paper);width:40px;height:44px;text-align:center;font-family:'Space Grotesk';font-size:29px;border-radius:11px 11px 14px 3px}.brand span{font-size:20px;font-weight:600;line-height:1.2}.brand small{display:block;font-size:10px;font-weight:400}.icon{width:44px;font-size:20px;padding:0;box-shadow:0 3px 0 #b2c0a9}.letters{display:flex;align-items:center;gap:9px}.dot{display:grid;place-items:center;font-family:'Space Grotesk';width:29px;height:29px;border:1px solid #9fb49d;border-radius:50%;background:var(--paper)}.dot.current{background:var(--green);color:white;box-shadow:0 0 0 4px #fffbed99}.dot.done{background:#f1cc8b}.letters i{width:30px;border-top:2px dotted #9faf97}.objective{margin:27px 0 20px;max-width:700px}.objective small{font-size:10px;letter-spacing:.1em;color:#66816b}.objective h1{font-size:25px;margin:5px 0 8px}.objective p{font-size:14px;line-height:1.65;margin:0;max-width:620px}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:35px;align-items:start}.map-section{max-width:670px;min-width:0}.map-heading{display:flex;justify-content:space-between;align-items:center;font-size:11px;margin:0 7px 9px;gap:8px}.map-heading b{font-size:10px;font-weight:500}.board{position:relative;aspect-ratio:1;border-radius:28px;background:#f7efd8;border:1px solid #ffffef;box-shadow:0 15px 35px #60744c20;overflow:hidden;isolation:isolate}#canvasHost,#fallback{position:absolute;inset:0}#canvasHost canvas{display:block;max-width:100%}#fallback svg{display:block;width:100%;height:100%}.map-status{font-size:11px;text-align:center;margin:10px 5px 0;min-height:18px;color:#55715f}.text-button{min-height:36px;background:transparent;border:0;padding:2px 7px;font-size:10px;text-decoration:underline;text-underline-offset:3px}.planner{background:#fffbeded;border:1px solid white;border-radius:22px;padding:19px;box-shadow:0 10px 25px #5f735414;min-width:0}.section-label{display:flex;align-items:center;justify-content:space-between;gap:8px}.section-label b{font-size:13px}.section-label span{font-size:10px;color:#637c66}.coordinate-inputs{display:grid;grid-template-columns:22px 44px minmax(0,1fr) 44px;gap:8px;align-items:center;margin:11px 0 9px}.coordinate-inputs label{font-family:'Space Grotesk';font-size:22px;font-weight:600;text-align:center}.coordinate-inputs button{width:44px;padding:0;font-size:21px}.coordinate-inputs input{min-width:0;width:100%;height:44px;text-align:center;border:1px solid #bccbbc;border-radius:10px;font-family:'Space Grotesk';font-size:22px;background:#edf2e6}.pin-button{width:100%;background:#eef3e6;font-size:12px}.route-section{border-top:1px dashed #c1cbb4;margin-top:17px;padding-top:11px}.route{display:flex;gap:6px;flex-wrap:wrap;margin:9px 0 13px;min-height:34px;align-items:center}.route .route-card{padding:7px 10px;background:#e2ead9;border:1px solid #c1ceb4;border-radius:9px;font-size:11px}.route .route-card:nth-child(even){background:#f0e5c6;border-color:#d8c398}.route .empty{font-size:11px;color:#788b70}.distance{display:flex;justify-content:space-between;align-items:center;font-size:11px;margin-bottom:10px}.distance select{height:40px;border:1px solid #c1cbb4;background:#f5f3df;border-radius:10px;padding:4px 12px}.direction-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.direction-cards button{padding:7px 0;border:2px solid #fffbed;background:linear-gradient(140deg,#ebf0df,#cbdcb9);box-shadow:0 4px 0 #9eb297;transition:transform .16s}.direction-cards button:nth-child(even){background:linear-gradient(140deg,#faf0d4,#e0c895);box-shadow:0 4px 0 #baa574}.direction-cards span{display:block;font-size:25px;line-height:1.2;font-family:'Space Grotesk'}.direction-cards small{font-size:10px}.direction-cards button:hover{transform:translateY(-3px)}.direction-cards button:active{transform:translateY(2px)}.actions{display:flex;gap:9px;margin-top:18px}.actions>button{flex:1;min-width:0;font-size:11px;padding-inline:9px}.primary{background:var(--green);border-color:#377b62;color:var(--paper);font-weight:600;min-height:46px;box-shadow:0 4px 0 #1b5645}.primary:active{transform:translateY(2px);box-shadow:0 2px 0 #1b5645}.hint{background:#faf0d7;border:1px dashed #bd9a54}.hint-panel{margin-top:14px;border:1px dashed #ba9256;background:linear-gradient(130deg,#fff8de,#f1e3be);border-radius:14px;padding:12px;animation:reveal .3s ease-out}.hint-panel>span{float:right;font-size:25px;color:#ab8042}.hint-panel b{font-size:12px}.hint-panel p{font-size:12px;margin:5px 0 0;line-height:1.6}#feedback{font-size:12px;line-height:1.6;margin:13px 0 0}#feedback:empty{display:none}#fixedNote{font-size:11px;line-height:1.6;color:#5e735b}.arrival h2{font-size:18px;margin:12px 0;color:#397c61}.arrival p{font-size:12px;line-height:1.7}.arrival .primary{width:100%}.welcome{display:grid;grid-template-columns:350px 1fr;align-items:center;gap:7vw;margin:9vh 4vw 30px}.postcard{position:relative;background:var(--paper);padding:30px;border:1px solid white;border-radius:25px;box-shadow:0 20px 50px #5d765a26}.eyebrow{font-size:9px;letter-spacing:.14em;font-weight:600}.postmark{position:absolute;right:28px;top:40px;border:2px dashed #b39762;padding:8px;font-size:27px;color:#967544;transform:rotate(10deg)}.postcard h1{font-size:33px;margin:28px 0 18px;line-height:1.25}.postcard em{font-style:normal;color:var(--green)}.postcard p{font-size:14px;line-height:1.65;margin:0 0 25px}.ticket-foot{display:flex;justify-content:space-between;font-size:10px;border-block:1px dashed #c3bea2;padding:13px 0;margin-bottom:20px}.postcard .primary{width:100%}.postcard>small:last-child{display:block;font-size:10px;text-align:center;margin-top:13px;color:#71806a}.welcome-art{position:relative;min-height:400px;display:grid;place-items:center}.envelope{position:relative;width:240px;height:160px;background:#ead4aa;border:7px double #e3c594;transform:rotate(-12deg);font-size:45px;display:grid;place-items:center;color:#416d56;border-radius:13px;box-shadow:0 20px 0 #bacda544,0 25px 40px #5d785b1c}.envelope:before{content:'';position:absolute;inset:0;clip-path:polygon(0 0,50% 65%,100% 0);background:#f7eac7;z-index:-1}.cloud{position:absolute;width:120px;height:38px;background:#fff7dd;border-radius:50%;filter:drop-shadow(0 8px 0 #c8d8bf50)}.cloud:before,.cloud:after{content:'';position:absolute;border-radius:50%;background:inherit;width:68px;height:50px;top:-24px;left:15px}.cloud:after{left:50px;top:-15px}.c1{top:80px;right:10px}.c2{bottom:20px;left:0}.letter-stamp{position:absolute;right:40px;bottom:60px;width:95px;height:95px;border-radius:50%;border:3px double #557862;display:grid;place-items:center;text-align:center;font-size:16px;color:#557862;transform:rotate(12deg)}.dotted-line{position:absolute;width:140px;right:80px;top:210px;border-top:3px dotted #6d916c;transform:rotate(-18deg)}.result{width:min(450px,100%);margin:65px auto 10px;text-align:center;background:var(--paper);padding:27px;border:1px solid white;border-radius:24px;box-shadow:0 20px 50px #5d765a26}.result h1{font-size:24px}.result p{font-size:13px;line-height:1.65}.seal{width:80px;height:80px;font-size:39px;border:5px double #b2945e;border-radius:50%;display:grid;place-items:center;background:#f0dfb0;color:#8f723c;margin:20px auto 15px}.result:not([hidden]) .seal{animation:reveal .6s ease-out}.result details{text-align:left;background:#f1f1df;border-radius:12px;padding:10px;font-size:12px}.result summary{min-height:30px;cursor:pointer}.result li{margin:9px 0;line-height:1.6}.result .fine{font-size:11px;color:#6b7c68}.result .primary{width:100%;margin-top:10px}.result a{display:block;font-size:12px;margin-top:18px}dialog{width:min(350px,calc(100% - 32px));max-height:calc(100svh - 32px);overflow:auto;padding:24px;border:1px solid white;border-radius:22px;color:var(--ink);background:var(--paper)}dialog::backdrop{background:#173c3866;backdrop-filter:blur(3px)}dialog h2{font-size:21px;margin-top:0}dialog button{display:block;width:100%;margin-top:10px}dialog p{font-size:12px;line-height:1.6}dialog a{display:block;text-align:center;font-size:12px;margin-top:17px}@keyframes reveal{from{transform:translateY(12px) scale(.96);opacity:0}to{transform:none;opacity:1}}
@media(max-width:850px){#game{padding:16px 16px max(20px,env(safe-area-inset-bottom))}.brand span{font-size:17px}.brand b{width:34px;height:38px;font-size:25px}.brand small{font-size:9px}.letters{gap:6px}.letters i{width:18px}.dot{width:24px;height:24px;font-size:11px}.game-layout{grid-template-columns:minmax(0,1fr);gap:16px}.map-section{max-width:500px;margin:auto;width:100%}.planner{width:min(500px,100%);margin:auto;padding:15px}.objective{margin:20px auto 15px;max-width:500px}.objective h1{font-size:21px}.objective p{font-size:12px}.board{border-radius:20px}.welcome{grid-template-columns:minmax(0,1fr);margin:27px auto 20px;max-width:400px;gap:10px}.welcome-art{grid-row:1;min-height:150px}.envelope{width:165px;height:105px;font-size:32px}.c1{top:35px;right:0;width:80px;height:25px}.c2{bottom:0;width:80px;height:25px}.cloud:before{width:44px;height:35px;top:-17px;left:10px}.cloud:after{width:40px;height:30px;left:40px;top:-12px}.letter-stamp{width:60px;height:60px;font-size:10px;right:5px;bottom:5px}.dotted-line{display:none}.postcard{padding:23px 26px}.postcard h1{font-size:30px;margin:22px 0 16px}.postcard p{font-size:13px;margin-bottom:20px}.result{margin-top:38px}.map-heading{font-size:10px}.map-heading b{font-size:9px}.coordinate-inputs{grid-template-columns:20px 44px minmax(0,1fr) 44px}.route-section{margin-top:14px}.direction-cards button{min-height:65px}.map-status{font-size:10px}header{position:relative;padding-bottom:35px}.letters{position:absolute;bottom:0;left:50%;transform:translateX(-50%)}.result h1{font-size:22px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}:root[data-reduced="true"] *{animation:none!important;transition:none!important}

@media(min-width:851px){.map-section{max-width:min(670px,calc(100svh - 260px));margin-inline:auto;width:100%}.game-layout{grid-template-columns:minmax(0,1fr) 360px}}

.postmark{top:12px;right:15px;font-size:23px;padding:5px}
@media(max-height:650px) and (max-width:850px){.welcome-art{display:none}.welcome{margin-top:23px}.postcard h1{font-size:28px}.postcard p{margin-bottom:16px}.ticket-foot{padding:10px 0;margin-bottom:15px}}
