:root {
  --green-900: #06231b;
  --green-800: #0b3227;
  --green-700: #114634;
  --green-600: #18614a;
  --gold: #d8b45a;
  --gold-soft: #f0d79a;
  --cream: #fdfaf3;
  --paper: #ffffff;
  --ink: #16241f;
  --ink-soft: #4a5c55;
  --line: #e4e7e3;
  --danger: #b03a3a;
  --danger-soft: #fdecec;
  --ok: #1f7a4d;
  --radius: 16px;
  --shadow: 0 18px 40px -22px rgba(4, 26, 20, .55), 0 2px 8px rgba(4, 26, 20, .08);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 12% -8%, #17503c 0%, rgba(23, 80, 60, 0) 60%),
    radial-gradient(900px 520px at 92% 4%, #123c4d 0%, rgba(18, 60, 77, 0) 58%),
    linear-gradient(168deg, var(--green-800) 0%, var(--green-900) 58%, #041711 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ baggrund */
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 320px at 78% 22%, rgba(216, 180, 90, .14), transparent 70%),
    radial-gradient(620px 380px at 18% 68%, rgba(216, 180, 90, .08), transparent 72%);
  z-index: 0;
}

.snowfall { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snowfall span {
  position: absolute;
  top: -6vh;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 0 6px rgba(255, 255, 255, .45);
  animation: fall linear infinite;
}
.snowfall span:nth-child(1) { left: 4%;  animation-duration: 16s; animation-delay: 0s;   opacity: .45; }
.snowfall span:nth-child(2) { left: 14%; animation-duration: 21s; animation-delay: 2.5s; opacity: .3;  width: 4px; height: 4px; }
.snowfall span:nth-child(3) { left: 27%; animation-duration: 13s; animation-delay: 1.2s; opacity: .5; }
.snowfall span:nth-child(4) { left: 41%; animation-duration: 24s; animation-delay: 4s;   opacity: .25; width: 4px; height: 4px; }
.snowfall span:nth-child(5) { left: 53%; animation-duration: 17s; animation-delay: 0.8s; opacity: .4; }
.snowfall span:nth-child(6) { left: 66%; animation-duration: 22s; animation-delay: 3.2s; opacity: .3; }
.snowfall span:nth-child(7) { left: 76%; animation-duration: 14s; animation-delay: 1.8s; opacity: .45; }
.snowfall span:nth-child(8) { left: 86%; animation-duration: 26s; animation-delay: 5s;   opacity: .22; width: 4px; height: 4px; }
.snowfall span:nth-child(9) { left: 33%; animation-duration: 19s; animation-delay: 2.9s; opacity: .35; }
.snowfall span:nth-child(10){ left: 61%; animation-duration: 15s; animation-delay: 0.3s; opacity: .28; width: 4px; height: 4px; }

@keyframes fall {
  0%   { transform: translate3d(0, -6vh, 0) rotate(0deg); }
  100% { transform: translate3d(28px, 106vh, 0) rotate(360deg); }
}

/* --------------------------------------------------------------- topbar */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--cream);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: .2px;
  font-size: 1.12rem;
}
.brand-mark { width: 30px; height: 30px; color: var(--gold); }
.brand-text { text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user {
  color: var(--gold-soft);
  font-size: .9rem;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
}

/* ----------------------------------------------------------------- layout */
.app {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) clamp(16px, 4vw, 40px) 48px;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3.4vw, 36px);
  border: 1px solid rgba(255, 255, 255, .6);
}

.narrow { max-width: 520px; margin: 0 auto; }
.wide { max-width: 900px; margin: 0 auto; }

.stack > * + * { margin-top: 18px; }
.stack-lg > * + * { margin-top: 28px; }

/* ------------------------------------------------------------- login */
.login-hero { text-align: center; margin-bottom: 22px; }
.login-hero .emoji { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.login-hero h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3.4vw, 1.9rem); letter-spacing: -.4px; }
.login-hero p { margin: 0; color: var(--ink-soft); line-height: 1.55; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fbfcfb;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--green-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24, 97, 74, .14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 620;
  font-size: .97rem;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 3px solid rgba(216, 180, 90, .6); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(180deg, var(--green-600), var(--green-700));
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(17, 70, 52, .9);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #1c6d54, var(--green-600)); }

.btn-gold {
  background: linear-gradient(180deg, #e6c470, var(--gold));
  color: #33270a;
  box-shadow: 0 10px 22px -12px rgba(216, 180, 90, .95);
}
.btn-gold:hover:not(:disabled) { background: linear-gradient(180deg, #ecd086, #dcb85c); }

.btn-ghost {
  background: rgba(255, 255, 255, .08);
  color: var(--cream);
  border-color: rgba(255, 255, 255, .22);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }

.btn-outline {
  background: #fff;
  color: var(--green-700);
  border-color: var(--line);
}
.btn-outline:hover:not(:disabled) { border-color: var(--green-600); background: #f5faf7; }

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f3cccc; }
.btn-danger:hover:not(:disabled) { background: #fbdede; }

.btn-block { width: 100%; }
.btn-lg { padding: 16px 26px; font-size: 1.08rem; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 9px; }

/* -------------------------------------------------------------- deltager */
.participant-head { text-align: center; margin-bottom: 26px; }
.participant-head .hello {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gold);
  font-weight: 700;
}
.participant-head h1 { margin: 8px 0 6px; font-size: clamp(1.6rem, 4vw, 2.15rem); letter-spacing: -.6px; }
.participant-head p { margin: 0; color: var(--ink-soft); }

.draw-panel {
  text-align: center;
  padding: clamp(26px, 4vw, 42px) clamp(20px, 3vw, 34px);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdfb, #f3f8f5);
  border: 1px solid #e3ece7;
}

.recipient {
  margin-top: 6px;
  font-size: clamp(2rem, 7vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -.8px;
  color: var(--green-700);
  line-height: 1.12;
  word-break: break-word;
}
.recipient-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--ink-soft);
  font-weight: 700;
}

.secret-note {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .88rem;
  color: var(--ink-soft);
  background: #fff;
  border: 1px dashed #d8e2dc;
  border-radius: 11px;
  padding: 10px 14px;
}

.reveal-fx { animation: reveal .55s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes reveal {
  0%   { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(6px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
.sparkles { position: relative; display: inline-block; }
.sparkles::before, .sparkles::after {
  content: "✦";
  position: absolute;
  color: var(--gold);
  font-size: 1.1rem;
  animation: twinkle 2.2s ease-in-out infinite;
}
.sparkles::before { top: -.55em; left: -1.1em; }
.sparkles::after { bottom: -.35em; right: -1.15em; animation-delay: 1.1s; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

/* ------------------------------------------------------------- admin */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-title h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section-title h2 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

.hint { color: var(--ink-soft); font-size: .92rem; line-height: 1.55; margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  background: #f7f9f8;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--ink-soft);
  font-weight: 700;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcfa; }
td.actions { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .2px;
}
.badge-ok { background: #e6f5ec; color: var(--ok); }
.badge-wait { background: #f1f3f2; color: #6d7c76; }
.badge-live { background: #fdf3dc; color: #9a7413; }

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: #f7faf8;
  border: 1px solid #e6ede9;
  border-radius: 12px;
  padding: 14px 16px;
}
.stat .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .9px; color: var(--ink-soft); font-weight: 700; }
.stat .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.6px; margin-top: 3px; color: var(--green-700); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1 1 180px; margin-bottom: 0; }

.alert {
  padding: 12px 15px;
  border-radius: 11px;
  font-size: .92rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-info { background: #eef6f2; color: #1c5e48; border: 1px solid #d5e8df; }
.alert-warn { background: #fdf6e3; color: #8a6a12; border: 1px solid #f0e2b6; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3cccc; }

.divider { height: 1px; background: var(--line); margin: 26px 0; border: 0; }

.credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 14px;
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .93rem;
}
.credential .copy { font-family: var(--font); }

.empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fcfdfc;
}
.empty .big { font-size: 1.8rem; display: block; margin-bottom: 6px; }

/* --------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 24px);
  background: #10221b;
  color: #fff;
  padding: 12px 18px;
  border-radius: 11px;
  font-size: .93rem;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 50;
  max-width: min(92vw, 460px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #7d2222; }
.toast.success { background: #14563c; }

/* --------------------------------------------------------------- footer */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px 26px;
  color: rgba(255, 255, 255, .55);
  font-size: .84rem;
}
.footer p { margin: 0; }

/* --------------------------------------------------------------- mobile */
@media (max-width: 560px) {
  .section-title { align-items: flex-start; flex-direction: column; }
  .btn { width: 100%; }
  .row .btn { width: 100%; }
  td.actions .btn { width: auto; }
}
