:root {
  --bg: #1a120b; --card: #2a1d12; --line: #4a3422; --tx: #f6ead8; --muted: #c4ad8f;
  --amber: #e0a23a; --gold: #f2c86b; --red: #d9534f;
  --r: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; background: radial-gradient(120% 60% at 50% 0%, #3a2614 0%, var(--bg) 60%); }
h1, h2 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 28px; } h2 { font-size: 21px; }
.muted { color: var(--muted); } .center { text-align: center; }
.wrap { max-width: 640px; margin: 0 auto; padding: 12px 14px calc(40px + env(safe-area-inset-bottom)); }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(26, 18, 11, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { font-weight: 800; font-size: 19px; letter-spacing: 0.2px; }
.hvem { font: inherit; font-size: 15px; color: var(--tx); background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-top: 16px; }
.stack { display: grid; gap: 12px; }
input, textarea { width: 100%; font: inherit; color: var(--tx); background: #1f150d; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.btn { font: inherit; font-weight: 700; color: #1a120b; background: var(--amber); border: 0; border-radius: 12px; padding: 13px 16px; cursor: pointer; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.stor { font-size: 19px; padding: 16px; }
.link { font: inherit; color: var(--muted); background: none; border: 0; padding: 8px 0; text-decoration: underline; cursor: pointer; display: inline-block; }
.link.fare { color: var(--red); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.tab { font: inherit; font-weight: 700; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px; cursor: pointer; }
.tab.on { color: #1a120b; background: var(--gold); border-color: var(--gold); }
.hint { background: rgba(224, 162, 58, 0.14); border: 1px solid rgba(224, 162, 58, 0.45); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }

.liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.kort { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.kort.vinder { border-color: var(--gold); background: linear-gradient(90deg, rgba(242, 200, 107, 0.14), transparent 70%), var(--card); }
.plads { width: 30px; flex: none; text-align: center; font-size: 21px; font-weight: 800; color: var(--muted); }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; background: #1f150d; }
.thumb.ingen { display: grid; place-items: center; font-size: 28px; }
.midt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.navn { font-weight: 800; font-size: 18px; overflow-wrap: anywhere; }
.info { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.chip { font-size: 13px; padding: 2px 8px; border-radius: 99px; background: #1f150d; border: 1px solid var(--line); }
.chip b { margin-left: 5px; color: var(--gold); }
.chip.tom { opacity: 0.6; } .chip.mig { border-color: var(--amber); }
.snit { flex: none; text-align: right; font-size: 30px; font-weight: 900; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; }
.snit small { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }

.foto-felt { position: relative; display: grid; place-items: center; min-height: 160px; border: 2px dashed var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; color: var(--muted); font-weight: 700; }
.foto-felt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-felt img { width: 100%; max-height: 320px; object-fit: contain; }
.foto-felt img:not([hidden]) + span { position: absolute; bottom: 8px; background: rgba(0, 0, 0, 0.6); padding: 4px 10px; border-radius: 99px; color: var(--tx); }

.ark { width: min(560px, 100vw); max-height: 92vh; margin: auto auto 0; padding: 0; color: var(--tx); background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 0 0; }
.ark::backdrop { background: rgba(0, 0, 0, 0.6); }
@media (min-width: 600px) { .ark { margin: auto; border-radius: 20px; } }
.ark-foto { width: 100%; max-height: 38vh; object-fit: cover; display: block; }
.ark-body { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.ark-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.x { font: inherit; font-size: 22px; color: var(--tx); background: none; border: 0; width: 44px; height: 44px; cursor: pointer; }
.label { margin: 4px 0 0; font-weight: 700; }
.point { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.p { font: inherit; font-size: 20px; font-weight: 800; color: var(--tx); background: #1f150d; border: 1px solid var(--line); border-radius: 12px; min-height: 50px; cursor: pointer; }
.p.valgt { color: #1a120b; background: var(--gold); border-color: var(--gold); }
.andres p { margin: 4px 0; font-size: 15px; }
.mere summary { color: var(--muted); cursor: pointer; }
.mere { display: grid; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); background: var(--gold); color: #1a120b; font-weight: 700; padding: 10px 16px; border-radius: 12px; transition: transform 0.25s; z-index: 50; max-width: 90vw; }
.toast.vis { transform: translate(-50%, 0); }
[hidden] { display: none !important; }
