:root {
  --bg: #0f0f12;
  --panel: #17171d;
  --panel-2: #1f1f27;
  --line: #2a2a34;
  --text: #f2f2f6;
  --muted: #a3a3ae;
  --purple: #7c3aed;
  --pink: #ec4899;
  --danger: #f87171;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

a { color: #c4b5fd; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }

header.top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #141419;
}
header.top img { width: 28px; height: 28px; }
header.top .brand { font-weight: 700; font-size: 17px; }
header.top .brand span {
  background: linear-gradient(90deg, var(--purple), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
header.top .spacer { flex: 1; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 16px; }

.hero { text-align: center; padding: 48px 16px 24px; }
.hero h1 { font-size: 30px; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 560px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }

input[type=text], input:not([type]) {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; outline: none;
}
input:focus { border-color: var(--purple); }

button {
  font: inherit; border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
}
button:hover:not(:disabled) { background: #282832; }
button:disabled { opacity: .45; cursor: default; }
button.primary {
  background: linear-gradient(90deg, var(--purple), var(--pink)); border: 0; font-weight: 600;
}
button.primary:hover:not(:disabled) { filter: brightness(1.1); }
button.icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 18px; }
button.icon.big { width: 56px; height: 56px; font-size: 22px; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.danger { color: var(--danger); }

.hint { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; }

.join-box { max-width: 420px; margin: 24px auto; }

/* Jam-Ansicht */
.jam { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
@media (max-width: 860px) { .jam { grid-template-columns: minmax(0, 1fr); } }

.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box iframe, .player-box #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-box .overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; text-align: center; padding: 16px;
  background: rgba(10, 10, 14, .82); color: var(--text);
}
.player-box .overlay[hidden] { display: none; }

.now { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.now .meta { flex: 1; min-width: 0; }
.now .title { font-size: 18px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now .artist { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress input[type=range] { flex: 1; accent-color: var(--pink); }

.controls { display: flex; justify-content: center; gap: 14px; margin-top: 8px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.list li:hover { background: var(--panel-2); }
.list img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; background: #000; }
.list .meta { flex: 1; min-width: 0; }
.list .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .empty { color: var(--muted); padding: 8px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--purple), var(--pink));
}
.avatar.off { opacity: .4; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.badge.host { color: #f5d0fe; border-color: #6d28d9; }
.badge.warn { color: #fecaca; border-color: #7f1d1d; }

.invite { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.invite .code { font-size: 26px; font-weight: 700; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.qr { background: #fff; border-radius: 10px; padding: 8px; width: 132px; height: 132px; }
.qr img, .qr svg { width: 100%; height: 100%; display: block; }

.side { display: flex; flex-direction: column; gap: 16px; }
.toggle { display: flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--pink); width: 18px; height: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #26262e; color: var(--text);
  border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 10; max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }

footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 16px; }
footer a { color: var(--muted); }
