/* Puztivo V1 – fælles design */
:root{
  --bg:#f6f3ec;
  --card:#ffffff;
  --ink:#1f1d1a;
  --muted:#6f6a60;
  --line:#e6e1d6;
  --soft:#f1ede4;
  --accent:#2f8f5b;
  --accent-ink:#ffffff;
  --green:#2f8f5b;
  --orange:#e07a2f;
  --purple:#6f4bd8;
  --red:#d64545;
  --yellow:#e2b93b;
  --radius:16px;
  --shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(31,29,26,.06);
  --font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
body[data-game="byjagten"]{--accent:var(--green)}
body[data-game="brobyggeren"]{--accent:var(--orange)}
body[data-game="faelles-ord"]{--accent:var(--purple)}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);line-height:1.45;font-size:17px}
a{color:inherit}
button{font:inherit}

.wrap{max-width:520px;margin:0 auto;padding:16px 16px 48px}

/* Header */
.top{display:flex;align-items:center;justify-content:space-between;padding:6px 0 18px}
.brand{font-weight:800;letter-spacing:-.02em;font-size:22px;text-decoration:none;display:flex;align-items:center;gap:8px}
.brand .dot{width:10px;height:10px;border-radius:50%;background:var(--accent);display:inline-block}
.top nav a{font-size:14px;color:var(--muted);text-decoration:none;margin-left:14px}
.top nav a:hover{color:var(--ink)}

/* Cards */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);margin-bottom:14px}
.card h2{margin:0 0 6px;font-size:20px;letter-spacing:-.01em}
.card p{margin:6px 0}
.muted{color:var(--muted)}
.small{font-size:14px}
.tiny{font-size:12px}
.center{text-align:center}
.row{display:flex;gap:10px;align-items:center}
.row.between{justify-content:space-between}
.stack{display:flex;flex-direction:column;gap:10px}

/* Hub */
.hero{padding:6px 0 14px}
.hero h1{margin:0;font-size:30px;letter-spacing:-.03em}
.hero p{margin:6px 0 0;color:var(--muted)}
.streakbar{display:flex;gap:10px;align-items:center;justify-content:space-between;background:var(--soft);border-radius:12px;padding:12px 14px;margin:12px 0 16px}
.streakbar b{font-size:20px}
.game-card{display:block;text-decoration:none;position:relative;overflow:hidden}
.game-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:6px;background:var(--gc)}
.game-card .tag{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--gc)}
.game-card .status{font-size:14px;color:var(--muted);margin-top:8px}
.game-card .status.done{color:var(--gc);font-weight:600}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--accent);color:var(--accent-ink);border:0;border-radius:12px;padding:12px 18px;font-weight:700;cursor:pointer;text-decoration:none;min-height:46px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.secondary{background:var(--soft);color:var(--ink)}
.btn.block{width:100%}
.btn.gc{background:var(--gc)}

/* Game header */
.game-head{display:flex;align-items:baseline;justify-content:space-between;margin:4px 0 10px}
.game-head h1{margin:0;font-size:26px;letter-spacing:-.02em}
.game-head .num{color:var(--muted);font-size:14px}
.instruction{font-size:16px;color:var(--muted);margin:0 0 14px}
.tries{font-size:14px;color:var(--muted)}

/* Inputs */
.input{width:100%;font-size:18px;padding:13px 14px;border:2px solid var(--line);border-radius:12px;background:#fff;outline:none;text-transform:none}
.input:focus{border-color:var(--accent)}
.input.caps{text-transform:uppercase;letter-spacing:.08em;font-weight:700}
.input-row{display:flex;gap:8px;margin-top:10px}
.input-row .input{flex:1;min-width:0}
.ac{position:relative}
.ac-list{position:absolute;left:0;right:0;top:100%;z-index:10;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);max-height:240px;overflow:auto;margin-top:4px;display:none}
.ac-list.open{display:block}
.ac-item{padding:11px 14px;cursor:pointer;display:flex;justify-content:space-between;gap:10px}
.ac-item .k{color:var(--muted);font-size:13px}
.ac-item:hover,.ac-item.active{background:var(--soft)}
.feedback{min-height:22px;font-size:14px;color:var(--muted);margin-top:8px}
.feedback.err{color:var(--red)}
.feedback.ok{color:var(--green)}

/* Byjagten */
.guesses{width:100%;border-collapse:collapse;margin-top:14px}
.guesses th{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)}
.guesses td{padding:10px 8px;border-bottom:1px solid var(--line);font-size:16px}
.guesses td.city{font-weight:700}
.swatch{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:8px;vertical-align:-1px}
.map{width:100%;aspect-ratio:1/1;background:var(--soft);border-radius:12px;margin-top:14px;position:relative;overflow:hidden}
.map svg{width:100%;height:100%;display:block}

/* Brobyggeren */
.bridge{display:flex;align-items:center;justify-content:center;gap:10px;margin:14px 0 8px;flex-wrap:wrap}
.bridge .w{font-size:22px;font-weight:800;letter-spacing:.04em}
.bridge .gap{display:flex;gap:4px}
.slots{display:flex;gap:5px;justify-content:center;flex-wrap:wrap}
.slot{width:34px;height:40px;border:2px solid var(--line);border-radius:8px;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:20px;background:#fff}
.slot.hint{border-color:var(--yellow);background:#fff8e1}
.bridge-list{list-style:none;padding:0;margin:14px 0 0}
.bridge-list li{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);font-size:15px}
.bridge-list li .st{font-size:18px}
.progress{display:flex;gap:6px;margin:0 0 10px}
.progress span{flex:1;height:8px;border-radius:4px;background:var(--line)}
.progress span.now{background:var(--accent)}
.progress span.ok{background:var(--green)}
.progress span.hint{background:var(--yellow)}
.progress span.fail{background:#3a3733}

/* Fælles ord */
.three{display:flex;flex-direction:column;gap:8px;margin:12px 0 16px}
.three .word{background:var(--soft);border-radius:12px;padding:14px;text-align:center;font-weight:800;font-size:22px;letter-spacing:.06em}
.three .word.extra{background:#efe9ff;border:1px dashed var(--purple)}
.grid{display:flex;flex-direction:column;gap:6px;margin:10px 0}
.grid .r{display:flex;gap:6px;justify-content:center}
.tile{width:40px;height:46px;border:2px solid var(--line);border-radius:8px;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:20px;background:#fff;text-transform:uppercase}
.tile.g{background:var(--green);border-color:var(--green);color:#fff}
.tile.y{background:var(--yellow);border-color:var(--yellow);color:#1f1d1a}
.tile.b{background:#3a3733;border-color:#3a3733;color:#fff}
.tile.empty{border-style:dashed}

/* Resultat */
.result{border:2px solid var(--accent)}
.result h2{color:var(--accent)}
.share-box{background:var(--soft);border-radius:12px;padding:12px 14px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px;white-space:pre-wrap;margin:10px 0}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:10px}
.stat{background:var(--soft);border-radius:12px;padding:10px 6px;text-align:center}
.stat b{display:block;font-size:22px}
.stat span{font-size:12px;color:var(--muted)}
.explain{margin:10px 0 0;padding:0;list-style:none}
.explain li{padding:8px 0;border-bottom:1px solid var(--line);font-size:15px}
.explain li b{color:var(--accent)}
.countdown{font-variant-numeric:tabular-nums}

/* Regler */
.rules h2{margin-top:22px}
.rules ol,.rules ul{padding-left:20px}
.rules li{margin:6px 0}
.footer{margin-top:30px;color:var(--muted);font-size:13px;text-align:center}
.footer a{color:var(--muted)}
.lang-pick{display:flex;flex-direction:column;gap:10px;margin-top:20px}

.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:10px 16px;border-radius:12px;font-size:14px;opacity:0;pointer-events:none;transition:opacity .2s}
.toast.show{opacity:1}
.hidden{display:none!important}
@media (min-width:720px){.wrap{max-width:560px}.three{flex-direction:row}.three .word{flex:1}}

/* V2.3 – Byjagten: rolige, læsbare spor og dansk kort */
.by-section-head{font-size:16px!important;letter-spacing:-.01em;margin:2px 0 12px!important;display:flex;align-items:center;justify-content:space-between}
.by-history{margin-top:20px}
.by-guesses{display:flex;flex-direction:column;gap:10px}
.by-guess{border:1px solid var(--line);border-radius:14px;background:#faf9f6;padding:12px;cursor:pointer;transition:border-color .15s,box-shadow .15s}
.by-guess:hover,.by-guess:focus-visible,.by-guess.selected{border-color:#81aa91;box-shadow:0 0 0 2px rgba(47,143,91,.11);outline:none}
.by-guess-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.by-guess-city{display:flex;align-items:center;gap:9px;min-width:0}
.by-guess-city strong{font-size:16px;overflow-wrap:anywhere}
.by-number{height:25px;min-width:25px;padding:2px 5px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px;font-weight:800}
.by-guess-label{font-size:12px;color:var(--muted);white-space:nowrap}
.by-clues{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px}
.by-clue{min-width:0;border:1px solid #e9e5dc;background:#fff;border-radius:10px;padding:9px 5px;text-align:center;display:flex;flex-direction:column;gap:3px}
.by-clue-label{font-size:10px;font-weight:750;letter-spacing:.07em;color:var(--muted)}
.by-clue-value{font-size:15px;font-weight:750;white-space:nowrap}
.by-clue.by-distance.red .by-clue-value{color:#bc3939}
.by-clue.by-distance.orange .by-clue-value{color:#ba6a23}
.by-clue.by-distance.yellow .by-clue-value{color:#8b6a12}
.by-clue.by-direction .by-clue-value{font-size:17px}
.by-clue.by-size .by-clue-value{font-size:13px}
.by-hit{background:#e5f4e8;border-radius:9px;padding:9px;text-align:center;color:#247444;font-weight:750}
.by-map-section{margin-top:22px}
.by-map-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.by-map-heading .by-section-head{margin:0 0 10px!important}
.by-map-heading .tiny{margin-bottom:10px}
body[data-game="byjagten"] .map{aspect-ratio:460 / 480;background:#e6efec;border:1px solid #d4e2dc;margin-top:0}
body[data-game="byjagten"] .map svg{max-width:100%;height:auto;aspect-ratio:460 / 480}
.dk-marker{cursor:pointer;outline:none}
.dk-marker:focus-visible circle:first-of-type{stroke:#1b5635;stroke-width:4px}
@media(max-width:370px){.by-clue{padding:8px 3px}.by-clue-value{font-size:13px}.by-clue.by-direction .by-clue-value{font-size:15px}.by-clue.by-size .by-clue-value{font-size:12px}.by-guess{padding:9px}}
