:root {
  --roed: #c41e27;
  --moerkroed: #7d0d14;
  --guld: #e2b53e;
  --creme: #fff3d6;
  --papir: #fdf6e3;
  --tekst: #2b1a10;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--creme);
  background: #1e4030;
  overflow-x: hidden;
}

/* ---------- Julestuen (baggrund) ---------- */
.stue { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
.stue .sne circle { animation: sne linear infinite; }
.stue .lys { animation: blink 1.4s ease-in-out infinite alternate; }
.stue .flamme { transform-box: fill-box; transform-origin: 50% 100%; animation: flak .45s ease-in-out infinite alternate; }
.stue .hjerte { transform-box: fill-box; transform-origin: 50% 0; animation: sving 5s ease-in-out infinite; }
@keyframes sne { to { transform: translateY(400px); } }
@keyframes blink { from { opacity: .3; } to { opacity: 1; } }
@keyframes flak { to { transform: scale(1.1, .86) skewX(4deg); } }
@keyframes sving { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ---------- Resultatsiden ---------- */
.scene {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
}
.hilsen {
  position: relative;
  max-width: min(640px, 100%);
  padding: .7rem 1.6rem .9rem;
  background: linear-gradient(180deg, #fffdf7 0%, #f7ead0 100%);
  border: 4px solid var(--guld);
  border-radius: 18px;
  box-shadow: inset 0 0 0 3px #fffdf7, inset 0 0 0 5px rgba(196, 30, 39, .35), 0 14px 34px rgba(0, 0, 0, .5);
}
.hilsen h1 {
  font-family: "Mountains of Christmas", cursive;
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 1;
  margin: 0;
  color: var(--moerkroed);
}
.hilsen p {
  margin: .3rem 0 0;
  font-size: clamp(1rem, 3.6vw, 1.25rem);
  font-weight: 800;
  color: #4a2c17;
}
.hemmelig {
  margin: .3rem 0 0;
  padding: .25rem .9rem;
  font-size: clamp(1rem, 3.6vw, 1.25rem);
  font-weight: 800;
  color: #4a2c17;
  background: linear-gradient(180deg, #fffdf7, #f7ead0);
  border: 3px solid var(--guld);
  border-radius: 999px;
  opacity: 0;
  transition: opacity .8s;
}
.hemmelig.vis { opacity: 1; }

.tombola-ramme {
  position: relative;
  width: min(720px, 100%, calc((100svh - 200px) * 720 / 560));
  min-width: 280px;
  aspect-ratio: 720 / 560;
  container-type: inline-size;
}
.tombola { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .45)); }
#haandtag { cursor: pointer; }
.trukket #haandtag { cursor: default; }

/* Skiltet */
.skilt {
  position: absolute;
  left: 63.2%; top: 3%;
  width: 34.7%; height: 16%;
  padding: 0;
  font-family: "Mountains of Christmas", cursive;
  font-weight: 700;
  font-size: 6.2cqi;
  line-height: 1;
  color: var(--creme);
  text-shadow: 0 .3cqi 0 #3d2210;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .09) 0 2px, transparent 2px 14px),
    linear-gradient(#a8692f, #7a4a22);
  border: .5cqi solid #3d2210;
  border-radius: 1.6cqi;
  box-shadow: 0 .8cqi 0 #3d2210, 0 2cqi 3cqi rgba(0, 0, 0, .45);
  cursor: pointer;
  transform-origin: 50% 100%;
  animation: vip 2.4s ease-in-out infinite;
}
.skilt:hover { filter: brightness(1.15); }
.skilt:focus-visible { outline: 3px solid var(--guld); outline-offset: 4px; }
.skiltdel { transition: opacity .4s; }
.pil { animation: puf 1s ease-in-out infinite; }
.trukket .skiltdel { opacity: 0; }
.trukket .skilt { animation: vaek .5s ease-in forwards; pointer-events: none; }
@keyframes vip { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes puf { 50% { transform: translate(-7px, 7px); } }
@keyframes vaek { to { transform: translateY(-40%) rotate(-18deg); opacity: 0; } }

/* Sedlerne */
.resultater {
  position: absolute;
  left: 2%; right: 2%; bottom: 5%;
  display: flex;
  justify-content: center;
  gap: 4%;
  pointer-events: none;
  filter: drop-shadow(0 1.4cqi 1.6cqi rgba(0, 0, 0, .5));
}
.seddel {
  position: relative;
  width: 44%;
  padding: 2.6cqi 4cqi;
  background: var(--papir);
  color: var(--tekst);
  border-radius: 1.2cqi;
  opacity: 0;
  -webkit-mask:
    radial-gradient(circle at 0 50%, transparent 2.4cqi, #000 2.5cqi) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 2.4cqi, #000 2.5cqi) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle at 0 50%, transparent 2.4cqi, #000 2.5cqi) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 2.4cqi, #000 2.5cqi) right / 51% 100% no-repeat;
}
.seddel::before {
  content: "";
  position: absolute;
  inset: 1.2cqi 3.4cqi;
  border: .35cqi dashed rgba(196, 30, 39, .45);
  border-radius: .8cqi;
}
.seddel .etiket { font-size: 2.3cqi; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8a6a4a; }
.seddel .navn {
  font-family: "Mountains of Christmas", cursive;
  font-weight: 700;
  font-size: 6.6cqi;
  line-height: 1.05;
  margin: .6cqi 0 1cqi;
  color: var(--moerkroed);
  overflow-wrap: anywhere;
}
.seddel .stempel {
  display: inline-block;
  padding: .4cqi 1.8cqi;
  font-size: 2.8cqi;
  font-weight: 900;
  color: #fff;
  background: var(--roed);
  border-radius: 999px;
  transform: rotate(-4deg);
}
@container (max-width: 480px) {
  .resultater { left: -2%; right: -2%; bottom: -6%; gap: 3%; }
  .seddel { width: 48%; padding: 3.4cqi 5cqi; }
  .seddel .etiket { font-size: 3.2cqi; }
  .seddel .navn { font-size: 9.5cqi; }
  .seddel .stempel { font-size: 4cqi; }
}
.gnist {
  position: absolute;
  left: 0; top: 0;
  font-size: 4cqi;
  color: #ffe08a;
  text-shadow: 0 0 8px #ffd76a;
  pointer-events: none;
}

/* ---------- Admin ---------- */
.kort {
  width: min(640px, calc(100% - 32px));
  margin: 6vh auto;
  padding: 1.5rem 1.5rem 2rem;
  background: var(--papir);
  color: var(--tekst);
  border: 4px solid var(--guld);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  line-height: 1.5;
}
.kort h1 {
  font-family: "Mountains of Christmas", cursive;
  font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--moerkroed);
}
.kort h2 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
.kort ul { padding-left: 1.2rem; margin: 0; }
.kort li { margin: .35rem 0; }
.kort form { display: flex; gap: .5rem; }
.kort input[type=text] {
  flex: 1;
  min-width: 0;
  padding: .55rem .8rem;
  font: inherit;
  border: 2px solid #d9c9a8;
  border-radius: 10px;
  background: #fff;
}
.kort input[type=text]:focus { outline: none; border-color: var(--roed); }
.knap {
  padding: .55rem 1.1rem;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: var(--roed);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.knap:hover:not(:disabled) { background: #a8151e; }
.knap:disabled { opacity: .45; cursor: not-allowed; }
.knap.lille { padding: .2rem .7rem; font-size: .85rem; background: #8a6a4a; }
.knap.stor { margin-top: 1.5rem; font-size: 1.1rem; padding: .75rem 1.4rem; }
.lodder { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0 !important; }
.lodder li { margin: 0; padding: .15rem .6rem; background: #fff; border: 2px dashed #e0b9b9; border-radius: 6px; font-size: .9rem; }
.linkliste { list-style: none; padding: 0 !important; }
.linkliste li { margin: .8rem 0; }
.linkliste .raekke { display: flex; gap: .5rem; margin-top: .2rem; }
.linkliste input { font-size: .8rem !important; }
.fejl { color: #b00020; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, .stue * { animation: none !important; }
}
