/* Wunschbox – Mitternacht & Champagner. Zwei Farben: Tinte + Gold. */

:root {
  --ink: #131217;
  --ink-2: #1a1920;
  --line: #29272f;
  --paper: #f2ede3;
  --muted: rgba(242, 237, 227, 0.56);
  --faint: rgba(242, 237, 227, 0.30);
  --gold: #d3b273;
  --gold-dim: rgba(211, 178, 115, 0.32);
  --serif: "Didot", "Bodoni 72", "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  padding: 0 1.1rem calc(2rem + env(safe-area-inset-bottom));
}

.wrap { max-width: 40rem; margin: 0 auto; }

/* ---- Kopf ---- */

.top { padding: 1.6rem 0 0.4rem; }

.wordmark {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wordmark .dot {
  width: 7px; height: 7px; border-radius: 50%;
  margin-left: auto;
  background: var(--faint);
  transition: background 0.4s;
}
.wordmark .dot.live { background: var(--gold); }

h1.event {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  line-height: 1.12;
  margin: 0.45rem 0 0.35rem;
  letter-spacing: 0.01em;
}

.explainer {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 1.1rem;
  max-width: 34rem;
}

/* ---- Suche ---- */

.search { position: relative; margin-bottom: 1.4rem; }
.search input { scroll-margin-top: 0.8rem; font-size: 16px; } /* 16px: verhindert iOS-Autozoom */

input[type="search"], input[type="text"], input[type="date"], input[type="number"] {
  width: 100%;
  appearance: none;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  font: inherit;
  padding: 0.8rem 1rem;
  outline: none;
}
input:focus { border-color: var(--gold-dim); }
input::placeholder { color: var(--faint); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---- Abschnitte ---- */

.label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 1.6rem 0 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.label .gold { color: var(--gold); }
.label small { letter-spacing: 0.05em; text-transform: none; color: var(--faint); margin-left: auto; }

/* ---- Song-Zeilen ---- */

.rows { list-style: none; margin: 0; padding: 0; }

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  min-height: 60px;
}
.rows .row:last-child { border-bottom: 0; }

.row .pos {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--faint);
  min-width: 1.7ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.row.first .pos { color: var(--gold); font-size: 1.25rem; }

.cover {
  width: 44px; height: 44px;
  border-radius: 9px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  object-fit: cover;
  flex: none;
}

.meta { min-width: 0; flex: 1; }
.meta .t {
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta .a {
  color: var(--muted); font-size: 0.84rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta .w { color: var(--faint); font-size: 0.75rem; }

.badge {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
  margin-top: 0.2rem;
}

/* ---- Buttons ---- */

button {
  appearance: none;
  font: inherit;
  color: var(--paper);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.heart {
  flex: none;
  min-width: 52px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  color: var(--faint);
  border-radius: 10px;
}
.heart svg { width: 21px; height: 21px; display: block; }
.heart svg path { fill: none; stroke: currentColor; stroke-width: 1.6; }
.heart .n { font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.heart.on { color: var(--gold); }
.heart.on svg path { fill: currentColor; stroke: currentColor; }
.heart:active svg { transform: scale(0.85); }
.heart svg { transition: transform 0.15s; }

a.btn { color: var(--paper); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
  padding: 0.7rem 1.1rem;
  min-height: 44px;
  font-size: 0.95rem;
}
.btn:active { border-color: var(--gold-dim); }
.btn.gold { border-color: var(--gold-dim); color: var(--gold); }
.btn.small { padding: 0.35rem 0.7rem; min-height: 36px; font-size: 0.84rem; border-radius: 10px; }

.check {
  flex: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 1.05rem;
}
.check:active { border-color: var(--gold); color: var(--gold); }

.more {
  flex: none;
  width: 36px; height: 44px;
  color: var(--faint);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
}

/* ---- Läuft gerade ---- */

.now {
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.4rem;
}
.now .cover { width: 52px; height: 52px; }
.now .t { font-family: var(--serif); font-size: 1.15rem; }

.eq { display: flex; gap: 3px; align-items: flex-end; height: 18px; margin-left: auto; flex: none; }
.eq i { width: 3px; background: var(--gold); border-radius: 2px; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.25s; }
.eq i:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 17px; } }

/* ---- Historie / gedimmt ---- */

.dim .row { opacity: 0.45; min-height: 48px; }
.dim .cover { width: 34px; height: 34px; }
.dim .meta .t { font-weight: 400; font-size: 0.92rem; }

/* ---- Toast ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.4rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 150%);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  max-width: min(92vw, 26rem);
  text-align: center;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 50;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast.gold { border-color: var(--gold-dim); color: var(--gold); }

/* ---- Undo-Leiste (DJ) ---- */

.undobar {
  position: fixed;
  left: 50%; transform: translate(-50%, 150%);
  bottom: calc(1.4rem + env(safe-area-inset-bottom));
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.45rem 0.6rem 0.45rem 1.1rem;
  display: flex; align-items: center; gap: 0.9rem;
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  z-index: 51;
}
.undobar.show { transform: translate(-50%, 0); }
.undobar button { color: var(--gold); font-weight: 600; padding: 0.3rem 0.7rem; }

/* ---- Menü-Sheet (DJ) ---- */

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--ink-2);
  color: var(--paper);
  width: 100%;
  max-width: 40rem;
  margin: auto auto 0;
  padding: 0.6rem;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog .sheet-title { padding: 0.6rem 0.8rem 0.2rem; color: var(--muted); font-size: 0.85rem; }
dialog button.item {
  display: block; width: 100%; text-align: left;
  padding: 0.85rem 0.8rem; border-radius: 10px; font-size: 1rem;
}
dialog button.item:active { background: var(--ink); }
dialog button.item.danger { color: var(--gold); }

/* ---- Statuszeile (DJ) ---- */

.stats {
  display: flex; gap: 0.4rem; align-items: baseline; flex-wrap: wrap;
  color: var(--muted); font-size: 0.86rem; margin-bottom: 1rem;
}
.stats b { color: var(--paper); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats .sep { color: var(--faint); }

/* ---- Karten / Formulare (Admin) ---- */

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin: 1rem 0;
}
.card h2 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 0 0 0.8rem; }
.field { margin-bottom: 0.85rem; }
.field label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; }
.linkline {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem; color: var(--muted);
  padding: 0.35rem 0;
  min-width: 0;
}
.linkline code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--paper);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.qr-frame { background: #fff; border-radius: 10px; padding: 10px; display: inline-block; margin-top: 0.6rem; }
.qr-frame img, .qr-frame svg { display: block; width: 200px; height: 200px; }

details summary { color: var(--muted); font-size: 0.85rem; cursor: pointer; padding: 0.3rem 0; }

/* ---- Leere Zustände / Screens ---- */

.empty { color: var(--faint); text-align: center; padding: 2.2rem 1rem; font-size: 0.92rem; }
.screen { text-align: center; padding: 4rem 1rem; }
.screen h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin: 0 0 0.6rem; }
.screen p { color: var(--muted); }

/* ---- Funkeln (dezent, respektiert reduced motion) ---- */

.spark {
  position: fixed; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); pointer-events: none; z-index: 60;
  animation: spark 0.7s ease-out forwards;
}
@keyframes spark {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; height: 10px; }
  .spark { display: none; }
  .toast, .undobar { transition: none; }
}
