/* =========================================================================
   Themes
   ========================================================================= */

:root, body[data-theme="elegant"] {
  --bg: #FAF6F0;
  --bg-2: #F1E8DC;
  --card: #FFFFFF;
  --ink: #2B2523;
  --muted: #7C6F66;
  --line: #E3D8CA;
  --accent: #A88652;
  --accent-dark: #8E6F3E;
  --accent-soft: #F3EADA;
  --accent-2: #A88652;
  --rec: #C4453B;
  --ok: #4E8A5F;
  --display: "Cormorant Garamond", "Didot", "Baskerville", "Hoefler Text", "Times New Roman", serif;
  --serif: "Cormorant Garamond", "Didot", "Baskerville", "Hoefler Text", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --photo-frame: #FFFFFF;
  --photo-text: #2B2523;
  --orn: "✦";
  --page-bg: radial-gradient(120% 90% at 50% 0%, #FFFDF9 0%, var(--bg) 55%, var(--bg-2) 100%);
}

body[data-theme="boho"] {
  --bg: #F4EBDF;
  --bg-2: #E7D6C0;
  --card: #FDF8F1;
  --ink: #3E2F27;
  --muted: #8A7B6E;
  --line: #DCC7AE;
  --accent: #B5623F;
  --accent-dark: #97502F;
  --accent-soft: #F3DFD0;
  --accent-2: #8A9A7B;
  --rec: #B5432F;
  --ok: #6E8B5E;
  --display: "Snell Roundhand", "Savoye LET", "Apple Chancery", "Bradley Hand", cursive;
  --serif: "Baskerville", "Hoefler Text", Georgia, serif;
  --photo-frame: #FBF4EA;
  --photo-text: #3E2F27;
  --orn: "❀";
  --page-bg: radial-gradient(120% 90% at 50% 0%, #FBF5EC 0%, var(--bg) 50%, var(--bg-2) 100%);
}

body[data-theme="neon"] {
  --bg: #0B0B14;
  --bg-2: #14122A;
  --card: #15152A;
  --ink: #F5F3FF;
  --muted: #9AA3B5;
  --line: #2C2C48;
  --accent: #FF2FA0;
  --accent-dark: #E0148A;
  --accent-soft: #3A1230;
  --accent-2: #22E0FF;
  --rec: #FF3B3B;
  --ok: #3DE8A0;
  --display: "Avenir Next Condensed", "Futura", "Helvetica Neue", Arial, sans-serif;
  --serif: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --photo-frame: #15151F;
  --photo-text: #FF2FA0;
  --orn: "★";
  --page-bg: radial-gradient(90% 70% at 50% 0%, #1C1436 0%, #0B0B14 60%, #07070D 100%);
  color-scheme: dark;
}

/* =========================================================================
   Grundlagen
   ========================================================================= */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--page-bg);
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow: hidden;
}
#app { height: 100%; height: 100dvh; }

/* Eigenes Hintergrundbild mit Abdunklung / Aufhellung in Theme-Farbe */
body.has-bg { background: transparent; }
body.has-bg::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: var(--bg-image) center / cover no-repeat;
}
body.has-bg::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--bg); opacity: var(--bg-overlay, .55);
}

.hidden { display: none !important; }
.orn::before { content: var(--orn); }

/* =========================================================================
   Screens
   ========================================================================= */

.screen {
  display: none;
  position: relative;
  height: 100%;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
}
.screen.active { display: flex; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.logo { max-height: 140px; max-width: 60vw; object-fit: contain; }

.ornament {
  display: flex; align-items: center; gap: 14px;
  color: var(--accent); font-family: var(--serif); font-size: 26px;
}
.ornament::before, .ornament::after { content: ""; width: 56px; height: 1px; background: var(--accent); opacity: .6; }

.title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(44px, 8vw, 96px); line-height: 1.05; letter-spacing: .01em;
  margin: 0;
}
.subtitle {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(20px, 2.6vw, 30px); color: var(--muted); margin: 0 0 10px;
}
.heading { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 4.5vw, 56px); margin: 0; line-height: 1.1; }
.hint { font-size: clamp(17px, 1.8vw, 22px); color: var(--muted); max-width: 640px; margin: 0; line-height: 1.45; }

body[data-theme="boho"] .title { font-size: clamp(56px, 10vw, 128px); font-weight: 400; }
body[data-theme="neon"] .title {
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  color: #fff; text-shadow: 0 0 12px var(--accent), 0 0 42px rgba(255, 47, 160, .65);
}
body[data-theme="neon"] .heading { text-transform: uppercase; letter-spacing: .06em; font-family: var(--display); font-weight: 600; }
body[data-theme="neon"] .subtitle { font-style: normal; letter-spacing: .12em; text-transform: uppercase; font-size: clamp(15px, 1.8vw, 20px); color: #D9DCEA; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
body[data-theme="neon"] .hint { color: #C3C8D8; }
body[data-theme="neon"] .ornament { color: var(--accent-2); text-shadow: 0 0 10px var(--accent-2); }
body[data-theme="neon"] .ornament::before, body[data-theme="neon"] .ornament::after { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); opacity: 1; }

/* =========================================================================
   Modus-Auswahl
   ========================================================================= */

.choices { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.choice {
  width: min(250px, 88vw);
  background: var(--card); color: inherit; font-family: inherit;
  border: 1px solid var(--line); border-radius: 28px;
  padding: 28px 18px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: 0 14px 40px rgba(70, 45, 20, .09);
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.choice:hover { box-shadow: 0 18px 48px rgba(70, 45, 20, .14); }
.choice:active { transform: scale(.97); }
.choice-icon { width: 50px; height: 50px; color: var(--accent); margin-bottom: 2px; }
.choice-title { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.choice-desc { color: var(--muted); font-size: 15px; }

body[data-theme="boho"] .choice { border-radius: 40px 40px 40px 12px; border-color: var(--line); background: var(--card); }
body[data-theme="neon"] .choice {
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 22px rgba(255, 47, 160, .28), inset 0 0 24px rgba(255, 47, 160, .06);
}
body[data-theme="neon"] .choice:nth-child(even) { border-color: var(--accent-2); box-shadow: 0 0 22px rgba(34, 224, 255, .28), inset 0 0 24px rgba(34, 224, 255, .06); }
body[data-theme="neon"] .choice:nth-child(even) .choice-icon { color: var(--accent-2); filter: drop-shadow(0 0 6px var(--accent-2)); }
body[data-theme="neon"] .choice-icon { filter: drop-shadow(0 0 6px var(--accent)); }
body[data-theme="neon"] .choice-title { text-transform: uppercase; letter-spacing: .06em; font-size: 20px; font-weight: 600; }

/* =========================================================================
   Buttons und Eingabe
   ========================================================================= */

.actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.btn {
  font-family: var(--sans); font-size: 20px; font-weight: 500;
  padding: 18px 36px; min-height: 64px; min-width: 200px;
  border-radius: 999px; border: 1.5px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  cursor: pointer; transition: transform .1s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: rgba(255,255,255,.6); border-color: var(--line); color: var(--ink); }
.btn-stop { background: var(--rec); color: #fff; }
.btn-big { font-size: 24px; padding: 22px 48px; min-height: 78px; }
.btn .dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.btn .square { width: 16px; height: 16px; border-radius: 3px; background: #fff; }

body[data-theme="neon"] .btn-primary { box-shadow: 0 0 18px rgba(255, 47, 160, .55); text-transform: uppercase; letter-spacing: .05em; }
body[data-theme="neon"] .btn-ghost { background: rgba(255,255,255,.04); border-color: var(--accent-2); color: #fff; box-shadow: 0 0 10px rgba(34, 224, 255, .25); }
body[data-theme="neon"] .btn-stop { box-shadow: 0 0 18px rgba(255, 59, 59, .6); }

.input {
  font-family: var(--serif); font-size: 30px;
  padding: 18px 24px; width: min(560px, 90vw);
  border: 1.5px solid var(--line); border-radius: 18px; background: var(--card);
  text-align: center; outline: none; color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* =========================================================================
   Karten ziehen
   ========================================================================= */

.question-label { text-transform: uppercase; letter-spacing: .28em; font-size: 13px; color: var(--accent); }

.deck {
  position: relative;
  width: min(400px, 78vw, calc((100dvh - 360px) * 3 / 4));
  aspect-ratio: 3 / 4;
  margin: 6px 0;
  cursor: pointer;
  perspective: 1600px;
}
.card-3d {
  position: absolute; inset: 0; border-radius: 26px;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .4s ease;
}
.card-3d.shadow-card { background: var(--accent); opacity: .85; box-shadow: 0 14px 30px rgba(40, 25, 10, .18); }
.card-3d.c2 { transform: rotate(-4deg) translate(-8px, 8px); }
.card-3d.c3 { transform: rotate(5deg) translate(10px, 14px); }
.deck.few .c3 { display: none; }
.deck.last .c2 { display: none; }
.card-3d.top.flipped { transform: rotateY(180deg); }
.card-3d.top.discard { transform: rotateY(180deg) translateX(-130%) rotate(-18deg); opacity: 0; transition: transform .45s ease-in, opacity .45s ease-in; }
.card-3d.no-anim { transition: none !important; }
.deck:active .top:not(.flipped) { transform: translateY(-14px) rotate(-2deg); }

.card-face {
  position: absolute; inset: 0; border-radius: 26px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 30px; gap: 10px;
  box-shadow: 0 20px 50px rgba(40, 25, 10, .25);
}
.card-back {
  background: var(--accent); color: #fff;
  border: 10px solid var(--card);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 14px, transparent 14px 28px);
}
.card-back::after { content: ""; position: absolute; inset: 14px; border: 1.5px solid rgba(255,255,255,.55); border-radius: 14px; }
.card-back-mark { font-size: 84px; line-height: 1; font-family: var(--serif); }
.card-back-name { font-family: var(--display); font-size: 30px; letter-spacing: .04em; }
.card-front { background: var(--card); color: var(--ink); transform: rotateY(180deg); border: 1px solid var(--line); }
.card-front-label { text-transform: uppercase; letter-spacing: .28em; font-size: 12px; color: var(--accent); }
.card-question { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 40px); line-height: 1.25; margin: 0; text-align: center; }

body[data-theme="neon"] .card-back { border-color: var(--accent-2); box-shadow: 0 0 30px rgba(34, 224, 255, .45); }
body[data-theme="neon"] .card-front { border: 1.5px solid var(--accent); box-shadow: 0 0 30px rgba(255, 47, 160, .35); }
body[data-theme="boho"] .card-back { border-radius: 36px 36px 36px 12px; }
body[data-theme="boho"] .card-front { border-radius: 36px 36px 36px 12px; }

/* =========================================================================
   Kamera
   ========================================================================= */

.screen-camera { gap: 18px; }
.question-box { max-width: 960px; }
.question-text { font-family: var(--serif); font-size: clamp(26px, 3.6vw, 44px); line-height: 1.18; margin: 6px 0 0; }
.only-question { display: none; }
body[data-mode="frage"] .only-question { display: inline-flex; }
.only-photo { display: none; }
body[data-mode="foto"] .only-photo { display: block; }

.frame {
  position: relative;
  width: min(100%, calc((100vh - 330px) * 16 / 9), 1280px);
  width: min(100%, calc((100dvh - 330px) * 16 / 9), 1280px);
  aspect-ratio: 16 / 9;
  background: #141210; border-radius: 24px; overflow: hidden;
  box-shadow: 0 22px 60px rgba(40, 25, 10, .2);
}
.frame video { width: 100%; height: 100%; object-fit: cover; display: block; background: #141210; }
video.mirrored { transform: scaleX(-1); }
body[data-theme="neon"] .frame { box-shadow: 0 0 0 2px var(--accent-2), 0 0 34px rgba(34, 224, 255, .35); }

/* Fotovorschau: das Bild bestimmt die Grösse */
.frame.photo {
  width: auto; max-width: 100%; aspect-ratio: auto; background: transparent;
  box-shadow: none; border-radius: 0; overflow: visible;
  max-height: calc(100dvh - 300px);
}
.frame.photo img {
  display: block; max-height: calc(100dvh - 300px); max-width: 100%; width: auto; height: auto;
  box-shadow: 0 22px 60px rgba(40, 25, 10, .25); border-radius: 6px;
}

.overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.overlay.show { display: flex; }
.countdown { background: rgba(0,0,0,.35); }
.countdown span {
  font-family: var(--serif); color: #fff;
  font-size: min(45vh, 340px); line-height: 1;
  text-shadow: 0 6px 30px rgba(0,0,0,.4);
  animation: pop 1s ease-out infinite;
}
@keyframes pop { 0% { transform: scale(1.15); opacity: .4; } 25% { transform: scale(1); opacity: 1; } 100% { opacity: 1; } }

.flash-overlay { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash-overlay.go { animation: flash .55s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.rec-badge, .shot-badge {
  position: absolute; top: 18px;
  display: none; align-items: center; gap: 10px;
  background: rgba(0,0,0,.55); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 20px; font-variant-numeric: tabular-nums;
}
.rec-badge { left: 18px; }
.shot-badge { right: 18px; }
.rec-badge.show, .shot-badge.show { display: flex; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--rec); animation: pulse 1s ease-in-out infinite; }
.rec-max { opacity: .6; }
@keyframes pulse { 50% { opacity: .25; } }

.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255,255,255,.25); display: none; }
.progress.show { display: block; }
.progress-bar { height: 100%; width: 0; background: var(--rec); transition: width .25s linear; }

.saving { background: rgba(0,0,0,.6); color: #fff; flex-direction: column; gap: 18px; font-size: 22px; border-radius: 6px; }
.spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fullscreen-btn {
  position: absolute; right: 16px; bottom: 14px;
  background: transparent; border: none; color: var(--muted);
  font-size: 22px; cursor: pointer; opacity: .45; padding: 8px;
}
.fullscreen-btn:hover { opacity: 1; }

/* Demo-Modus (?fake=1) */
.demo-badge {
  position: fixed; top: 12px; right: 14px; z-index: 60; pointer-events: none;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}

/* =========================================================================
   Bildschirmschoner
   ========================================================================= */

.screensaver {
  position: fixed; inset: 0; z-index: 50;
  background: #000; cursor: pointer; overflow: hidden;
}
.screensaver.no-media { background: var(--page-bg); }
.ss-media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s ease;
}
.ss-media.show { opacity: 1; }
.ss-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 24px 9vh; gap: 18px;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.25) 35%, rgba(0,0,0,0) 60%);
  color: #fff; text-align: center;
}
.screensaver.no-media .ss-overlay { background: none; color: var(--ink); justify-content: center; padding-bottom: 0; }
.ss-title { font-family: var(--display); font-size: clamp(44px, 7vw, 96px); line-height: 1.05; text-shadow: 0 4px 24px rgba(0,0,0,.5); }
.screensaver.no-media .ss-title { text-shadow: none; }
.ss-hint {
  font-size: clamp(20px, 2.4vw, 30px); padding: 16px 34px;
  border: 1.5px solid rgba(255,255,255,.75); border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: breathe 2.4s ease-in-out infinite;
}
.screensaver.no-media .ss-hint { border-color: var(--accent); color: var(--ink); background: var(--card); }
@keyframes breathe { 50% { transform: scale(1.04); opacity: .85; } }
.ss-caption {
  position: absolute; left: 28px; bottom: 28px; color: #fff; font-family: var(--serif);
  font-size: 26px; text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.ss-caption:empty { display: none; }
.screensaver.no-media .ss-caption { display: none; }
.screensaver .logo { max-height: 110px; }
body[data-theme="neon"] .ss-title { text-transform: uppercase; letter-spacing: .08em; text-shadow: 0 0 14px var(--accent), 0 0 40px rgba(255,47,160,.6); }

/* =========================================================================
   Admin
   ========================================================================= */

body.admin { overflow: auto; -webkit-user-select: text; user-select: text; }
.admin-wrap { max-width: 880px; margin: 0 auto; padding: 40px 24px 80px; }
.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-head h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; margin: 0; }
.admin-head a { color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; margin-bottom: 20px; box-shadow: 0 10px 30px rgba(70,45,20,.06); }
.card h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 18px; }
.field { display: grid; grid-template-columns: 220px 1fr; gap: 10px 18px; align-items: center; margin-bottom: 14px; }
.field label { color: var(--muted); font-size: 15px; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 17px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input[type="range"] { padding: 0; border: none; accent-color: var(--accent); }
.field input[type="file"] { padding: 8px; }
.field input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.field textarea { min-height: 300px; line-height: 1.6; resize: vertical; }
.field small { grid-column: 2; color: var(--muted); font-size: 13px; margin-top: -6px; }
.field .inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn-small { font-size: 16px; padding: 12px 22px; min-height: 46px; min-width: 0; }
.status-grid { display: grid; grid-template-columns: 220px 1fr; gap: 10px 18px; font-size: 16px; }
.status-grid dt { color: var(--muted); }
.status-grid dd { margin: 0; word-break: break-all; }
.msg { margin-top: 14px; font-size: 15px; min-height: 20px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--rec); }
.login { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.login .input { font-size: 34px; letter-spacing: .3em; width: 100%; margin: 16px 0; }

.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.theme-card {
  border: 2px solid var(--line); border-radius: 16px; padding: 16px 12px; cursor: pointer; text-align: center;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.theme-card input { display: none; }
.theme-name { display: block; font-size: 22px; margin-bottom: 4px; }
.theme-desc { display: block; font-size: 13px; color: var(--muted); }
.swatches { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.theme-card[data-theme="elegant"] .theme-name { font-family: "Cormorant Garamond", "Didot", Georgia, serif; }
.theme-card[data-theme="boho"] .theme-name { font-family: "Snell Roundhand", "Apple Chancery", cursive; font-size: 28px; }
.theme-card[data-theme="neon"] { background: #0B0B14; color: #fff; }
.theme-card[data-theme="neon"] .theme-name { font-family: "Avenir Next Condensed", "Futura", sans-serif; text-transform: uppercase; letter-spacing: .08em; text-shadow: 0 0 10px #FF2FA0; }
.theme-card[data-theme="neon"] .theme-desc { color: #9AA3B5; }
.brand-preview { max-height: 90px; max-width: 220px; border-radius: 8px; border: 1px solid var(--line); background: #f3f3f3; display: block; }
pre.log {
  background: #1c1a18; color: #e8e2d9; padding: 14px 16px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; max-height: 280px; overflow: auto; white-space: pre-wrap; margin: 14px 0 0;
}
pre.log:empty { display: none; }

@media (max-width: 640px) {
  .field, .status-grid { grid-template-columns: 1fr; }
  .field small { grid-column: 1; }
  .theme-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Songauswahl und Auftritt (Singen, Tanzen)
   ========================================================================= */

.song-info { font-family: var(--serif); font-size: clamp(22px, 2.8vw, 34px); color: var(--accent); margin: 0; }
.song-list {
  display: flex; flex-direction: column; gap: 12px;
  width: min(680px, 92vw); max-height: 56vh; overflow-y: auto; padding: 4px;
}
.song-card {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 18px; align-items: center; text-align: left;
  padding: 18px 26px; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  font-family: inherit; color: inherit; cursor: pointer; transition: transform .1s ease, box-shadow .15s ease;
  box-shadow: 0 8px 24px rgba(70, 45, 20, .06);
}
.song-card:active { transform: scale(.98); }
.song-card .song-title { grid-column: 1; grid-row: 1; font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.song-card .song-artist { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 16px; }
.song-card .song-artist:empty { display: none; }
.song-card .song-dur { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 18px; }
body[data-theme="neon"] .song-card { border-color: var(--accent-2); box-shadow: 0 0 14px rgba(34, 224, 255, .2); }

.screen-perform { gap: 14px; justify-content: space-between; }
.perf-head {
  width: 100%; max-width: 1280px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.perf-song { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; }
.perf-title { font-family: var(--serif); font-size: clamp(24px, 3vw, 36px); line-height: 1.1; }
.perf-artist { color: var(--muted); font-size: 16px; }
.perf-badge { position: static; flex: none; }
.perf-stage {
  position: relative; flex: 1; width: 100%; max-width: 1280px; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.perf-video-wrap {
  position: relative; border-radius: 24px; overflow: hidden; background: #141210;
  transition: box-shadow .08s linear, transform .08s linear;
}
.perf-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Tanzen: Vorschau gross, Rahmen pulsiert zur Musik */
body[data-mode="dance"] .perf-video-wrap {
  width: min(100%, calc((100dvh - 300px) * 16 / 9));
  aspect-ratio: 16 / 9;
  box-shadow: 0 0 0 calc(2px + var(--beat, 0) * 10px) var(--accent), 0 0 calc(24px + var(--beat, 0) * 100px) var(--accent);
  transform: scale(calc(1 + var(--beat, 0) * 0.025));
}
body[data-mode="dance"] .lyrics { display: none; }

/* Singen: Text gross, Vorschau klein in der Ecke */
body[data-mode="sing"] .perf-video-wrap {
  position: absolute; top: 0; right: 0; z-index: 2;
  width: min(28%, 340px); aspect-ratio: 16 / 9;
  box-shadow: 0 10px 30px rgba(0,0,0,.25), 0 0 calc(4px + var(--beat, 0) * 30px) var(--accent);
}
.lyrics {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
.lyrics-track { position: absolute; left: 0; right: 0; top: 50%; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.lyric-line {
  font-family: var(--serif); font-size: clamp(24px, 3.2vw, 42px); line-height: 1.3;
  padding: 8px 14%; opacity: .38; text-align: center;
  transition: opacity .3s ease, font-size .3s ease, color .3s ease;
}
.lyric-line.active { opacity: 1; color: var(--accent); font-size: clamp(32px, 4.4vw, 58px); font-weight: 600; }
.lyric-line.past { opacity: .18; }
.lyrics-empty { color: var(--muted); font-size: 22px; }
body[data-theme="neon"] .lyric-line.active { text-shadow: 0 0 18px var(--accent); }
body[data-theme="neon"] .perf-title { text-transform: uppercase; letter-spacing: .06em; }
.perf-progress { width: 100%; max-width: 1280px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.perf-progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

/* Admin: Songs */
.song-item { border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; margin-bottom: 10px; background: #fff; }
.song-item summary { cursor: pointer; padding: 10px 0; font-size: 16px; }
.song-item summary strong { font-family: var(--serif); font-size: 20px; }
.song-item .field { margin-top: 12px; }
.song-item textarea { min-height: 180px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.song-item .admin-actions { padding: 6px 0 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); margin-right: 18px; }
.check input { width: auto; accent-color: var(--accent); }
.modes-grid { display: flex; flex-wrap: wrap; gap: 10px 22px; }

/* =========================================================================
   Kiosk: Kopplung und Gerätemenü
   ========================================================================= */

.secret-corner { position: fixed; top: 0; left: 0; width: 90px; height: 90px; z-index: 55; }
.device-panel {
  position: fixed; inset: 0; z-index: 70; background: rgba(20, 16, 12, .55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  -webkit-user-select: text; user-select: text;
}
.device-card {
  background: var(--card); color: var(--ink); border-radius: 22px; padding: 28px 30px;
  width: min(640px, 100%); max-height: 90vh; overflow: auto; text-align: left;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.device-card h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; margin: 0 0 16px; }
.device-card .status-grid { grid-template-columns: 200px 1fr; font-size: 15px; }
.device-card .btn-small { min-width: 0; }
.device-card .msg { font-size: 14px; margin-top: 12px; }
.device-card .msg.ok { color: var(--ok); }
.device-card .msg.err { color: var(--rec); }
body[data-theme="neon"] .device-card { background: #15152A; }
