*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(60% 40% at 90% 0%, rgba(225, 29, 60, 0.14), transparent 70%),
    radial-gradient(50% 35% at 0% 40%, rgba(25, 240, 224, 0.07), transparent 70%),
    var(--bg);
  min-height: 100vh;
}
main, .top, .foot { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 16px; }
section { margin: 28px 0; }
h1, h2 { line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 750; letter-spacing: -0.02em; }
h2 { font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
p { margin: 0 0 14px; }
a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }

/* header */
.top { display: flex; align-items: center; gap: 12px; padding-top: 20px; padding-bottom: 14px; }
.logo { color: var(--text); font-weight: 750; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 10px; }
.logo:hover { text-decoration: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px var(--red); }
.by { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.pill { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); border: 1px solid var(--red); border-radius: 999px; padding: 3px 10px; }

/* hero and copy */
.hero { margin-top: 36px; }
.intro p { max-width: 66ch; color: #d9d9e0; }
.fine { font-size: 0.85rem; color: var(--muted); }

/* cards */
.card { background: linear-gradient(180deg, var(--panel), #0b0b0e); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.about p { max-width: 66ch; color: #d9d9e0; }

/* player */
.stage { position: relative; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); min-height: 140px; display: grid; place-items: center; }
.stage canvas, .stage video { width: 100%; height: auto; display: block; }
.stage audio { display: none; }
.empty { color: var(--muted); padding: 40px 16px; margin: 0; }
.transport { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--red), #8f0f24); box-shadow: 0 8px 22px rgba(225, 29, 60, 0.35); flex: none; }
.round svg { width: 22px; height: 22px; fill: currentColor; }
.round:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.scrub { flex: 1 1 280px; min-width: 0; }
.scrub .meta { display: flex; justify-content: space-between; gap: 12px; font-size: 0.88rem; margin-bottom: 6px; }
#now-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; }
.vol input { width: 110px; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.ghost:hover { border-color: var(--aqua); color: var(--aqua); }
.row { margin-top: 14px; }

/* custom range */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 8px 0; border-radius: 999px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--red) var(--p, 0%), var(--line) var(--p, 0%));
}
input[type="range"]:disabled { opacity: 0.4; cursor: default; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(25, 240, 224, 0.25); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(25, 240, 224, 0.25); }
input[type="range"]::-moz-range-track { background: transparent; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.9rem; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.knob { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + .knob { background: var(--aqua); }
.switch input:checked + .knob::after { transform: translateX(20px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--aqua); outline-offset: 3px; }

/* playlist */
.list { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.list button { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; text-align: left; background: none; border: 0; color: var(--text); padding: 12px 6px; font: inherit; cursor: pointer; border-radius: 10px; }
.list button:hover { background: rgba(255, 255, 255, 0.03); }
.list .num { color: var(--red); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.list .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.list button[aria-current="true"] .title { color: var(--aqua); font-weight: 650; }

/* upload */
.upform { display: grid; gap: 14px; max-width: 520px; }
.filerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pick { cursor: pointer; border: 1px dashed var(--red); color: var(--text); border-radius: 12px; padding: 12px 18px; font-weight: 600; }
.pick:hover { background: rgba(225, 29, 60, 0.08); }
.btn { justify-self: start; font: inherit; font-weight: 700; color: #fff; background: linear-gradient(145deg, var(--red), #8f0f24); border: 0; border-radius: 999px; padding: 11px 26px; cursor: pointer; box-shadow: 0 8px 20px rgba(225, 29, 60, 0.3); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
#barFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--aqua)); transition: width 0.2s; }
.msg { margin: 0; font-size: 0.92rem; min-height: 1.4em; }

/* AI zone */
.ai-zone { border: 1px dashed var(--aqua); background: rgba(25, 240, 224, 0.04); }
.ai-zone ul { padding-left: 20px; margin: 10px 0 0; color: #d9d9e0; }
.tag { display: inline-block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 6px; padding: 2px 8px; margin-right: 6px; vertical-align: middle; }
.tag.ai { background: rgba(25, 240, 224, 0.12); color: var(--aqua); border: 1px solid var(--aqua); }
.tag.wait { background: rgba(225, 29, 60, 0.12); color: var(--red); border: 1px solid var(--red); }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 16px; padding-bottom: 40px; color: var(--muted); font-size: 0.85rem; }
.foot p { margin: 0 0 6px; }

@media (max-width: 520px) {
  .card { padding: 18px; }
  .list .meta { display: none; }
  .by { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
