:root{
  --bg:#eef2f6; --land:#ffffff; --land-stroke:#8b9aab; --ink:#1c2733; --muted:#5d6b7a;
  --primary:#1f6feb; --primary-d:#1757bd; --ok:#1a9a55; --bad:#d63a3a; --card:#ffffff;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;margin:0}
body{font-family:system-ui,-apple-system,"Segoe UI","Heebo",Arial,sans-serif;background:var(--bg);color:var(--ink);overscroll-behavior:none}
#app{height:100dvh;display:flex;flex-direction:column;max-width:760px;margin:0 auto;position:relative}

#bar{display:flex;align-items:center;gap:8px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));background:#fff;border-bottom:1px solid #dbe2ea}
.stat{min-width:56px;text-align:center;line-height:1.15}
.stat b{display:block;font-size:20px}
.lbl{display:block;font-size:12px;color:var(--muted)}
#prompt{flex:1;text-align:center;line-height:1.15}
#placeName{display:block;font-size:26px;font-weight:800;overflow-wrap:anywhere}

#mapWrap{flex:1;position:relative;overflow:hidden;background:var(--bg);touch-action:none;cursor:crosshair;min-height:0}
#map{width:100%;height:100%;display:block;user-select:none;-webkit-user-select:none}
#landStroke path{fill:var(--land-stroke);stroke:var(--land-stroke);stroke-linejoin:round}
#landFill path{fill:var(--land);stroke:none}
.guess{fill:var(--primary);stroke:#fff}
.truth{fill:var(--ok);stroke:#fff}
.link{stroke:#556;stroke-dasharray:6 5;fill:none}
#zoomBtns{position:absolute;inset-inline-start:10px;top:10px;display:flex;flex-direction:column;gap:6px}
#zoomBtns button{width:40px;height:40px;border-radius:10px;border:1px solid #ccd5df;background:#fff;font-size:22px;line-height:1;cursor:pointer;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12)}
#zoomBtns button:active{background:#eef2f6}
#toast{position:absolute;inset-inline:12px;bottom:10px;margin:auto;max-width:360px;text-align:center;background:rgba(28,39,51,.9);color:#fff;padding:8px 12px;border-radius:10px;font-size:14px;pointer-events:none}

#actions{background:#fff;border-top:1px solid #dbe2ea;padding:10px 12px;padding-bottom:max(10px,env(safe-area-inset-bottom))}
#result{text-align:center;margin-bottom:8px;font-size:17px}
#result b{font-size:22px}
#result .pts{color:var(--ok);font-weight:800}
.row{display:flex;gap:8px}
button{font:inherit;cursor:pointer}
.primary{background:var(--primary);color:#fff;border:0;border-radius:12px;padding:13px 18px;font-weight:700;font-size:17px;flex:1}
.primary:hover:not(:disabled){background:var(--primary-d)}
.primary:disabled{background:#a9b8cc;cursor:not-allowed}
.ghost{background:#fff;color:var(--ink);border:1px solid #ccd5df;border-radius:12px;padding:13px 16px;font-size:16px}
.ghost:hover{background:#f3f6f9}
.row .ghost{flex:0 0 auto}
[hidden]{display:none!important}

.overlay{position:absolute;inset:0;background:rgba(238,242,246,.96);display:flex;align-items:center;justify-content:center;padding:16px;z-index:5;overflow:auto}
.card{background:var(--card);border-radius:18px;padding:24px 22px;width:100%;max-width:420px;box-shadow:0 8px 30px rgba(20,40,70,.15);text-align:center}
.card h1{margin:0 0 8px;font-size:34px}
.card h2{font-size:16px;margin:18px 0 10px;color:var(--muted)}
.card p{margin:0 0 6px;color:#37465a;line-height:1.5}
.big{display:block;width:100%;margin:8px 0;padding:15px 18px}
.big small{display:block;font-weight:400;font-size:13px;opacity:.85}
.alt{background:#10375c}
.alt:hover:not(:disabled){background:#0b2943}
.best{font-size:14px;color:var(--muted);min-height:1.2em}
.bigscore{font-size:54px;font-weight:800;margin:6px 0 4px;color:var(--primary)}
.bigscore small{font-size:18px;color:var(--muted);font-weight:500}

@media (min-width:700px){#app{border-inline:1px solid #dbe2ea}}
