/* Coop-o-ween · Celleblok 2620 */

@font-face { font-family: 'Black Ops One'; src: url('../fonts/black-ops-one.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Special Elite'; src: url('../fonts/special-elite.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('../fonts/archivo-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('../fonts/archivo-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('../fonts/archivo-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --bg: #0f1211;
  --bg-deep: #070908;
  --wall: #1a211c;
  --surface: #2f3a32;
  --door-a: #3a463d;
  --door-b: #2b352e;
  --line: #3d4a40;
  --muted: #8fa89a;
  --text: #e8eed8;
  --yellow: #e0b400;
  --yellow-hi: #f5cc2a;
  --red: #ef4444;
  --red-ink: #b3261e;
  --rust: #7a3418;
  --green: #4ade80;
  --blue: #60a5fa;
  --paper: #e9e2cc;
  --paper-2: #ece5d2;
  --ink: #1b1a17;
  --ink-muted: #5c574a;
  --folder: #c9ae78;
  --stencil: 'Black Ops One', 'Impact', sans-serif;
  --type: 'Special Elite', 'Courier New', monospace;
  --body: 'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
}
/* Støjlag og slidte ridser oven på betonen */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[hidden] { display: none !important; }
a { color: var(--yellow); }
a:hover { color: var(--yellow-hi); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.stencil { font-family: var(--stencil); letter-spacing: .04em; font-weight: 400; }
.type { font-family: var(--type); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
}
.topbar--solid { background: var(--wall); border-bottom: 1px solid var(--surface); }
.brand { font-family: var(--type); font-size: 13px; letter-spacing: 3px; color: var(--muted); text-decoration: none; }
.topbar__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn, .lang-btn {
  height: 44px; min-width: 44px; padding: 0 12px;
  background: transparent; border: 1px solid var(--line); border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted);
}
.lang-btn { font-family: var(--stencil); font-size: 14px; letter-spacing: 1px; }
.lang-btn span { color: #5b6b5f; }
.lang-btn span.is-active { color: var(--text); }
.icon-btn:hover, .lang-btn:hover { border-color: var(--muted); }
.topbar__info { font-size: 13px; color: var(--muted); line-height: 1.35; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px;
  background: none; border: 0; color: var(--yellow); font-family: var(--type); font-size: 15px; text-decoration: none;
}
.link-btn:hover { color: var(--yellow-hi); }
.link-btn--muted { color: var(--muted); font-family: var(--body); font-size: 14px; }

/* ---------- Knapper ---------- */
.btn-primary {
  height: 54px; padding: 0 20px; border: 0; border-radius: 4px;
  background: var(--yellow); color: var(--bg);
  font-family: var(--stencil); font-size: 17px; letter-spacing: 1.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.25);
  text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.btn-primary:hover { background: var(--yellow-hi); color: var(--bg); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; }
.btn-ghost {
  height: 48px; padding: 0 14px; background: transparent; border: 1px solid var(--line); border-radius: 4px;
  color: var(--text); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.hazard { height: 8px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, var(--bg) 10px 20px); opacity: .8; }

/* ---------- Lysstofrør ---------- */
.tube {
  width: 180px; height: 6px; margin: 0 auto; border-radius: 3px; background: var(--text);
  box-shadow: 0 0 28px 8px rgba(232,238,216,.22), 0 0 110px 30px rgba(232,238,216,.07);
  animation: tube-flicker 1.8s ease-out 1;
}
@keyframes tube-flicker {
  0% { opacity: .15; } 18% { opacity: .9; } 26% { opacity: .35; } 40% { opacity: 1; } 55% { opacity: .6; } 70%, 100% { opacity: 1; }
}

/* =========================================================
   PORTEN
   ========================================================= */
.view-gate {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: radial-gradient(ellipse 120% 60% at 50% 0%, #1d2620 0%, var(--bg) 60%);
  position: relative; overflow: hidden;
}
.gate__walls { display: none; }
.gate__main {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 4px 20px 0; position: relative; z-index: 1;
}
.gate__title {
  margin: 8px 0 0; font-family: var(--stencil); font-size: clamp(40px, 12vw, 76px); line-height: 1; letter-spacing: .1em;
  text-align: center; text-shadow: 0 0 28px rgba(239,68,68,.25);
}
.door {
  position: relative; width: 100%; max-width: 400px; flex: 1; min-height: 430px;
  background: linear-gradient(180deg, var(--door-a) 0%, var(--door-b) 100%);
  border: 3px solid var(--wall); border-bottom: 0; border-radius: 6px 6px 0 0;
  box-shadow: inset 0 0 44px rgba(0,0,0,.6), 0 0 70px rgba(143,168,154,.08);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 26px 22px 20px;
  transition: transform 1.1s cubic-bezier(.6,.05,.3,1), opacity 1.1s ease;
}
.door__rivet { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--wall); }
.door__rivet:nth-child(1) { top: 10px; left: 10px; } .door__rivet:nth-child(2) { top: 10px; right: 10px; }
.door__rivet:nth-child(3) { bottom: 10px; left: 10px; } .door__rivet:nth-child(4) { bottom: 10px; right: 10px; }
.door__rust { position: absolute; top: 160px; left: 28px; width: 70px; height: 28px; background: var(--rust); opacity: .35; border-radius: 40% 60% 50% 45%; filter: blur(3px); }
.door__slit { width: 160px; height: 48px; background: #050706; border: 3px solid var(--wall); background-image: repeating-linear-gradient(90deg, transparent 0 20px, var(--door-a) 20px 26px); }
.door__sign { font-family: var(--stencil); font-size: 12px; letter-spacing: 2px; color: #c9b27a; background: var(--wall); padding: 6px 10px; border: 1px solid #5b4a1f; text-align: center; }
.door__handle { margin-top: auto; align-self: flex-end; width: 18px; height: 72px; background: var(--wall); border-radius: 4px; }

.status { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.status__lamp { width: 14px; height: 14px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px var(--red), 0 0 30px rgba(239,68,68,.5); transition: background .3s, box-shadow .3s; }
.status__text { font-family: var(--type); font-size: 14px; color: #fca5a5; }
.status[data-state="ok"] .status__lamp { background: var(--green); box-shadow: 0 0 14px var(--green), 0 0 30px rgba(74,222,128,.5); }
.status[data-state="ok"] .status__text { color: #a7f3c0; }
.status[data-state="guard"] .status__lamp { background: var(--blue); box-shadow: 0 0 14px var(--blue), 0 0 30px rgba(96,165,250,.5); }
.status[data-state="guard"] .status__text { color: #bfdbfe; }
.status[data-state="busy"] .status__lamp { background: var(--yellow); box-shadow: 0 0 14px var(--yellow); }
.status[data-state="busy"] .status__text { color: #fde68a; }

.display {
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px;
  width: 100%; padding: 10px; background: #070908; border: 2px solid var(--wall);
}
.display__cell {
  height: 38px; display: flex; align-items: center; justify-content: center;
  background: #1a0d0d; border: 1px solid #3a1c1c;
  font-family: var(--stencil); font-size: 19px; color: #7a3a3a;
  transition: color .2s, background .2s, border-color .2s;
}
.display__cell.is-filled { color: #fca5a5; }
.display[data-state="ok"] .display__cell { background: #0d1a10; border-color: #1f3324; color: #7dff9e; text-shadow: 0 0 8px rgba(125,255,158,.6); }
.display[data-state="guard"] .display__cell { background: #0d1320; border-color: #1f2c44; color: #93c5fd; text-shadow: 0 0 8px rgba(147,197,253,.6); }
.display[data-state="denied"] { animation: shake .4s ease 1; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.gate__form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 10px; padding: 18px 0 22px; }
.gate__label { font-family: var(--stencil); font-size: 16px; letter-spacing: 2px; }
.gate__row { display: flex; gap: 8px; }
.gate__input {
  flex: 1; min-width: 0; height: 54px; background: #070908; border: 2px solid var(--line); border-radius: 4px;
  padding: 0 14px; color: var(--text); font-family: var(--stencil); font-size: 20px; letter-spacing: 3px; text-transform: uppercase;
}
.gate__input::placeholder { color: #45524a; letter-spacing: 4px; }
.gate__input:focus { border-color: var(--yellow); outline: none; }
.gate__msg { min-height: 20px; font-size: 14px; color: #fca5a5; }
.gate__hint { font-size: 13px; color: var(--muted); display: none; }
.gate__skip {
  position: absolute; inset: 0; z-index: 5; background: transparent; border: 0;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 28px;
  font-family: var(--type); color: var(--muted); font-size: 13px;
}
.view-gate.is-open .door { transform: translateY(-110%); opacity: 0; }
.view-gate.is-open .gate__form { opacity: 0; transition: opacity .5s; }

/* =========================================================
   GANGEN
   ========================================================= */
.view-hall { min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse 100% 40% at 50% 0%, #1d2620 0%, var(--bg) 70%); }
.hall__layout { display: flex; }
.hall__main { flex: 1; min-width: 0; padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.hall__head { display: flex; flex-direction: column; gap: 6px; }
.hall__title { margin: 0; font-family: var(--stencil); font-size: clamp(30px, 8vw, 48px); letter-spacing: .04em; line-height: 1.05; }
.hall__sub { margin: 0; font-size: 15px; color: var(--muted); }
.hall__sub strong { color: var(--text); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot--open { background: var(--green); } .dot--near { background: var(--yellow); } .dot--locked { background: var(--red); }

.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border: 1px solid #5b4a1f; background: rgba(224,180,0,.08); border-radius: 4px; font-size: 14px;
}
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cell {
  position: relative; height: 108px; padding: 10px; text-align: left;
  background: linear-gradient(180deg, #34403a 0%, #29332d 100%);
  border: 2px solid var(--wall); border-radius: 4px 4px 0 0;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  color: var(--text); transition: border-color .15s, box-shadow .15s, transform .08s;
}
.cell:not(:disabled):hover { border-color: var(--muted); }
.cell:not(:disabled):active { transform: translateY(1px); }
.cell.is-selected { border: 3px solid var(--yellow); box-shadow: 0 0 22px rgba(224,180,0,.35); }
.cell__top { display: flex; justify-content: space-between; align-items: center; }
.cell__slit { width: 36px; height: 10px; background: #050706; background-image: repeating-linear-gradient(90deg, transparent 0 6px, #34403a 6px 9px); }
.cell__lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.cell__time { font-family: var(--stencil); font-size: 26px; letter-spacing: 1px; line-height: 1; }
.cell__label { font-size: 12px; font-weight: 600; color: var(--muted); }
.cell[data-state="near"] .cell__lamp { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); animation: lamp-pulse 2.4s ease-in-out infinite; }
.cell[data-state="near"] .cell__label { color: var(--yellow); }
.cell[data-state="locked"] .cell__lamp, .cell[data-state="closed"] .cell__lamp { background: var(--red); box-shadow: 0 0 10px var(--red); }
@keyframes lamp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.cell__bars {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(90deg, rgba(10,12,11,.55) 0 12px, #4a4f4c 12px 16px);
}
.cell__stamp { transform: rotate(-12deg); border: 2px solid var(--red); color: var(--red); background: rgba(15,18,17,.85); padding: 2px 8px; font-family: var(--stencil); font-size: 16px; letter-spacing: 2px; }
.cell[data-state="closed"] .cell__bars { background: rgba(10,12,11,.7); }
.cell[data-state="closed"] .cell__stamp { border-color: var(--muted); color: var(--muted); }

.dropin { padding: 14px; border: 1px dashed var(--line); border-radius: 4px; display: flex; flex-direction: column; gap: 4px; }
.dropin__title { font-family: var(--type); font-size: 15px; }
.dropin__text { font-size: 13px; color: var(--muted); }

/* ---------- Indskrivning (sheet på mobil, panel på PC) ---------- */
.panel {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto;
  background: radial-gradient(ellipse 100% 40% at 50% 0%, #1d2620 0%, var(--bg) 70%);
  padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 14px;
  animation: sheet-in .28s ease-out;
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.panel__back { align-self: flex-start; }
.panel__close { display: none; }
.panel__kicker { font-family: var(--type); font-size: 14px; color: var(--muted); }
.panel__title { margin: 0; font-family: var(--stencil); font-size: 38px; letter-spacing: 1px; line-height: 1.05; }
.panel__free { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

.folder { position: relative; background: var(--folder); border-radius: 4px 14px 4px 4px; padding: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); margin-top: 10px; }
.folder::before { content: ''; position: absolute; top: -10px; left: 18px; width: 110px; height: 16px; background: var(--folder); border-radius: 6px 6px 0 0; }
.sheet { background: var(--paper-2); color: var(--ink); padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.sheet__title { font-family: var(--stencil); font-size: 14px; letter-spacing: 2px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-family: var(--type); font-size: 12px; color: var(--ink-muted); }
.field__input {
  height: 50px; background: #fbf8ee; border: 2px solid var(--ink); border-radius: 2px; padding: 0 12px;
  font-family: var(--type); font-size: 18px; color: var(--ink);
}
.field__input:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper__btn {
  width: 56px; height: 56px; border: 2px solid var(--ink); background: #fbf8ee; border-radius: 2px; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.stepper__btn:disabled { opacity: .3; }
.stepper__value { flex: 1; text-align: center; font-family: var(--stencil); font-size: 40px; }
.field__help { font-size: 13px; color: var(--ink-muted); text-align: center; }
.times { border-top: 1px dashed var(--ink); padding-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.times__label { font-family: var(--type); font-size: 10px; color: var(--ink-muted); }
.times__value { font-family: var(--stencil); font-size: 24px; }
.q { color: var(--red-ink); }
.form-error { min-height: 20px; font-size: 14px; color: #fca5a5; }
.panel__submit { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.panel__submit .btn-primary { width: 100%; height: 56px; font-size: 18px; letter-spacing: 2px; }

/* ---------- Sagsakten (dialog) ---------- */
.case {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; background: transparent; color: var(--ink);
  overflow: visible;
}
.case::backdrop { background: rgba(5,7,6,.82); }
.case__wrap { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.case__bar { display: flex; justify-content: flex-end; }
.case__close { width: 44px; height: 44px; background: transparent; border: 0; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.case .folder { margin-top: 12px; min-height: 0; display: flex; flex-direction: column; }
.case__paper {
  position: relative; overflow-y: auto; background: var(--paper-2); color: var(--ink); padding: 22px 18px 26px;
  display: flex; flex-direction: column; gap: 14px;
}
.case__stamp { position: absolute; top: 24px; right: 12px; transform: rotate(8deg); border: 3px solid var(--red-ink); color: var(--red-ink); padding: 2px 8px; font-family: var(--stencil); font-size: 18px; letter-spacing: 3px; opacity: .8; }
.case__no { font-family: var(--type); font-size: 11px; color: var(--ink-muted); padding-right: 150px; }
.case__title { margin: 0; font-family: var(--stencil); font-size: 24px; letter-spacing: 1px; }
.facts { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 10px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-family: var(--type); font-size: 13px; }
.facts dt { font-size: 10px; color: var(--ink-muted); }
.facts dd { margin: 0; }
.story { font-family: var(--type); font-size: 14.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 12px; }
.story p { margin: 0; white-space: pre-line; }
.redacted { background: var(--ink); color: var(--ink); border-radius: 1px; user-select: none; }
.case__h { margin: 8px 0 0; font-family: var(--stencil); font-size: 16px; letter-spacing: 2px; border-top: 1px dashed var(--ink); padding-top: 14px; }
.how { margin: 0; padding-left: 22px; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.how__drop { margin: 0; font-size: 14px; color: var(--ink-muted); }
.faq { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.faq dt { font-weight: 800; font-size: 15px; }
.faq dd { margin: 2px 0 0; font-size: 15px; }

/* =========================================================
   VAGTRUMMET
   ========================================================= */
.view-guard { min-height: 100vh; min-height: 100dvh; background: #0b0d0c; }
.guard__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #22302a; }
.guard__title { display: flex; align-items: center; gap: 10px; font-family: var(--stencil); font-size: 20px; letter-spacing: 1px; margin: 0; }
.guard__lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.guard__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.guard__tools .btn-ghost { height: 44px; font-size: 13px; font-weight: 400; color: var(--muted); }
.guard__body { max-width: 760px; margin: 0 auto; padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: #151a17; border-radius: 4px; padding: 10px; }
.stat__label { font-size: 11px; color: var(--muted); }
.stat__value { font-size: 22px; font-weight: 800; }
.stat__value small { font-size: 13px; color: var(--muted); font-weight: 400; }
.slotgroup { display: flex; flex-direction: column; gap: 4px; }
.slotgroup__head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #22302a; padding-bottom: 6px; }
.slotgroup__time { font-family: var(--stencil); font-size: 22px; }
.slotgroup__count { font-size: 13px; font-weight: 600; color: var(--muted); }
.slotgroup__count.is-full { color: #ef6b6b; }
.slotgroup__none { font-size: 13px; color: #5b6b5f; padding: 2px 0 6px; }
.row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.row__main { flex: 1; min-width: 0; }
.row__name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.row__meta { font-size: 11px; color: var(--muted); font-family: var(--type); }
.row__pers { flex-shrink: 0; padding: 6px 10px; border-radius: 4px; background: #1f2a23; border: 1px solid #34443a; font-size: 14px; font-weight: 800; white-space: nowrap; }
.row__del {
  flex-shrink: 0; min-width: 44px; height: 44px; padding: 0 10px; background: transparent; border: 1px solid #3a2323; border-radius: 4px; color: #ef6b6b;
  display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 13px;
}
.row__del.is-confirm { background: #b3261e; border-color: #b3261e; color: #fff; }

/* =========================================================
   INDSÆTTELSESKORTET
   ========================================================= */
.view-card { min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse 100% 50% at 50% 20%, #1d2620 0%, var(--bg) 70%); display: flex; flex-direction: column; }
.cardpage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px 20px 36px; }
.cardpage__intro { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.cardpage__kicker { font-family: var(--type); font-size: 14px; color: var(--muted); }
.cardpage__title { margin: 0; font-family: var(--stencil); font-size: clamp(28px, 8vw, 48px); letter-spacing: .04em; line-height: 1; }
.cardpage__side { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.cardpage__save { font-family: var(--type); font-size: 14px; color: #c9b27a; text-align: center; white-space: pre-line; }
.cardpage__actions { display: flex; flex-direction: column; gap: 10px; }
.cardpage__actions .btn-primary { width: 100%; }
.cardpage__two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cardpage__tip { padding: 12px 14px; background: #151a17; border: 1px solid var(--surface); border-radius: 4px; font-size: 13px; color: var(--muted); display: none; }
.cardpage__cancel { align-self: center; min-height: 44px; background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 14px; }
.cancelbox { border: 1px solid #5a2a2a; background: rgba(179,38,30,.1); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cancelbox__q { font-family: var(--type); font-size: 16px; }
.cancelbox__row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-danger { height: 48px; padding: 0 14px; border: 0; border-radius: 4px; background: var(--red-ink); color: #fff; font-weight: 800; }
.cardpage__msg { max-width: 420px; text-align: center; font-family: var(--type); font-size: 17px; color: var(--text); padding: 30px 0; display: flex; flex-direction: column; gap: 18px; align-items: center; }

.idcard {
  position: relative; width: 100%; max-width: 420px;
  background: var(--paper); color: var(--ink); border-radius: 6px; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 12px 44px rgba(0,0,0,.6);
  transform: rotate(-1deg);
}
.idcard__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.idcard__title { font-family: var(--stencil); font-size: 14px; letter-spacing: 1px; }
.idcard__block { font-family: var(--type); font-size: 12px; }
.idcard__body { display: flex; gap: 14px; }
.mugshot {
  width: 110px; height: 136px; flex-shrink: 0; position: relative; overflow: hidden;
  background-color: #cfc6ab; background-image: repeating-linear-gradient(180deg, transparent 0 16px, rgba(27,26,23,.35) 16px 17px);
  border: 2px solid var(--ink);
}
.mugshot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mugshot__no { position: absolute; bottom: 6px; left: 6px; background: var(--ink); color: var(--paper); font-family: var(--type); font-size: 10px; padding: 2px 4px; }
.idcard__fields { display: flex; flex-direction: column; gap: 8px; font-family: var(--type); min-width: 0; }
.idcard__label { font-size: 10px; color: var(--ink-muted); }
.idcard__value { font-size: 16px; overflow-wrap: anywhere; }
.idcard__times { border-top: 1px dashed var(--ink); padding-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-family: var(--type); }
.idcard__time { font-family: var(--stencil); font-size: 28px; line-height: 1.1; }
.idcard__where { grid-column: span 2; font-size: 12px; }
.idcard__stamp {
  position: absolute; right: 14px; top: 104px; transform: rotate(-14deg);
  border: 3px solid var(--red-ink); color: var(--red-ink); padding: 2px 10px;
  font-family: var(--stencil); font-size: 24px; letter-spacing: 3px; opacity: .85; background: rgba(233,226,204,.4);
}
.idcard__stamp.is-slam { animation: stamp .45s cubic-bezier(.2,1.6,.4,1) 1 both; animation-delay: .35s; }
@keyframes stamp { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: .85; } }

/* ---------- Mobil-specifikke justeringer ---------- */
.gate__form { max-width: none; padding: 6px 0 0; }
.hall__tools { justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.hall__tools .legend { flex: 1 1 100%; }
.panel__form { display: flex; flex-direction: column; gap: 12px; flex: 1; }
#guard-list { display: flex; flex-direction: column; gap: 18px; }
.link-btn { white-space: nowrap; }
.idcard__stamp { top: 168px; right: 10px; font-size: 18px; }
@media (max-width: 479px) {
  .view-card .topbar .brand { display: none; }
  .view-card .topbar { justify-content: flex-end; }
  .view-hall .topbar__info { font-size: 12px; }
}
@media (max-width: 899px) {
  .cardpage__side { display: contents; }
  .cardpage__intro { order: -1; }
  .cardpage__save, .cardpage__actions, .cardpage__cancel, .cancelbox { order: 1; width: 100%; max-width: 420px; }
  .cardpage__cancel { width: auto; }
}

/* =========================================================
   PC-layout
   ========================================================= */
@media (min-width: 900px) {
  .topbar { padding: 14px 40px; }
  .brand { font-size: 14px; }

  .view-gate { background: radial-gradient(ellipse 50% 70% at 50% 45%, #25302a 0%, #141917 45%, #070908 100%); }
  .gate__walls { display: block; position: absolute; inset: 0; pointer-events: none; }
  .gate__walls::before, .gate__walls::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 29%;
    background: repeating-linear-gradient(180deg, rgba(58,70,61,.18) 0 60px, rgba(0,0,0,.25) 60px 62px);
  }
  .gate__walls::before { left: 0; clip-path: polygon(0 0, 100% 22%, 100% 78%, 0 100%); }
  .gate__walls::after { right: 0; clip-path: polygon(0 22%, 100% 0, 100% 100%, 0 78%); }
  .gate__main { padding-top: 0; }
  .door { max-width: 420px; min-height: 0; }
  .gate__form { padding-bottom: 36px; }
  .gate__hint { display: block; }

  .hall__main { padding: 32px 40px 40px; gap: 18px; }
  .hall__tools { margin-top: 0; flex-wrap: nowrap; }
  .hall__tools .legend { flex: 0 0 auto; margin-right: 12px; }
  .hall__headrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
  .hall__sub { font-size: 17px; }
  .cells { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .cell { height: 190px; padding: 14px; }
  .cell__slit { width: 56px; height: 14px; }
  .cell__lamp { width: 12px; height: 12px; }
  .cell__time { font-size: 34px; }
  .cell__label { font-size: 14px; }
  .cell__stamp { font-size: 20px; }
  .dropin { flex-direction: row; align-items: baseline; gap: 12px; }
  .dropin__title { flex-shrink: 0; font-size: 16px; }
  .dropin__text { font-size: 14px; }

  .panel {
    position: sticky; top: 0; inset: auto; height: 100vh; width: 420px; flex-shrink: 0;
    background: #151a17; border-left: 1px solid var(--surface); padding: 24px 28px; animation: panel-in .25s ease-out;
  }
  @keyframes panel-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
  .panel__back { display: none; }
  .panel__close { display: flex; }
  .panel__title { font-size: 36px; }

  .cardpage { flex-direction: row; justify-content: center; align-items: center; gap: 72px; padding: 40px; flex-wrap: wrap; }
  .cardpage__intro { text-align: left; order: 0; }
  .idcard { max-width: 560px; padding: 24px; gap: 18px; transform: rotate(-1.5deg); }
  .idcard__title { font-size: 18px; letter-spacing: 2px; }
  .idcard__block { font-size: 14px; }
  .mugshot { width: 160px; height: 196px; }
  .mugshot__no { font-size: 12px; bottom: 8px; left: 8px; padding: 2px 6px; }
  .idcard__label { font-size: 11px; }
  .idcard__value { font-size: 22px; }
  .idcard__time { font-size: 40px; }
  .idcard__where { font-size: 14px; }
  .idcard__stamp { top: 222px; right: 28px; font-size: 30px; border-width: 4px; padding: 4px 14px; }
  .panel__submit { margin-top: 8px; }
  .cardpage__side { max-width: 360px; }
  .cardpage__side .cardpage__intro { gap: 10px; }
  .cardpage__save { text-align: left; font-size: 16px; }
  .cardpage__tip { display: block; }
  .cardpage__cancel { align-self: flex-start; }
}

/* Ingen animationer for dem, der har slået "reducer bevægelse" til */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Print (blækvenligt)
   ========================================================= */
@media print {
  body { background: #fff !important; color: #000; }
  body::before, .topbar, .cardpage__intro, .cardpage__actions, .cardpage__tip, .cardpage__cancel, .cancelbox, .no-print { display: none !important; }
  .view-card, .cardpage { background: #fff !important; min-height: 0; padding: 0; display: block; }
  .cardpage__side { max-width: none; }
  .cardpage__save { color: #000; text-align: center; margin-top: 16px; }
  .idcard { transform: none; box-shadow: none; border: 2px solid #000; background: #fff; max-width: 150mm; margin: 10mm auto 0; }
  .mugshot { background-color: #fff; }
  .idcard__stamp { background: #fff; }
}
