/* ==========================================================================
   guest.css – Gästeseite von Wunschpult (aus v2 übernommen)
   Bewusst dunkel (dunkle Locations), große Tippflächen, nur System-Schriften.
   ========================================================================== */

:root {
  --night:   #1A1322;
  --panel:   #261C31;
  --panel-2: #30243D;
  --line:    #43344F;
  --text:    #F4EDE3;
  --muted:   #AC9DB9;
  --ok:      #9BD8AE;
  --err:     #F4A193;
  --radius:  16px;
  --accent:  #D9C08C;            /* Standard, wird je Event überschrieben */
  --accent-hi: #EBD9B1;
  --accent-tint: rgba(217, 192, 140, .15);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

/* Farbvorlagen je Event (data-accent am body bzw. an Farbmustern) */
[data-accent="gold"]   { --accent: #D9C08C; --accent-hi: #EBD9B1; --accent-tint: rgba(217, 192, 140, .15); }
[data-accent="rose"]   { --accent: #E9A6B4; --accent-hi: #F4C9D2; --accent-tint: rgba(233, 166, 180, .15); }
[data-accent="mint"]   { --accent: #8ED3BE; --accent-hi: #B6E6D7; --accent-tint: rgba(142, 211, 190, .15); }
[data-accent="sky"]    { --accent: #94BCEB; --accent-hi: #BCD5F3; --accent-tint: rgba(148, 188, 235, .15); }
[data-accent="violet"] { --accent: #B9A3EC; --accent-hi: #D3C5F4; --accent-tint: rgba(185, 163, 236, .15); }
[data-accent="coral"]  { --accent: #F0A483; --accent-hi: #F6C3AC; --accent-tint: rgba(240, 164, 131, .15); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--night);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
}

a { color: var(--accent); }
.wrap { max-width: 34rem; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; }
.wrap.wide { max-width: 62rem; }

h1 { margin: 0 0 1rem; font-size: clamp(2.2rem, 10vw, 3.1rem); line-height: 1.04; font-weight: 800; letter-spacing: -.025em; }
h2 { margin: 0 0 .6rem; font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.kicker { margin: 0 0 .2rem; color: var(--accent); font-weight: 700; }
.lead { margin: 0 0 1.25rem; font-size: 1.15rem; color: var(--muted); }
.hint { margin: .5rem 0; color: var(--muted); font-size: .95rem; }
.opt { font-weight: 500; color: var(--muted); font-size: .85em; }
.ev-head { margin-bottom: 1.25rem; }

.notice { margin: 0 0 1rem; padding: .85rem 1rem; background: var(--panel); border-left: 4px solid var(--accent); border-radius: 12px; }
.notice.err { border-left-color: var(--err); }
.notice.ok  { border-left-color: var(--ok); }

.card { margin: 0 0 1.25rem; padding: 1.25rem; background: var(--panel); border-radius: 18px; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack > .field { margin: 0; }
.row-buttons { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 48px;
  padding: .6rem 1.1rem;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--panel-2);
  border: 2px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s, background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.btn.primary { color: var(--night); background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); background: transparent; border-color: rgba(244, 161, 147, .45); }
.btn.big { width: 100%; min-height: 68px; font-size: 1.3rem; font-weight: 800; border-radius: 20px; }
.btn.wide { width: 100%; }
.btn.small { min-height: 40px; padding: .35rem .85rem; font-size: .92rem; border-radius: 10px; }
.btn.done-btn { color: var(--accent); border-color: transparent; background: var(--accent-tint); }
.btn.sticky { position: sticky; bottom: calc(.75rem + env(safe-area-inset-bottom)); box-shadow: 0 0 0 .75rem var(--night); }
.link { padding: 0; font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; cursor: pointer; text-decoration: underline; }

.btn:focus-visible, .link:focus-visible, .seg > *:focus-visible, .chips button:focus-visible, summary:focus-visible, .result:focus-visible, .event-card:focus-visible {
  outline: 3px solid var(--accent-hi);
  outline-offset: 3px;
}

/* ---------- Formulare ---------- */
.field { display: block; margin-bottom: 1.1rem; }
.field > span { display: block; margin-bottom: .4rem; font-weight: 700; color: var(--muted); }

input[type="text"], input[type="search"], input[type="password"], input[type="url"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 58px;
  padding: .75rem 1rem;
  font: inherit;
  font-size: 1.2rem;            /* ≥ 16px: kein Auto-Zoom auf iPhones */
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
}
.card input, .card select, .card textarea { background: var(--night); }
textarea { min-height: 0; font-size: 1.05rem; resize: vertical; }
select { font-size: 1.05rem; }
input::placeholder, textarea::placeholder { color: #7D6F8A; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
input:disabled { opacity: .5; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: .6rem; padding: 0; font-weight: 700; color: var(--muted); }

.code-input { text-align: center; font-size: 2.2rem !important; font-weight: 800; letter-spacing: .35em; text-transform: uppercase; min-height: 76px !important; }

/* Schalter (Checkbox als Toggle) */
.switch { display: flex; align-items: flex-start; gap: .85rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span { position: relative; padding-left: 3.6rem; min-height: 32px; font-weight: 600; }
.switch > span small { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }
.switch > span::before, .switch > span::after { content: ""; position: absolute; left: 0; top: 2px; transition: transform .15s, background-color .15s; }
.switch > span::before { width: 2.9rem; height: 28px; border-radius: 999px; background: var(--line); }
.switch > span::after { top: 6px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); }
.switch input:checked + span::before { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(1.4rem); background: var(--night); }
.switch input:focus-visible + span::before { outline: 3px solid var(--accent-hi); outline-offset: 2px; }
.switch.small > span { font-size: .92rem; }

/* ---------- Segment-Umschalter (Reiter) ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .35rem; margin: 0 0 1.25rem; padding: .3rem; background: var(--panel); border-radius: 16px; }
.seg > * {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 52px; padding: .4rem .5rem;
  font: inherit; font-weight: 700; color: var(--muted); text-align: center; text-decoration: none;
  background: none; border: 0; border-radius: 12px; cursor: pointer;
}
.seg > [aria-pressed="true"] { color: var(--night); background: var(--accent); }
.count { min-width: 1.6rem; padding: 0 .4rem; font-size: .85rem; color: var(--night); background: var(--accent-hi); border-radius: 999px; }
.seg > [aria-pressed="true"] .count { background: var(--night); color: var(--accent); }
.tabs4 > * { font-size: .95rem; }
@media (max-width: 30rem) { .tabs4 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } }

/* ---------- Chips ---------- */
.chip { display: inline-block; padding: .1rem .6rem; font-size: .85rem; font-weight: 600; color: var(--text); background: var(--panel-2); border-radius: 999px; white-space: nowrap; }
.chip.big { padding: .35rem .8rem; font-size: .95rem; }
.chip.flag { color: var(--err); background: rgba(244, 161, 147, .16); }
.chip.accent, .chip.st-accepted { color: var(--night); background: var(--accent); }
.chip.ev-open, .chip.st-played { color: #16301F; background: var(--ok); }
.chip.ev-ended, .chip.st-rejected { color: var(--muted); }

/* ==========================================================================
   Gäste
   ========================================================================== */
#tab-wish.disabled #step-search, #tab-wish.disabled #step-details { opacity: .45; pointer-events: none; }

.results { margin: .5rem 0 1rem; padding: 0; list-style: none; display: grid; gap: .5rem; }
.result {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; min-height: 64px; padding: .7rem 1rem;
  font: inherit; text-align: left; color: var(--text);
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
}
.result:hover, .result:active { border-color: var(--accent); }
.result b { display: block; font-size: 1.1rem; line-height: 1.25; }
.result small { display: block; color: var(--muted); font-size: .95rem; }
.plus { flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-size: 1.6rem; font-weight: 800; color: var(--night); background: var(--accent); border-radius: 50%; }

.picked { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--accent-tint); border: 2px solid var(--accent); border-radius: 16px; }
.picked .t { margin: 0; font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.picked .a { margin: 0; color: var(--muted); }

.phase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.phase { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.phase input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: .8rem; min-height: 96px; padding: .9rem 1rem; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); transition: border-color .15s, background-color .15s; }
.tile .name { font-size: 1.1rem; font-weight: 800; line-height: 1.15; }
.meter { display: flex; align-items: flex-end; gap: 5px; height: 28px; }
.meter i { display: block; width: 9px; border-radius: 3px; background: var(--line); }
.meter i:nth-child(1) { height: 30%; } .meter i:nth-child(2) { height: 55%; } .meter i:nth-child(3) { height: 80%; } .meter i:nth-child(4) { height: 100%; }
.meter i.on { background: var(--accent); }
.phase input:checked + .tile { border-color: var(--accent); background: var(--accent-tint); }
.phase input:focus-visible + .tile { outline: 3px solid var(--accent-hi); outline-offset: 3px; }
.phase.any { grid-column: 1 / -1; }
.phase.any .tile { min-height: 58px; justify-content: center; }
.phase.any .name { font-size: 1rem; font-weight: 700; }

.msg { min-height: 1.4em; margin: 0; font-weight: 700; }
.msg[data-type="err"] { color: var(--err); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.done { padding: 1rem 0; }
.done h2 { margin: 1rem 0 .4rem; font-size: 2.3rem; line-height: 1.05; }
.done p { margin: 0 0 1.75rem; font-size: 1.15rem; color: var(--muted); }
.check { width: 84px; height: 84px; }
.check circle, .check path { fill: none; stroke: var(--accent); }
.check circle { stroke-width: 3; }
.check path { stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .15s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Listen (Wunschliste, Meine Wünsche, Sperrliste, Konten) */
.rows { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.row .song { min-width: 0; }
.row .song b { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.row .song small { display: block; color: var(--muted); }
.row > :last-child { flex: none; display: flex; align-items: center; gap: .6rem; }
.row .votes { min-width: 2ch; font-weight: 800; color: var(--accent); text-align: right; }
.row.played { opacity: .55; }

.foot { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.foot p { margin: .4rem 0; }
.foot .btn { margin: .5rem 0; }
.links a { margin-right: 1.1rem; }

/* ==========================================================================
   DJ-Cockpit
   ========================================================================== */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .75rem 1.25rem; background: var(--panel); }
.topbar .brand { font-weight: 800; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 1.1rem; align-items: center; }
.topbar nav a { color: var(--muted); font-weight: 700; text-decoration: none; }
.topbar nav a:hover { color: var(--text); }
.topbar .link { color: var(--muted); text-decoration: none; }

.login { max-width: 26rem; margin: 8vh auto 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.back { display: inline-block; margin-bottom: 1rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.back::before { content: "‹ "; }
.empty-state { text-align: left; }

.event-list { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.event-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; color: var(--text); text-decoration: none; background: var(--panel); border: 2px solid transparent; border-radius: 16px; }
.event-card:hover { border-color: var(--accent); }
.ev-main b { display: block; font-size: 1.2rem; line-height: 1.2; }
.ev-main small, .ev-side small { display: block; color: var(--muted); }
.ev-side { text-align: right; flex: none; }
.new-dot { color: var(--accent); }

.ev-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.ev-bar h1 { margin: 0; font-size: clamp(1.9rem, 7vw, 2.6rem); }
.ev-bar .meta { margin: .25rem 0 0; color: var(--muted); }
.code { letter-spacing: .12em; color: var(--text); }
.ev-status { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button { min-height: 40px; padding: .35rem .85rem; font: inherit; font-weight: 700; color: var(--muted); background: var(--panel); border: 0; border-radius: 999px; cursor: pointer; }
.chips button[aria-pressed="true"] { color: var(--night); background: var(--accent); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.tools select { width: auto; min-height: 40px; padding: .3rem 2rem .3rem .8rem; font-size: .92rem; border-radius: 10px; }

.reqs { display: grid; gap: .6rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.req { display: grid; grid-template-columns: 3.4rem 1fr; gap: .2rem 1rem; align-items: start; padding: .9rem 1rem; background: var(--panel); border-left: 4px solid transparent; border-radius: 14px; }
.req.s-accepted { border-left-color: var(--accent); }
.req.s-played, .req.s-rejected { opacity: .55; }
.req.is-new { box-shadow: 0 0 0 2px var(--accent); animation: pulse 1.2s ease-out 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--accent-tint); } }
.req .votes { grid-row: span 2; text-align: center; font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--accent); }
.req .votes small { display: block; margin-top: .2rem; font-size: .7rem; font-weight: 600; color: var(--muted); }
.req .t { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.req .a { margin: 0; color: var(--muted); }
.req .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .4rem 0 0; font-size: .85rem; }
.req .time { color: var(--muted); }
.notes { margin: .5rem 0 0; padding: .5rem .75rem; list-style: none; font-size: .95rem; background: var(--panel-2); border-radius: 10px; }
.acts { grid-column: 2; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
@media (min-width: 46rem) {
  .req { grid-template-columns: 3.4rem 1fr auto; }
  .acts { grid-column: 3; grid-row: 1 / span 2; align-self: center; justify-content: flex-end; margin: 0; max-width: 20rem; }
}

.dialog { max-width: 26rem; padding: 1.5rem; color: var(--text); background: var(--panel); border: 0; border-radius: 18px; }
.dialog::backdrop { background: rgba(10, 6, 14, .7); }

/* Playlist */
.phase-block { margin: 0 0 1.75rem; }
.phase-block h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; font-size: 1.25rem; }
.energy { display: inline-flex; gap: 2px; }
.energy i { width: 6px; height: 14px; border-radius: 2px; background: var(--line); }
.energy i.on { background: var(--accent); }
.tracks { margin: 0; padding-left: 1.8rem; }
.tracks li, .side li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.tracks li.bridge b { color: var(--accent-hi); }
.tracks small, .side small { display: block; color: var(--muted); font-size: .9rem; }
.by { color: var(--muted); }
.side summary { font-weight: 700; cursor: pointer; }
.side ul { margin: .5rem 0 0; padding: 0; list-style: none; }

/* Teilen */
.share { display: grid; gap: 1.5rem; align-items: start; margin-bottom: 1rem; }
@media (min-width: 46rem) { .share { grid-template-columns: minmax(0, 22rem) 1fr; } }
.qr-box { padding: 1rem; background: #fff; border-radius: 18px; line-height: 0; }
.qr-box svg { width: 100%; height: auto; }
.label { margin: 0; font-weight: 700; color: var(--muted); }
.big-code { margin: 0; font-size: 3rem; font-weight: 800; letter-spacing: .2em; line-height: 1.1; color: var(--accent); }
.copy { display: flex; gap: .5rem; }
.copy input { min-height: 48px; font-size: 1rem; }

.qr-full { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2rem; text-align: center; background: var(--night); overflow: auto; }
.qr-full h1 { margin: 0; }
.qr-full .lead { margin: 0; font-size: clamp(1.1rem, 2.5vw, 1.6rem); color: var(--text); }
.qr-full .qr-box { width: min(70vh, 80vw); }
.qr-full .close { position: absolute; top: 1rem; right: 1rem; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: flex; align-items: center; gap: .6rem; min-height: 48px; padding: .4rem .8rem; font-weight: 600; background: var(--night); border: 2px solid var(--line); border-radius: 12px; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); }
.swatch input:checked + span { border-color: var(--accent); }
.swatch input:focus-visible + span { outline: 3px solid var(--accent-hi); outline-offset: 2px; }

.radio-chip { position: relative; cursor: pointer; }
.radio-chip input { position: absolute; opacity: 0; }
.radio-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem 1rem; font-weight: 700; background: var(--night); border: 2px solid var(--line); border-radius: 999px; }
.radio-chip input:checked + span { color: var(--night); background: var(--accent); border-color: var(--accent); }

details.more { padding: .2rem 0; }
details.more summary { font-weight: 700; color: var(--accent); cursor: pointer; margin-bottom: 1rem; }
.inline-form { display: grid; gap: .5rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .inline-form { grid-template-columns: 1fr 1fr auto; } }
.card.danger { border: 2px solid rgba(244, 161, 147, .35); background: transparent; margin-top: 2rem; }

.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 60; max-width: calc(100% - 2rem); padding: .85rem 1.2rem; font-weight: 700; color: var(--night); background: var(--accent); border-radius: 14px; transform: translateX(-50%); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.toast.err { color: var(--night); background: var(--err); }

/* ==========================================================================
   Druck: Plakat (DIN A4)
   ========================================================================== */
.poster { display: none; }
@media print {
  @page { size: A4 portrait; margin: 15mm; }
  body.printing { padding: 0; background: #fff; color: #000; }
  body.printing > *:not(.poster) { display: none !important; }
  body.printing .poster { display: flex; flex-direction: column; align-items: center; gap: 8mm; text-align: center; color: #000; }
  .poster h1 { margin: 10mm 0 0; font-size: 34pt; color: #000; }
  .poster .lead { margin: 0; font-size: 18pt; color: #000; }
  .poster .qr-box { width: 120mm; padding: 0; }
  .poster .code { color: #000; letter-spacing: .15em; }
  .poster .small { font-size: 12pt; color: #444; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .check path { stroke-dashoffset: 0; }
}
