:root {
  --bg: #0b0b14;
  --panel: #161624;
  --panel-2: #1f1f33;
  --line: #2c2c46;
  --text: #f2f2fa;
  --muted: #9a9ab8;
  --accent: #ff3d9a;
  --accent-2: #4dd9ff;
  --ok: #3ddc84;
  --warn: #ffb020;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; color: inherit; }

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--panel-2);
  cursor: pointer;
}
button:active { transform: scale(0.97); }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.danger { background: #5a1830; }
button:disabled { opacity: 0.4; }

input[type=text], input[type=search], input[type=number], input[type=password], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  outline: none;
}
input:focus { border-color: var(--accent-2); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

.cover {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--panel-2);
}
.cover-empty { display: grid; place-items: center; color: var(--muted); font-size: 22px; }

/* ---------- Gaeste-Seite ---------- */

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

.now {
  position: sticky; top: 0; z-index: 5;
  margin: 0 -16px; padding: 16px;
  background: linear-gradient(180deg, #1a1030 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.now-row { display: flex; gap: 14px; align-items: center; }
.now .cover { width: 72px; height: 72px; }
.now-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.now-title { font-size: 18px; font-weight: 700; }
.bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 12px; overflow: hidden; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width .5s linear; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.next-line { margin-top: 8px; font-size: 13px; color: var(--muted); }

.tabs { display: flex; gap: 8px; margin: 16px 0 12px; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--accent); color: #fff; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px; border-radius: var(--radius);
  background: var(--panel);
}
.item.mine { outline: 1px solid var(--accent); }
.item .meta { flex: 1; min-width: 0; }
.item .title, .item .artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .title { font-weight: 600; }
.item .artist { color: var(--muted); font-size: 14px; }
.rank { width: 22px; text-align: center; color: var(--muted); font-weight: 700; }
.item .eta { font-size: 12px; color: var(--accent-2); margin-top: 1px; }
.item.auto { background: rgba(22, 22, 36, .55); }
.item.auto .title { font-weight: 500; }
.list-head { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 2px 2px; }
.list-head span { text-transform: none; letter-spacing: 0; }
.list-head:first-child { margin-top: 0; }
.screen .top .item.auto { opacity: .62; }
.screen .top .auto-tag { font-size: 1.6vh; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

.vote {
  min-width: 64px; display: flex; flex-direction: column; align-items: center;
  padding: 6px 10px; line-height: 1.1;
}
.vote .heart { font-size: 20px; }
.vote.on { background: var(--accent); color: #fff; }

.join {
  margin: 16px 0; padding: 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--accent);
}
.join form { display: flex; gap: 8px; margin-top: 10px; }
.join input { text-transform: uppercase; letter-spacing: .2em; text-align: center; font-size: 20px; }

.empty { text-align: center; color: var(--muted); padding: 32px 0; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px);
  max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 12px;
  background: #2a2a44; box-shadow: 0 8px 30px #0008;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: #6a1f3a; }
#toast.ok { background: #1d5a3a; }

.offline-banner { display: none; }
body.offline .offline-banner {
  display: block; position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--warn); color: #000; text-align: center; font-size: 13px; padding: 4px;
}

/* ---------- Grossbild ---------- */

.screen {
  height: 100vh; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: minmax(0, 1fr) auto;
  gap: 3vh 4vw; padding: 4vh 4vw;
  background: radial-gradient(circle at 20% 20%, #2a0f3a 0%, var(--bg) 60%);
}
.screen .now-big { display: flex; flex-direction: column; justify-content: center; gap: 2.5vh; min-height: 0; }
.screen .now-big .cover { width: min(30vh, 28vw); height: min(30vh, 28vw); border-radius: 2vh; box-shadow: 0 2vh 6vh #000a; font-size: 12vh; }
.screen .now-big .title { font-size: 5vh; font-weight: 800; line-height: 1.1; }
.screen .now-big .artist { font-size: 3.2vh; color: var(--muted); }
.screen .now-big .bar { height: 1vh; border-radius: 1vh; }
.screen .up-next { font-size: 2.4vh; color: var(--accent-2); }
.screen h2 { font-size: 2.6vh; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 2vh; }
.screen .top { display: flex; flex-direction: column; gap: 1.2vh; }
.screen .top .item { padding: 1.2vh 1.5vh; gap: 1.6vh; }
.screen .top .cover { width: 6vh; height: 6vh; }
.screen .top .title { font-size: 2.5vh; }
.screen .top .artist { font-size: 2vh; }
.screen .top .rank { font-size: 2.6vh; width: 4vh; }
.screen .top .votes { font-size: 2.6vh; font-weight: 700; color: var(--accent); }
.screen .join-box {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 3vw;
  background: #fff1; border-radius: 2vh; padding: 2vh 3vw;
}
.screen .join-box figure { margin: 0; text-align: center; font-size: 1.8vh; color: var(--muted); }
.screen .join-box img { height: 20vh; width: 20vh; border-radius: 1vh; background: #fff; display: block; margin-bottom: .6vh; }
.screen .join-box .big { font-size: 4vh; font-weight: 800; }
.screen .join-box .code { font-size: 6vh; font-weight: 900; letter-spacing: .3em; color: var(--accent-2); }
.screen > section { min-height: 0; overflow: hidden; }

/* ---------- Admin ---------- */

.admin { max-width: 1100px; margin: 0 auto; padding: 16px; }
.admin h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 24px 0 10px; }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.admin label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.admin label.check { flex-direction: row; align-items: flex-end; color: var(--text); }
.admin label.check span { display: flex; gap: 8px; align-items: center; padding-bottom: 12px; }
.admin .card { background: var(--panel); border-radius: var(--radius); padding: 14px; }
.admin .item button { padding: 6px 10px; font-size: 13px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin td, .admin th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); font-size: 13px; }
.chip button { padding: 0 4px; background: none; }
.code-big { font-size: 28px; font-weight: 800; letter-spacing: .25em; color: var(--accent-2); }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr !important; } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
