/* LIMA Musikbox – Handy-Seite */
:root {
  --aubergine: #1d0b33;
  --aubergine-2: #2a1247;
  --aubergine-3: #3a1c5e;
  --lamp-red: #ff3b5c;
  --lamp-amber: #ffb020;
  --lamp-green: #2be38b;
  --lamp-blue: #3d7bff;
  --text: #fff4e6;
  --muted: #c4aee3;
  --line: rgba(196, 174, 227, 0.18);
  --display: Bahnschrift, "DIN Alternate", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background:
    radial-gradient(60vmax 50vmax at 110% -10%, rgba(61, 123, 255, .28), transparent 60%),
    radial-gradient(60vmax 50vmax at -20% 110%, rgba(255, 59, 92, .22), transparent 60%),
    var(--aubergine);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.4 var(--body);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--lamp-amber); outline-offset: 2px; }
img { display: block; }

.head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(29, 11, 51, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; background: url("../icon.svg") center / contain no-repeat; }
.brand-text { font: 500 24px/1 var(--display); font-stretch: 75%; white-space: nowrap; }
.brand-text b { font-weight: 800; color: var(--lamp-amber); letter-spacing: .04em; }
.me {
  min-height: 40px; padding: 0 14px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--aubergine-2);
  font-weight: 600; font-size: 15px; white-space: nowrap; max-width: 50vw; overflow: hidden; text-overflow: ellipsis;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(40px + env(safe-area-inset-bottom)); }

.banner { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 176, 32, .15); border: 1px solid rgba(255, 176, 32, .45); color: var(--lamp-amber); font-weight: 600; }

.now { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: var(--aubergine-2); border: 1px solid var(--line); }
.now-cover { width: 76px; height: 76px; border-radius: 8px; object-fit: cover; flex: none; background: var(--aubergine-3); }
.now-cover.empty { background: var(--aubergine-3) url("../icon.svg") center / 40% no-repeat; }
.now-text { min-width: 0; flex: 1; }
.label { margin: 0 0 2px; color: var(--lamp-amber); font-weight: 600; font-size: 13px; }
.now-title { margin: 0; font: 700 24px/1.08 var(--display); font-stretch: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-artist { margin: 2px 0 8px; color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-bar { height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--lamp-red), var(--lamp-amber), var(--lamp-green), var(--lamp-blue)); }

.block { margin-top: 22px; }
.block h2 { margin: 0 0 8px; font: 700 24px/1.1 var(--display); font-stretch: 75%; display: flex; align-items: center; gap: 8px; }
.count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: inline-grid; place-items: center; background: var(--lamp-amber); color: var(--aubergine); font: 700 14px/1 var(--body); }
.count:empty { display: none; }

.search-bar {
  position: sticky; top: calc(61px + env(safe-area-inset-top)); z-index: 4;
  padding: 8px 0 10px; margin: 0 -16px; padding-inline: 16px;
  background: linear-gradient(var(--aubergine) 85%, transparent);
}
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.search input {
  width: 100%; height: 50px; padding: 0 14px 0 44px;
  border-radius: 25px; border: 2px solid var(--line);
  background: var(--aubergine-2); color: var(--text);
  font: 500 17px var(--body);
}
.search input:focus { outline: none; border-color: var(--lamp-amber); }
.search input::-webkit-search-cancel-button { filter: invert(1); }

.scope { display: flex; gap: 4px; margin-top: 8px; padding: 4px; border-radius: 22px; background: var(--aubergine-2); border: 1px solid var(--line); }
.scope button { flex: 1; height: 38px; border: 0; border-radius: 19px; background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; }
.scope button[aria-checked="true"] { background: var(--text); color: var(--aubergine); }
.scope button.is-closed { opacity: .6; }
.cat-hint { font-weight: 400; font-size: 13px; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-cover { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; flex: none; background: var(--aubergine-3); }
.row-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-artist { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 3px; background: var(--aubergine-3); color: var(--muted); font-size: 10px; font-weight: 700; vertical-align: 2px; }

.pill { flex: none; padding: 5px 10px; border-radius: 12px; background: var(--lamp-amber); color: var(--aubergine); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill-green { background: var(--lamp-green); }
.pill-dim { background: var(--aubergine-3); color: var(--muted); }
.by { flex: none; max-width: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--lamp-amber); font-size: 13px; font-weight: 600; }
.by-me { color: var(--lamp-green); }
.icon-btn { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 22px; line-height: 1; color: var(--muted); }

.btn { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 2px solid var(--line); background: var(--aubergine-2); font-weight: 700; }
.btn:disabled { opacity: .5; }
.btn:not(:disabled):active { transform: scale(.96); }
.btn-hot { background: var(--lamp-red); border-color: var(--lamp-red); color: #fff; }
.btn-ghost { background: transparent; }
.btn-wish { flex: none; min-height: 40px; padding: 0 14px; font-size: 15px; }
.more { display: block; margin: 12px auto 0; }

.muted { color: var(--muted); }
.more-line { padding: 8px 0; }
.fair { margin: 28px 0 0; color: var(--muted); font-size: 14px; text-align: center; }

.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 6, 36, .7); }
.sheet-card {
  width: 100%; max-width: 640px; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; background: var(--aubergine-2); border-top: 1px solid var(--line);
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-card h2 { margin: 0 0 6px; font: 700 26px/1.1 var(--display); font-stretch: 75%; }
.sheet-card p { margin: 0 0 14px; }
.sheet-card input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--aubergine); color: var(--text); font: 500 17px var(--body);
}
.sheet-actions { display: flex; gap: 10px; margin-top: 14px; }
.sheet-actions .btn { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 22px;
  background: var(--lamp-amber); color: var(--aubergine);
  font-weight: 700; text-align: center;
  box-shadow: 0 10px 30px rgba(10, 2, 20, .5);
}

@media (prefers-reduced-motion: reduce) { .sheet-card { animation: none; } }
