/* PartyFlow: ein Stylesheet für alle Seiten. Hell und Dunkel sind getrennt gestaltet
   (Coding-Baselines: Buttons rechteckig mit kleinem Radius, Umschalter auf jeder Seite). */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 16px;
	--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--ok: #2f9e6e;
	--warn: #b7861b;
	--danger: #c0283c;
}

:root[data-theme='dark'] {
	color-scheme: dark;
	--page-bg: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
	--bar: var(--bg1);
	--text: #f5efe1;
	--muted: rgba(245, 239, 225, 0.66);
	--card: rgba(255, 255, 255, 0.06);
	--card-strong: rgba(255, 255, 255, 0.1);
	--border: rgba(255, 255, 255, 0.13);
	--input: rgba(0, 0, 0, 0.28);
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
	--btn-text: #1b1405;
	--glow-a: color-mix(in srgb, var(--accent2) 22%, transparent);
	--glow-b: color-mix(in srgb, var(--accent) 16%, transparent);
	--glow-c: rgba(90, 60, 160, 0.14);
	--word-a: #fff6df;
	--word-b: var(--accent);
	--word-c: #ff5a6e;
	--link: var(--accent);
	--ok-text: #5fd29c;
	--danger-text: #ff8595;
	--warn-text: #e6b94c;
	--modal-bg: #141d3a;
}

:root[data-theme='light'] {
	color-scheme: light;
	--page-bg: linear-gradient(135deg, var(--lbg1) 0%, var(--lbg2) 55%, var(--lbg3) 100%);
	--bar: var(--lbg1);
	--text: #1c2340;
	--muted: rgba(28, 35, 64, 0.66);
	--card: rgba(255, 255, 255, 0.72);
	--card-strong: #ffffff;
	--border: rgba(28, 35, 64, 0.14);
	--input: #ffffff;
	--shadow: 0 10px 28px rgba(28, 35, 64, 0.12);
	--shadow-sm: 0 1px 4px rgba(28, 35, 64, 0.12);
	--btn-text: #1b1405;
	--glow-a: color-mix(in srgb, var(--accent2) 10%, transparent);
	--glow-b: color-mix(in srgb, var(--accent) 14%, transparent);
	--glow-c: rgba(13, 27, 62, 0.06);
	--word-a: #0d1b3e;
	--word-b: #22356e;
	--word-c: var(--accent2);
	--link: #8a6a12;
	--ok-text: #1f7a52;
	--danger-text: #a51d30;
	--warn-text: #8a6410;
	--modal-bg: #ffffff;
}

html, body { min-height: 100%; }

body {
	font-family: var(--font);
	color: var(--text);
	background: var(--page-bg);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
	line-height: 1.45;
	transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--link); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; }

/* ---------- Bausteine ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 18px; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer;
	font-weight: 700; font-size: 1rem; text-decoration: none; line-height: 1.2;
	background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff));
	color: var(--btn-text); box-shadow: var(--shadow-sm);
	transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-secondary { background: var(--card-strong); color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small { padding: 7px 12px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }

.theme-toggle {
	position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 40;
	padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border);
	background: var(--card-strong); color: var(--text); font-size: 0.8rem; font-weight: 600; cursor: pointer;
	box-shadow: var(--shadow-sm);
}

.help-btn {
	position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 78px; z-index: 40;
	width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm); border: 1px solid var(--border);
	background: var(--card-strong); color: var(--text); font-weight: 700; font-size: 0.95rem; cursor: pointer;
	box-shadow: var(--shadow-sm);
}
.modal {
	position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.6);
	display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
	background: var(--modal-bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg);
	width: 100%; max-width: 720px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.modal-head { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.modal-body { overflow: auto; padding: 16px 18px; line-height: 1.55; font-size: 0.95rem; }
.modal-body h2 { font-size: 1.05rem; margin: 14px 0 6px; }
.modal-body h2:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 10px; }
.modal-body ul { margin: 0 0 10px 20px; }

.card {
	background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
	padding: 18px; box-shadow: var(--shadow-sm);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.badge {
	display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.76rem; font-weight: 600;
	border: 1px solid var(--border); background: var(--card-strong); white-space: nowrap;
}
.badge.ok { border-color: var(--ok); color: var(--ok-text); }
.badge.warn { border-color: var(--warn); color: var(--warn-text); }
.badge.off { border-color: var(--danger); color: var(--danger-text); }

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }

input.input, select.input, textarea.input,
label.field input, label.field textarea, label.field select {
	padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border);
	background: var(--input); color: var(--text); font-size: 1rem; width: 100%;
}
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
label.field input[type=color] { padding: 2px; height: 42px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 0.92rem; }

.notice { padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--card-strong); }
.notice.ok { border-color: var(--ok); }
.notice.warn { border-color: var(--warn); }
.notice.error { border-color: var(--danger); }

.toast {
	position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
	z-index: 60; padding: 12px 16px; border-radius: var(--r-md); background: var(--card-strong);
	border: 1px solid var(--border); box-shadow: var(--shadow); max-width: calc(100% - 32px); font-size: 0.95rem;
}

/* ---------- Startseite und Einladung ---------- */

.landing { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; }
.landing::before {
	content: ''; position: absolute; inset: 0; pointer-events: none;
	background:
		radial-gradient(ellipse at 20% 50%, var(--glow-a) 0%, transparent 55%),
		radial-gradient(ellipse at 80% 20%, var(--glow-b) 0%, transparent 50%),
		radial-gradient(ellipse at 50% 85%, var(--glow-c) 0%, transparent 50%);
}
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.landing-inner {
	position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 26px; padding: 56px 16px calc(32px + env(safe-area-inset-bottom));
}
.logo-wrap { position: relative; width: clamp(220px, 58vw, 420px); text-align: center; animation: fadeInUp 1.1s ease-out both; }
.logo-wrap img { width: 78%; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.3)); }
.wordmark {
	margin-top: 10px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05;
	font-size: clamp(2.5rem, 10vw, 5rem); white-space: nowrap;
	background: linear-gradient(135deg, var(--word-a), var(--word-b));
	-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.wordmark span {
	background: linear-gradient(135deg, var(--word-c), var(--accent2) 75%);
	-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.flash {
	display: inline-flex; align-items: flex-end; gap: 0.11em; margin-left: 0.14em; vertical-align: baseline;
	height: 0.24em; position: relative; top: -0.02em;
}
.flash .dot {
	position: relative; width: 0.2em; height: 0.2em; border-radius: 50%; background: #fff;
	box-shadow: 0 0 0.08em 0.01em rgba(255, 255, 255, 0.55); opacity: 0; transform: scale(0.3);
	transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.flash .dot.show { opacity: 1; transform: scale(1); }
[data-theme='light'] .flash .dot { box-shadow: 0 0 0 1px rgba(13, 27, 62, 0.35), 0 1px 4px rgba(13, 27, 62, 0.35); }
.flash .d3 .core { position: absolute; inset: 0; border-radius: 50%; background: #fff; }
.flash .d3 .glow {
	position: absolute; inset: -170%; border-radius: 50%; opacity: 0; transform: scale(0.2);
	background: radial-gradient(circle, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.5) 22%, rgba(255, 250, 235, 0.15) 45%, rgba(255, 255, 255, 0) 65%);
}
.flash .d3 .ray {
	position: absolute; left: 50%; top: 50%; width: 1200%; height: 5%; border-radius: 1em; opacity: 0;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 25%, #fff 75%, rgba(255, 255, 255, 0));
	transform: translate(-50%, -50%) rotate(var(--a)) scaleX(0.1);
}
[data-theme='light'] .flash .d3 .ray { background: linear-gradient(90deg, rgba(13, 27, 62, 0), rgba(255, 255, 255, 0.95) 25%, rgba(255, 255, 255, 0.95) 75%, rgba(13, 27, 62, 0)); filter: drop-shadow(0 0 2px rgba(13, 27, 62, 0.45)); }
.flash.charging .d3 .core { animation: flashCharge 1.1s ease-in forwards; }
.flash.firing .d3 .core { animation: flashCore 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.flash.firing .d3 .glow { animation: flashGlow 1s cubic-bezier(0.1, 0.9, 0.2, 1) forwards; }
.flash.firing .d3 .ray { animation: flashRay 0.75s cubic-bezier(0.1, 0.9, 0.2, 1) forwards; }
#flashVeil { position: fixed; inset: 0; z-index: 3; pointer-events: none; background: #fff; opacity: 0; }
#flashVeil.firing { animation: flashVeil 0.6s ease-out forwards; }
.logo-wrap.firing img { animation: logoFlash 0.8s ease-out; }
@keyframes flashCharge {
	from { box-shadow: 0 0 0.08em 0.01em rgba(255, 255, 255, 0.55); transform: scale(1); }
	to { box-shadow: 0 0 0.5em 0.14em rgba(255, 255, 255, 0.95), 0 0 1.3em 0.4em rgba(255, 250, 230, 0.55); transform: scale(1.15); }
}
@keyframes flashCore {
	0% { transform: scale(1.15); box-shadow: 0 0 0.6em 0.2em #fff, 0 0 2em 0.8em rgba(255, 255, 255, 0.8); }
	12% { transform: scale(1.6); box-shadow: 0 0 1.3em 0.6em #fff, 0 0 4.5em 1.8em rgba(255, 255, 255, 0.6); }
	45% { transform: scale(1.05); box-shadow: 0 0 0.5em 0.1em rgba(255, 255, 255, 0.5); }
	100% { transform: scale(1); box-shadow: 0 0 0.08em 0.01em rgba(255, 255, 255, 0.55); }
}
@keyframes flashGlow {
	0% { opacity: 1; transform: scale(0.3); }
	10% { opacity: 1; transform: scale(1.6); }
	100% { opacity: 0; transform: scale(2.4); }
}
@keyframes flashRay {
	0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) scaleX(0.1); }
	10% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--a)) scaleX(1); }
	100% { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--a) + 18deg)) scaleX(1.25); }
}
@keyframes flashVeil {
	0% { opacity: 0; }
	5% { opacity: 0.5; }
	100% { opacity: 0; }
}
[data-theme='light'] #flashVeil.firing { animation-name: flashVeilLight; }
@keyframes flashVeilLight {
	0% { opacity: 0; }
	6% { opacity: 0.85; }
	100% { opacity: 0; }
}
@keyframes logoFlash {
	0% { filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.3)) brightness(1.55) contrast(0.9); }
	100% { filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.3)) brightness(1); }
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .flash .core, .flash .glow, .flash .ray, #flashVeil, .logo-wrap, .logo-wrap img, .event-card { animation: none !important; } .flash .dot { opacity: 1; transform: none; } }

.event-card { width: min(520px, 100%); text-align: center; animation: fadeInUp 1.3s ease-out both; }
.event-card h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); margin-bottom: 10px; }
.event-card .when { font-size: 1.08rem; font-weight: 600; color: var(--link); }
.event-card .where { margin-top: 6px; }
.event-card .comment { margin-top: 14px; font-style: italic; white-space: pre-line; }
.event-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.event-actions .btn { padding: 14px 18px; }

.footer-links { position: relative; z-index: 2; text-align: center; padding: 0 16px 18px; font-size: 0.8rem; }
.footer-links a { color: var(--muted); text-decoration: none; margin: 0 8px; }

/* ---------- Gästeseiten ---------- */

.page { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
.page-header { display: flex; align-items: center; gap: 12px; margin: 4px 130px 16px 0; }
.page-header img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.page-header h1 { font-size: 1.3rem; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a, .tabs button {
	padding: 10px 14px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer;
	text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs .active { color: var(--text); border-bottom-color: var(--accent); }

.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.switch .btn { padding: 16px 10px; font-size: 1.05rem; }
.switch .btn.active { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-actions .btn { padding: 20px 10px; flex-direction: column; font-size: 1rem; border-radius: var(--r-md); }
.upload-actions .btn svg { width: 34px; height: 34px; }

.name-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.name-row input { flex: 1; min-width: 0; }

.queue { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--card-strong); border: 1px solid var(--border); }
.queue-item .qname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.queue-item .bar { width: 90px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.queue-item .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.queue-item.done .bar i { background: var(--ok); }
.queue-item.error .bar i { background: var(--danger); width: 100%; }

.success { margin-top: 14px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.success strong { display: block; font-size: 1.12rem; margin-bottom: 4px; }

.section-title { margin: 26px 0 10px; font-size: 1.08rem; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.grid > p { grid-column: 1 / -1; }
.tile { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--card-strong); border: 1px solid var(--border); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.tile .video-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.tile .video-badge svg { width: 32px; height: 32px; }
.like {
	position: absolute; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 4px;
	padding: 4px 8px; border-radius: var(--r-sm); border: 0; cursor: pointer;
	background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.85rem; font-weight: 700;
}
.like svg { width: 16px; height: 16px; }
.like.on { background: var(--accent2); }
.tile .del { position: absolute; left: 6px; top: 6px; border: 0; border-radius: var(--r-sm); padding: 3px 8px; cursor: pointer; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem; }
.tile .pick {
	position: absolute; left: 6px; top: 6px; width: 26px; height: 26px; border-radius: 6px; border: 2px solid #fff;
	background: rgba(0, 0, 0, 0.35); cursor: pointer;
}
.tile.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile.selected .pick { background: var(--accent); }
.tile .tag { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; font-size: 0.72rem; background: rgba(0, 0, 0, 0.6); color: #fff; }

.select-bar {
	position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); margin-top: 14px; z-index: 20;
	display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
	padding: 10px 12px; border-radius: var(--r-md); background: var(--card-strong); border: 1px solid var(--border); box-shadow: var(--shadow);
}

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 80vh; border-radius: var(--r-sm); }
.lightbox .lb-bar { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.lightbox .like { position: static; padding: 9px 12px; }

/* ---------- Musik ---------- */

.now-playing { display: flex; gap: 14px; align-items: center; }
.now-playing img { width: 72px; height: 72px; border-radius: var(--r-sm); object-fit: cover; flex: none; background: var(--card-strong); }
.now-playing .t { font-weight: 700; font-size: 1.05rem; }
.progress { height: 4px; border-radius: 2px; background: var(--border); margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; }

.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }

.tracks { display: flex; flex-direction: column; }
.track { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.track:last-child { border-bottom: 0; }
.track img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; flex: none; background: var(--card-strong); }
.track .info { flex: 1; min-width: 0; }
.track .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .artist { font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .votes { display: flex; align-items: center; gap: 6px; }
.vote {
	min-width: 54px; padding: 7px 10px; border-radius: var(--r-sm); border: 1px solid var(--border);
	background: var(--card-strong); font-weight: 700; cursor: pointer;
}
.vote.on { background: var(--accent); color: var(--btn-text); border-color: transparent; }
.track .by { font-size: 0.74rem; color: var(--muted); }
.vote-heart { position: static; padding: 7px 11px; font-size: 0.95rem; }
.vote-heart[disabled] { opacity: 0.6; cursor: default; }
.spotify-note { font-size: 0.75rem; color: var(--muted); margin-top: 10px; }
.spotify-note a { color: inherit; }

/* ---------- TV ---------- */

.tv { position: fixed; inset: 0; overflow: hidden; background: #000; cursor: none; color: #fff; font-family: var(--tv-font, var(--font)); }
[data-theme='light'] .tv { background: var(--lbg2); }
.tv-panel > *, .tv-bar .np, .tv-bar .next, .tv-caption, .tv-empty .center, .tv-music .m-left, .tv-music .m-right, .tv-qr span, .tv-qr small, .tv-new { zoom: var(--tv-scale, 1); }
.tv.show-cursor { cursor: default; }
.tv .slide { position: absolute; inset: 0; opacity: 0; transition: opacity var(--tv-trans, 1.6s) ease, transform var(--tv-trans, 1.6s) ease; display: flex; align-items: center; justify-content: center; }
.tv .slide.show { opacity: 1; }
.tv.fx-zoom .slide { transform: scale(1.06); }
.tv.fx-zoom .slide.show { transform: scale(1); }
.tv.fx-slide .slide { transform: translateX(6%); }
.tv.fx-slide .slide.show { transform: none; }
.tv.fx-none .slide { transition: none; }
.tv .slide .blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) brightness(0.45); }
.tv .slide img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; will-change: transform; }
.tv .slide.kb img { animation: var(--kb) linear forwards; animation-duration: var(--dur, 9s); }
@keyframes kbIn { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes kbOut { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes kbLeft { from { transform: scale(1.1) translateX(2.5%); } to { transform: scale(1.1) translateX(-2.5%); } }
@keyframes kbRight { from { transform: scale(1.1) translateX(-2.5%); } to { transform: scale(1.1) translateX(2.5%); } }
@keyframes kbUp { from { transform: scale(1.1) translateY(2.5%); } to { transform: scale(1.1) translateY(-2.5%); } }
.tv.with-bar .slide, .tv.with-bar .tv-empty { bottom: 12vh; }
.tv-music .cover.hidden { display: none; }
.tv-music .cover-logo { width: 60%; margin: 0 auto; display: block; filter: drop-shadow(0 2vh 6vh rgba(0, 0, 0, 0.5)); }

.tv-caption {
	position: absolute; left: 3vw; bottom: 3vh; z-index: 5; display: flex; gap: 1.2vw; align-items: center;
	padding: 1vh 1.4vw; border-radius: 1vh; background: rgba(0, 0, 0, 0.55); font-size: 2.2vh;
}
.tv.with-bar .tv-caption { bottom: 14vh; }
.tv-caption .heart { display: flex; align-items: center; gap: 0.5vw; color: #ff6b81; font-weight: 700; }
.tv-caption svg { width: 2.4vh; height: 2.4vh; }
.tv-qr { position: absolute; right: 2.5vw; bottom: 3vh; z-index: 6; background: #fff; color: #111; border-radius: 1.2vh; padding: 1.2vh; text-align: center; font-weight: 700; font-size: 1.6vh; width: var(--tv-qr, 17vh); }
.tv.with-bar .tv-qr { bottom: 14vh; }
.tv-qr img { width: 100%; height: auto; display: block; margin-bottom: 0.6vh; }
.tv-logo { position: absolute; left: 2.5vw; top: 3vh; z-index: 5; width: var(--tv-logo, 11vh); filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6)); }
.tv-logo.pos-right { left: auto; right: 2.5vw; }
.tv.mode-gallery .tv-logo.pos-right { right: 36vw; }
.tv-new { position: absolute; right: 2.5vw; top: 3vh; z-index: 5; padding: 1vh 1.6vw; border-radius: 1vh; background: var(--accent2); color: #fff; font-weight: 700; font-size: 2vh; opacity: 0; transition: opacity 0.6s; }
.tv-new.on { opacity: 1; }
.tv-empty {
	position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 3vh; text-align: center; background: linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3)); z-index: 4; overflow: hidden;
}
.tv-empty .bg {
	position: absolute; inset: -6vh; background-size: cover; background-position: center;
	filter: blur(28px) brightness(0.32) saturate(1.15); opacity: 0; transition: opacity 1.2s ease;
}
.tv-empty.has-art .bg { opacity: 1; }
.tv-empty .shade { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)); opacity: 0; transition: opacity 1.2s ease; }
.tv-empty.has-art .shade { opacity: 1; }
.tv-empty .center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2.4vh; padding: 0 6vw; max-width: 90vw; }
.tv-empty.has-art .center { color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7); }
.tv-empty .hint { font-size: 2.9vh; line-height: 1.35; opacity: 0.95; }
.tv-empty .hint.small { font-size: 2.1vh; opacity: 0.75; }
.tv-empty .qr-pair { display: flex; gap: 4vw; }
.tv-empty .qr-pair > div { background: #fff; color: #111; padding: 1.4vh; border-radius: 1.6vh; width: 24vh; font-weight: 700; font-size: 1.8vh; }
.tv-empty .qr-pair img { width: 100%; display: block; margin-bottom: 0.6vh; }
[data-theme='light'] .tv-empty { background: linear-gradient(135deg, var(--lbg1), var(--lbg2) 55%, var(--lbg3)); color: var(--text); }
.tv-empty img.logo { width: 30vh; }
.tv-empty h1 { font-size: 6vh; line-height: 1.1; }
.tv-empty .qr-big { background: #fff; padding: 2vh; border-radius: 2vh; width: 30vh; }
.tv-empty .qr-big img { width: 100%; display: block; }

.tv-bar {
	position: absolute; left: 0; right: 0; bottom: 0; height: 12vh; z-index: 7;
	display: flex; align-items: center; gap: 2vw; padding: 0 2.5vw;
	background: linear-gradient(90deg, var(--bg1), var(--bg2)); border-top: 0.3vh solid var(--accent);
}
.tv-bar img { height: 8.5vh; width: 8.5vh; border-radius: 0.8vh; object-fit: cover; }
.tv-bar .np { min-width: 0; flex: 1.2; }
.tv-bar .np .label { font-size: 1.5vh; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.1em; }
.tv-bar .np .t { font-size: 3vh; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-bar .np .a { font-size: 2.2vh; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-bar .next { flex: 1; min-width: 0; font-size: 1.9vh; display: flex; flex-direction: column; justify-content: center; }
.tv-bar .next .label { font-size: 1.5vh; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.1em; }
.tv-bar .next .nx { display: flex; align-items: center; gap: 0.8vw; margin-top: 0.4vh; white-space: nowrap; overflow: hidden; }
.tv-bar .next .nx img { width: 3.9vh; height: 3.9vh; border-radius: 0.6vh; object-fit: cover; flex: none; background: rgba(255, 255, 255, 0.1); }
.tv-bar .next .nx span { overflow: hidden; text-overflow: ellipsis; }
.tv-bar .next .nx em { font-style: normal; opacity: 0.7; }
.tv-bar .progress { height: 0.5vh; margin-top: 1vh; background: rgba(255, 255, 255, 0.2); }

.tv-music {
	position: absolute; inset: 0; z-index: 3; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 4vw;
	padding: 3vh 4vw 3vh 16vh; background: linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
}
.tv-music .m-left { display: flex; flex-direction: column; min-height: 0; }
.tv-music .m-right { display: flex; flex-direction: column; min-height: 0; padding-top: 1vh; }
.tv-music .cover { width: 46vh; max-width: 100%; aspect-ratio: 1; border-radius: 2vh; object-fit: cover; box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.5); }
.tv-music .cover.hidden { display: none; }
.tv-music .cover-logo { width: 34vh; margin: 2vh 0; display: block; filter: drop-shadow(0 2vh 6vh rgba(0, 0, 0, 0.5)); }
.tv-music .t { font-size: 4.2vh; font-weight: 800; line-height: 1.1; margin-top: 2.4vh; }
.tv-music .a { font-size: 2.6vh; opacity: 0.8; margin-top: 0.6vh; }
.tv-music .progress { height: 0.7vh; margin: 2vh 0; background: rgba(255, 255, 255, 0.2); }
.tv-music .m-left .p-cta { margin-top: auto; }
.tv-music .m-right .g-queue { font-size: 2.2vh; --thumb: 3.4vh; gap: 0.7vh; }
.tv-music .m-right .g-queue.rows-m { font-size: 2.5vh; --thumb: 4.4vh; gap: 1vh; }
.tv-music .m-right .g-queue.rows-l { font-size: 2.9vh; --thumb: 5.6vh; gap: 1.4vh; }
.tv-music .m-right .g-queue.rows-xl { font-size: 3.3vh; --thumb: 7vh; gap: 2.2vh; }
[data-theme='light'] .tv-music { background: linear-gradient(135deg, var(--lbg1), var(--lbg2) 55%, var(--lbg3)); color: var(--text); }
[data-theme='light'] .tv-music .progress { background: rgba(28, 35, 64, 0.15); }

.tv-panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: 34vw; z-index: 6; display: flex; flex-direction: column;
	padding: 3vh 2vw 2.5vh; background: rgba(6, 10, 28, 0.74); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
	border-left: 1px solid rgba(255, 255, 255, 0.12); color: #fff;
}
[data-theme='light'] .tv-panel { background: rgba(255, 252, 245, 0.82); color: var(--text); border-left-color: rgba(28, 35, 64, 0.14); }
.tv-panel .p-head { font-size: 3.2vh; font-weight: 800; margin-bottom: 1.2vh; }
.tv-panel .label, .tv-music .label { font-size: 1.6vh; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; margin-bottom: 0.8vh; }
.tv-panel .g-now { display: flex; gap: 1.4vh; align-items: center; margin-bottom: 2vh; }
.tv-panel .g-now img { width: 8vh; height: 8vh; border-radius: 1vh; object-fit: cover; flex: none; }
.tv-panel .g-now .t { font-size: 2.6vh; font-weight: 800; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-panel .g-now .a { font-size: 1.9vh; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-panel .g-now .progress { height: 0.5vh; margin-top: 1vh; background: rgba(255, 255, 255, 0.2); }
[data-theme='light'] .tv-panel .g-now .progress { background: rgba(28, 35, 64, 0.15); }
.tv-panel .g-queue, .tv-music .g-queue { list-style: none; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; gap: 0.45vh; font-size: 1.95vh; --thumb: 2.8vh; }
.tv-panel .g-queue, .tv-music .g-queue.rows-m { font-size: 2.2vh; gap: 0.8vh; --thumb: 3.8vh; }
.tv-panel .g-queue, .tv-music .g-queue.rows-l { font-size: 2.5vh; gap: 1.2vh; --thumb: 4.8vh; }
.tv-panel .g-queue, .tv-music .g-queue.rows-xl { font-size: 2.9vh; gap: 2vh; --thumb: 6.2vh; }
.tv-panel .g-queue, .tv-music .g-queue li { display: flex; align-items: center; gap: 1.2vh; line-height: 1.15; }
.tv-panel .g-queue, .tv-music .g-queue .n { width: 3vh; text-align: right; opacity: 0.55; font-variant-numeric: tabular-nums; flex: none; }
.tv-panel .g-queue, .tv-music .g-queue img { width: var(--thumb); height: var(--thumb); border-radius: 0.6vh; object-fit: cover; flex: none; background: rgba(255, 255, 255, 0.1); }
.tv-panel .g-queue, .tv-music .g-queue .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-panel .g-queue, .tv-music .g-queue.rows-xl .txt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.tv-panel .g-queue, .tv-music .g-queue .txt em { font-style: normal; opacity: 0.65; margin-left: 0.6vh; }
.tv-panel .g-queue, .tv-music .g-queue.rows-l .txt em, .tv-panel .g-queue.rows-xl .txt em { display: block; margin-left: 0; font-size: 0.8em; }
.tv-panel .g-queue, .tv-music .g-queue .v { display: flex; align-items: center; gap: 0.4vh; color: #ff6b81; font-weight: 700; font-size: 0.95em; flex: none; min-width: 5.5vh; justify-content: flex-end; }
.tv-panel .g-queue, .tv-music .g-queue .v svg { width: 1em; height: 1em; }
.tv-panel .p-more, .tv-music .p-more { font-size: 1.7vh; margin: 0.6vh 0 0 4.2vh; min-height: 2vh; }
.tv-panel .p-cta, .tv-music .p-cta {
	margin-top: 1.2vh; display: flex; align-items: center; gap: 2vh; padding: 1.5vh; border-radius: 1.6vh;
	background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16);
}
[data-theme='light'] .tv-panel .p-cta, [data-theme='light'] .tv-music .p-cta { background: rgba(255, 255, 255, 0.7); border-color: rgba(28, 35, 64, 0.14); }
.tv-panel .p-cta, .tv-music .p-cta .qr { background: #fff; padding: 0.9vh; border-radius: 1.2vh; width: 14vh; flex: none; }
.tv-panel .p-cta, .tv-music .p-cta .qr img { width: 100%; display: block; }
.tv-panel .p-cta, .tv-music .p-cta h4 { font-size: 2.6vh; font-weight: 800; margin-bottom: 0.4vh; }
.tv-panel .p-cta, .tv-music .p-cta p { font-size: 1.9vh; line-height: 1.35; opacity: 0.9; }
.tv-panel .p-cta, .tv-music .p-cta .scan { margin-top: 0.6vh; font-size: 1.8vh; font-weight: 700; color: var(--accent); }
/* Slideshow im Galerie-Modus links neben der Tafel */
.tv.mode-gallery .slide { padding-right: 34vw; }
.tv.mode-gallery .tv-empty .center { padding-right: 36vw; }
.tv.mode-gallery .tv-qr { display: none; }
.tv.mode-gallery .tv-caption { right: auto; }
.tv.mode-gallery .tv-new { right: 36vw; }
.tv-qr small { display: block; font-weight: 500; font-size: 1.25vh; line-height: 1.25; opacity: 0.75; margin-top: 0.4vh; }
.tv-bar .next .nx .v { display: inline-flex; align-items: center; gap: 0.3vh; color: #ff6b81; font-weight: 700; font-size: 1.7vh; margin-left: 0.6vw; flex: none; }
.tv-bar .next .nx .v svg { width: 1.7vh; height: 1.7vh; }

/* Herkunft und Statistik */
.tile .tag.origin-archive { background: rgba(176, 24, 42, 0.75); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { padding: 12px 14px; border-radius: var(--r-md); background: var(--card-strong); border: 1px solid var(--border); }
.stat .v { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat .k { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.admin-tile .meta.origin { padding-top: 0; }

.subnav { display: flex; flex-wrap: wrap; gap: 6px; }
.subnav a { padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--card-strong); color: var(--text); text-decoration: none; font-size: 0.85rem; }
.impersonate-bar {
	display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
	padding: 10px 16px; background: var(--warn); color: #1b1405; font-size: 0.92rem;
}
.impersonate-bar .btn { background: #1b1405; color: #fff; }

/* ---------- Verwaltung ---------- */

.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; padding-right: 130px; border-bottom: 1px solid var(--border); background: var(--card); flex-wrap: wrap; }
.admin-top a { text-decoration: none; }
.admin-top .brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.admin-top .brand img { width: 34px; height: 34px; }
.admin-top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-page { max-width: 1120px; margin: 0 auto; padding: 18px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
.admin-page h2 { font-size: 1.15rem; margin-bottom: 12px; }
.admin-page h3 { font-size: 1rem; margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.form-grid > .check { min-height: 42px; }
.form-grid.wide { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.perms { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--card-strong); cursor: pointer; }
.perm input { margin-top: 3px; flex: none; }
.perm strong { display: block; font-size: 0.9rem; }
.perm span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.form-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.list th, table.list td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
table.list a { color: var(--text); }
.table-wrap { max-width: 100%; }
select, .input { max-width: 100%; }
table.list select.input { min-width: 0 !important; width: 100% !important; }
table.list a { overflow-wrap: anywhere; }
@media (max-width: 640px) {
	/* Tabellen stapeln statt seitlich scrollen */
	table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
	table.list thead { display: none; }
	table.list tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
	table.list td { padding: 3px 0; border: 0; white-space: normal; }
	table.list td[data-label]::before { content: attr(data-label); display: block; font-size: 0.74rem; color: var(--muted); }
	table.list td:empty { display: none; }
	table.list td .row { margin-top: 6px; }
}
.tokens { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.token-card { display: flex; flex-direction: column; gap: 8px; }
.token-card .qr { background: #fff; border-radius: var(--r-sm); padding: 10px; width: 170px; align-self: center; }
.token-card .qr img { width: 100%; display: block; }
.token-card .url { word-break: break-all; font-size: 0.85rem; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.admin-tile { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--card-strong); border: 1px solid var(--border); }
.admin-tile .thumb { aspect-ratio: 1; display: block; width: 100%; object-fit: cover; cursor: zoom-in; }
.admin-tile .meta { padding: 6px 8px; font-size: 0.78rem; display: flex; justify-content: space-between; gap: 6px; }
.admin-tile .acts { display: flex; gap: 6px; padding: 0 8px 8px; }
.admin-tile .acts button {
	flex: 1; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center;
	border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer;
}
.admin-tile .acts button svg { width: 18px; height: 18px; }
.admin-tile .acts button:hover { background: var(--card-strong); }
.admin-tile .acts button.ok { color: var(--ok-text); border-color: var(--ok); }
.admin-tile .acts button.danger:hover { color: var(--danger-text); border-color: var(--danger); }
.admin-tile.is-hidden .thumb { opacity: 0.3; }
.admin-tile.is-review { outline: 3px solid var(--warn); outline-offset: -3px; }
.admin-tile .vid { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.login-box { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.login-box img { display: block; width: 130px; margin: 0 auto 18px; }
.player-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv .badge { white-space: normal; }
@media (max-width: 560px) {
	.kv { grid-template-columns: 1fr; gap: 2px; }
	.kv dt { margin-top: 8px; }
}

@media print {
	body { background: #fff !important; color: #000; }
	.admin-top, .no-print, .theme-toggle, form { display: none !important; }
	.card { box-shadow: none; border: 1px solid #ccc; background: #fff; }
	.token-card { break-inside: avoid; }
}

@media (max-width: 560px) {
	.admin-top { padding-right: 16px; padding-top: 50px; }
	.page-header { margin-right: 0; padding-top: 34px; }
}

.tv-page .theme-toggle { opacity: 0; transition: opacity 0.3s; }
.tv-page.cursor .theme-toggle { opacity: 1; }
