:root {
  --bg: #160b29;
  --bg2: #1f1038;
  --plum: #3d2061;
  --card: rgba(255, 255, 255, 0.055);
  --card-hi: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3eefa;
  --muted: #b5a9c9;
  --dim: #8a7ca3;
  --amber: #faa61a;
  --amber2: #ffc15a;
  --hot: #ef3a54;
  --grad: linear-gradient(100deg, #f7941d 0%, #ef3a54 100%);
  --song: #faa61a;
  --link: #ef5a8a;
  --ad: #33d1b8;
  --other: #7d6aa3;
  --r: 16px;
  --dock-h: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 Outfit, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(239, 58, 84, 0.18), transparent 60%),
    radial-gradient(900px 600px at -10% 10%, rgba(97, 50, 150, 0.45), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: calc(var(--dock-h) + 24px);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: rgba(22, 11, 41, 0.78);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: 70px; height: auto; }
.brand-sub {
  font-weight: 700; font-size: 15px; letter-spacing: 0.02em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.search { flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23b5a9c9' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") 14px 50% no-repeat;
  color: var(--text); font: inherit; font-size: 15px;
}
.search input::placeholder { color: var(--dim); }
.live {
  display: flex; align-items: center; gap: 8px; flex: none;
  height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(239, 58, 84, 0.5); background: rgba(239, 58, 84, 0.12);
  font-weight: 600; font-size: 14px; max-width: 320px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 0 rgba(239, 58, 84, 0.6); animation: pulse 2s infinite; flex: none; }
.live.playing { background: var(--grad); border-color: transparent; }
.live.playing .live-dot { background: #fff; }
.live-now { color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live.playing .live-now { color: #fff; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(239, 58, 84, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 58, 84, 0); } }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px; outline: none; }

/* ---------- home ---------- */
.hero { padding: 44px 0 20px; }
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 56px); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 12px 0 0; color: var(--muted); font-size: 18px; max-width: 560px; }

.days {
  display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; display: flex; flex-direction: column; align-items: center; min-width: 62px;
  padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
}
.day b { font-size: 20px; line-height: 1.1; }
.day span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.day[aria-current="true"] { background: var(--grad); border-color: transparent; }
.day[aria-current="true"] span { color: rgba(255, 255, 255, 0.85); }

.section-title { margin: 28px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); background: var(--card-hi); border-color: rgba(255, 255, 255, 0.18); }
.card-art { position: relative; aspect-ratio: 16 / 9; background: var(--plum); overflow: hidden; }
.card-body { padding: 12px 14px 14px; }
.card-time { font-size: 13px; color: var(--amber2); font-weight: 600; letter-spacing: 0.02em; }
.card-title { font-weight: 700; font-size: 18px; line-height: 1.2; margin-top: 2px; }
.card-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.card-meta { display: flex; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--dim); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 12px; color: var(--muted); }
.badge.warn { background: rgba(250, 166, 26, 0.14); color: var(--amber2); }

/* generated show artwork: mosaic of track covers under a gradient wash */
.mosaic { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1); }
.mosaic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(61, 32, 97, 0.15), rgba(22, 11, 41, 0.92) 85%); }
.card-art .art-label {
  position: absolute; left: 14px; right: 14px; bottom: 10px; z-index: 1;
  font-weight: 800; font-size: 24px; line-height: 1.05; letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}
.card-art .art-logo { position: absolute; top: 10px; left: 12px; width: 46px; z-index: 1; opacity: 0.95; }
.card-art .dur { position: absolute; top: 10px; right: 10px; z-index: 1; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); }
.art-fallback { position: absolute; inset: 0; background: radial-gradient(120% 120% at 100% 0%, #ef3a54 0%, #7a2c8a 40%, #3d2061 75%); }

.empty, .locked {
  margin: 40px auto; max-width: 520px; text-align: center; padding: 36px 24px;
  border-radius: 22px; background: var(--card); border: 1px solid var(--line);
}
.empty h2, .locked h2 { margin: 0 0 8px; font-size: 24px; }
.empty p, .locked p { margin: 0; color: var(--muted); }

/* ---------- show page ---------- */
.show-head { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: end; padding: 34px 0 22px; }
.show-art { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6); background: var(--plum); }
.show-art .mosaic { grid-template-columns: repeat(2, 1fr); }
.show-art .art-logo { width: 64px; top: 16px; left: 16px; position: absolute; z-index: 1; }
.show-kicker { color: var(--amber2); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.show-title { margin: 6px 0 4px; font-size: clamp(30px, 5vw, 50px); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
.show-pres { color: var(--muted); font-size: 18px; }
.show-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.btn-play {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px 0 18px;
  border: 0; border-radius: 999px; background: var(--grad); font-weight: 700; font-size: 17px;
  box-shadow: 0 12px 30px -10px rgba(239, 58, 84, 0.7);
}
.btn-play svg { width: 26px; height: 26px; fill: #fff; }
.btn { height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--card-hi); }
select.btn { appearance: none; padding-right: 28px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%23b5a9c9'%3E%3Cpath d='M0 0h10L5 6z'/%3E%3C/svg%3E") right 12px center no-repeat; color: var(--text); }
select.btn option { color: #000; }

.player { position: sticky; top: 64px; z-index: 10; margin: 4px -16px 0; padding: 14px 16px 12px; background: rgba(22, 11, 41, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.now { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.now img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--plum); flex: none; }
.now-text { min-width: 0; flex: 1; }
.now-kind { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.now-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transport { display: flex; align-items: center; gap: 6px; flex: none; }
.tbtn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.tbtn svg { width: 20px; height: 20px; fill: currentColor; }
.tbtn.main { width: 50px; height: 50px; background: var(--grad); border: 0; }
.tbtn.main svg { width: 24px; height: 24px; }
.i-pause { display: none; }
.is-playing .i-play { display: none; }
.is-playing .i-pause { display: inline; }
.times { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 6px; }

.timeline { position: relative; height: 64px; margin-top: 10px; cursor: pointer; touch-action: none; user-select: none; }
.timeline canvas { width: 100%; height: 100%; display: block; }
.tip {
  position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); pointer-events: none;
  padding: 6px 10px; border-radius: 10px; background: #2a1748; border: 1px solid var(--line);
  font-size: 13px; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.tip b { color: var(--amber2); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.tracks { list-style: none; margin: 18px 0 0; padding: 0; }
.track {
  display: grid; grid-template-columns: 64px 48px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px; cursor: pointer;
}
.track:hover { background: var(--card); }
.track.current { background: linear-gradient(90deg, rgba(247, 148, 29, 0.18), rgba(239, 58, 84, 0.08)); }
.track .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.track.current .t { color: var(--amber2); font-weight: 600; }
.track .art { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: rgba(255, 255, 255, 0.06); display: grid; place-items: center; font-size: 20px; }
.track .ti { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .ar { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.track.k-link .ti { color: var(--muted); font-weight: 500; }
.kind.song { color: var(--song); background: rgba(250, 166, 26, 0.12); }
.kind.link { color: var(--link); background: rgba(239, 90, 138, 0.12); }
.kind.ad { color: var(--ad); background: rgba(51, 209, 184, 0.12); }
.kind.other { color: #c6b8e0; background: rgba(125, 106, 163, 0.2); }
.adv-link { color: var(--ad); font-size: 13px; font-weight: 600; margin-left: 8px; }
.adv-link:hover { text-decoration: underline; }
.note { color: var(--dim); font-size: 13.5px; margin: 18px 0; }

.results { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.result { padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.result-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.result-head b { font-size: 17px; }
.result-head span { color: var(--muted); font-size: 13px; }
.hits { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.hit { font-size: 13.5px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.hit b { color: var(--amber2); margin-right: 6px; font-variant-numeric: tabular-nums; }

/* ---------- dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 48px 44px 1fr auto; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom));
  background: rgba(31, 16, 56, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.dock[hidden] { display: none; }
.dock-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grad); display: grid; place-items: center; }
.dock-play svg { width: 22px; height: 22px; fill: #fff; }
.dock-art { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--plum); }
.dock-text { min-width: 0; display: flex; flex-direction: column; }
.dock-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dock-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(255, 255, 255, 0.08); }
.dock-progress i { display: block; height: 100%; width: 0; background: var(--grad); }

.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 20px); transform: translateX(-50%); background: #2a1748; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 40; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .live { margin-left: auto; }
  .live-now { display: none; }
  .player { top: 112px; }
  .show-head { grid-template-columns: 1fr; gap: 18px; padding-top: 22px; }
  .show-art { width: 62%; max-width: 260px; }
  .track { grid-template-columns: 52px 40px 1fr; gap: 10px; }
  .track .art { width: 40px; height: 40px; }
  .track .kind { display: none; }
  .transport .skip { display: none; }
  .dock-time { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
