:root { --bg: #0b1020; --panel: #141b33; --line: #26304d; --text: #eef1fa; --muted: #95a0c0; --accent: #f5b83d; --good: #4fd18b; --bad: #ff6b6b; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, select, input { font: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- home ---------- */
#home { max-width: 980px; margin: 0 auto; padding: 14px 16px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: .3px; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #1a1300; font-size: 14px; margin-right: 6px; }
.hero h1 { font-size: clamp(24px, 4.4vw, 38px); line-height: 1.15; margin: 22px 0 8px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 0 18px; }
h2 { font-size: 20px; margin: 26px 0 10px; }
h3 { margin: 0 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.lbl { width: 70px; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; background: #0e1428; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #1a1300; font-weight: 700; }
.connect { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #1b2442; color: var(--text); padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.chip.on { border-color: var(--good); color: var(--good); }
.btn { border: 0; background: var(--accent); color: #1a1300; font-weight: 700; padding: 10px 18px; border-radius: 10px; cursor: pointer; }
.btn.ghost { background: #1b2442; color: var(--text); border: 1px solid var(--line); }
.btn.big { font-size: 20px; padding: 14px 34px; }
.help summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.help ul { padding-left: 18px; color: var(--muted); font-size: 14px; }
.help b { color: var(--text); }
.songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.song { position: relative; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; color: var(--text); overflow: hidden; }
.song:hover { border-color: var(--accent); }
.song .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.song .t { font-weight: 700; font-size: 18px; }
.song .b { color: var(--muted); font-size: 13px; }
.song .m { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.song .del { position: absolute; right: 8px; top: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.yt-form { display: flex; gap: 8px; margin-bottom: 8px; }
.yt-form input { flex: 1; min-width: 0; background: #0e1428; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; }
#mysongs { margin-top: 12px; }
.msg { color: var(--bad); }
.settings { margin-top: 26px; }
.settings label { display: flex; gap: 10px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.foot { margin-top: 30px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- play ---------- */
#play { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.pbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: #0e1428; }
.ptitle { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { border: 1px solid var(--line); background: #1b2442; color: var(--text); width: 38px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 18px; }
.pbar select { background: #1b2442; color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; }
.stage { flex: 1; min-height: 0; display: flex; }
.vid { flex: 0 0 44%; background: #000; display: flex; align-items: center; justify-content: center; position: relative; }
.vid video, .vid #yt-box, .vid iframe { width: 100%; aspect-ratio: 16 / 9; max-height: 100%; border: 0; display: block; }
.lane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hud { display: flex; gap: 16px; padding: 6px 12px; flex-wrap: wrap; font-size: 15px; }
.hud .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.hud .heard { margin-left: auto; }
#hw { flex: 1; min-height: 0; width: 100%; display: block; }
#fb { height: 30%; max-height: 170px; min-height: 90px; width: 100%; display: block; touch-action: none; }
@media (orientation: portrait), (max-width: 700px) {
  .stage { flex-direction: column; }
  .vid { flex: 0 0 auto; }
  .vid video, .vid #yt-box, .vid iframe { max-height: 32vh; }
  .lane { flex: 1; min-height: 0; }
}
.overlay { position: absolute; inset: 0; background: rgba(5, 8, 18, .72); display: grid; place-items: center; z-index: 5; }
.overlay .box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 26px; text-align: center; max-width: 440px; width: calc(100% - 32px); }
.overlay h2 { margin: 0 0 6px; }
.stars { font-size: 42px; letter-spacing: 6px; }
.big-num { font-size: 40px; font-weight: 800; margin: 4px 0; }
.btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1b2442; border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px; z-index: 9; max-width: 92vw; }
.toast button { margin-left: 8px; }
