/* OUTSIDE — field-guide meets spray can. Cream paper, heavy ink.
   Contrast sits ~8–11:1 on purpose (neurodiverse rule): cream not white,
   ink not black, no walls of alarm. */
:root {
  --cream: #F2EDE0; --cream-2: #FBF7EC; --paper: #E9E2D0;
  --ink: #38352A; --ink-2: #6B665A;
  --moss: #2F6B38; --moss-2: #3F8A4A;
  --orange: #C43D1B; --amber: #B8860B;
  --font-display: Anton, Impact, 'Arial Narrow', sans-serif;
  --font-body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--cream); color: var(--ink); font-family: var(--font-body); font-size: 16px; overscroll-behavior: none; }
body { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
h1, h2, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: 1px; text-transform: uppercase; margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.on { display: flex; }

/* HOME */
#home { padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); gap: 18px; overflow: auto; }
#home h1 { font-size: 64px; line-height: 0.95; }
#home .tag { color: var(--ink-2); font-weight: 700; letter-spacing: 2px; font-size: 12px; text-transform: uppercase; }
.park-card { border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; background: var(--cream-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.park-card b { font-size: 18px; }
.tiers { display: grid; gap: 10px; }
.tier { border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; text-align: left; background: var(--cream-2); display: grid; gap: 4px; }
.tier .name { font-family: var(--font-display); font-size: 24px; letter-spacing: 1px; }
.tier .blurb { color: var(--ink-2); font-size: 14px; }
.tier[aria-pressed="true"] { background: var(--ink); color: var(--cream-2); }
.tier[aria-pressed="true"] .blurb { color: var(--paper); }
.best { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.best b { color: var(--ink); font-size: 18px; }
.cta { background: var(--moss); color: var(--cream-2); border-radius: 14px; padding: 18px; font-family: var(--font-display); font-size: 28px; letter-spacing: 2px; text-transform: uppercase; }
.cta[disabled] { background: var(--ink-2); }
.cta.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); font-size: 18px; padding: 12px; }
.hint { color: var(--ink-2); font-size: 14px; text-align: center; }
.safety { border-left: 4px solid var(--amber); padding: 8px 12px; font-size: 14px; color: var(--ink); background: var(--paper); border-radius: 6px; }
.gps-line { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); }
.dot.ok { background: var(--moss-2); } .dot.weak { background: var(--amber); } .dot.bad { background: var(--orange); }

/* MAP */
#map { background: var(--cream); }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; pointer-events: none; }
.stat { background: var(--cream-2); border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px; text-align: center; }
.stat .k { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--ink-2); text-transform: uppercase; }
.stat .v { font-family: var(--font-display); font-size: 24px; line-height: 1; margin-top: 2px; }
.stat.flash .v { color: var(--orange); }
.chips { position: absolute; left: 12px; right: 12px; top: calc(86px + env(safe-area-inset-top)); display: flex; gap: 8px; pointer-events: none; }
.chip { background: var(--cream-2); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.chip.weak { border-color: var(--amber); color: var(--amber); }
.chip.bad { border-color: var(--orange); color: var(--orange); }
.chip .meter { display: inline-block; width: 60px; height: 8px; border: 1.5px solid var(--ink); vertical-align: middle; margin-left: 6px; background: var(--cream); }
.chip .meter i { display: block; height: 100%; background: var(--orange); width: 0; }
.bottom { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.carry { background: var(--ink); color: var(--cream-2); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: baseline; }
.carry .display { font-size: 22px; }
.carry.hidden { display: none; }
.action { position: relative; overflow: hidden; background: var(--moss); color: var(--cream-2); border-radius: 14px; padding: 18px; font-family: var(--font-display); font-size: 28px; letter-spacing: 2px; text-transform: uppercase; text-align: center; }
.action[disabled] { background: var(--paper); color: var(--ink-2); }
.action .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(0,0,0,0.25); }
.action span { position: relative; }
.row { display: flex; gap: 8px; }
.row .small { flex: 1; background: var(--cream-2); border: 2px solid var(--ink); border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.row .small[disabled] { color: var(--ink-2); border-color: var(--ink-2); }
.edge { position: absolute; inset: 0; pointer-events: none; border: 0 solid var(--orange); transition: border-width 0.15s; }
.edge.on { border-width: 14px; }
.banner { position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); text-align: center; pointer-events: none; display: none; }
.banner.on { display: block; }
.banner .display { font-size: 44px; color: var(--cream-2); background: var(--orange); padding: 10px 16px; border-radius: 12px; display: inline-block; }
.banner .sub { font-weight: 700; letter-spacing: 1px; margin-top: 8px; color: var(--orange); font-size: 14px; text-transform: uppercase; }
.pulse { position: absolute; inset: 0; pointer-events: none; background: var(--orange); opacity: 0; }
.pulse.go { animation: pulse 0.5s ease-out; }
@keyframes pulse { 0% { opacity: 0.35; } 100% { opacity: 0; } }
.toast { position: absolute; left: 50%; transform: translateX(-50%); top: calc(126px + env(safe-area-inset-top)); background: var(--ink); color: var(--cream-2); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.toast.on { opacity: 1; }

/* OVERLAYS: caught / over */
.overlay { position: absolute; inset: 0; z-index: 6; display: none; flex-direction: column; justify-content: center; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); gap: 14px; background: var(--cream); }
.overlay.on { display: flex; }
.overlay h1 { font-size: 72px; line-height: 0.9; }
#caught h1 { color: var(--orange); }
.overlay p { font-size: 18px; margin: 0; line-height: 1.35; }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scores .stat .v { font-size: 34px; }

/* EDIT */
#edit .tools { position: absolute; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); display: flex; flex-wrap: wrap; gap: 6px; }
.tool { background: var(--cream-2); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--cream-2); }
#edit .bottom textarea { width: 100%; height: 120px; font: 12px/1.3 ui-monospace, monospace; border: 2px solid var(--ink); border-radius: 10px; background: var(--cream-2); color: var(--ink); padding: 8px; }
#edit .note { background: var(--cream-2); border: 2px solid var(--ink); border-radius: 10px; padding: 8px 12px; font-size: 13px; }

/* GHOST panel */
#ghost { position: absolute; right: 12px; top: calc(126px + env(safe-area-inset-top)); background: var(--cream-2); border: 2px dashed var(--ink-2); border-radius: 10px; padding: 8px 10px; font-size: 12px; display: none; gap: 6px; flex-direction: column; z-index: 5; }
#ghost.on { display: flex; }
#ghost label { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.stamp { position: absolute; right: 8px; bottom: 4px; font-size: 10px; color: var(--ink-2); pointer-events: none; }
