:root { --vand: #186880; --papir: #f6f3ec; --blaek: #16323a; --daempet: #5c7178; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--blaek); background: var(--vand); }
a { color: inherit; }

/* Kortsiden */
#kort { position: fixed; inset: 0; background: var(--vand); }
.skilt { position: fixed; top: 16px; left: 16px; max-width: calc(100vw - 32px); padding: 10px 14px;
  background: var(--papir); border-radius: 12px; box-shadow: 0 2px 12px rgb(0 0 0 / .25); }
.skilt .sti { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--daempet); text-decoration: none; }
.skilt h1 { margin: 0; font-size: 22px; line-height: 1.15; }
.skilt #vejr { color: var(--blaek); font-weight: 600; }
.skilt p { margin: 4px 0 0; font-size: 13px; color: var(--daempet); max-width: 30ch; }
.skilt .soeg { position: relative; margin-top: 8px; }
.skilt .soeg input { width: 100%; min-width: 0; padding: 7px 10px; border: 1.5px solid #cfc5b0; border-radius: 9px; background: #fff; font: inherit; font-size: 14px; color: var(--blaek); }
.skilt .soeg input:focus { outline: none; border-color: var(--blaek); box-shadow: 0 0 0 3px rgb(255 209 102 / .6); }
.skilt .soeg ul { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; background: #fff;
  border-radius: 10px; box-shadow: 0 6px 20px rgb(0 0 0 / .25); max-height: 50vh; overflow-y: auto; }
.skilt .soeg ul[hidden] { display: none; }
.skilt .soeg li { display: grid; padding: 6px 12px; cursor: pointer; }
.skilt .soeg li strong { font-size: 14px; }
.skilt .soeg li span { font-size: 12px; color: var(--daempet); }
.skilt .soeg li.valgt, .skilt .soeg li:hover { background: #fff4c7; }
.skilt .soeg li.tom { color: var(--daempet); cursor: default; }
.skilt .knapper { display: flex; flex-wrap: wrap; gap: 6px; }
.skilt .kontakt.stempel::before { border-radius: 3px; background: #ffd23f; }
.skilt .kontakt.del::before { display: none; }
.skilt .kontakt.del { padding-left: 10px; }
.skilt .kontakt { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px 3px 6px; border: 1.5px solid var(--blaek);
  border-radius: 999px; background: none; font: inherit; font-size: 12.5px; color: var(--blaek); cursor: pointer; }
.skilt .kontakt::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--blaek); }
.skilt .kontakt[aria-pressed="true"]::before { background: var(--blaek); }
.skilt .kontakt:hover { background: #fff; }
.skilt .kontakt:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.skilt .kontakt[hidden] { display: none; }
.zoom { position: fixed; right: 16px; bottom: 44px; display: grid; gap: 6px; }
.zoom button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--papir); color: var(--blaek);
  font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 12px rgb(0 0 0 / .25); }
.zoom button:hover { background: #fff; }
.zoom button:focus-visible, a:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.kilde { position: fixed; right: 0; bottom: 0; max-width: 100vw; padding: 3px 10px; font-size: 11px; background: rgb(246 243 236 / .85);
  border-top-left-radius: 8px; }

/* Nattemørke: et blåt lag ganges ind over kortet. Køretøjerne tegnes ovenpå og står derfor oplyste. */
#lys { position: fixed; inset: 0; background: #2b3a78; mix-blend-mode: multiply; opacity: 0; pointer-events: none; transition: opacity 2s; }
#lys[hidden] { display: none; }
.fpsmaaler { position: fixed; top: 8px; right: 8px; z-index: 9; padding: 3px 8px; border-radius: 6px; background: rgb(0 0 0 / .7); color: #fff; font: 600 12px ui-monospace, monospace; pointer-events: none; }
#live, .live-gl { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.maerkat { position: fixed; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 10px; background: var(--blaek); color: #fff;
  font-size: 13px; white-space: nowrap; pointer-events: none; box-shadow: 0 2px 10px rgb(0 0 0 / .3); }
.maerkat strong { display: block; }
.maerkat span { opacity: .75; font-size: 12px; }
.maerkat[hidden] { display: none; }

.plan { position: fixed; left: 16px; bottom: 40px; width: 300px; max-width: calc(100vw - 92px); max-height: min(52vh, 460px);
  display: flex; flex-direction: column; background: var(--papir); border-radius: 12px; box-shadow: 0 2px 12px rgb(0 0 0 / .25); overflow: hidden; }
.plan[hidden] { display: none; }
.planhoved { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 12px; border-bottom: 1px solid #ddd6c8; }
.planhoved strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planhoved .linje { min-width: 30px; padding: 2px 7px; border-radius: 7px; background: #ffd23f; border: 1.5px solid var(--blaek); font-weight: 700; text-align: center; }
.planhoved .linje.tog { background: #c8102e; color: #fff; }
.planhoved button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; font-size: 22px; line-height: 1; color: var(--blaek); cursor: pointer; }
.planhoved button:hover { background: #e9e3d6; }
.planhoved .foelg { width: auto; padding: 0 10px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--blaek); }
.planhoved .foelg[aria-pressed="true"] { background: var(--blaek); color: #fff; }
.planhoved .foelg:disabled { opacity: .4; cursor: default; }
.plan ol { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.plan li { display: flex; gap: 10px; padding: 4px 12px; font-size: 14px; }
.plan li time { flex: none; width: 3.2em; font-variant-numeric: tabular-nums; color: var(--daempet); }
.plan li.koert { color: #9aa7ab; }
.plan li.koert time { color: #b3bdc0; }
.plan li.naeste { font-weight: 700; background: #fff4c7; }
.plan li.naeste time { color: var(--blaek); }
.plan .note { margin: 0; padding: 7px 12px; font-size: 11.5px; color: var(--daempet); border-top: 1px solid #ddd6c8; }

.stopnavn { flex: 1; min-width: 0; }
.stopnavn strong, .stopnavn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stopnavn span { font-size: 12px; color: var(--daempet); }
.plan .afgange li { padding: 0; }
.plan .afgange li.tom { padding: 10px 12px; color: var(--daempet); }
.plan .afgange button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.plan .afgange button:hover, .plan .afgange button:focus-visible { background: #fff4c7; outline: none; }
.plan .afgange time { width: 2.9em; }
.plan .afgange .linje { flex: none; min-width: 30px; padding: 1px 6px; border-radius: 7px; background: #ffd23f; border: 1.5px solid var(--blaek); font-weight: 700; font-size: 13px; text-align: center; }
.plan .afgange .linje.tog { background: #c8102e; color: #fff; }
.plan .afgange .mod { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan .afgange .om { flex: none; font-size: 12px; color: var(--daempet); }

/* Seværdighed i panelet */
.plan .stedbillede { position: relative; margin: 0; flex: none; }
.plan .stedbillede img { display: block; width: 100%; max-height: 180px; object-fit: cover; background: #e9e3d6; }
.plan .stedbillede .kredit { position: absolute; right: 0; bottom: 0; max-width: 100%; padding: 2px 6px; font-size: 10.5px; color: #fff;
  background: rgb(0 0 0 / .55); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan .stedtekst { padding: 10px 12px; overflow-y: auto; font-size: 14px; }
.plan .stedtekst p { margin: 0 0 8px; }
.plan .stedtekst .tom { color: var(--daempet); }
.plan .stedtekst a { font-weight: 600; }

/* Stempelkort og del */
.stempellinje { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid #ddd6c8; font-size: 13px; }
.stempellinje .stemplet { font-weight: 700; }
.stempellinje .stemplet::before { content: "✓ "; color: #b08800; }
.stempellinje .ikke { color: var(--daempet); flex: 1; min-width: 12ch; }
.plan button.tjekind, .plan button.delknap { padding: 5px 12px; border: 1.5px solid var(--blaek); border-radius: 999px; background: #ffd23f; font: inherit; font-size: 13px; font-weight: 700; color: var(--blaek); cursor: pointer; }
.plan button.delknap { background: none; }
.plan button.tjekind:hover, .plan button.delknap:hover { background: #fff; }
.plan .stempelliste li { padding: 0; }
.plan .stempelliste button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.plan .stempelliste button:hover { background: #fff4c7; }
.plan .stempelliste .maerke { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px dashed #b9b09e; font-weight: 800; }
.plan .stempelliste .maerke.fuld { border: 2px solid var(--blaek); background: #ffd23f; }
.plan .stempelliste .navn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan .stempelliste .om { flex: none; font-size: 12px; color: var(--daempet); }
.stempelfod { padding: 10px 12px; border-top: 1px solid #ddd6c8; }
.stempelfod button.stor { width: 100%; padding: 9px; font-size: 14px; }
.stempelfod p { margin: 8px 0 0; font-size: 11.5px; color: var(--daempet); }
.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 10; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px;
  background: var(--blaek); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgb(0 0 0 / .3); text-align: center; }
.toast[hidden] { display: none; }

/* Forsiden: Danmarkskortet */
body.danmark { overflow: hidden; background: var(--vand); }
#danmark { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#danmark .nabo { fill: #2a7d93; }
#danmark .land { fill: var(--papir); stroke: #cfc5b0; stroke-width: .6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#danmark .boks { fill: none; stroke: rgb(246 243 236 / .45); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
#danmark .by { cursor: pointer; outline: none; }
#danmark .glorie { transform-box: fill-box; transform-origin: center; animation: puls 2.6s ease-in-out infinite; }
#danmark .ring { fill: #ffd23f; stroke: var(--blaek); }
#danmark .omrids { fill: #ffd23f; stroke: var(--blaek); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
#danmark .navn { font-weight: 700; fill: var(--blaek); stroke: var(--papir); paint-order: stroke; stroke-linejoin: round; }
#danmark .by:hover .ring, #danmark .by:focus-visible .ring { fill: #fff; }
#danmark .by:focus-visible .navn { text-decoration: underline; }
#danmark.zoomer .glorie, #danmark.zoomer .ring, #danmark.zoomer .navn { display: none; }
@keyframes puls { 0%, 100% { transform: scale(.8); opacity: .75; } 50% { transform: scale(1.15); opacity: 1; } }
.byliste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.byliste a { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #ffd23f; border: 1.5px solid var(--blaek); font-size: 13px; font-weight: 600; text-decoration: none; }
.byliste a:hover { background: #fff; }
.bykort { position: fixed; width: 280px; border-radius: 14px; overflow: hidden; background: var(--papir); color: var(--blaek); text-decoration: none;
  box-shadow: 0 6px 24px rgb(0 0 0 / .3); animation: frem .35s ease-out; }
.bykort[hidden] { display: none; }
.bykort img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 967; object-fit: cover; }
.bykort .tekst { display: grid; gap: 2px; padding: 10px 14px 12px; }
.bykort strong { font-size: 18px; }
.bykort .tekst > span:not(.knap) { font-size: 13px; color: var(--daempet); }
.bykort .knap { margin-top: 6px; font-weight: 700; font-size: 14px; }
.bykort:hover .knap, .bykort:focus-visible .knap { text-decoration: underline; }
.bykort:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.bykort.bund { left: 16px; right: 16px; bottom: 40px; width: auto; display: grid; grid-template-columns: 112px 1fr; }
.bykort.bund img { height: 100%; aspect-ratio: auto; }
@keyframes frem { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #danmark .glorie, .bykort { animation: none; } }

/* Forsiden (gammel liste, bruges ikke længere) */
.forside { min-height: 100%; background: var(--papir); padding: 48px 16px; }
.forside main { max-width: 760px; margin: 0 auto; }
.forside h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.05; margin: 0 0 12px; }
.forside .intro { font-size: 18px; color: var(--daempet); max-width: 52ch; margin: 0 0 32px; }
.by { display: block; text-decoration: none; border-radius: 16px; overflow: hidden; background: #fff;
  box-shadow: 0 2px 16px rgb(0 0 0 / .12); transition: transform .15s; }
.by:hover { transform: translateY(-2px); }
.by img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.by span { display: block; padding: 14px 18px; font-size: 20px; font-weight: 600; }
.forside footer { margin-top: 40px; font-size: 13px; color: var(--daempet); }
@media (prefers-reduced-motion: reduce) { .by { transition: none; } }
body[data-by] .skilt { width: min(330px, calc(100vw - 32px)); }

/* Smalle skærme: kildelinjen er én linje, der foldes ud ved tryk */
@media (max-width: 640px) {
  .kilde { left: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top-left-radius: 0; cursor: pointer; }
  .kilde:focus, .kilde:focus-within { white-space: normal; outline: none; }
}
