:root {
  --ink: #1d2a22; --muted: #5d6b60; --paper: #f3f5ec; --card: #ffffff;
  --forest: #1f4a35; --gold: #d49a12; --line: #d6dccb;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; display: flex; flex-direction: column; overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }

.top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px)); background: var(--forest); color: #fff; z-index: 2; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.2rem; margin-right: auto; }
.stat { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 5px 10px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .88rem; white-space: nowrap; }

.mapwrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #e8e4d8; }
.hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 500; background: rgba(29,42,34,.9); color: #fff; padding: 7px 12px; border-radius: 10px; font-size: .85rem; width: max-content; max-width: calc(100% - 24px); text-align: center; }
.modebar { position: absolute; right: 10px; bottom: 26px; z-index: 500; display: grid; gap: 8px; }
.fabmini { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-weight: 700; font-size: .82rem; box-shadow: 0 4px 14px rgba(0,0,0,.15); cursor: pointer; }
.fabmini.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.toast { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 600; background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 12px; font-weight: 600; font-size: .9rem; width: max-content; max-width: calc(100% - 32px); text-align: center; transition: opacity .25s; pointer-events: none; }

/* markører */
.mk { font-size: 24px; line-height: 1; text-align: center; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.mk span { display: block; }
.mk.rare span { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { transform: scale(1.18); } }
.me { width: 20px; height: 20px; border-radius: 50%; background: #1e74d6; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(30,116,214,.3), 0 2px 6px rgba(0,0,0,.35); }
.friend { width: 16px; height: 16px; border-radius: 50%; background: #7a4fb5; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.lbl { background: rgba(255,255,255,.95); border-radius: 10px; padding: 2px 8px; font: 700 11px var(--body); color: var(--ink); white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.2); }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); z-index: 2; }
.tabs button { background: none; border: 0; padding: 8px 4px 10px; display: grid; justify-items: center; gap: 2px; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button .ic { font-size: 1.3rem; line-height: 1.2; }
.tabs button[aria-selected="true"] { color: var(--forest); }

.sheet { position: absolute; inset: auto 0 0 0; z-index: 700; max-height: 80%; overflow-y: auto; background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(29,42,34,.2); padding: 16px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; }
.sheet h2 { font-family: var(--display); font-size: 1.35rem; margin: 0; }
.sheet h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }
.sheet p { margin: 0; color: var(--muted); line-height: 1.45; }
.row { display: flex; align-items: center; gap: 10px; }
.close { margin-left: auto; background: var(--paper); border: 0; border-radius: 999px; width: 34px; height: 34px; font-size: 1.1rem; cursor: pointer; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.slot { background: var(--paper); border-radius: 12px; padding: 8px 4px; text-align: center; }
.slot .e { font-size: 1.5rem; display: block; }
.slot b { font-size: .85rem; }
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.item .e { font-size: 1.6rem; }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 700; }
.item .sub { font-size: .82rem; color: var(--muted); }
.btn { background: var(--forest); color: #fff; border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.big { padding: 13px 16px; font-size: 1rem; width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.note { background: #fbf3dc; border-radius: 12px; padding: 10px 12px; font-size: .85rem; line-height: 1.4; display: grid; gap: 8px; justify-items: start; }
.leaflet-control-attribution { font-size: 10px; }
.carry { position: absolute; left: 10px; top: 56px; z-index: 500; background: #7a3b1d; color: #fff; font-weight: 700; font-size: .85rem; padding: 8px 12px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: calc(100% - 150px); }
.mk.animal span { font-size: 30px; }
.joy { position: absolute; left: max(18px, env(safe-area-inset-left, 0px)); bottom: 28px; z-index: 550; width: 128px; height: 128px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,.15)); border: 2px solid rgba(255,255,255,.75);
  box-shadow: 0 6px 20px rgba(0,0,0,.25), inset 0 0 0 1px rgba(0,0,0,.08); touch-action: none; display: grid; place-items: center; }
.knob { width: 56px; height: 56px; border-radius: 50%; background: var(--forest); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.3); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .mk.rare span { animation: none; } .toast { transition: none; } }
.leaflet-tooltip { background: none; border: 0; box-shadow: none; padding: 0; } .leaflet-tooltip-top:before { display: none; }
/* login – alt på én skærm */
.login { position: fixed; inset: 0; z-index: 2000; background: #17382a; color: #f4f1e6; overflow-y: auto; }
.topo { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.login-inner { position: relative; height: 100%; min-height: 560px; max-width: 440px; margin: 0 auto; display: grid; grid-template-rows: auto minmax(90px, 1fr) auto; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.intro { display: grid; gap: 4px; min-width: 0; }
.eyebrow { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c9d8c4; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #6fe08f; box-shadow: 0 0 0 3px rgba(111,224,143,.18); }
.intro h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 9vw, 2.6rem); line-height: 1; margin: 0; letter-spacing: -.03em; color: #fff7dc; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.beta { font-family: var(--body); font-size: .62rem; font-weight: 800; letter-spacing: .12em; color: #17382a; background: #e8b840; border-radius: 6px; padding: 3px 6px; line-height: 1; }
.brand .beta { font-size: .55rem; vertical-align: middle; }
.tag { margin: 0; color: #d7e2d2; line-height: 1.35; font-size: .92rem; }
.demo3d { display: block; width: 100%; height: 100%; min-height: 0; border-radius: 16px; background: #17382a; box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08); }
.login .box { background: #fbf8ee; color: var(--ink); border-radius: 18px; padding: 12px; display: grid; gap: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.login label { display: grid; gap: 3px; font-weight: 700; font-size: .8rem; }
.login label[hidden] { display: none; }
.login input { font: inherit; font-size: 16px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.login input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.login .btn.big { background: #1f4a35; padding: 12px; font-size: 1rem; }
.switch { display: grid; grid-template-columns: 1fr 1fr; background: #ece7d8; border-radius: 10px; padding: 3px; }
.switch button { border: 0; background: none; padding: 7px; border-radius: 8px; font-weight: 700; color: var(--muted); cursor: pointer; }
.switch button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.err { color: #b4432f; font-weight: 600; font-size: .82rem; min-height: 0; }
.err:empty { display: none; }
/* online + startvalg */
.online { position: absolute; right: 10px; top: 10px; z-index: 520; background: rgba(255,255,255,.95); border-radius: 999px; padding: 5px 10px 5px 24px; font-weight: 700; font-size: .78rem; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.online::before { content: ""; position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #2fbf5b; }
.hint { top: 46px; }
.startbox { position: absolute; inset: auto 0 0 0; z-index: 700; background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 10px; }
.startbox h2 { font-family: var(--display); margin: 0; font-size: 1.35rem; }
.startbox p { margin: 0; color: var(--muted); line-height: 1.45; }
.startbox input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.startbox .msg { color: var(--ink); font-weight: 600; }
input.price { width: 70px; font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; }

/* liv i toppen */
.stat.walked { display: none; }
.stat.hp { gap: 6px; padding-right: 10px; }
.stat.hp #lvl { font-size: .72rem; background: var(--gold); color: var(--ink); border-radius: 6px; padding: 1px 5px; }
.hpbox { width: 54px; height: 8px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; }
.hpbox i { display: block; height: 100%; width: 100%; background: #57d27a; transition: width .2s; }
/* helten */
.hero-wrap { overflow: visible; }
.hero { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid var(--forest); display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.hero span { font-size: 24px; line-height: 1; }
.hit .hero { animation: hit .35s; }
@keyframes hit { 30% { background: #ff8a7a; transform: scale(1.12); } }
/* fjender */
.en-wrap { overflow: visible; }
.en { display: grid; justify-items: center; gap: 1px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.en span { font-size: 28px; line-height: 1; }
.en b { font: 800 10px var(--body); background: #7a1f12; color: #fff; border-radius: 6px; padding: 0 5px; }
.en i { width: 36px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.45); overflow: hidden; }
.en i s { display: block; height: 100%; background: #e2553f; text-decoration: none; }
.en.tgt span { outline: 2px dashed #ffd24a; outline-offset: 2px; border-radius: 50%; }
.float-wrap { overflow: visible; pointer-events: none; }
.float { font: 800 16px var(--display); text-shadow: 0 1px 3px rgba(0,0,0,.8); animation: up .9s ease-out forwards; text-align: center; }
@keyframes up { to { transform: translateY(-34px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .float, .hit .hero { animation: none; } }
/* figurvalg */
.chars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 46vh; overflow-y: auto; }
.char { text-align: center; justify-items: center; border: 2px solid var(--line); background: var(--paper); border-radius: 14px; padding: 10px; display: grid; gap: 4px; cursor: pointer; }
.char[aria-pressed="true"] { border-color: var(--forest); background: #e6f0e4; }
.char .ce { font-size: 38px; line-height: 1; }
.char b { font-size: 1rem; }
.char .st { display: grid; grid-template-columns: 44px 1fr; align-items: center; font-size: .72rem; color: var(--muted); font-weight: 700; }
.char small { color: var(--ink); font-size: .78rem; line-height: 1.3; }
.bar { display: block; height: 6px; border-radius: 4px; background: rgba(0,0,0,.1); overflow: hidden; }
.bar s { display: block; height: 100%; background: var(--forest); text-decoration: none; }
#charStep, #placeStep { display: grid; gap: 10px; }
#charStep[hidden], #placeStep[hidden] { display: none; }
@media (max-width: 420px) { .brand { font-size: 1rem; line-height: 1.05; max-width: 6.5em; } }

.demo3d { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 18px; background: #17382a; box-shadow: 0 14px 40px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08); }

/* valg af startsted: kun kortet */
body.choosing .online, body.choosing .hint, body.choosing .modebar, body.choosing .carry, body.choosing .joy, body.choosing .tabs, body.choosing .top .stat { display: none !important; }
.townsearch { position: relative; display: flex; gap: 8px; }
.towns { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: grid; overflow: hidden; z-index: 5; }
.towns[hidden] { display: none; }
.town { text-align: left; border: 0; background: none; padding: 11px 14px; font-weight: 700; cursor: pointer; border-bottom: 1px solid var(--line); }
.town:last-child { border-bottom: 0; }
.town:hover, .town:focus-visible { background: var(--paper); }
@media (max-width: 420px) { .brand .beta { display: none; } }

/* installér */
.toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.install { border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff7dc; font-weight: 700; font-size: .78rem; border-radius: 999px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.install:hover { background: rgba(255,255,255,.18); }
.ios-tip { margin: 2px 0 0; font-size: .82rem; color: #fff7dc; background: rgba(255,255,255,.1); border-radius: 10px; padding: 7px 10px; }

/* online i toppen */
.stat.onl { gap: 6px; }
.stat.onl i { width: 8px; height: 8px; border-radius: 50%; background: #57d27a; box-shadow: 0 0 0 3px rgba(87,210,122,.25); }
.hint { top: 10px; }
/* til/fra-kontakt: grøn = til, rød = fra */
.switch-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 800; font-size: .85rem; cursor: pointer; color: #fff; background: #c4452f; transition: background .2s; }
.switch-btn i { width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch-btn[aria-checked="true"] { background: #2e9e55; flex-direction: row-reverse; padding: 4px 4px 4px 12px; }
@media (max-width: 420px) { .top { gap: 6px; } .stat { padding: 5px 8px; font-size: .82rem; } .hpbox { width: 40px; } }

/* følg mig / hjem */
.fabmini.follow { background: #c4452f; color: #fff; border-color: #c4452f; }
.fabmini.follow.on { background: #2e9e55; border-color: #2e9e55; }
button.stat { border: 0; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.bar.big { height: 12px; border-radius: 8px; }
