/* ───────── NYKS · magasin-look (inspireret af Popkryds) · mobil først ─────────
   Hvidt papir, stiplede gitterlinjer, sorte ledetrådsfelter med Familjen Grotesk i versaler,
   sorte piktogrammer direkte på papiret, skrå overskrifter og script-sidehoved. */
:root {
  --ink: #121212;
  --paper: #ffffff;
  --mute: #6b6b6b;
  --shade: #f3f3f3;
  --hilite: #e4e4e4;
  --line: #b8b8b8;          /* stiplede gitterlinjer */
  --void: #ececec;          /* tomme felter: lysegrå som magasinets markeringer */
  --void-line: #d6d6d6;
  --f-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Work Sans", system-ui, sans-serif;
  --f-clue: "Familjen Grotesk", "Arial Narrow", Arial, sans-serif;
  --cell: 36px;
  --cols: 10;
  --dock-h: 200px;
  --col: 560px;
  --news: #e63946;         /* kraftig rød: dagens nyheder (ledetråde, billeder, nyhedsknap) */
  --news-ink: #ffffff;
  --news-soft: #f19299;    /* lyserød: et valgt nyhedsord i feltet */
  --act: #a8dadc;          /* lyseblå: det valgte ord */
  --act-ink: #121212;      /* tekst på lyseblå */
  --act-line: #3f8f95;     /* mørkere blågrøn til markør og pil, så de kan ses på hvidt */
  --act-news: #e63946;     /* rød: valgt nyhedsord + logoets ✱ */
  --blue: #457b9d;         /* kraftig blå – søster til den lyseblå, bruges som billedfarve */
  --err: #871a2b;          /* mørk rød: forkert bogstav */
  color-scheme: only light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.hidden, [hidden] { display: none !important; }

/* ── appens ramme: fylder præcis skærmen */
.app {
  height: 100dvh; display: flex; flex-direction: column;
  max-width: var(--col); margin: 0 auto;
  padding-top: env(safe-area-inset-top);
}

/* ── top */
.top {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 8px;
}
/* logo: sorte versaler direkte på papiret, rød ✱ i midten – og forkortelsen forklaret nedenunder */
.logo { margin: 0; display: flex; flex-direction: column; align-items: flex-start; line-height: 1; color: var(--ink); }
.lw { display: flex; align-items: center; }
.tagline { margin-top: 3px; font-family: var(--f-body); font-size: 8.5px; font-weight: 600; letter-spacing: .06em; color: var(--mute); white-space: nowrap; }
.tagline i { font-style: normal; color: var(--act-news); }
.lt {
  display: grid; place-items: center; height: 26px;
  font-family: var(--f-display); font-weight: 700; font-size: 27px; letter-spacing: -.01em;
}
.lt.star { color: var(--act-news); font-size: 18px; width: 19px; margin: 0 2px; transform-origin: 50% 52%; }
.lt.star { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hud { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; min-width: 0; }
.hud b { font-family: var(--f-display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.hud span { font-size: 10px; color: var(--mute); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: .08em; }
/* sidehoved som i et magasin: script til venstre, sidetal til højre */
/* sidehoved som i et magasin: dato til venstre, sidetal til højre, tynd linje under */
.runhead {
  flex: none; display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 12px 8px; padding-bottom: 5px; border-bottom: 1px solid var(--ink);
}
.runhead .rh-date { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.runhead .rh-no { font-family: var(--f-display); font-size: 13px; letter-spacing: .06em; }
.actions { display: flex; gap: 5px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 0; padding: 0;
  border: 1px solid var(--ink); background: var(--paper);
  display: grid; place-items: center; font-size: 14px;
  transition: transform .08s;
}
.icon-btn:active { transform: scale(.92); background: var(--ink); color: var(--paper); }
.icon-btn:disabled { opacity: .3; }
@media (hover: hover) { .icon-btn:hover { background: var(--ink); color: var(--paper); } }

/* ── brættet: tager resten af højden, gitteret skaleres i JS */
.board { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: 2px 8px 8px; overflow: auto; }
.grid-wrap { position: relative; }
.grid {
  display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-auto-rows: var(--cell);
  border: 1px dashed var(--line); border-radius: 0; overflow: hidden;
  background: var(--paper); gap: 0;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: filter .25s;
}
.grid.blur { filter: blur(7px); pointer-events: none; }
.cell {
  position: relative; background: var(--paper); display: grid; place-items: center; overflow: hidden; min-width: 0;
  border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
}
.cell.void { background: var(--void); }
.cell.letter { cursor: pointer; }
.cell.letter .ch { font-family: var(--f-display); font-weight: 700; font-size: calc(var(--cell) * .56); line-height: 1; }
/* det valgte ord: grå baggrund + en tyk mørkerød ramme rundt om hele ordet, så retningen er tydelig */
.cell.inword { background: var(--act); color: var(--act-ink); --wb: max(3px, calc(var(--cell) * .055)); }
.cell.inword.w-a { box-shadow: inset 0 var(--wb) 0 var(--act), inset 0 calc(var(--wb) * -1) 0 var(--act); }
.cell.inword.w-a.w-first { box-shadow: inset 0 var(--wb) 0 var(--act), inset 0 calc(var(--wb) * -1) 0 var(--act), inset var(--wb) 0 0 var(--act); }
.cell.inword.w-a.w-last { box-shadow: inset 0 var(--wb) 0 var(--act), inset 0 calc(var(--wb) * -1) 0 var(--act), inset calc(var(--wb) * -1) 0 0 var(--act); }
.cell.inword.w-a.w-first.w-last { box-shadow: inset 0 0 0 var(--wb) var(--act); }
.cell.inword.w-d { box-shadow: inset var(--wb) 0 0 var(--act), inset calc(var(--wb) * -1) 0 0 var(--act); }
.cell.inword.w-d.w-first { box-shadow: inset var(--wb) 0 0 var(--act), inset calc(var(--wb) * -1) 0 0 var(--act), inset 0 var(--wb) 0 var(--act); }
.cell.inword.w-d.w-last { box-shadow: inset var(--wb) 0 0 var(--act), inset calc(var(--wb) * -1) 0 0 var(--act), inset 0 calc(var(--wb) * -1) 0 var(--act); }
.cell.inword.w-d.w-first.w-last { box-shadow: inset 0 0 0 var(--wb) var(--act); }
/* aktivt felt: hvidt (beholder ordets ramme) */
.cell.active { background: var(--paper); color: var(--ink); }
.grid.news-sel { --act: var(--news-soft); --act-ink: var(--ink); --act-line: var(--act-news); }
.cell.active:not(.inword) { box-shadow: inset 0 0 0 3px var(--act-line); }
/* retningspil: sidder på forkanten af det aktive felt – mellem bogstavet og den vej, man skriver */
.cell .dm { display: none; position: absolute; width: 0; height: 0; border: 0 solid transparent; pointer-events: none; }
.cell.active .dm { display: block; }
.grid[data-dir="a"] .cell.active .dm {
  right: calc(var(--cell) * .05); top: 50%; margin-top: calc(var(--cell) * -.1);
  border-width: calc(var(--cell) * .1) 0 calc(var(--cell) * .1) calc(var(--cell) * .13); border-left-color: var(--act-line);
}
.grid[data-dir="d"] .cell.active .dm {
  bottom: calc(var(--cell) * .04); left: 50%; margin-left: calc(var(--cell) * -.1);
  border-width: calc(var(--cell) * .13) calc(var(--cell) * .1) 0 calc(var(--cell) * .1); border-top-color: var(--act-line);
}
/* lodret: blinkemarkøren rykker lidt op, så den ikke rammer pilen i bunden */
.grid[data-dir="d"] .cell.active::before { bottom: 22%; }
.cell.active::before {
  content: ""; position: absolute; left: 28%; right: 28%; bottom: 14%; height: 2px; background: var(--act-line);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.cell.wrong .ch { text-decoration: line-through 2px; color: var(--err); }
.cell.wrong { color: var(--err); }
.cell.inword.wrong:not(.active) { background: var(--err); color: var(--paper); }
.cell.inword.wrong:not(.active) .ch { color: var(--paper); }
.cell.wrong::after { content: ""; position: absolute; inset: 3px; border: 1.5px dashed currentColor; border-radius: 0; pointer-events: none; }
.cell.revealed .ch::after { content: "✱"; position: absolute; bottom: 1px; right: 2px; font-size: calc(var(--cell) * .2); }

/* små pile i ordets første felt */
.arr { position: absolute; width: 0; height: 0; pointer-events: none; border: 0 solid transparent; }
.arr.r { left: 0; top: 50%; margin-top: -5.5px; border-width: 5.5px 0 5.5px 7px; border-left-color: currentColor; }
.arr.d { top: 0; left: 50%; margin-left: -5.5px; border-width: 7px 5.5px 0 5.5px; border-top-color: currentColor; }
.arr.br, .arr.bd { width: 9px; height: 9px; }
.arr.br { top: 0; left: 3px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.arr.br::after { content: ""; position: absolute; right: -6px; bottom: -6px; border: 5px solid transparent; border-left: 6px solid currentColor; border-right: 0; }
.arr.bd { left: 0; top: 3px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
.arr.bd::after { content: ""; position: absolute; bottom: -6px; right: -6px; border: 5px solid transparent; border-top: 6px solid currentColor; border-bottom: 0; }

/* knækpile fra et billede under ordet (vandret) eller til højre for det (lodret) */
.arr.ur, .arr.dl { width: 9px; height: 9px; }
.arr.ur { bottom: 0; left: 3px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; }
.arr.ur::after { content: ""; position: absolute; right: -6px; top: -6px; border: 5px solid transparent; border-left: 6px solid currentColor; border-right: 0; }
.arr.dl { right: 0; top: 3px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; }
.arr.dl::after { content: ""; position: absolute; bottom: -6px; left: -6px; border: 5px solid transparent; border-top: 6px solid currentColor; border-bottom: 0; }

/* billedfelter: én blok over w×h felter, ikonet i ledetrådenes tekstfarve */
.cell.pic { background: var(--paper); cursor: pointer; }
.cell.pic.lead { overflow: visible; z-index: 2; place-items: start; }
.picimg {
  position: absolute; left: 0; top: 0; display: grid;
  width: calc(var(--cell) * var(--pw) - 1px);
  height: calc(var(--cell) * var(--ph) - 1px);
  background: var(--paper); color: var(--ink);
}
.picimg.inv { background: var(--ink); color: var(--paper); }
/* billedfarver (sat i admin-testen): farvet ikon på hvidt – eller vendt: farvet baggrund */
.picimg:not(.on).t-navy { color: var(--blue); }
.picimg:not(.on).t-blue { color: var(--act); }
.picimg:not(.on).t-red { color: var(--act-news); }
.picimg:not(.on).t-pink { color: var(--news-soft); }
.picimg:not(.on).t-navy.inv { background: var(--blue); color: var(--paper); }
.picimg:not(.on).t-blue.inv { background: var(--act); color: var(--ink); }
.picimg:not(.on).t-red.inv { background: var(--act-news); color: var(--paper); }
.picimg:not(.on).t-pink.inv { background: var(--news-soft); color: var(--ink); }
.picimg.news { background: var(--news); color: var(--news-ink); }
.picimg.on { background: var(--act); color: var(--act-ink); box-shadow: inset 0 0 0 2px var(--paper); }
.picimg.news.on { background: var(--news-soft); color: var(--ink); }
.picimg.done .pic-ico { opacity: .4; }
.pic-ico {
  display: block; width: 100%; height: 100%; background: currentColor;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.picimg .pic-ico { width: calc(100% - 6px); height: calc(100% - 6px); margin: 3px; }
.cb-pic { display: inline-block; height: 1.6em; width: calc(1.6em * var(--pa, 1)); vertical-align: middle; }

/* ledetrådsfelter */
.cell.clue { background: var(--ink); color: var(--paper); cursor: pointer; display: flex; flex-direction: column; align-items: stretch; }
.cell.clue .cp {
  flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 2px 3px; overflow: hidden; text-align: center;
  font-family: var(--f-clue); font-weight: 700; font-size: 9px; line-height: 1.04;
  text-transform: uppercase; letter-spacing: .01em;
  hyphens: manual; overflow-wrap: normal; word-break: normal;
}
.cell.clue .cp + .cp { border-top: 1px dashed color-mix(in srgb, var(--paper) 55%, transparent); }
/* vendte farver (sat i admin-testen): hvid ledetråd med sort tekst, sort billedfelt med hvidt ikon */
.cell.clue .cp.inv:not(.news) { background: var(--paper); color: var(--ink); }
.cell.clue .cp.inv + .cp, .cell.clue .cp + .cp.inv { border-top-color: var(--line); }
.cell.clue .cp.on { background: var(--act); color: var(--act-ink); box-shadow: inset 0 0 0 1.5px var(--paper); }
.cell.clue .cp.done { opacity: .4; }
.grid.solved .cell.letter { animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
.grid.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

/* ── overlays */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; z-index: 3; }
.card {
  background: var(--paper); border: 1px solid var(--ink); border-radius: 0;
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--ink) 45%, transparent);
  padding: 24px 22px 18px; text-align: center; max-width: 320px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.card h2 {
  font-family: var(--f-display); font-weight: 700; font-size: 44px; margin: 4px 0 2px;
  line-height: .95; text-transform: uppercase; letter-spacing: -.03em;
}
.card p { margin: 0 0 4px; font-size: 13px; line-height: 1.45; color: var(--mute); }
.pill {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  border: 0; border-radius: 0; padding: 0;
}
.pill::before { content: "✱ "; color: var(--act-news); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--hilite); border-top-color: var(--act-news); animation: spin .8s linear infinite; }
.link { background: none; border: 0; padding: 6px; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: var(--mute); }

/* ── knapper */
.btn {
  border: 1.5px solid var(--ink); background: var(--paper); border-radius: 0;
  padding: 10px 18px; font-weight: 700; font-size: 15px; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s;
}
.btn small { font-weight: 600; font-size: 12px; color: var(--mute); }
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-red { background: var(--act-news); border-color: var(--act-news); color: var(--paper); }
.btn-solid small { color: inherit; opacity: .7; }
.btn.big { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; padding: 10px 34px; }
.btn.wide { width: 100%; }

/* ── dock: aktiv ledetråd + tastatur */
.dock { flex: none; padding: 0 6px calc(6px + env(safe-area-inset-bottom)); }
.clue-row { display: flex; gap: 6px; }
.clue-row .cluebar { flex: 1; min-width: 0; }
.hint-btn {
  flex: none; width: 52px; padding: 0; border: 0; border-radius: 0;
  background: var(--ink); color: var(--paper); display: grid; place-items: center;
  transition: transform .08s;
}
.hint-btn:active { transform: scale(.94); }
.hint-btn:disabled { opacity: .3; }
/* nyhedsord valgt: pæren er lime indeni og vifter "vælg mig!" */
.hint-btn.pick:not(:disabled) svg path:last-child { fill: var(--news); }
.hint-btn.spot:not(:disabled) svg path:last-child { fill: var(--err); }
.hint-btn.pick:not(:disabled) svg, .hint-btn.spot:not(:disabled) svg { transform-origin: 50% 90%; animation: pickme 1.8s ease-in-out infinite; }
@keyframes pickme {
  0%, 45%, 100% { transform: rotate(0) scale(1); }
  5% { transform: rotate(-16deg) scale(1.1); }
  12% { transform: rotate(14deg) scale(1.1); }
  19% { transform: rotate(-11deg) scale(1.08); }
  26% { transform: rotate(8deg) scale(1.05); }
  33% { transform: rotate(-4deg) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { .hint-btn.pick svg, .hint-btn.spot svg { animation: none; } }
.cluebar {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: stretch;
  background: var(--ink); color: var(--paper); border-radius: 0; min-height: 46px;
}
.cluebar .nav { background: transparent; border: 0; color: var(--paper); font-size: 26px; padding: 0; border-radius: 0; }
.cluebar .nav:active { background: var(--paper); color: var(--ink); }
.cluebar-text {
  display: flex; align-items: center; justify-content: center; gap: 9px; padding: 6px 2px;
  font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: .02em; text-transform: uppercase;
  line-height: 1.1; text-align: center; cursor: pointer;
}
.cb-arrow { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 0; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 700; }
.cb-arrow svg { display: block; transition: transform .2s ease; }
.cb-arrow.down svg { transform: rotate(90deg); }
.kb { padding: 6px 0 0; display: flex; flex-direction: column; gap: 5px; }
.kb-row { display: flex; gap: 4px; justify-content: center; }
.kb button {
  flex: 1 1 0; min-width: 0; height: 44px; padding: 0;
  border: 1px dashed var(--line); background: var(--paper); border-radius: 0;
  font-family: var(--f-display); font-weight: 700; font-size: 18px;
}
.kb button.wide { flex-grow: 1.6; font-size: 19px; background: var(--shade); }
.kb button:active { background: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .kb { display: none; } .dock { padding-bottom: 14px; } }
body.done .kb { display: none; }
body.veiled .cluebar-text { filter: blur(6px); }

/* ── toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 10px); transform: translate(-50%, 10px); opacity: 0;
  background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 0;
  font-weight: 700; font-size: 14px; pointer-events: none; transition: .2s; z-index: 50; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── dialoger */
.dlg {
  /* på PC skaleres popups med zoom: var(--ui), så mål ift. skærmen skal divideres med --ui */
  width: min(400px, calc((100vw - 24px) / var(--ui, 1))); max-height: calc((100dvh - 40px) / var(--ui, 1));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 20px 18px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink); border-radius: 0; box-shadow: 0 24px 50px -20px color-mix(in srgb, var(--ink) 50%, transparent);
}
.dlg::backdrop { background: color-mix(in srgb, var(--paper) 60%, transparent); backdrop-filter: blur(4px); }
.dlg[open] { animation: dlgIn .2s ease-out; }
@keyframes dlgIn { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.dlg h2 {
  font-family: var(--f-display); font-weight: 700; margin: 0 34px 14px 0; font-size: 30px; line-height: .95;
  text-transform: uppercase;
}
.close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 0;
  border: 1px solid var(--ink); background: var(--paper); font-size: 20px; line-height: 1; padding: 0;
}
.sheet[open] { display: flex; flex-direction: column; gap: 10px; }
.rules { padding-left: 18px; margin: 0 0 16px; font-size: 14px; line-height: 1.5; }
.rules li { margin-bottom: 8px; }
.ranks { border: 1px dashed var(--line); border-radius: 0; margin-bottom: 14px; overflow: hidden; }
.ranks div { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 7px 12px; font-size: 13px; }
.ranks div + div { border-top: 1px dashed var(--line); }
.ranks span { color: var(--mute); white-space: nowrap; }
.ranks b small { display: block; font-weight: 400; font-size: 11.5px; color: var(--mute); margin-top: 1px; letter-spacing: 0; text-transform: none; }
.result-sub { font-size: 13px; color: var(--mute); margin-top: 2px; }
.result { text-align: center; padding: 4px 0 6px; }
.result-score {
  font-family: var(--f-display); font-weight: 700; font-size: 88px; line-height: .95; margin-top: 6px;
  color: var(--ink); letter-spacing: -.04em;
}
.result-rank { font-family: var(--f-display); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; }
.result-meta { font-size: 13px; color: var(--mute); margin: 6px 0 14px; }
.share-msg {
  display: grid; gap: 2px; font-size: 13px; color: var(--mute);
  max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
  transition: max-height .25s, opacity .25s, margin-top .25s;
}
.share-msg b { color: var(--ink); font-size: 14px; }
.share-msg.show { max-height: 60px; opacity: 1; margin-top: 10px; }
.sec { font-size: 12px; font-weight: 700; letter-spacing: .08em; margin: 16px 0 8px; text-transform: uppercase; color: var(--mute); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--shade); border-radius: 0; }
.stats-grid div { text-align: center; padding: 10px 2px; min-width: 0; }
.stats-grid b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 26px; }
.stats-grid span { font-size: 11px; color: var(--mute); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 90px; }
.week .bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.week .bar i { display: block; width: 100%; background: var(--ink); min-height: 2px; border-radius: 0; }
.week .bar.empty i { background: var(--hilite); height: 4px; border-radius: 0; }
.week .bar span { font-size: 11px; font-weight: 600; color: var(--mute); }
.week .bar.today span { color: var(--ink); }
.next { text-align: center; font-size: 13px; margin: 16px 0 2px; }
.next b { font-family: var(--f-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.dlg .link { display: block; margin: 0 auto; }

/* ── nyheder: pink ledetråde */
.cell.clue .cp.news { background: var(--news); color: var(--news-ink); }
.cell.clue .cp.news + .cp, .cell.clue .cp + .cp.news { border-top-color: var(--ink); }
.cell.clue .cp.news.on { background: var(--news-soft); color: var(--ink); box-shadow: inset 0 0 0 2px var(--news); }
.btn-news { background: var(--news); color: var(--news-ink); border-color: var(--news-ink); }
.btn-news small { color: inherit; opacity: .75; }
.news-pill { background: var(--news); color: var(--news-ink); border-color: var(--news-ink); }
.news-dlg h2 { margin: 6px 0 4px; font-size: 26px; line-height: 1; }
.nw-clue { margin: 12px 0 0; font-size: 13px; color: var(--mute); font-weight: 600; }
.nw-domain { margin: 0 0 16px; font-size: 13px; color: var(--mute); }
.nw-note { margin: 10px 0 0; font-size: 12px; color: var(--mute); text-align: center; }
a.btn { text-decoration: none; }
.news-list { text-align: left; margin: 4px 0 14px; }
.news-list .sec { margin-top: 4px; }
.news-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.news-list a {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline;
  padding: 9px 12px; border-radius: 0; border: 0; background: var(--news); color: var(--news-ink); text-decoration: none;
}
.news-list a b { font-family: var(--f-display); font-weight: 700; font-size: 15px; letter-spacing: .02em; grid-row: span 2; }
.news-list a span { font-size: 14px; font-weight: 600; line-height: 1.3; }
.news-list a small { font-size: 11px; opacity: .75; }

/* ── admin-testvisning */
body.preview .logo::after {
  content: "TEST"; margin-top: 4px; align-self: flex-start;
  font-family: var(--f-display); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  background: var(--act-news); color: var(--paper); border-radius: 0; padding: 3px 6px;
}
body.preview #btn-cal { display: none; }
.pvbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 12px 8px; }
.pvbar button { border: 1.5px solid var(--ink); background: var(--paper); padding: 9px 16px; min-height: 40px; font-family: var(--f-display); font-weight: 700; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; border-radius: 0; }
.pvbar button.on, .pvbar button.solid { background: var(--ink); color: var(--paper); }
.pvbar button:disabled { opacity: .35; cursor: default; }
.pvbar span { font-size: 13px; font-weight: 600; color: var(--mute); }
.pvbar { flex-direction: column; align-items: stretch; }
.pv-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pvpick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 10px; border: 1px dashed var(--line); background: var(--shade); }
.pvpick[hidden] { display: none; }
.pv-what { flex-basis: 100%; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.pk { display: flex; align-items: center; gap: 6px; }
.pk span { font-size: 12px; font-weight: 700; color: var(--ink); min-width: 70px; }
.sws { display: flex; gap: 6px; flex-wrap: wrap; }
.pvbar .sws button { width: 34px; height: 34px; min-height: 0; padding: 0; border: 1px solid var(--line); position: relative; }
.pvbar .sws button.on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.pvbar button.ghost { min-height: 38px; padding: 6px 12px; font-size: 13px; }
.pvbar button.swap { margin-left: auto; } /* helt ude til højre */
/* egne farver fra testen – og feltet, man er ved at ændre, viser altid sine farver */
.grid .cp.custom:not(.on), .grid .cp.editing { background: var(--cbg) !important; color: var(--cfg) !important; }
.grid .cp.editing { box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 4px var(--ink) !important; z-index: 3; }
body.preview .grid .cp { cursor: pointer; }

/* ── spillere i dag */
.players { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.players::before { content: "✱ "; color: var(--act-news); }
#st-players { text-align: center; margin: 14px 0 0; }

/* ── sammenligning med andre spillere */
.cmp { border: 1px dashed var(--line); border-radius: 0; padding: 12px 12px 8px; margin: 0 0 14px; text-align: center; }
.cmp-head { display: block; font-family: var(--f-display); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .01em; }
.cmp-sub { display: block; font-size: 12px; color: var(--mute); margin-top: 2px; }
.cmp-chart { position: relative; margin-top: 22px; }
.cmp-chart svg { display: block; width: 100%; height: 96px; overflow: visible; }
.cmp-me {
  position: absolute; top: -20px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 0; white-space: nowrap;
}
.cmp-axis { display: flex; justify-content: space-between; gap: 6px; font-size: 10px; color: var(--mute); border-top: 1.5px solid var(--ink); padding-top: 4px; font-variant-numeric: tabular-nums; }

/* ── kalender */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-family: var(--f-display); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; }
.cal-head .icon-btn { font-size: 20px; line-height: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--mute); padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 0; font-size: 14px; position: relative; padding: 0;
}
.cal-day.off { background: var(--void); color: var(--mute); opacity: .7; }
button.cal-day { background: var(--paper); border: 1px dashed var(--ink); font-family: var(--f-display); font-weight: 700; font-size: 16px; }
button.cal-day i { font-style: normal; font-size: 9px; line-height: 1; position: absolute; bottom: 3px; }
button.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
button.cal-day.cur { background: var(--ink); color: var(--paper); }
@media (hover: hover) { button.cal-day:not(.cur):hover { background: var(--hilite); } }
.cal-legend { font-size: 12px; color: var(--mute); text-align: center; margin: 12px 0 0; }
.cal-key { display: inline-block; width: 12px; height: 12px; border: 1px dashed var(--ink); border-radius: 0; vertical-align: -2px; background: var(--paper); }

/* lydknap: to bølger = musik + lyd, én bølge = kun effekter, kryds = fra */
.sound-btn .s-off { display: none; }
.sound-btn[data-mode="sfx"] .s-wave2,
.sound-btn[data-mode="off"] .s-wave, .sound-btn[data-mode="off"] .s-wave2 { display: none; }
.sound-btn[data-mode="off"] .s-off { display: inline; }
@media (max-width: 420px) {
  .top { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .lt { height: 22px; font-size: 23px; }
  .lt.star { width: 16px; font-size: 15px; }
  .actions { gap: 4px; }
  .icon-btn { width: 31px; height: 31px; }
}

@media (max-width: 360px) {
  .lt { height: 20px; font-size: 20px; }
  .lt.star { width: 14px; font-size: 13px; }
  .icon-btn { width: 28px; height: 28px; }
  .hud b { font-size: 15px; }
  .kb button { height: 40px; font-size: 13px; }
}
/* ── PC: samme layout som mobil, bare bredere, så brættet kan blive stort.
   Bredden følger skærmhøjden, så brættet (10×11) fylder skærmen uden at blive aflangt. */
@media (min-width: 900px) {
  /* --ui: hvor meget top, bjælke, knapper og popups skaleres op – følger skærmhøjden */
  :root { --ui: 1.25; }
  /* bredden følger højden, så brættet (10×11) kan fylde hele højden mellem top og bjælke */
  .app { max-width: clamp(560px, calc((100dvh - 130px * var(--ui)) * 10 / 11 + 30px), 1700px); }
  .top, .runhead, .dock, .overlay .card, .dlg, .toast { zoom: var(--ui); }

  /* logo til venstre, tid og point i midten, knapper til højre */
  .top { display: grid; grid-template-columns: 1fr auto 1fr; }
  .logo { justify-self: start; }
  .hud { margin: 0; justify-self: center; align-items: center; text-align: center; }
  .actions { justify-self: end; }

  .toast { bottom: 84px; }
}
@media (min-width: 900px) and (max-height: 780px) { :root { --ui: 1.1; } }
@media (min-width: 900px) and (min-height: 950px) { :root { --ui: 1.5; } }
@media (min-width: 900px) and (min-height: 1250px) { :root { --ui: 1.8; } }
@media (min-width: 900px) and (min-height: 1500px) { :root { --ui: 2; } }

@media (prefers-reduced-motion: reduce) {
  .lt.star, .spinner, .cell.active::before { animation: none; }
}
