:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(16, 30, 49, 0.84);
  --panel-strong: #101f33;
  --line: rgba(159, 187, 220, 0.16);
  --text: #f1f6fc;
  --muted: #8ea3bd;
  --accent: #d64e72;
  --accent-soft: rgba(214, 78, 114, 0.15);
  --blue: #66a8ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: radial-gradient(circle at 80% -10%, #173a5a 0, transparent 42%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, video { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 24px; }
.topbar, .connection-status, .brand, .hero-panel, .player-layout, .player-footer, .section-heading, .media-item, .footer-note { display: flex; align-items: center; }
.topbar { justify-content: space-between; margin-bottom: 52px; }
.brand { gap: 11px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(214,78,114,.58); border-radius: 10px; background: var(--accent-soft); transform: rotate(45deg); }
.brand-mark span { width: 11px; height: 11px; border: 2px solid var(--accent); border-radius: 3px; }
.connection-status { gap: 8px; color: var(--muted); font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero-panel { justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 10px; font-size: clamp(2rem, 4vw, 4.15rem); line-height: .98; letter-spacing: -.055em; }
.lede { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.hero-chip { flex: 0 0 auto; padding: 14px 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 23, 39, .55); }
.chip-label, .now-playing-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.hero-chip strong { font-size: 14px; }
.player-layout { align-items: stretch; gap: 18px; }
.player-card, .library-card { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.22); backdrop-filter: blur(16px); }
.player-card { flex: 1 1 auto; min-width: 0; overflow: hidden; }
video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #02060b; object-fit: contain; }
.player-footer { justify-content: space-between; gap: 18px; padding: 18px 20px 20px; }
.player-footer h2 { margin-bottom: 0; font-size: 17px; letter-spacing: -.02em; }
.plain-button { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--text); background: transparent; font-size: 13px; }
.plain-button:hover { border-color: var(--accent); color: var(--accent); }
.library-card { flex: 0 0 325px; padding: 20px; }
.section-heading { justify-content: space-between; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.count-badge { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.media-item { width: 100%; gap: 12px; padding: 9px; border: 1px solid rgba(214,78,114,.4); border-radius: 14px; color: var(--text); text-align: left; background: rgba(214,78,114,.09); }
.media-thumb { display: grid; place-items: center; flex: 0 0 72px; width: 72px; height: 52px; border-radius: 9px; background: linear-gradient(135deg, #143d61, #0d807e 60%, #18324a); }
.play-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: rgba(255,255,255,.92); color: #0b3444; font-size: 10px; padding-left: 2px; }
.media-copy { min-width: 0; flex: 1; }
.media-copy strong, .media-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-copy strong { margin-bottom: 5px; font-size: 13px; }
.media-copy small { color: var(--muted); font-size: 11px; }
.item-arrow { color: var(--accent); font-size: 17px; }
.empty-note { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.footer-note { justify-content: center; gap: 10px; padding-top: 22px; color: #61758e; font-size: 12px; }
.footer-separator { color: var(--accent); }

@media (max-width: 820px) {
  .app-shell { width: min(100% - 28px, 680px); padding-top: 20px; }
  .topbar { margin-bottom: 38px; }
  .hero-panel { align-items: flex-start; flex-direction: column; }
  .hero-chip { width: 100%; }
  .player-layout { flex-direction: column; }
  .library-card { flex-basis: auto; }
}

@media (max-width: 480px) {
  .connection-status { font-size: 0; }
  .connection-status .status-dot { width: 9px; height: 9px; }
  h1 { font-size: 2.65rem; }
  .footer-note { align-items: flex-start; flex-direction: column; gap: 4px; }
  .footer-separator { display: none; }
}
