/* MEHRKANAL DJ – dunkles Theme auf Basis des MEHRKANAL Design Systems
   Markenfarbe #00A0BC, Schiefer #3C4650, Überschriften Mehrway (aus dem MEHRKANAL Design System, Ersatz: Raleway), Text Source Sans 3. */

@font-face { font-family: "Mehrway"; font-weight: 500; font-display: swap; src: url(fonts/mehrway-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Mehrway"; font-weight: 600; font-display: swap; src: url(fonts/mehrway-latin-600.woff2) format("woff2"); }
@font-face { font-family: "Mehrway"; font-weight: 700; font-display: swap; src: url(fonts/mehrway-latin-700.woff2) format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 500; font-display: swap; src: url(fonts/raleway-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 600; font-display: swap; src: url(fonts/raleway-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 700; font-display: swap; src: url(fonts/raleway-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url(fonts/source-sans-3-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #12171C; --bg-2: #161C22; --surface: #1E252D; --surface-2: #252D36; --line: #2A333D; --line-2: #3C4650;
  --text: #F2F5F8; --text-2: #DCE3EA; --muted: #A9B4C0; --faint: #8794A1;
  --brand: #00A0BC; --brand-dark: #00788F; --brand-light: #4FC8DC; --brand-pale: #8FDDEA; --on-brand: #0B1A20;
  --ok: #6FD49A; --warn: #F2C14E; --danger: #F08A9B;
  --font-heading: "Mehrway", "Raleway", sans-serif; --font-body: "Source Sans 3", sans-serif;
  --r: 12px; --r-lg: 24px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.45; }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
a { color: var(--brand-light); }
:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

/* Bausteine */
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; } .accent { color: var(--brand-pale); font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h { display: block; margin: 0 0 10px; font-family: var(--font-heading); font-weight: 600; font-size: 19px; }
.h.sm { font-size: 16px; margin-top: 16px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-light); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.error { color: var(--danger); min-height: 1em; margin: 0; }
.hint.danger { background: rgba(220,76,100,.12); border-color: rgba(240,138,155,.5); color: var(--text); }
.hint code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.hint { background: rgba(242,193,78,.1); border: 1px solid rgba(242,193,78,.35); border-radius: var(--r); padding: 12px 16px; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.logo-tile { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); border-radius: 8px; }
.logo-tile svg { width: 62%; height: 62%; }
.logo-34 { width: 34px; height: 34px; border-radius: 7px; } .logo-40 { width: 40px; height: 40px; } .logo-64 { width: 64px; height: 64px; border-radius: 10px; }
.wordmark { font-family: var(--font-heading); font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.wordmark span { color: var(--brand-light); } .wordmark.sm { font-size: 16px; } .wordmark.xl { font-size: 30px; }
.g-brand { display: flex; align-items: center; gap: 12px; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(0,160,188,.16); border: 1px solid rgba(79,200,220,.4); color: var(--brand-pale); font-size: 13px; font-weight: 600; }
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-light); }
.pill.ok { background: rgba(20,164,77,.15); border-color: transparent; color: var(--ok); }
.pill.ok .dot { background: #3BC274; }
.pill.bad { background: rgba(220,76,100,.15); border-color: transparent; color: var(--danger); }
.pill.bad .dot { background: #DC4C64; }

.field { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); }
.field.small { min-height: 40px; font-size: 13px; }
.field.code { text-transform: uppercase; letter-spacing: .15em; font-family: var(--font-heading); font-weight: 700; }
textarea.field { resize: vertical; }
.field::placeholder { color: var(--faint); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 700; }
.btn.primary:hover { background: var(--brand-light); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.end { align-self: flex-end; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.on { background: transparent; color: var(--brand-pale); border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.del { color: var(--danger); }
.icon-btn svg, .round svg, .vote svg, .search svg, .g-tabs svg, .tv-comment svg, .cover-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg { width: 16px; height: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.static { cursor: default; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; font-weight: 400; font-size: 13px; background: #2F3842; border-color: transparent; }
.chip.static button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }

.cover { position: relative; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: linear-gradient(145deg, var(--brand) 0%, #2B5F73 50%, var(--line-2) 100%); }
.cover img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.cover img:not([src]), .cover img[src=""] { display: none; }
img.cover:not([src]), img.cover[src=""] { visibility: hidden; }
.cover.sm { width: 48px; height: 48px; } .cover.md { width: 112px; height: 112px; border-radius: 16px; }
.cover.xl { width: 360px; height: 360px; border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0,160,188,.45); display: flex; align-items: center; justify-content: center; }
.cover-icon { position: absolute; width: 120px; height: 120px; color: rgba(255,255,255,.85); stroke-width: 1.2; }
.cover.thumb { width: 42px; height: 42px; border-radius: 8px; background: #2F3842; }

.bar { height: 6px; border-radius: 3px; background: #2F3842; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-light)); transition: width 1s linear; }
.bar.sm { height: 4px; }

.list { list-style: none; margin: 0 0 16px; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .pos { width: 22px; font-family: var(--font-heading); font-weight: 600; color: var(--faint); }
.vote { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 56px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--brand-pale); font-weight: 700; cursor: pointer; }
.vote svg { width: 16px; height: 16px; }
.vote.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.vote:disabled { cursor: default; }
.status { font-size: 13px; font-weight: 600; }
.status.ok { color: var(--ok); } .status.wait { color: var(--warn); } .status.no { color: var(--danger); }

.panel { background: var(--surface); border-radius: var(--r-lg); padding: 24px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(92vw, 420px); padding: 12px 16px; border-radius: var(--r); background: #14A44D; color: #fff; font-weight: 600; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.bad { background: #B83A50; }

/* ---------- Gäste-App ---------- */
body.guest { background: var(--bg-2); }
.g-app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.g-head { padding: 20px 20px 14px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, #1F3A44 0%, var(--bg-2) 100%); }
.g-head .g-brand { gap: 10px; }
.g-head .pill { margin-left: auto; }
.g-now { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(37,45,54,.9); }
.g-now .bar { width: 46px; margin: 0; }
.g-main { flex: 1; padding: 8px 20px 110px; display: flex; flex-direction: column; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 48px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); margin-bottom: 8px; }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.search input { flex: 1; background: transparent; border: 0; outline: none; min-height: 46px; }
.search input::placeholder { color: var(--faint); }
.g-tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--bg); border-top: 1px solid var(--surface-2); padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); }
.g-tabs button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 52px; justify-content: center; background: transparent; border: 0; font-size: 13px; font-weight: 600; color: var(--faint); cursor: pointer; }
.g-tabs button.active { color: var(--brand-light); }
.g-tabs svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* ---------- Fernseher (für 1920 × 1080 gestaltet, wird auf jede Bildschirmgröße skaliert) ---------- */
body.tv-page { overflow: hidden; background: var(--bg); }
.tv-stage { position: fixed; inset: 0; overflow: hidden; }
.tv { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; padding: 56px 72px; display: flex; flex-direction: column; gap: 40px;
  background: radial-gradient(1200px 700px at 18% 30%, #1F3A44 0%, var(--bg-2) 55%, var(--bg) 100%); }
.tv-head { display: flex; align-items: center; justify-content: space-between; }
.tv-head .g-brand { gap: 20px; }
.tv-party { font-family: var(--font-heading); font-weight: 500; font-size: 30px; color: #C9D2DB; }
.pill.lg { padding: 10px 22px; font-size: 22px; gap: 12px; }
.tv-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; }
.tv-now { display: flex; flex-direction: column; justify-content: center; gap: 36px; min-width: 0; }
.eyebrow.lg { font-size: 22px; letter-spacing: .14em; }
.tv-track { display: flex; gap: 44px; align-items: center; }
.tv-meta { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tv-title { font-family: var(--font-heading); font-weight: 700; font-size: 72px; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tv-artist { font-size: 40px; color: #C9D2DB; }
.tags { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.tag { padding: 8px 18px; border-radius: 999px; background: var(--surface-2); font-size: 22px; color: var(--text-2); }
.tv-now .bar { height: 8px; border-radius: 4px; }
.times { display: flex; justify-content: space-between; font-size: 20px; color: var(--muted); margin-top: 10px; }
.tv-comment { display: flex; gap: 18px; align-items: flex-start; padding: 24px 28px; border-radius: 20px; background: rgba(37,45,54,.75); border: 1px solid #343E49; font-size: 26px; line-height: 1.4; color: var(--text-2); }
.tv-comment svg { width: 32px; height: 32px; flex-shrink: 0; margin-top: 2px; color: var(--brand-light); stroke-width: 1.6; }
.tv-side { display: flex; flex-direction: column; gap: 28px; min-height: 0; }
.tv-side .panel { background: rgba(30,37,45,.85); border: 1px solid #2F3842; padding: 28px 32px; }
.tv-queue { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tv-queue li { display: flex; align-items: center; gap: 20px; padding-top: 8px; border-top: 1px solid #2F3842; }
.tv-queue .n { width: 40px; font-family: var(--font-heading); font-weight: 600; font-size: 28px; color: #6F7C89; }
.tv-queue .t { font-size: 28px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-queue .a { font-size: 21px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-queue .v { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 600; color: var(--brand-pale); }
.tv-queue .v svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.tv-queue .soon { font-size: 18px; color: var(--brand-light); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.tv-empty { font-size: 24px; margin: 14px 0 0; }
.panel.join { display: flex; gap: 28px; align-items: center; background: linear-gradient(135deg, rgba(0,160,188,.22), rgba(60,70,80,.35)); border-color: rgba(79,200,220,.35); }
.qr { width: 168px; height: 168px; flex-shrink: 0; border-radius: 14px; background: #fff; padding: 12px; }
.qr svg { width: 100%; height: 100%; display: block; }
.join-text { display: flex; flex-direction: column; gap: 10px; font-size: 24px; color: var(--text-2); }
.join-h { font-family: var(--font-heading); font-weight: 700; font-size: 38px; color: var(--text); }
.join-url { font-size: 28px; font-weight: 700; color: var(--brand-pale); }
.code-box { font-family: var(--font-heading); font-weight: 700; letter-spacing: .12em; color: #fff; background: #2F3842; padding: 2px 12px; border-radius: 8px; }
.tv-foot { display: flex; align-items: center; justify-content: space-between; font-size: 20px; color: var(--muted); }
.tv-locked { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; font-size: 20px; color: var(--muted); }

/* ---------- Administration ---------- */
body.admin { background: linear-gradient(120deg, var(--bg-2) 0%, var(--bg) 100%); min-height: 100vh; font-size: 15px; }
.login { max-width: 400px; margin: 12vh auto; padding: 0 20px; display: flex; flex-direction: column; gap: 24px; }
.a-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; background: #1B2229; border-bottom: 1px solid var(--line); }
.a-head .sep { color: #5C6875; }
.a-title { font-family: var(--font-heading); font-weight: 500; font-size: 17px; color: #C9D2DB; }
.a-status { display: flex; flex-wrap: wrap; gap: 8px; }
.a-wrap { max-width: 1400px; margin: 0 auto; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.a-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; border-radius: 16px; background: var(--surface); }
.num { font-family: var(--font-heading); font-weight: 700; font-size: 30px; }
.num.warn { color: var(--warn); }
.a-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.a-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.a-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.a-now { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.a-now .grow { flex: 1 1 220px; }
.a-track { font-family: var(--font-heading); font-weight: 700; font-size: 26px; line-height: 1.2; }
.a-ctrl { display: flex; gap: 10px; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.round.primary { border: 0; background: var(--brand); color: var(--on-brand); }
.round svg { width: 20px; height: 20px; }
.round svg.fill { fill: currentColor; stroke: none; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 520px; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; padding: 8px; }
.table td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.table .right { text-align: right; white-space: nowrap; }
.table .pos { color: var(--faint); font-family: var(--font-heading); font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg button { min-height: 48px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.kv { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.switch { display: flex; gap: 10px; align-items: center; color: var(--text-2); cursor: pointer; min-height: 44px; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); }
.ok-text { color: var(--ok); } .bad-text { color: var(--danger); }

@media (max-width: 640px) {
  .a-head, .a-wrap { padding-left: 16px; padding-right: 16px; }
  .a-title, .a-head .sep { display: none; }
  .a-now { gap: 16px; } .cover.md { width: 72px; height: 72px; } .a-track { font-size: 21px; }
  .panel { padding: 18px; }
}

/* ---------- Bunter Nebel (Phasen Party und Höhepunkt) ----------
   Weiche Farbwolken, die sich langsam bewegen. Nur Transformationen, damit es auch auf Smart-TV-Browsern flüssig läuft. */
.tv { overflow: hidden; }
.tv > :not(.fog) { position: relative; z-index: 1; }
.fog { position: absolute; inset: -15%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 4s ease; }
.fog::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(18,23,28,0) 30%, rgba(18,23,28,.55) 100%); }
.fog span { position: absolute; width: 62%; height: 72%; border-radius: 50%; mix-blend-mode: screen; will-change: transform;
  animation: fog-a 34s ease-in-out infinite alternate; }
.fog .f1 { left: -6%; top: 4%;  background: radial-gradient(closest-side, rgba(0,160,188,.62), rgba(0,160,188,0)); }
.fog .f2 { left: 38%; top: -8%; background: radial-gradient(closest-side, rgba(214,51,132,.50), rgba(214,51,132,0)); animation-name: fog-b; animation-duration: 41s; }
.fog .f3 { left: 46%; top: 40%; background: radial-gradient(closest-side, rgba(112,72,232,.52), rgba(112,72,232,0)); animation-name: fog-c; animation-duration: 37s; }
.fog .f4 { left: 4%;  top: 46%; background: radial-gradient(closest-side, rgba(255,170,64,.34), rgba(255,170,64,0)); animation-name: fog-b; animation-duration: 47s; animation-direction: alternate-reverse; }
.fog .f5 { left: 24%; top: 18%; width: 48%; height: 56%; background: radial-gradient(closest-side, rgba(79,200,220,.40), rgba(79,200,220,0)); animation-name: fog-c; animation-duration: 29s; animation-direction: alternate-reverse; }
@keyframes fog-a { 0% { transform: translate(0, 0) scale(1) rotate(0deg); } 50% { transform: translate(14%, 10%) scale(1.18) rotate(20deg); } 100% { transform: translate(28%, -6%) scale(.92) rotate(-10deg); } }
@keyframes fog-b { 0% { transform: translate(0, 0) scale(1.05); } 50% { transform: translate(-18%, 16%) scale(.88) rotate(-18deg); } 100% { transform: translate(-6%, 30%) scale(1.22) rotate(12deg); } }
@keyframes fog-c { 0% { transform: translate(0, 0) scale(.95) rotate(0deg); } 50% { transform: translate(-22%, -14%) scale(1.2) rotate(25deg); } 100% { transform: translate(10%, -24%) scale(1) rotate(-15deg); } }
@keyframes fog-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
body.phase-party .fog { opacity: .7; }
body.phase-peak .fog { opacity: 1; animation: fog-pulse 7s ease-in-out infinite; }
body.phase-peak .fog span { animation-duration: 14s; }
body.phase-peak .fog .f2, body.phase-peak .fog .f4 { animation-duration: 18s; }
body.phase-peak .fog::after { background: radial-gradient(ellipse at 50% 50%, rgba(18,23,28,0) 40%, rgba(18,23,28,.45) 100%); }
body.phase-party .tv-artist, body.phase-peak .tv-artist { text-shadow: 0 2px 18px rgba(0,0,0,.6); }
@media (prefers-reduced-motion: reduce) { .fog, .fog span { animation: none !important; } }
