/* VOIDBEAT – Dunkler Audio Altar 🕯 (Design nach INFERNUS-Referenz) */

@font-face {
  font-family: "Fraktur";
  src: url("fonts/unifraktur.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Gold";
  src: url("fonts/cinzel.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0a0505;
  --card: #150b0c;
  --card2: #1e0f11;
  --border: #391114;
  --border-soft: #26090b;
  --red: #e8232e;
  --red-hi: #ff4650;
  --gold: #d9a54a;
  --text: #f2e8e6;
  --muted: #9a8080;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --glow: 0 0 22px rgba(232, 35, 46, 0.4);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(150, 15, 25, 0.22), transparent 70%),
    radial-gradient(50% 35% at 50% 100%, rgba(150, 15, 25, 0.14), transparent 70%),
    radial-gradient(rgba(190, 30, 40, 0.07) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  overflow-x: hidden;
  /* Platz für Mini-Player + Tab-Bar, damit unten nichts abgeschnitten wird */
  padding-bottom: calc(215px + env(safe-area-inset-bottom));
}

/* Blutstropfen am oberen Rand */
.blood {
  position: fixed; top: 0; left: 0; width: 100%; height: 30px;
  color: #7a0d12; z-index: 45; pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(122, 13, 18, 0.55));
}

.pentagram { width: 100%; height: 100%; display: block; padding: 15%; box-sizing: border-box; }
.penta-inline {
  width: 14px; height: 14px; flex: none; color: var(--red-hi);
  filter: drop-shadow(0 0 5px rgba(232, 35, 46, 0.7));
}
.goldhead .penta-inline { margin-right: 8px; align-self: center; }
.goldhead .headleft { display: inline-flex; align-items: center; }
.hidden { display: none !important; }
button { font-family: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; }

/* ---------- Marken-Elemente ---------- */

.sigil {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2a0d10, #140708);
  border: 1px solid var(--border);
  box-shadow: var(--glow), inset 0 0 14px rgba(232, 35, 46, 0.35);
  display: flex; align-items: center; justify-content: center;
  color: var(--red-hi); font-size: 26px; text-shadow: 0 0 12px var(--red);
}
.sigil.small { width: 42px; height: 42px; font-size: 19px; margin: 0; }

.logo, .logo-big {
  font-family: "Fraktur", serif;
  background: linear-gradient(100deg, var(--red-hi) 20%, var(--gold) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px rgba(232, 35, 46, 0.5));
}
.logo { font-size: 26px; line-height: 1; }
.logo-big { font-size: 52px; }
.tagline {
  font-family: var(--mono); font-size: 10px; letter-spacing: 4px;
  color: var(--muted); margin-top: 4px;
}

.goldhead {
  font-family: "Gold", serif; font-weight: 700; color: var(--gold);
  font-size: 16px; letter-spacing: 2px; text-transform: uppercase;
  margin: 26px 2px 14px; text-shadow: 0 0 14px rgba(217, 165, 74, 0.25);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.goldhead.left { text-align: left; margin-top: 30px; }
.goldhead .more {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0; text-transform: none;
  color: var(--red-hi); font-weight: 400;
}

/* ---------- Login ---------- */

.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: min(370px, 100%); text-align: center; padding: 42px 30px;
  background: linear-gradient(180deg, #170a0b, #0e0607);
  border-radius: var(--r-lg); border: 1px solid var(--border);
  box-shadow: var(--glow);
}
.login-card input {
  width: 100%; margin-top: 26px; padding: 15px 20px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: #0c0506; color: var(--text);
  font-size: 16px; outline: none; text-align: center; font-family: var(--mono);
}
.login-card input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232, 35, 46, 0.18); }
.btn-primary {
  margin-top: 16px; width: 100%; padding: 15px; border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--red-hi), #c1121c);
  color: #fff; font-size: 15px; font-weight: 800; letter-spacing: 1px;
  box-shadow: var(--glow); transition: transform 0.1s;
}
.btn-primary:active { transform: scale(0.96); }
.err { color: var(--red-hi); margin-top: 14px; font-family: var(--mono); font-size: 13px; }

/* ---------- Header & Suche ---------- */

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 20px 10px;
}
.brand { display: flex; align-items: center; gap: 12px; }

.badge {
  position: absolute; top: 2px; right: 14px; min-width: 17px; height: 17px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; line-height: 17px; padding: 0 4px;
  font-style: normal; font-family: var(--mono); box-shadow: 0 0 10px rgba(232, 35, 46, 0.6);
}

.searchwrap { padding: 8px 20px 4px; position: sticky; top: 0; z-index: 5; }
.searchpill {
  display: flex; align-items: center; gap: 12px; padding: 4px 16px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border);
  color: var(--muted);
}
.searchpill:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232, 35, 46, 0.15); }
.searchpill input {
  flex: 1; padding: 13px 0; background: none; border: 0; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
}
.searchpill .clear { color: var(--muted); font-size: 15px; padding: 8px; }

/* ---------- Inhalte ---------- */

main { padding: 8px 20px 0; }

/* Hero */
.hero {
  border-radius: var(--r-lg); border: 1px solid var(--border);
  background:
    radial-gradient(90% 120% at 85% 110%, rgba(160, 18, 28, 0.35), transparent 60%),
    linear-gradient(160deg, #180a0c, #0c0506 70%);
  box-shadow: var(--glow);
  padding: 24px 22px; margin-top: 8px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--red-hi);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  background: rgba(232, 35, 46, 0.07);
}
.hero-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 8px var(--red);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }
.hero h1 {
  font-family: "Fraktur", serif; font-weight: 400; color: var(--red-hi);
  font-size: 34px; margin: 14px 0 10px; text-shadow: 0 0 18px rgba(232, 35, 46, 0.55);
}
.hero p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.hero-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn-red {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px;
  border-radius: var(--r-md); background: linear-gradient(180deg, var(--red-hi), #c1121c);
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 0.5px;
  box-shadow: var(--glow); transition: transform 0.1s;
}
.btn-red:active { transform: scale(0.95); }
.btn-dark {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px;
  border-radius: var(--r-md); background: #170b0c; border: 1px solid var(--border);
  color: var(--text); font-weight: 700; font-size: 14px; transition: transform 0.1s;
}
.btn-dark:active { transform: scale(0.95); }

/* Grid-Kacheln (Für dich) */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border-soft);
  text-align: left; transition: transform 0.1s; min-width: 0;
}
.tile:active { transform: scale(0.96); border-color: var(--border); }
.tile img, .tile .noimg {
  width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; flex: none;
  background: var(--card2); display: flex; align-items: center; justify-content: center;
  color: var(--red-hi); font-size: 20px;
}
.tile .t { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .a {
  font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile > div { min-width: 0; }

/* Chart-Liste */
.chartnum {
  font-family: "Gold", serif; color: var(--red-hi); font-size: 16px; width: 28px;
  text-align: center; flex: none; text-shadow: 0 0 10px rgba(232, 35, 46, 0.5);
}

/* Track-Zeilen */
.track {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border-soft);
  margin-bottom: 9px; transition: transform 0.08s;
}
.track:active { transform: scale(0.985); }
.track.playing { border-color: var(--red); box-shadow: 0 0 14px rgba(232, 35, 46, 0.25); background: var(--card2); }
.track img, .track .noimg {
  width: 50px; height: 50px; border-radius: var(--r-sm); object-fit: cover; flex: none;
  background: var(--card2); display: flex; align-items: center; justify-content: center;
  color: var(--red-hi); font-size: 20px;
}
.track .meta { flex: 1; min-width: 0; }
.track .t { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .a {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track .dur { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.heart { color: #5a3d3f; font-size: 19px; transition: transform 0.1s, color 0.15s; padding: 6px; }
.heart:active { transform: scale(1.3); }
.heart.on { color: var(--red-hi); text-shadow: 0 0 12px var(--red); }

.dlstate { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.dlstate.load { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Equalizer */
.eq { display: inline-flex; gap: 2px; height: 14px; align-items: flex-end; margin-right: 4px; }
.eq i { width: 3px; border-radius: 2px; background: var(--red-hi); box-shadow: 0 0 6px var(--red); animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.25s; background: var(--gold); }
.eq i:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* Horizontale Reihen */
.hscroll { display: flex; gap: 13px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.album-card { flex: 0 0 124px; text-align: left; transition: transform 0.1s; min-width: 0; }
.album-card:active { transform: scale(0.95); }
.album-card img, .album-card .noimg {
  width: 124px; height: 124px; border-radius: var(--r-md); object-fit: cover;
  background: var(--card2); border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center; color: var(--red-hi); font-size: 34px;
}
.album-card .t { margin-top: 8px; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-card .a { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.artist-card { text-align: center; flex: 0 0 92px; transition: transform 0.1s; }
.artist-card:active { transform: scale(0.93); }
.artist-card img, .artist-card .noimg {
  width: 82px; height: 82px; border-radius: 50%; object-fit: cover; margin: 0 auto;
  border: 2px solid var(--border); background: var(--card2);
  display: flex; align-items: center; justify-content: center; color: var(--red-hi); font-size: 30px;
}
.artist-card div { margin-top: 8px; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Album-/Artist-Seiten */
.pagehead { text-align: center; padding: 10px 0 4px; }
.pagehead img {
  width: 190px; height: 190px; object-fit: cover; border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: var(--glow);
}
.pagehead img.round { border-radius: 50%; }
.pagehead h1 { font-family: "Gold", serif; font-size: 21px; margin-top: 16px; color: var(--text); }
.pagehead p { color: var(--muted); font-family: var(--mono); font-size: 12px; margin-top: 4px; }
.playall { margin: 16px auto 8px; }
.backbtn { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 8px 0; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; line-height: 1.6; }
.empty .big { font-size: 40px; margin-bottom: 12px; color: var(--red-hi); text-shadow: 0 0 16px var(--red); }

.st { font-family: var(--mono); font-size: 11px; padding: 4px 10px; border-radius: 999px; flex: none; border: 1px solid var(--border-soft); }
.st.finished { color: #58d8a5; background: rgba(60, 200, 140, 0.08); }
.st.error { color: var(--red-hi); background: rgba(232, 35, 46, 0.1); }
.st.processing, .st.download, .st.queue_processing { color: var(--gold); background: rgba(217, 165, 74, 0.08); }
.st.queue, .st.queue_download { color: var(--muted); background: rgba(255, 255, 255, 0.04); }

/* ---------- Mini-Player ---------- */

#miniplayer {
  position: fixed; left: 10px; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  background: linear-gradient(180deg, #1c0d0f, #120708);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.7), var(--glow); z-index: 20; overflow: hidden;
}
#mpCover { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--border); }
#miniplayer.playing #mpCover { box-shadow: 0 0 12px rgba(232, 35, 46, 0.5); }
.mp-meta { flex: 1; min-width: 0; }
.mp-title { font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-artist { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mp-btn { font-size: 19px; padding: 6px; transition: transform 0.1s; }
.mp-btn:active { transform: scale(0.85); }
.mp-play {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: linear-gradient(180deg, var(--red-hi), #c1121c); color: #fff; font-size: 18px;
  box-shadow: var(--glow);
}
.mp-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
#mpBar { height: 100%; width: 0%; background: var(--red-hi); box-shadow: 0 0 8px var(--red); }

/* ---------- Tab-Bar ---------- */

#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  display: flex; justify-content: space-around;
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 5, 5, 0.96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: 10.5px; font-family: var(--mono);
  padding: 4px 14px; transition: color 0.15s;
}
.tab.active { color: var(--red-hi); text-shadow: 0 0 10px rgba(232, 35, 46, 0.6); }
.tab.active svg { filter: drop-shadow(0 0 7px rgba(232, 35, 46, 0.7)); }

/* ---------- Sheets ---------- */

.sheet {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto;
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(150, 15, 25, 0.28), transparent 70%),
    var(--bg);
  padding: calc(14px + env(safe-area-inset-top)) 24px 40px; text-align: center;
  animation: slideup 0.25s ease;
}
@keyframes slideup { from { transform: translateY(6%); opacity: 0; } }
.sheet-close { font-size: 30px; color: var(--muted); padding: 2px 20px; }

.bp-coverwrap { margin: 14px auto 20px; width: min(70vw, 300px); }
#bpCover {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: 0 0 46px rgba(232, 35, 46, 0.4);
}
.bp-title { font-family: "Fraktur", serif; font-size: 27px; color: var(--red-hi); text-shadow: 0 0 16px rgba(232, 35, 46, 0.5); }
.bp-artist { color: var(--muted); font-family: var(--mono); font-size: 13px; margin-top: 6px; }
.bp-dl { margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: #58d8a5; min-height: 16px; }
.bp-seek { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; }
.bp-seek span { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 36px; }
.bp-seek input { flex: 1; accent-color: var(--red); height: 22px; }
.bp-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 10px 0 20px; }
.bp-btn { font-size: 27px; transition: transform 0.1s; color: var(--text); }
.bp-btn:active { transform: scale(0.85); }
.bp-btn.heart { font-size: 23px; }
.bp-spacer { width: 35px; }
.bp-play {
  width: 74px; height: 74px; border-radius: 50%;
  background: linear-gradient(180deg, var(--red-hi), #b00e18); font-size: 28px; color: #fff;
  box-shadow: 0 0 34px rgba(232, 35, 46, 0.55);
}
#bpQueue .track, #dlList .track { text-align: left; }

/* Bibliothek-Kopf */
.libhead {
  display: flex; align-items: center; gap: 16px; padding: 14px 0 4px;
}
.libheart {
  width: 84px; height: 84px; border-radius: var(--r-md); flex: none;
  background: linear-gradient(160deg, #2a0d10, #150708);
  border: 1px solid var(--border); box-shadow: var(--glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--red-hi); font-size: 36px; text-shadow: 0 0 16px var(--red);
}
.libhead h1 { font-family: "Gold", serif; font-size: 20px; color: var(--gold); letter-spacing: 1px; }
.libhead p { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.librow { display: flex; gap: 12px; margin: 14px 0 6px; }

/* Playlist-Karten in der Bibliothek */
.plcard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border-soft);
  text-align: left; transition: transform 0.1s; min-width: 0; width: 100%;
}
.plcard:active { transform: scale(0.96); border-color: var(--border); }
.plicon {
  width: 62px; height: 62px; border-radius: var(--r-sm); overflow: hidden; flex: none;
  background: linear-gradient(160deg, #2a0d10, #150708); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--red-hi); font-size: 26px; text-shadow: 0 0 12px var(--red);
}
.plicon.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.plicon.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.plicon .penta-sm { width: 30px; height: 30px; color: var(--red-hi); filter: drop-shadow(0 0 8px rgba(232,35,46,.7)); }
.plcard .t { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.plcard .a { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.plcard.new { align-items: center; justify-content: center; border-style: dashed; min-height: 130px; color: var(--muted); }
.plcard.new .plus { font-size: 30px; color: var(--red-hi); text-shadow: 0 0 12px var(--red); }

.newplrow { display: flex; gap: 10px; margin: 12px 0; }
.newplrow input {
  flex: 1; padding: 13px 16px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: #0c0506; color: var(--text); font-size: 14px; outline: none; font-family: var(--mono);
}
.newplrow input:focus { border-color: var(--red); }

/* Action-Sheet (Long-Press auf Song / Playlist) */
#asheetWrap { position: fixed; inset: 0; z-index: 60; }
.asheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); }
.asheet {
  position: absolute; left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #1c0d0f, #0f0607);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.8), var(--glow);
  padding: 16px 14px; animation: slideup 0.2s ease; max-height: 70vh; overflow-y: auto;
}
.asheet .ash-title {
  font-weight: 800; font-size: 14px; padding: 2px 8px 12px;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asheet .ash-title small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.ash-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 10px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 600;
}
.ash-opt:active { background: rgba(232, 35, 46, 0.1); }
.ash-opt .ico { width: 24px; text-align: center; color: var(--red-hi); flex: none; }
.ash-opt.danger { color: var(--red-hi); }
.ash-opt.muted { color: var(--muted); }
