:root {
  --bg: #140b1f;
  --bg-2: #1d1030;
  --card: #231539;
  --line: #3a2658;
  --text: #f3ecff;
  --muted: #a794c4;
  --orange: #ff8a1f;
  --orange-2: #ffb15c;
  --green: #9bff6a;
  --danger: #ff5d73;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 138, 31, .16), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(120, 60, 200, .22), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

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

.top { text-align: center; padding: 14px 0 6px; }
h1 {
  margin: 0;
  font-family: "Creepster", "Nunito", sans-serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 11vw, 3.2rem);
  letter-spacing: .04em;
}
h1 span { color: var(--orange); text-shadow: 0 0 22px rgba(255, 138, 31, .55); }
h2 { margin: 0 0 12px; font-size: 1.1rem; font-weight: 800; }

.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
}

.muted, .hint { color: var(--muted); font-weight: 400; }
.hint { font-size: .85rem; margin: 8px 2px 0; }
.err { color: var(--danger); min-height: 1.2em; margin: 10px 0 0; }

.notice {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 93, 115, .12);
  border: 1px solid rgba(255, 93, 115, .5);
  font-size: .92rem;
}

/* tlačítka a pole */
input[type="search"], input#pin {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #160c26;
  color: var(--text);
  font: inherit;
}
input:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.row { display: flex; gap: 8px; }
#login-form { display: grid; gap: 10px; }

.btn {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #2c1a47;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #2a1200; }
.btn.ghost { background: transparent; border-style: dashed; color: var(--orange-2); width: 100%; }
.btn.round { width: 64px; height: 64px; min-height: 64px; border-radius: 50%; font-size: 1.5rem; padding: 0; }
.btn[disabled] { opacity: .5; }

/* právě hraje */
.now { display: grid; grid-template-columns: 76px 1fr; gap: 4px 14px; align-items: center; }
.art {
  width: 76px; height: 76px; border-radius: 16px;
  display: grid; place-items: center; font-size: 2.2rem;
  background: #160c26 center / cover no-repeat;
  border: 1px solid var(--line);
}
.meta { min-width: 0; }
.label { margin: 0; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.title { margin: 2px 0 0; font-weight: 800; font-size: 1.15rem; overflow-wrap: anywhere; }
.artist { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.bar { grid-column: 1 / -1; margin-top: 12px; height: 6px; border-radius: 99px; background: #160c26; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--orange-2)); }
.times { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.controls { grid-column: 1 / -1; display: flex; justify-content: center; gap: 18px; margin-top: 8px; }

/* seznamy */
.list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.list:empty { display: none; }
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  background: #160c26; border: 1px solid var(--line);
}
.item .txt { flex: 1; min-width: 0; }
.item .t { font-weight: 800; overflow-wrap: anywhere; }
.item .a { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.item .src { font-size: .7rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.item .btn { min-height: 44px; padding: 0 14px; }
.item .x { width: 44px; padding: 0; color: var(--danger); }
.item.loading .a::after { content: " · stahuju…"; color: var(--orange-2); }

.upload { display: block; margin-top: 14px; }

.btn.big { width: 100%; min-height: 60px; font-size: 1.15rem; margin-top: 14px; }
.status { min-height: 1.4em; margin: 12px 0 0; color: var(--green); }
.status.bad { color: var(--danger); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--orange); flex: none; }
a { color: var(--orange-2); }
.player-link { display: inline-flex; margin-top: 8px; }
.top { padding-top: max(14px, env(safe-area-inset-top)); }   /* vrub / stavový řádek v nainstalované appce */
.btn.install { width: auto; min-height: 40px; margin-top: 6px; }

details.card summary { cursor: pointer; font-weight: 800; min-height: 32px; display: flex; align-items: center; }
details.card summary b { color: var(--orange-2); margin-left: 6px; font-weight: 800; }
details.card[open] summary { margin-bottom: 8px; }
details.card .btn.ghost { margin-top: 4px; }
.item .btn.on { background: transparent; border-color: var(--green); color: var(--green); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 460px);
  padding: 12px 18px; border-radius: 14px;
  background: #3b1f5e; border: 1px solid var(--orange);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  z-index: 10;
}
.toast.bad { border-color: var(--danger); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
