@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --yellow: #fbcb12;
  --yellow-strong: #e4a814;
  --yellow-soft: #fff2cc;
  --navy: #1e1655;
  --navy-2: #372b91;
  --grape: #b8256a;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f6f5f2;
  --text: #1a1a1a;
  --muted: #5f6068;
  --line: #e7e7e7;
  --stage: #1e1655;
  --stage-text: #ffffff;
  --stage-muted: #c5c1e2;
  --glow: rgba(251, 203, 18, 0.55);
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 8px 24px rgba(26, 26, 26, 0.06);
  --radius: 24px;
  --r: 10px;
  --font-head: 'Space Grotesk', Arial, sans-serif;
  --font-body: 'Inter', Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #121212;
  --surface: #1c1c1c;
  --surface-2: #262626;
  --text: #f5f5f4;
  --muted: #a3a3a3;
  --line: #303030;
  --stage: #1c1c1c;
  --stage-text: #ffffff;
  --stage-muted: #b5b5b5;
  --glow: rgba(251, 203, 18, 0.10);
  --grape: #e07fa9;
  --yellow-soft: #2e2919;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at -10% -20%, var(--glow), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(34px, 7vw, 60px); line-height: 1.05; }
h2 { font-size: 22px; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin: 12px auto 0;
  width: min(1240px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 22px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .b { color: var(--yellow); }
.brands {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}
.brands img { display: block; width: auto; }
.brands .lg-bb { height: 22px; }
.brands .lg-k, .brands .lg-bt { height: 34px; }
.brands .x { color: var(--muted); font-size: 15px; }
:root[data-theme='dark'] .brands .on-light,
:root:not([data-theme='dark']) .brands .on-dark { display: none; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r);
  background: var(--yellow-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar .spacer { flex: 1; }
.xmas-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; white-space: nowrap;
  font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: -0.02em;
}
.xmas-tag .b { color: var(--yellow); }
.xmas-tag .xt-flower { width: 30px; display: block; line-height: 0; }
.xmas-tag .xt-star { width: 16px; display: block; line-height: 0; transform: translateY(-7px) rotate(12deg); }
.xmas-tag svg { width: 100%; height: auto; display: block; }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Bausteine ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 0;
  border-radius: var(--r);
  background: var(--yellow);
  color: #1a1a1a;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: #ffd963; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
:root[data-theme='dark'] .btn-dark { background: #2c2c2c; }
:root[data-theme='dark'] .btn-dark:hover { background: #363636; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--yellow);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.narrow { max-width: 460px; }
.page-center {
  display: grid;
  place-items: center;
  padding: 24px;
}
.page-center .card { display: grid; gap: 14px; justify-items: start; }

.input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}
.input:focus { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(251, 203, 18, 0.25); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: var(--r);
  background: var(--navy);
  color: #fff;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
  max-width: calc(100% - 32px);
  text-align: center;
}
:root[data-theme='dark'] .toast { background: var(--yellow); color: #1a1a1a; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.banner {
  margin: 0;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--yellow-soft);
  font-weight: 500;
}
.banner.warn { background: rgba(184, 37, 106, 0.12); color: var(--grape); }

body.wide .topbar { width: min(1480px, calc(100% - 24px)); }
body.slim .topbar { width: min(680px, calc(100% - 24px)); }

/* ---------- Startseite ---------- */
.hero {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: clamp(48px, 10vh, 120px) clamp(8px, 4vw, 64px) 64px;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
}
.hero p.lead { font-size: 18px; max-width: 520px; margin: 20px 0 0; }
.join {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 32px;
}
.code-input {
  font-family: var(--font-head);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-align: center;
  padding: 14px 0 14px 0.35em;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.steps { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: center; }
.steps b {
  width: 28px; height: 28px; flex: none; border-radius: var(--r);
  display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow);
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
}

/* ---------- Gast ---------- */
.guest {
  width: min(680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 80px;
  display: grid;
  gap: 16px;
}
.now {
  position: relative;
  background: var(--stage);
  color: var(--stage-text);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
}
.now .cover { width: 92px; height: 92px; border-radius: 14px; object-fit: cover; background: rgba(255,255,255,0.08); }
.now .label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); font-weight: 600; }
.now .title { font-family: var(--font-head); font-size: 20px; font-weight: 500; line-height: 1.2; margin-top: 4px; }
.now .artist { color: var(--stage-muted); margin-top: 2px; }
.progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.16); margin-top: 12px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 4px; }

.searchbox { position: relative; }
.searchbox .input { padding-left: 48px; }
.searchbox svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 4px 0; }
.section-head h2 { font-size: 20px; }

.list { display: grid; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 10px 10px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.row .cover { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.row .meta { min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .a { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .by { font-size: 12px; color: var(--grape); font-weight: 600; margin-top: 2px; }
.row .actions { display: flex; gap: 6px; align-items: center; }
.row.next { outline: 2px solid var(--yellow); }
.e-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  background: var(--line); color: var(--muted); vertical-align: 2px; margin-right: 4px;
}

.vote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  justify-content: center;
  padding: 9px 14px;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.vote svg { width: 16px; height: 16px; }
.vote.on { background: var(--yellow); border-color: var(--yellow); color: #1a1a1a; }
.add {
  width: 42px; height: 42px; border-radius: var(--r); border: 0; cursor: pointer;
  background: var(--yellow); color: #1a1a1a; display: grid; place-items: center;
}
.add svg { width: 20px; height: 20px; }
.add.done { background: var(--surface-2); color: var(--muted); }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }

.namebar { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); padding: 0 4px; }
.namebar input {
  border: 0; border-bottom: 1.5px dashed var(--line); background: transparent; color: var(--text);
  font: inherit; padding: 2px 2px; width: 140px; outline: none;
}

/* ---------- Host- und Beamer-Ansicht ---------- */
.screen {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(380px, 1fr);
  gap: 20px;
  align-items: stretch;
}
.main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.main-col .upcard { flex: 1; display: flex; flex-direction: column; }
.main-col .upcard .upnext { flex: 1; align-content: start; }
.main-col .upcard .empty { margin: auto 0; }
.stage {
  background: var(--stage);
  color: var(--stage-text);
  border-radius: 28px;
  padding: 26px 120px 26px 26px;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}
:root[data-theme='dark'] .stage { border: 1px solid var(--line); }
.stage::after {
  content: '';
  position: absolute;
  right: -140px;
  top: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 203, 18, 0.18), transparent 70%);
  pointer-events: none;
}
.stage .label { color: var(--yellow); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; margin-bottom: 6px; }
.stage .big-cover {
  width: 224px;
  height: 224px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}
.stage .stage-info { min-width: 0; position: relative; z-index: 3; }
.stage .big-title { font-family: var(--font-head); font-size: clamp(24px, 2.4vw, 36px); line-height: 1.1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stage .big-artist { font-size: clamp(16px, 1.4vw, 20px); color: var(--stage-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage .times { display: flex; justify-content: space-between; gap: 10px; color: var(--stage-muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stage .orn { position: absolute; top: 0; pointer-events: none; z-index: 0; color: var(--stage-muted); }
.stage .orn-bg { opacity: 0.16; filter: saturate(0.6); }
.stage > img, .stage > .stage-info { position: relative; z-index: 1; }

.side { display: flex; flex-direction: column; gap: 20px; }
.side .joinbox { flex: 1; }
.joinbox {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 28px 28px 30px;
  position: relative;
}
.joinbox .eyebrow { margin: 0; }
.joinbox .qr {
  width: min(100%, 340px);
  aspect-ratio: 1;
  border-radius: 18px;
  background: #fff;
  padding: 12px;
}
.joinbox .code { font-family: var(--font-head); font-size: clamp(56px, 6vw, 88px); font-weight: 600; letter-spacing: 0.12em; line-height: 1; padding-left: 0.12em; }
.join-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; text-align: left; width: min(100%, 380px); }
.join-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: center; font-size: 16px; }
.join-steps b {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--yellow); color: #1a1a1a; font-family: var(--font-head); font-size: 14px;
}
.join-steps strong { color: var(--text); }
.screen.tv .joinbox .qr { width: min(100%, 420px); }
.screen.tv .join-steps li { font-size: 18px; }
.upcard { position: relative; }

/* ---------- Schlitten-Fortschritt ---------- */
.sledbar { position: relative; height: 74px; margin-top: 8px; }
.sledbar .sled-snow, .sledbar .sled-trail {
  position: absolute; left: 0; bottom: 4px; height: 5px; border-radius: 3px;
}
.sledbar .sled-snow { right: 0; background: rgba(255, 255, 255, 0.16); }
.sledbar .sled-trail {
  width: 0;
  background: repeating-linear-gradient(90deg, #fff 0 6px, rgba(255,255,255,0.75) 6px 9px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
  transition: width 0.5s linear;
}
.sledbar .sled {
  position: absolute; bottom: 4px; left: 0; width: 88px; height: 70px;
  transition: left 0.5s linear, transform 0.5s linear;
}
.sledbar .sled svg { width: 88px; height: auto; display: block; position: absolute; bottom: -4px; left: 0; }
.sledbar.playing .sled svg { animation: sled-bob 0.9s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sled-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-1.5deg); }
}
.sledbar .puff {
  position: absolute; bottom: 2px; left: 2px; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; opacity: 0;
}
.sledbar.playing .puff { animation: puff 1.2s ease-out infinite; }
.sledbar.playing .p2 { animation-delay: 0.4s; }
.sledbar.playing .p3 { animation-delay: 0.8s; }
@keyframes puff {
  0% { opacity: 0.8; transform: translate(0, 0) scale(0.6); }
  100% { opacity: 0; transform: translate(-16px, -8px) scale(1.4); }
}
.now .sledbar { height: 46px; margin-top: 4px; }
.now .sledbar .sled { width: 54px; height: 44px; }
.now .sledbar .sled svg { width: 54px; }

/* ---------- Deko ---------- */
.deco-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.deco { position: absolute; pointer-events: none; line-height: 0; }
.deco svg { display: block; width: 100%; height: auto; overflow: visible; }
.deco.dot { border-radius: 50%; opacity: 0.85; }
.topbar, .screen, .guest, .hero { position: relative; z-index: 1; }
.topbar { z-index: 20; }
.card-deco { z-index: 4; }

.upnext { display: grid; gap: 10px; }
.upnext .row { grid-template-columns: 26px 56px 1fr auto; box-shadow: none; background: var(--surface-2); }
.upnext .row .cover { width: 56px; height: 56px; }
.upnext .pos { font-family: var(--font-head); font-weight: 600; color: var(--muted); text-align: center; font-size: 18px; }
.votes {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r);
  background: var(--yellow); color: #1a1a1a; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.votes svg { width: 14px; height: 14px; }
.votes.soft { background: transparent; border: 1.5px solid var(--line); color: var(--text); }

.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.host-only { grid-column: 1 / -1; display: grid; gap: 20px; grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); align-items: start; }
.screen.tv .host-only { display: none; }

.panel {
  position: fixed; inset: 0; z-index: 40; display: grid; justify-items: end;
  background: rgba(10, 8, 30, 0.45);
}
.panel > .sheet {
  width: min(440px, 100%); height: 100%; overflow-y: auto; background: var(--surface);
  padding: 24px; display: grid; gap: 18px; align-content: start;
}
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch input { width: 20px; height: 20px; accent-color: var(--yellow); }
.pick { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.pick button {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line);
  background: transparent; cursor: pointer; text-align: left;
}
.pick button.on { border-color: var(--yellow); background: var(--yellow-soft); }
.pick img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.hostq .row { grid-template-columns: 44px 1fr auto; box-shadow: none; background: var(--surface-2); }
.hostq .row .cover { width: 44px; height: 44px; }
.mini {
  border: 1.5px solid var(--line); background: transparent; border-radius: var(--r); padding: 6px 10px;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.mini.on { background: var(--yellow); border-color: var(--yellow); color: #1a1a1a; }

@media (max-width: 1000px) {
  .screen { grid-template-columns: 1fr; }
  .host-only { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .stage { grid-template-columns: 96px minmax(0, 1fr); padding: 18px; gap: 16px; }
  .stage .big-cover { width: 96px; height: 96px; }
  .stage .orn { display: none; }
}
@media (max-width: 640px) {
  .brands { gap: 6px; }
  .brands .lg-bb { height: 12px; }
  .brands .lg-k, .brands .lg-bt { height: 20px; }
  .brands .x { font-size: 11px; }
  .topbar { gap: 8px; padding: 8px 8px 8px 14px; }
  .topbar .icon-btn { width: 36px; height: 36px; flex: none; }
  .topbar .tag, .topbar .xmas-tag { display: none; }
}
@media (max-width: 520px) {
  .topbar { padding-left: 16px; }
}
@media (max-width: 380px) {
  .brands .lg-bb { height: 11px; }
  .brands .lg-k, .brands .lg-bt { height: 18px; }
}
