/* Kraftriget — blokverdenen fylder hele skærmen, og alt andet ligger ovenpå som spil-HUD i pixelstil. */
:root {
  --night: #1b1430; --night-d: #0c0818; --night-l: #4a3f78; --violet: #3b2f6b;
  --gold: #ffc23d; --gold-d: #c98a16; --gold-l: #ffe59a; --wood: #3a2206;
  --parch: #f3e3b3; --parch-d: #d6bf85; --ink: #2b1d10; --ink-soft: #6b5433;
  --green: #6cc24a; --green-d: #3d8f27; --green-l: #a5e885;
  --cyan: #58c7f3; --ember: #e2483d; --ember-d: #a52a26; --ember-l: #ff8a7d;
  --stone: #aab1bd; --stone-d: #6b707b; --stone-l: #d9dee6;
  --f-head: 'Jersey 10', 'Trebuchet MS', 'Arial Narrow', sans-serif;
  --f-body: 'Jersey 20', 'Trebuchet MS', Arial, sans-serif;
  --f-logo: 'Jacquard 24', 'Jersey 10', Georgia, serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --notch: polygon(0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
  --out: 4px 0 0 var(--night), -4px 0 0 var(--night), 0 4px 0 var(--night), 0 -4px 0 var(--night), 4px 4px 0 var(--night), -4px -4px 0 var(--night), 4px -4px 0 var(--night), -4px 4px 0 var(--night);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--night); color: var(--parch); font: 400 20px/1.15 var(--f-body); overscroll-behavior: none; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 400; line-height: 1; text-wrap: balance; }
h1 { font-size: 40px; } h2 { font-size: 34px; } h3 { font-size: 26px; }
img { max-width: 100%; }
.ic { display: block; flex: none; image-rendering: pixelated; }
[hidden] { display: none !important; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: 0; }
#ui { position: fixed; inset: 0; pointer-events: none; }

/* ---------- byggesten ---------- */
.px { clip-path: var(--notch); }
.panel { position: relative; pointer-events: auto; clip-path: var(--notch); }
.parch {
  color: var(--ink); background-color: var(--parch); padding: 22px 20px;
  background-image: linear-gradient(45deg, rgba(120, 80, 20, .07) 25%, transparent 25%, transparent 75%, rgba(120, 80, 20, .07) 75%), linear-gradient(45deg, rgba(120, 80, 20, .07) 25%, transparent 25%, transparent 75%, rgba(120, 80, 20, .07) 75%);
  background-size: 8px 8px; background-position: 0 0, 4px 4px;
  box-shadow: inset 0 0 0 4px var(--wood), inset 0 0 0 8px var(--gold-d), inset 0 0 0 10px var(--wood);
}
.dark { color: var(--parch); background: var(--night); padding: 20px; box-shadow: inset 0 0 0 4px var(--night-d), inset 0 0 0 8px var(--night-l), inset 0 0 0 10px var(--night-d); }

.btn {
  pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 8px 18px 11px;
  font: 400 28px/1 var(--f-head); letter-spacing: .5px; text-align: center; color: var(--wood); background: var(--gold); clip-path: var(--notch);
  box-shadow: inset 0 0 0 4px var(--wood), inset 4px 4px 0 4px var(--gold-l), inset -4px -4px 0 4px var(--gold-d);
}
.btn:active { transform: translateY(2px); filter: brightness(.94); }
.btn:focus-visible { box-shadow: inset 0 0 0 4px var(--cyan), inset 4px 4px 0 4px var(--gold-l), inset -4px -4px 0 4px var(--gold-d); outline: 0; }
.btn.green { background: var(--green); color: #12300a; box-shadow: inset 0 0 0 4px #12300a, inset 4px 4px 0 4px var(--green-l), inset -4px -4px 0 4px var(--green-d); }
.btn.stone { background: var(--stone); color: #1f2230; box-shadow: inset 0 0 0 4px #1f2230, inset 4px 4px 0 4px var(--stone-l), inset -4px -4px 0 4px var(--stone-d); }
.btn.red { background: var(--ember); color: #fff; box-shadow: inset 0 0 0 4px #3a0f0c, inset 4px 4px 0 4px var(--ember-l), inset -4px -4px 0 4px var(--ember-d); }
.btn.big { min-height: 68px; font-size: 34px; width: 100%; }
.btn.sm { min-height: 44px; font-size: 22px; padding: 5px 12px 8px; gap: 6px; }
.btn[disabled] { filter: grayscale(1) brightness(.8); pointer-events: none; }
.row { display: flex; gap: 8px; } .row > * { flex: 1 1 0; min-width: 0; }
.row.tight > .fix { flex: none; }
.ibtn { pointer-events: auto; width: 48px; height: 48px; flex: none; display: grid; place-items: center; background: var(--night); clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--night-d), inset 0 0 0 6px var(--night-l); }
.ibtn:active { filter: brightness(1.3); }
.ibtn:focus-visible { box-shadow: inset 0 0 0 4px var(--cyan); outline: 0; }
.ibtn.onparch { background: var(--wood); box-shadow: inset 0 0 0 4px var(--wood), inset 0 0 0 6px var(--gold-d); }
.link { pointer-events: auto; font-size: 18px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; }
.muted { color: var(--ink-soft); } .dark .muted { color: var(--stone); }
.center { text-align: center; }

/* ---------- HUD ---------- */
#hud { position: absolute; top: calc(var(--sat) + 8px); left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; z-index: 5; }
.plate { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; background: var(--night); color: var(--parch); text-align: left; clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--night-d), inset 0 0 0 6px var(--night-l); min-width: 0; }
.plate .face { position: relative; width: 44px; height: 44px; flex: none; }
.plate .face img { width: 44px; height: 44px; display: block; background: #2a62c9; box-shadow: 0 0 0 2px var(--gold); }
.plate .face b { position: absolute; right: -9px; bottom: -5px; min-width: 22px; height: 22px; padding: 0 3px; background: var(--gold); color: var(--wood); font: 400 22px/20px var(--f-head); text-align: center; box-shadow: 0 0 0 2px var(--wood); }
.who { min-width: 0; }
.who b { display: block; font: 400 24px/1 var(--f-head); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.who i { display: block; font-style: normal; font-size: 17px; line-height: 1; color: var(--gold); }
.xpbar { display: block; width: 112px; height: 8px; margin-top: 4px; background: var(--night-d); box-shadow: 0 0 0 2px var(--night-l); }
.xpbar span { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .5s steps(8); }
.hud-r { display: flex; gap: 8px; align-items: center; }
.gems { pointer-events: auto; display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 12px 2px 8px; background: var(--night); clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--night-d), inset 0 0 0 6px var(--night-l); font: 400 28px/1 var(--f-head); color: #fff; }
.update { position: absolute; top: calc(var(--sat) + 68px); left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: auto; padding: 10px 16px 12px; background: var(--green); color: #12300a; font: 400 22px/1 var(--f-head); clip-path: var(--notch); box-shadow: inset 0 0 0 4px #12300a; white-space: nowrap; }

/* ---------- skærme ---------- */
#home, #map, #quest, #nav, #hud { display: none; }
body[data-screen="home"] #home, body[data-screen="home"] #nav, body[data-screen="home"] #hud { display: flex; }
body[data-screen="map"] #map, body[data-screen="map"] #hud { display: block; } body[data-screen="map"] #nav { display: grid; } body[data-screen="map"] #hud { display: flex; }
body[data-screen="home"] #nav { display: grid; }
body[data-screen="quest"] #quest { display: block; }

.dock { position: absolute; left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 8px); flex-direction: column; justify-content: flex-end; gap: 8px; height: calc(100% - 200px - var(--sat)); pointer-events: none; }
.dock.above-nav { bottom: calc(var(--sab) + 84px); height: calc(100% - 276px - var(--sat)); }
.dock > .panel { overflow: auto; overscroll-behavior: contain; scrollbar-width: none; max-height: 100%; }
.panel.split { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.split .pb { flex: 1; min-height: 0; overflow: auto; padding: 22px 20px 6px; overscroll-behavior: contain; scrollbar-width: none; }
.split .pf { flex: none; padding: 10px 20px 20px; box-shadow: 0 -2px 0 var(--parch-d); }
#q-dock { display: flex; }

#nav { position: absolute; left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 8px); grid-template-columns: repeat(4, 1fr); gap: 6px; z-index: 4; }
#nav button { pointer-events: auto; height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--night); color: var(--stone-l); font: 400 21px/1 var(--f-head); clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--night-d), inset 0 0 0 6px var(--night-l); }
#nav button[aria-current="page"] { background: var(--violet); color: #fff; box-shadow: inset 0 0 0 4px var(--night-d), inset 0 0 0 6px var(--gold); }
#nav button:focus-visible { box-shadow: inset 0 0 0 4px var(--cyan); outline: 0; }

/* ---------- lejr ---------- */
.hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home h1 { font-size: 42px; }
.home .line { margin-top: 4px; font-size: 21px; }
.meter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px; margin: 12px 0 14px; padding: 10px 12px 11px; background: rgba(58, 34, 6, .1); box-shadow: inset 0 0 0 2px var(--parch-d); }
.meter b { font: 400 24px/1 var(--f-head); }
.meter .pips { display: flex; gap: 3px; align-items: center; }
.pip { width: 16px; height: 16px; background: var(--parch-d); box-shadow: inset 0 0 0 2px var(--wood); }
.pip.on { background: var(--green); } .pip.x { background: var(--cyan); }

/* ---------- kort ---------- */
#labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.lab { position: absolute; left: 0; top: 0; pointer-events: auto; display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; padding: 6px 13px 8px 8px; background: rgba(27, 20, 48, .93); color: #fff; text-align: left; white-space: nowrap; clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--night-d); will-change: transform; }
.lab b { font: 400 24px/1 var(--f-head); } .lab i { grid-column: 2; font-style: normal; font-size: 16px; line-height: 1; color: var(--stone-l); }
.lab .bd { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; }
.lab.route { box-shadow: inset 0 0 0 4px var(--gold); } .lab.route .bd { animation: bob .7s steps(2) infinite; }
.lab.done { box-shadow: inset 0 0 0 4px var(--green); }
.lab.lock b, .lab.lock i { color: var(--stone); }
.lab:focus-visible { box-shadow: inset 0 0 0 4px var(--cyan); outline: 0; }
.lab .st { display: flex; gap: 1px; margin-top: 3px; grid-column: 2; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.chip { position: absolute; top: calc(var(--sat) + 70px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 14px 9px; background: var(--night); color: #fff; font: 400 22px/1 var(--f-head); white-space: nowrap; clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--night-d), inset 0 0 0 6px var(--night-l); }
.chip .pips { display: flex; gap: 3px; } .chip .pip { width: 12px; height: 12px; background: var(--night-l); box-shadow: none; } .chip .pip.on { background: var(--gold); }

/* ---------- quest ---------- */
.qhead { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.qhead h2 { font-size: 36px; } .qhead .ex { font: 400 23px/1.05 var(--f-head); color: var(--ink-soft); margin-top: 2px; }
.npc { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: center; margin: 12px 0 10px; }
.npc img { width: 60px; height: 60px; display: block; box-shadow: 0 0 0 2px var(--wood), 0 0 0 4px var(--gold-d); }
.npc p { position: relative; padding: 8px 10px 9px; background: #fffaf0; box-shadow: 0 0 0 2px var(--wood); font-size: 20px; line-height: 1.1; }
.npc p b { font-family: var(--f-head); font-weight: 400; font-size: 22px; }
.steps { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 7px; }
.steps li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; font-size: 21px; line-height: 1.1; }
.steps li::before { content: ''; width: 10px; height: 10px; margin-top: 6px; background: var(--gold-d); box-shadow: 0 0 0 2px var(--wood); }
.rule { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 9px 12px 10px; background: #fff3c9; box-shadow: inset 0 0 0 2px var(--gold-d); font-size: 19px; line-height: 1.1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.chips span { padding: 3px 10px 5px; background: var(--wood); color: var(--parch); font: 400 21px/1.05 var(--f-head); }
.chips span.hi { background: var(--green-d); color: #fff; }
.sealed { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px; margin: 10px 0; background: var(--night); color: var(--parch); font-size: 20px; }

.count { position: absolute; left: 0; right: 0; top: calc(var(--sat) + 14px); text-align: center; pointer-events: none; font: 400 124px/.86 var(--f-head); color: var(--gold); text-shadow: var(--out), 0 10px 0 var(--night); z-index: 3; }
.count i { font-style: normal; font-size: 46px; color: #fff; margin-left: 4px; text-shadow: 3px 0 0 var(--night), -3px 0 0 var(--night), 0 3px 0 var(--night), 0 -3px 0 var(--night), 3px 3px 0 var(--night), -3px -3px 0 var(--night), 3px -3px 0 var(--night), -3px 3px 0 var(--night); }
.count small { display: block; font: 400 30px/1 var(--f-head); color: #fff; margin-top: 12px; text-shadow: 3px 0 0 var(--night), -3px 0 0 var(--night), 0 3px 0 var(--night), 0 -3px 0 var(--night), 3px 3px 0 var(--night), -3px -3px 0 var(--night), 3px -3px 0 var(--night), -3px 3px 0 var(--night); }
.count.pop { animation: pop .22s steps(3); }
@keyframes pop { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.work .round { font: 400 22px/1 var(--f-head); color: var(--gold); display: flex; justify-content: space-between; gap: 12px; }
.work .round span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .work .round span:last-child { flex: none; color: #fff; }
.work .cue { font: 400 32px/1 var(--f-head); color: #fff; margin: 8px 0 10px; min-height: 64px; display: flex; align-items: center; text-wrap: balance; }
.bar { height: 14px; background: var(--night-d); box-shadow: inset 0 0 0 2px var(--night-l); margin-bottom: 12px; }
.bar span { display: block; height: 100%; width: 0; background: var(--green); box-shadow: inset 0 -4px 0 var(--green-d); }
.work .btn.sm { font-size: 23px; min-height: 52px; }
.feel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.feel button { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 12px; background: #fffaf0; font: 400 24px/1 var(--f-head); color: var(--ink); clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--wood); }
.feel button:active { background: var(--gold-l); }
.gains { display: grid; gap: 8px; margin: 12px 0; }
.gain { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; padding: 8px 12px; background: rgba(58, 34, 6, .1); box-shadow: inset 0 0 0 2px var(--parch-d); font: 400 25px/1.05 var(--f-head); }
.gain small { display: block; font: 400 18px/1.1 var(--f-body); color: var(--ink-soft); }
.gain img { width: 56px; height: 56px; margin: -4px 0 -4px -10px; box-shadow: 0 0 0 2px var(--wood); }
.gain.friend { grid-template-columns: 56px 1fr; background: #fffaf0; box-shadow: inset 0 0 0 2px var(--gold-d); }
.bigfig { text-align: center; }
.bigfig .lv { font: 400 110px/.9 var(--f-logo); color: var(--gold-d); text-shadow: 3px 3px 0 var(--wood); }
.restbox { text-align: center; }
.restbox .n { font: 400 84px/.9 var(--f-head); color: var(--gold); }

/* ---------- sider (venner, rygsæk, voksen) ---------- */
#page { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: flex-end; pointer-events: auto; padding: calc(var(--sat) + 8px) calc(var(--sar) + 8px) calc(var(--sab) + 8px) calc(var(--sal) + 8px); background: rgba(12, 8, 24, .62); z-index: 10; }
#page.on { display: flex; }
#page.half { background: none; pointer-events: none; padding-top: calc(var(--sat) + 42vh); }
#page > .panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.page-h { display: flex; align-items: center; gap: 12px; padding: 20px 20px 10px; }
.page-h h2 { flex: 1; }
.page-b { flex: 1; min-height: 0; overflow: auto; padding: 4px 20px 22px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.page-f { padding: 10px 20px 20px; box-shadow: 0 -2px 0 var(--parch-d); }
.tabs { display: flex; gap: 6px; padding: 0 20px 10px; }
.tabs button { pointer-events: auto; flex: 1; padding: 7px 4px 9px; background: var(--parch-d); color: var(--ink); font: 400 23px/1 var(--f-head); box-shadow: inset 0 0 0 2px var(--wood); }
.tabs button[aria-selected="true"] { background: var(--wood); color: var(--parch); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.card { pointer-events: auto; display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; background: #fffaf0; color: var(--ink); text-align: left; box-shadow: inset 0 0 0 2px var(--wood); }
.card img, .card .unk { width: 100%; aspect-ratio: 1; display: block; background: var(--night); box-shadow: inset 0 0 0 2px var(--wood); }
.card .unk { display: grid; place-items: center; font: 400 64px/1 var(--f-head); color: var(--night-l); }
.card b { font: 400 24px/1 var(--f-head); margin-top: 4px; } .card i { font-style: normal; font-size: 17px; line-height: 1; color: var(--ink-soft); }
.card .st { display: flex; gap: 1px; margin-top: 2px; }
.card.off { background: var(--parch-d); }
.sec { margin: 18px 0 8px; font: 400 27px/1 var(--f-head); }
.sec:first-child { margin-top: 4px; }
.sw { display: flex; flex-wrap: wrap; gap: 8px; }
.sw button { pointer-events: auto; width: 44px; height: 44px; box-shadow: inset 0 0 0 3px var(--wood), inset 0 0 0 5px rgba(255, 255, 255, .35); }
.sw button[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--wood), inset 0 0 0 6px #fff, 0 0 0 3px var(--green-d); }
.sw button.txt { width: auto; padding: 0 12px 2px; background: #fffaf0; font: 400 22px/1 var(--f-head); color: var(--ink); }
.field { display: block; width: 100%; padding: 8px 12px 10px; background: #fffaf0; color: var(--ink); border: 0; border-radius: 0; box-shadow: inset 0 0 0 3px var(--wood); font: 400 26px/1 var(--f-head); -webkit-user-select: text; user-select: text; }
.field.small { font: 400 19px/1.1 var(--f-body); padding: 6px 8px 7px; box-shadow: inset 0 0 0 2px var(--wood); }
.gearlist { display: grid; gap: 6px; }
.gear { pointer-events: auto; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px 9px; background: #fffaf0; color: var(--ink); text-align: left; font: 400 23px/1 var(--f-head); box-shadow: inset 0 0 0 2px var(--wood); }
.gear small { font: 400 17px/1 var(--f-body); color: var(--ink-soft); }
.gear[aria-pressed="true"] { background: var(--green-l); }
.gear.locked { background: var(--parch-d); color: var(--ink-soft); }
.eq { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 8px; margin-bottom: 8px; background: #fffaf0; box-shadow: inset 0 0 0 2px var(--wood); }
.eq img { width: 76px; height: 76px; display: block; box-shadow: inset 0 0 0 2px var(--wood); }
.eq b { font: 400 25px/1 var(--f-head); } .eq i { font-style: normal; color: var(--ink-soft); } .eq p { font-size: 18px; line-height: 1.1; margin-top: 3px; }
.rules { display: grid; gap: 8px; }
.rules .rule { font-size: 22px; }
.rlist { list-style: none; padding: 0; display: grid; gap: 8px; }
.rlist li { padding: 8px 12px 9px; background: #fffaf0; box-shadow: inset 0 0 0 2px var(--parch-d); font-size: 19px; line-height: 1.1; }
.rlist b { display: block; font: 400 22px/1 var(--f-head); margin-bottom: 2px; }
/* voksen */
.set { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 2px solid var(--parch-d); }
.set:first-of-type { border-top: 0; }
.set b { font: 400 23px/1 var(--f-head); } .set p { grid-column: 1; font-size: 17px; line-height: 1.1; color: var(--ink-soft); }
.set .ctl { grid-row: span 2; }
.step { display: inline-flex; align-items: center; background: #fffaf0; box-shadow: inset 0 0 0 2px var(--wood); }
.step button { pointer-events: auto; width: 38px; height: 40px; font: 400 30px/1 var(--f-head); color: var(--ink); }
.step button:active { background: var(--gold-l); }
.step span { min-width: 40px; text-align: center; font: 400 26px/1 var(--f-head); }
.tog { pointer-events: auto; min-width: 70px; height: 40px; padding: 0 12px 2px; background: var(--parch-d); color: var(--ink); font: 400 22px/1 var(--f-head); box-shadow: inset 0 0 0 2px var(--wood); }
.tog[aria-pressed="true"] { background: var(--green); color: #12300a; }
.xt { width: 100%; border-collapse: collapse; font-size: 18px; }
.xt th { text-align: left; font: 400 19px/1 var(--f-head); color: var(--ink-soft); padding: 4px 4px 6px; }
.xt td { padding: 5px 4px; border-top: 2px solid var(--parch-d); vertical-align: middle; }
.xt td:first-child { font: 400 21px/1 var(--f-head); }
.xt .mini { width: 30px; height: 30px; background: var(--parch-d); font: 400 20px/1 var(--f-head); box-shadow: inset 0 0 0 2px var(--wood); pointer-events: auto; }
.xt .mini[aria-pressed="true"] { background: var(--green); }
.xt .step button { width: 28px; height: 32px; font-size: 24px; } .xt .step span { min-width: 30px; font-size: 22px; }
.logt { width: 100%; border-collapse: collapse; font-size: 18px; } .logt td { padding: 4px; border-top: 2px solid var(--parch-d); }
.note { padding: 10px 12px 11px; background: #fff3c9; box-shadow: inset 0 0 0 2px var(--gold-d); font-size: 18px; line-height: 1.15; }
textarea.field { min-height: 90px; resize: vertical; font: 400 14px/1.2 ui-monospace, Menlo, Consolas, monospace; -webkit-user-select: text; user-select: text; }

/* ---------- dialog, plakat, toast ---------- */
#modal { position: absolute; inset: 0; display: none; place-items: center; padding: calc(var(--sat) + 12px) 12px calc(var(--sab) + 12px); background: rgba(12, 8, 24, .74); pointer-events: auto; z-index: 20; }
#modal.on { display: grid; }
#modal > .panel { width: min(440px, 100%); max-height: 100%; overflow: auto; scrollbar-width: none; }
#modal > .panel.wide { width: min(760px, 100%); padding: 14px; }
.m-t { font: 400 38px/1 var(--f-head); } .m-b { margin: 10px 0 16px; font-size: 21px; line-height: 1.15; }
.m-b p + p { margin-top: 8px; }
.m-btn { display: grid; gap: 8px; }
.poster { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 0 0 2px var(--wood); }
.poster-wrap { max-height: 70vh; overflow: auto; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
#toast { position: absolute; left: 50%; bottom: calc(var(--sab) + 96px); transform: translateX(-50%); padding: 8px 14px 10px; background: var(--night); color: #fff; font: 400 22px/1 var(--f-head); clip-path: var(--notch); box-shadow: inset 0 0 0 4px var(--green); opacity: 0; transition: opacity .2s steps(3); z-index: 25; white-space: nowrap; }
#toast.on { opacity: 1; }

/* ---------- start ---------- */
#splash { position: absolute; inset: 0; display: grid; place-items: end center; padding: 24px 24px calc(var(--sab) + 9vh); pointer-events: auto; background: linear-gradient(rgba(27, 20, 48, 0) 30%, rgba(27, 20, 48, .82) 62%); z-index: 28; text-align: center; }
#splash.off { display: none; }
.logo { font: 400 clamp(72px, 22vw, 136px)/.9 var(--f-logo); color: var(--gold); text-shadow: var(--out), 0 10px 0 var(--night); }
.tag { margin: 14px 0 26px; font: 400 30px/1 var(--f-head); color: #fff; text-shadow: 3px 0 0 var(--night), -3px 0 0 var(--night), 0 3px 0 var(--night), 0 -3px 0 var(--night), 3px 3px 0 var(--night), -3px -3px 0 var(--night), 3px -3px 0 var(--night), -3px 3px 0 var(--night); }
.splash-in { width: min(360px, 100%); }
.splash-note { margin-top: 14px; font-size: 19px; color: #fff; text-shadow: 2px 2px 0 var(--night); }
#wipe { position: absolute; inset: 0; background: var(--night); opacity: 0; pointer-events: none; transition: opacity .18s steps(4); z-index: 30; }
#wipe.on { opacity: 1; pointer-events: auto; }

/* ---------- bredformat (tablet og liggende telefon) ---------- */
@media (orientation: landscape) and (min-width: 620px) {
  .dock { left: auto; top: calc(var(--sat) + 68px); width: min(400px, 45%); height: auto; }
  .dock.above-nav { bottom: calc(var(--sab) + 8px); height: auto; }
  #nav { right: auto; width: min(400px, 48%); }
  .count { right: min(416px, 46%); }
  .chip { left: calc(50% - min(200px, 22%)); }
  #page { align-items: flex-end; }
  #page > .panel { width: min(560px, 100%); }
  #page.half { padding-top: calc(var(--sat) + 8px); }
  #page.half > .panel { width: min(430px, 48%); }
  #page.full > .panel { width: min(860px, 100%); align-self: center; }
  #toast { bottom: calc(var(--sab) + 20px); }
  #splash { place-items: center end; padding: 24px 5vw; background: linear-gradient(90deg, rgba(27, 20, 48, 0) 34%, rgba(27, 20, 48, .85) 60%); }
  .splash-in { width: min(430px, 42vw); }
  .logo { font-size: clamp(56px, 8.4vw, 104px); }
  .tag { margin: 8px 0 16px; font-size: clamp(20px, 2.6vw, 30px); }
}
@media (max-height: 700px) and (orientation: portrait) {
  .home h1 { font-size: 34px; } .home .line { display: none; } .meter { margin: 8px 0 10px; padding: 7px 10px 8px; gap: 6px 10px; } .meter b { font-size: 22px; }
  .btn.big { min-height: 58px; font-size: 30px; } .parch { padding: 18px 16px; }
  .dock { height: calc(100% - 170px - var(--sat)); } .dock.above-nav { height: calc(100% - 250px - var(--sat)); }
  .split .pb { padding: 18px 16px 4px; } .split .pf { padding: 8px 16px 16px; } .qhead h2 { font-size: 30px; } .steps li { font-size: 19px; } .npc { margin: 8px 0 6px; } .chips { margin: 8px 0 6px; }
  .count { font-size: 100px; }
}
@media (max-height: 520px) {
  .parch { padding: 16px; } .home h1 { font-size: 32px; } .home .line { font-size: 18px; } .meter { margin: 8px 0; padding: 6px 10px 7px; gap: 5px 10px; } .meter b { font-size: 21px; }
  .btn.big { min-height: 52px; font-size: 28px; } .dock { top: calc(var(--sat) + 62px); }
  .split .pb { padding: 14px 16px 4px; } .split .pf { padding: 8px 16px 14px; } .qhead h2 { font-size: 28px; } .steps li { font-size: 18px; } .npc { margin: 6px 0; }
  .count { font-size: 92px; } .count small { font-size: 24px; margin-top: 6px; }
  .work .cue { font-size: 26px; min-height: 52px; }
  .plate .face, .plate .face img { width: 36px; height: 36px; } .who i { display: none; }
}
@media (max-width: 370px) {
  .who b { max-width: 104px; } .xpbar { width: 88px; }
  .btn { font-size: 25px; padding-left: 12px; padding-right: 12px; } .work .btn.sm { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
