:root {
  --bg: #1f3a2e;
  --fg: #fdf8ef;
  --accent: #c8323c;
  --panel: #fdf8ef;
  --panel-fg: #2a2a2a;
  --gap: 8px;
  --hud-h: 120px;
  --flip: 250ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
main { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 12px 16px; }
[hidden] { display: none !important; }

.screen { margin: auto; text-align: center; }
.screen h1 { font-size: clamp(2rem, 8vw, 3.5rem); margin: 0 0 .25em; }
#start { position: relative; z-index: 0; }
.start-content { transition: opacity .6s ease, transform .6s ease; }
.start-content.loading { opacity: 0; transform: translateY(10px); pointer-events: none; }
.start-bg {
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(rgba(10,20,50,.35), rgba(10,20,50,.15) 40%, rgba(10,20,50,.45)),
              var(--start-img, none) 0% 100% / auto max(115%, 56vw) no-repeat;
  background-color: #0e2a5c;
  animation: start-pan 90s cubic-bezier(.37, 0, .63, 1) -45s infinite alternate;
}
.start-bg:not(.ready) { background-image: none; }
.start-loader {
  position: fixed; left: 50%; top: 50%; translate: -50% -50%;
  width: min(60vw, 260px); height: 10px; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.2); transition: opacity .4s ease;
}
.start-loader.done { opacity: 0; }
.start-loader .fill { height: 100%; width: 0; border-radius: 6px; background: #ffd54a; transition: width .25s ease-out; }
@media (prefers-reduced-motion: reduce) { .start-content, .start-loader, .start-loader .fill { transition: none; } .start-content.loading { transform: none; } }
@keyframes start-pan { to { background-position: 100% 100%, 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .start-bg { animation: none; background-position: 50% 100%, 50% 100%; } }
.studio-mark { display: block; width: 70px; height: auto; margin: 0 auto -10px; opacity: .9; transform: translateY(-13px); }
.screen h1.logo-title { margin: 0 0 .1em; line-height: 0; }
.logo-title img { width: min(88vw, 460px); height: auto; }

.btn {
  font: inherit; font-weight: 600;
  background: var(--accent); color: #fff;
  border: 0; border-radius: 10px;
  padding: 10px 16px; min-height: 44px; min-width: 44px;
  cursor: pointer; touch-action: manipulation;
}
.btn.big { font-size: 1.25rem; padding: 14px 40px; margin-top: 16px; }
.btn.icon { padding: 0 10px; background: rgba(255,255,255,.15); }
.btn:focus-visible, .card:focus-visible { outline: 3px solid #ffd54a; outline-offset: 3px; }

/* Control panel: buttons on top, counters underneath. Phones: above the board. Wider screens: beside it, on the right. */
#game {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  --cols: 4; --rows: 4; --bar-h: 104px;
  --logo-h: clamp(34px, 6dvh, 56px);
  --santa-room: calc(var(--logo-h) * .9 - 4px + 6px);
  --hud-h: calc(var(--bar-h) + var(--logo-h) + 8px + var(--santa-room));
  --size: min(calc(100vw - 32px), calc((100dvh - var(--hud-h) - 44px) * var(--cols) / var(--rows)), 640px);
}
.hud .btn { white-space: nowrap; }
@media (min-width: 600px) { #game { --bar-h: 80px; --santa-room: calc(var(--logo-h) * .9 - 30px + 6px); } }
/* Top room so Santa's hat (taller than the logo) isn't cut off. */
.game-top { position: relative; margin: var(--santa-room) 0 8px; }
.game-logo { height: var(--logo-h); width: auto; display: block; }
/* Santa next to the logo; his bottom tucks down behind the control bar. */
.game-santa {
  position: absolute; left: calc(100% + 10px); bottom: calc(var(--santa-tuck) * -1);
  height: calc(var(--logo-h) * 1.9); width: auto; z-index: 0; pointer-events: none;
  --santa-tuck: 4px;
}
.hud { position: relative; z-index: 1; }
@media (min-width: 600px) {
  .game-santa { --santa-tuck: 30px; }
  .hud { background: #263f37 !important; }
}
.hud {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.hud-actions { display: flex; gap: 8px; justify-content: center; }
.hud-stats { display: flex; gap: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; justify-content: center; }
.hud-stats .k { opacity: .8; }

.board {
  width: var(--size);
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--gap);
}

.board.shuffling .card { cursor: default; }
#time.low { color: #ff8a80; }
/* Restart is an icon button everywhere (the label stays for screen readers via aria-label). */
#restart { padding: 0 10px; }
#restart .lbl { display: none; }
#restart .ico { font-size: 1.3rem; line-height: 1; }
.board.dealing { pointer-events: none; }

#game { position: relative; }
.toast {
  position: fixed; left: 50%; top: 45%; z-index: 5;
  background: var(--panel); color: var(--accent);
  font-weight: 800; font-size: clamp(1.4rem, 6vw, 2rem);
  padding: 14px 28px; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.4);
  transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
}
.toast.show { animation: toast 1.6s ease forwards; }
@keyframes toast {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-6deg); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(2deg); }
  28%  { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(.95); }
}

.round-panel { max-width: 400px; }
.round-panel h2 { font-size: clamp(1.8rem, 7vw, 2.4rem); margin: 0 0 .4em; }
.ri-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; opacity: .6; margin: 0 !important; }
.ri-icon { font-size: 3.5rem; line-height: 1.2; margin: 8px 0 4px; }
.round-panel p { margin: .5em 0; line-height: 1.5; }
.ri-timed { background: #fff3cd; border-radius: 8px; padding: 10px 12px; font-size: .95rem; }
.overlay:not([hidden]) .panel { animation: panel-in .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes panel-in { from { opacity: 0; transform: scale(.85) translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  .toast.show { animation: toast-fade 1.6s ease forwards; }
  @keyframes toast-fade { 0%, 100% { opacity: 0; } 15%, 80% { opacity: 1; } }
  .overlay:not([hidden]) .panel { animation: none; }
}

.hud-stats .par { opacity: .65; font-weight: 400; }

.rounds-screen { width: 100%; max-width: 640px; }
.rounds-screen h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: 0 0 .2em; }
.round-list { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.round-btn {
  width: 100%; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  text-align: left; font: inherit; color: var(--panel-fg); background: var(--panel);
  border: 0; border-radius: 12px; padding: 12px 14px; cursor: pointer; touch-action: manipulation;
}
.round-btn:focus-visible { outline: 3px solid #ffd54a; outline-offset: 3px; }
.round-btn .ri { font-size: 1.8rem; text-align: center; }
.round-btn .rn { font-weight: 700; display: block; }
.round-btn .rs { font-size: .85rem; opacity: .7; }
.round-btn .rp { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.round-btn.done .rp::before { content: "✓ "; color: #2e7d32; }
.round-btn:disabled { background: #ffffff1a; color: var(--fg); cursor: default; }
.round-btn:disabled .rp { color: inherit; }

#music.off { opacity: .45; text-decoration: line-through; }
/* Wide enough for one row: a horizontal bar across the top, as wide as the board. */
@media (min-width: 600px) {
  .hud {
    flex-direction: row; justify-content: space-between; align-items: center;
    width: var(--size); min-width: max-content; box-sizing: border-box; gap: 16px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px; padding: 10px 12px 10px 18px;
  }
  .hud-actions { order: 2; }
  .hud-stats { gap: 22px; font-size: 1.1rem; }
}
.points { list-style: none; padding: 8px 0 0; margin: 8px 0 0; border-top: 1px solid #0002; font-size: .95rem; }
.points li { display: flex; justify-content: space-between; gap: 16px; }
.points li.total { font-weight: 700; margin-top: 4px; }

.start-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }
/* Santa stands beside the buttons, level with the lowest one. */
.start-row { display: flex; flex-direction: column-reverse; align-items: center; gap: 18px; margin-top: 12px; }
/* Horizontal glass menu: buttons side by side, wrapping on narrow screens. */
.start-menu .start-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.start-row .start-actions { margin-top: 0; }
.start-santa { height: clamp(128px, 25.5vh, 255px); width: auto; flex: none; pointer-events: none; position: relative; z-index: 1; }
@media (max-width: 599px) {
  .start-santa { height: clamp(150px, 26vh, 210px); }
  .start-menu { padding: 12px; width: fit-content; }
  .start-menu .start-actions { flex-direction: column; flex-wrap: nowrap; }
}
/* Frosted-glass menu: the snowy night shows blurred through it. */
.start-menu {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 18px; max-width: min(720px, calc(100vw - 32px));
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(5, 15, 40, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
}
.start-menu .total-line { margin: 0; }
.start-menu .note { margin: 0; font-size: .85rem; }
/* Glass buttons inside the glass menu; the main action is a touch brighter. */
.start-menu .btn {
  background: rgba(255, 255, 255, .14); color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  min-width: 200px;
}
.start-menu .btn.big { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .55); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.start-menu .btn {
  position: relative; overflow: hidden;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* Hover (mouse only): lift, brighten, soft glow, and a light streak across the glass. */
.start-menu .btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%);
}
@media (hover: hover) {
  .start-menu .btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .34); border-color: rgba(255, 255, 255, .7);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 18px rgba(255, 255, 255, .18), 0 0 14px rgba(255, 230, 150, .25);
  }
  .start-menu .btn:hover::after { transform: translateX(120%); transition: transform .6s ease; }
}
.start-menu .btn:active { transform: translateY(0) scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .start-menu .btn, .start-menu .btn::after { transition: none !important; }
  .start-menu .btn:hover { transform: none; }
}
/* All menu buttons share one size; the points line isn't shown on the start screen. */
.start-menu .btn, .start-menu .btn.big { width: 220px; min-width: 0; font-size: 1rem; padding: 0 16px; margin: 0; height: 50px; box-sizing: border-box; }
.start-menu #s-total { display: none !important; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .start-menu { background: rgba(20, 35, 70, .7); }
}
.start-actions .btn.big { margin-top: 0; }
.start-actions .btn:not(.big) { background: transparent; border: 2px solid #fff6; }
.total-line { font-weight: 700; margin: .5em 0 0; }
.screen .note a, .panel .note a { color: inherit; font-weight: 700; }
.screen .note { opacity: .85; margin-top: 16px; }

.board-list { margin: 20px auto 0; max-width: 340px; text-align: left; }
.board-list h3 { font-size: 1rem; margin: 0 0 8px; text-align: center; }
.board-list ol { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.board-list li {
  counter-increment: rank;
  display: grid; grid-template-columns: 24px 32px 1fr auto; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.board-list li::before { content: counter(rank) "."; opacity: .7; text-align: right; }
.board-list li.me { background: #ffffff22; font-weight: 700; }
.panel .board-list li.me { background: #0000000d; }
.board-list img, .board-list .initials { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.board-list .initials { display: grid; place-items: center; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; }
.board-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card {
  aspect-ratio: 1;
  padding: 0; border: 0; background: none;
  perspective: 600px;
  cursor: pointer; touch-action: manipulation;
  border-radius: 10px;
}
.card:disabled { cursor: default; }
.inner {
  display: block; position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--flip) ease;
}
.card:not([data-state="down"]) .inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 10px;
  display: grid; place-items: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.back {
  background: radial-gradient(circle at 50% 42%, #d42a3c 0%, #b3172a 55%, #8a0f1f 100%);
  overflow: hidden;
}
/* Thin gold frame sitting just inside the card edge. */
.back::after {
  content: ""; position: absolute; inset: 6%;
  border: 1.5px solid rgba(255, 214, 102, .75); border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(138, 15, 31, .9), inset 0 0 0 4px rgba(255, 214, 102, .35);
  pointer-events: none;
}
.back .stars { position: absolute; inset: 12%; width: 76%; height: 76%; overflow: visible; }
.back .core polygon { fill: #ffe27a; }
.back .glow polygon { fill: #ffc93c; opacity: .55; animation: twinkle 2.8s ease-in-out infinite alternate; animation-delay: var(--tw, 0s); }
.back .glow .tw1 { animation-duration: 2.1s; animation-delay: calc(var(--tw, 0s) - .7s); }
.back .glow .tw2 { animation-duration: 2.5s; animation-delay: calc(var(--tw, 0s) - 1.6s); }
.back .glow .tw3 { animation-duration: 1.9s; animation-delay: calc(var(--tw, 0s) - .3s); }
.back .glow .tw4 { animation-duration: 2.3s; animation-delay: calc(var(--tw, 0s) - 1.1s); }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
.back .spin { transform-box: view-box; transform-origin: 50% 50%; animation: orbit 20s linear infinite; animation-delay: var(--orb, 0s); } /* den store stjerne drejer langsomt rundt */
@keyframes orbit { to { transform: rotate(360deg); } }
.front { transform: rotateY(180deg); overflow: hidden; }
/* Found pair: a light beam sweeps once from top-left to bottom-right. */
.front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, transparent 42%, rgba(255,255,255,.15) 46%, rgba(255,255,255,.9) 50%, rgba(255,255,255,.15) 54%, transparent 58%);
  background-size: 300% 300%; background-position: 0% 0%; background-repeat: no-repeat;
}
.card.shine .front::after { animation: shine 900ms ease-in-out 280ms both; }
@keyframes shine { from { background-position: 100% 100%; } to { background-position: 0% 0%; } }
.front img { width: 80%; height: 80%; object-fit: contain; }
/* Illustrated faces: white card, faint red-grey tint towards the bottom. */
.front.art {
  background: linear-gradient(180deg, #fff 0%, #fff 35%, #d3dee9 100%);
  overflow: hidden;
}
.front.art img {
  position: absolute; top: 11%; left: 11%; width: 78%; height: 78%;
  object-fit: contain; object-position: 50% 50%;
  -webkit-user-drag: none; user-select: none;
}
.front.align-top img { top: 0; height: 89%; object-position: 50% 0; }
.front.align-right img { left: 11%; width: 89%; object-position: 100% 50%; }
.front.align-julemor img { top: calc(24.35% - 28px); left: 17.6%; width: 64.8%; height: 145.6%; object-position: 50% 0; }
.front.align-rudolf img { top: calc(4.35% - 40px); left: calc(14% + 15px); width: 72%; height: 193.5%; object-position: 50% 0; }
.front.align-bottom-left img { top: calc(-11.3% - 18px); left: 0; width: calc(117.3% + 18px); height: calc(117.3% + 18px); object-position: 0 100%; }
.front.align-storm img { top: calc(-1.6% + 15px); left: -1.6%; width: 103.2%; height: 103.2%; }
.front.align-wide img { top: calc(-2.4% + 10px); left: -2.25%; width: 104.5%; height: 102.4%; object-fit: contain; object-position: 50% 100%; }
/* Face-up drawings float gently up and down, each card at its own pace. */
.card:not([data-state="down"]) .front.art img { animation: float 3.2s ease-in-out infinite alternate; animation-delay: var(--fl, 0s); }
@keyframes float { from { transform: translateY(2.5%); } to { transform: translateY(-2.5%); } }
.emoji { font-size: calc(var(--size) / var(--cols) * .5); line-height: 1; }
.card[data-state="matched"] .front { box-shadow: 0 0 0 3px #ffd54a; }
.card.pulse .inner { animation: pulse 400ms ease var(--flip); }
@keyframes pulse { 50% { transform: rotateY(180deg) scale(1.08); } }

.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); /* z-index: over spilbaren (.hud har z-index 1) – 2026-11-15 */
  display: grid; place-items: center; padding: 16px;
}
.panel {
  background: var(--panel); color: var(--panel-fg);
  border-radius: 16px; padding: 24px 32px; text-align: center;
  max-width: 360px; width: 100%;
}
.panel h2 { margin-top: 0; color: var(--accent); }
.panel p { margin: .3em 0; }
.note { font-size: .85rem; opacity: .7; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  .back .glow polygon { animation: none; opacity: .7; }
  .back .spin { animation: none; }
  .card.shine .front::after { animation: none; }
  .card .front.art img { animation: none !important; }
  .inner { transition: none; }
  .card.pulse .inner { animation: none; }
}

/* ---------- Popups (runde-intro, banen er klaret, tiden er gået, afslutning) – 2026-10-27 ----------
   Røde som kortenes bagside, hvid tekst, inverteret knap (hvid med rød tekst) og et subtilt mønster af stjerner. */
.panel {
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22 viewBox=%220 0 160 160%22%3E%3Cpolygon points=%2223.5,15.1 25.4,22.4 32.8,24.1 26.4,28.2 27.2,35.7 21.3,30.9 14.4,33.9 17.1,26.9 12.1,21.2 19.7,21.6%22 fill=%22%23fff%22 fill-opacity=%220.152%22/%3E%3Cpolygon points=%2296.8,12.1 99.1,15.5 103.2,15.0 100.7,18.3 102.5,22.0 98.6,20.6 95.6,23.5 95.7,19.4 92.0,17.4 96.0,16.2%22 fill=%22%23fff%22 fill-opacity=%220.122%22/%3E%3Cpolygon points=%22143.1,53.5 143.4,59.7 149.0,62.3 143.2,64.5 142.5,70.7 138.6,65.8 132.5,67.0 136.0,61.9 132.9,56.5 138.9,58.1%22 fill=%22%23fff%22 fill-opacity=%220.136%22/%3E%3Cpolygon points=%2260.5,64.1 65.2,72.5 74.8,72.3 68.2,79.3 71.4,88.4 62.7,84.3 55.0,90.1 56.2,80.6 48.3,75.1 57.8,73.3%22 fill=%22%23fff%22 fill-opacity=%220.107%22/%3E%3Cpolygon points=%2219.8,111.2 20.4,116.0 25.0,117.6 20.6,119.7 20.5,124.5 17.2,121.0 12.6,122.4 14.9,118.2 12.1,114.2 16.9,115.1%22 fill=%22%23fff%22 fill-opacity=%220.122%22/%3E%3Cpolygon points=%22108.3,116.6 113.7,122.9 121.7,120.9 117.4,128.0 121.7,135.1 113.7,133.1 108.3,139.4 107.6,131.2 100.0,128.0 107.6,124.8%22 fill=%22%23fff%22 fill-opacity=%220.152%22/%3E%3Cpolygon points=%22150.0,145.0 151.3,148.2 154.8,148.5 152.1,150.7 152.9,154.0 150.0,152.2 147.1,154.0 147.9,150.7 145.2,148.5 148.7,148.2%22 fill=%22%23fff%22 fill-opacity=%220.107%22/%3E%3Cpolygon points=%2281.0,140.8 80.5,144.9 83.9,147.2 79.8,148.0 78.6,152.0 76.7,148.3 72.5,148.4 75.4,145.4 74.0,141.5 77.7,143.3%22 fill=%22%23fff%22 fill-opacity=%220.122%22/%3E%3Cpolygon points=%22132.7,94.1 133.3,96.7 136.0,97.4 133.6,98.8 133.8,101.6 131.7,99.8 129.1,100.8 130.2,98.3 128.5,96.1 131.2,96.4%22 fill=%22%23fff%22 fill-opacity=%220.091%22/%3E%3Cpolygon points=%2242.3,48.4 44.3,50.2 46.9,49.3 45.8,51.8 47.5,53.9 44.8,53.6 43.2,55.9 42.7,53.2 40.0,52.5 42.4,51.1%22 fill=%22%23fff%22 fill-opacity=%220.091%22/%3E%3C/svg%3E") 0 0 / 160px 160px, radial-gradient(circle at 50% 30%, #d42a3c 0%, #b3172a 55%, #8a0f1f 100%);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 214, 102, .55), inset 0 0 0 6px rgba(138, 15, 31, .6), 0 18px 50px rgba(0, 0, 0, .45);
}
.panel h2 { color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.panel .btn { background: #fff; color: #b3172a; font-weight: 800; box-shadow: 0 4px 0 rgba(90, 8, 20, .45); }
.panel .btn:hover { background: #fff6e0; }
.panel .note { opacity: .85; }
.panel .ri-kicker { opacity: .8; }
.panel .ri-timed { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); }
.panel .points { border-top-color: rgba(255, 255, 255, .35); }
.panel .board-list li.me { background: rgba(255, 255, 255, .16); }
.panel .board-list .initials { background: #fff; color: #b3172a; }

#ri-desc { white-space: pre-line; } /* linjeskift i rundeteksterne (\n i levels.js) */
#ri-icon.ri-white { filter: brightness(0) invert(1) drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); } /* hvide fodspor (On the move) */

/* ---------- Vælg runde (banevalg) – 2026-10-27: røde kort med guldkant, ikoner i gyldne cirkler, hvid tekst ---------- */
.round-btn {
  color: #fff;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22 viewBox=%220 0 160 160%22%3E%3Cpolygon points=%2223.5,15.1 25.4,22.4 32.8,24.1 26.4,28.2 27.2,35.7 21.3,30.9 14.4,33.9 17.1,26.9 12.1,21.2 19.7,21.6%22 fill=%22%23fff%22 fill-opacity=%220.152%22/%3E%3Cpolygon points=%2296.8,12.1 99.1,15.5 103.2,15.0 100.7,18.3 102.5,22.0 98.6,20.6 95.6,23.5 95.7,19.4 92.0,17.4 96.0,16.2%22 fill=%22%23fff%22 fill-opacity=%220.122%22/%3E%3Cpolygon points=%22143.1,53.5 143.4,59.7 149.0,62.3 143.2,64.5 142.5,70.7 138.6,65.8 132.5,67.0 136.0,61.9 132.9,56.5 138.9,58.1%22 fill=%22%23fff%22 fill-opacity=%220.136%22/%3E%3Cpolygon points=%2260.5,64.1 65.2,72.5 74.8,72.3 68.2,79.3 71.4,88.4 62.7,84.3 55.0,90.1 56.2,80.6 48.3,75.1 57.8,73.3%22 fill=%22%23fff%22 fill-opacity=%220.107%22/%3E%3Cpolygon points=%2219.8,111.2 20.4,116.0 25.0,117.6 20.6,119.7 20.5,124.5 17.2,121.0 12.6,122.4 14.9,118.2 12.1,114.2 16.9,115.1%22 fill=%22%23fff%22 fill-opacity=%220.122%22/%3E%3Cpolygon points=%22108.3,116.6 113.7,122.9 121.7,120.9 117.4,128.0 121.7,135.1 113.7,133.1 108.3,139.4 107.6,131.2 100.0,128.0 107.6,124.8%22 fill=%22%23fff%22 fill-opacity=%220.152%22/%3E%3Cpolygon points=%22150.0,145.0 151.3,148.2 154.8,148.5 152.1,150.7 152.9,154.0 150.0,152.2 147.1,154.0 147.9,150.7 145.2,148.5 148.7,148.2%22 fill=%22%23fff%22 fill-opacity=%220.107%22/%3E%3Cpolygon points=%2281.0,140.8 80.5,144.9 83.9,147.2 79.8,148.0 78.6,152.0 76.7,148.3 72.5,148.4 75.4,145.4 74.0,141.5 77.7,143.3%22 fill=%22%23fff%22 fill-opacity=%220.122%22/%3E%3Cpolygon points=%22132.7,94.1 133.3,96.7 136.0,97.4 133.6,98.8 133.8,101.6 131.7,99.8 129.1,100.8 130.2,98.3 128.5,96.1 131.2,96.4%22 fill=%22%23fff%22 fill-opacity=%220.091%22/%3E%3Cpolygon points=%2242.3,48.4 44.3,50.2 46.9,49.3 45.8,51.8 47.5,53.9 44.8,53.6 43.2,55.9 42.7,53.2 40.0,52.5 42.4,51.1%22 fill=%22%23fff%22 fill-opacity=%220.091%22/%3E%3C/svg%3E") 0 0 / 160px 160px, radial-gradient(circle at 50% 30%, #d42a3c 0%, #b3172a 60%, #8a0f1f 100%);
  border: 2px solid #e2b94c;
  box-shadow: inset 0 0 0 3px rgba(138, 15, 31, .55), 0 6px 16px rgba(0, 0, 0, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.round-btn .ri {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; line-height: 1;
  background: radial-gradient(circle at 35% 30%, #fff1c0 0%, #f0cf6a 38%, #c99a2e 78%, #8f6c12 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 2px #8f6c12, 0 2px 5px rgba(0, 0, 0, .35);
}
.round-btn .rs { opacity: .85; }
.round-btn .rp { color: #ffe27a; }
.round-btn.done .rp::before { color: #ffe27a; }
@media (hover: hover) { .round-btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: inset 0 0 0 3px rgba(138, 15, 31, .55), 0 10px 22px rgba(0, 0, 0, .45); } }
.round-btn:disabled { color: #fff; background: radial-gradient(circle at 50% 30%, #7a1a26 0%, #5a0f1a 100%); border-color: rgba(226, 185, 76, .45); opacity: .75; }
.round-btn:disabled .ri { filter: saturate(.4) brightness(.85); }
/* Vælg runde: Kriss Kross-gnisterne hvide; Classic-kortet får en mørk kontur, så det står frem på guldet */
.round-btn .ri i { font-style: normal; display: block; }
.round-btn .ri.ri-kant i { filter: drop-shadow(1px 0 0 #6b0f1c) drop-shadow(-1px 0 0 #6b0f1c) drop-shadow(0 1px 0 #6b0f1c) drop-shadow(0 -1px 0 #6b0f1c); }
/* SVG-ikoner (Kriss Kross-zigzag): samme størrelse som emojierne */
.ico-svg { display: block; width: 1em; height: 1em; }
.round-btn .ri .ico-svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(90, 15, 26, .7)); }
#ri-icon .ico-svg { width: 1em; height: 1em; margin: 0 auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }

/* ---------- Telefon (2026-11-15): alt på én skærm uden at rulle ----------
   Vælg runde: rundekortene to og to og mere kompakte. Spilskærmen: logo + julemand rykkes lidt til venstre, når
   de fælles skærmknapper (bf-skaerm.js: fuld skærm + luk) sidder øverst til højre. */
@media (max-width: 599px) {
  .rounds-screen h2 { font-size: 1.6rem; }
  .round-list { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; margin: 10px 0 12px; }
  .round-btn { grid-template-columns: 34px 1fr; gap: 1px 8px; padding: 8px 9px; border-radius: 10px; }
  .round-btn .ri { width: 34px; height: 34px; font-size: 1.05rem; grid-row: 1 / 3; }
  .round-btn .ri .ico-svg { width: 20px; height: 20px; }
  .round-btn .rn { font-size: .92rem; line-height: 1.15; }
  .round-btn .rs { font-size: .76rem; line-height: 1.2; }
  .round-btn .rp { grid-column: 2; font-size: .8rem; }
  html.bfsk-side .game-top { transform: translateX(-60px); }
}

/* ---------- Telefon (2026-11-16): startskærmen på én skærm ----------
   Logo, julemand og knapper skalerer med skærmhøjden; toplisten (top 10) står under og må gerne kræve, at man ruller. */
@media (max-width: 599px) {
  #start { margin: 0 auto; width: 100%; min-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
  #start[hidden] { display: none; }
  #start .start-content { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; }
  #start { box-sizing: border-box; padding-top: clamp(16px, 4.5dvh, 40px); }
  .studio-mark { width: 60px; flex: none; transform: none; margin-bottom: 2px; }
  .logo-title { flex: none; }
  .logo-title img { width: min(84vw, 460px, 40dvh); }
  .start-row { gap: 12px; margin-top: 6px; flex: none; }
  .start-santa { height: clamp(96px, 22dvh, 200px); }
  .start-menu { padding: 10px; }
  .start-menu .start-actions { gap: 7px; }
  .start-menu .btn, .start-menu .btn.big { height: clamp(40px, 6.6dvh, 50px); }
  #s-board { margin-top: 10px; flex: none; width: 100%; padding-bottom: 16px; }
  #s-board h3 { margin-bottom: 4px; }
  #s-board li { padding: 2px 8px; }
  #s-board img, #s-board .initials { width: 28px; height: 28px; }
}

/* 2026-11-16: popups der er højere end skærmen (slut-popuppen med top 10) kan rulles; margin:auto centrerer uden at toppen skæres af */
.overlay { overflow-y: auto; overscroll-behavior: contain; }
.overlay > .panel { margin: auto; }
@media (max-width: 599px) {
  .panel { padding: 20px 20px; }
  .panel .board-list { margin-top: 12px; }
  .panel .board-list li { padding: 2px 8px; }
  .panel .board-list img, .panel .board-list .initials { width: 28px; height: 28px; }
}
/* 2026-11-16: Vælg runde på telefon — alle rundekort lige høje (fylder hele rækken) */
@media (max-width: 599px) {
  .round-list > li { display: flex; }
  .round-list .round-btn { height: 100%; align-content: center; }
}
