* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; touch-action: pan-x pan-y; -webkit-tap-highlight-color: transparent; }
body { font-family: Arial, Helvetica, sans-serif; background: #05070c; color: #e8ecf5; min-height: 100vh; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input { -webkit-user-select: auto; user-select: auto; }
img { -webkit-user-drag: none; pointer-events: none; }
button, a, li, .toggle { touch-action: manipulation; }
button { font-family: inherit; cursor: pointer; }

/* Intro overlay */
html.intro-lock, html.intro-lock body { overflow: hidden; height: 100%; touch-action: none; overscroll-behavior: none; }
#intro { position: fixed; inset: 0; background: #000; z-index: 999; display: flex; align-items: center; justify-content: center; transition: opacity .6s ease; touch-action: none; }
#intro.fade { opacity: 0; pointer-events: none; }
#intro.hide { display: none; }
#intro video { width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }

/* App */
.app { min-height: 100vh; padding-bottom: 90px; background: radial-gradient(circle at top, #0d1a33, #05070c 60%); }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 24px; border-bottom: 1px solid #1a2233; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #3b82f6; object-fit: cover; }
.brand-logo { height: 46px; }
.tagline { letter-spacing: 6px; font-size: 12px; color: #8a96b0; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 10px; background: #0f1626; border: 1px solid #1f2b44; padding: 8px 14px; border-radius: 30px; font-size: 14px; cursor: pointer; }
.toggle input { display: none; }
.toggle i { width: 36px; height: 20px; background: #2a3550; border-radius: 20px; position: relative; transition: .2s; }
.toggle i::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .2s; }
.toggle input:checked + i { background: #3b82f6; }
.toggle input:checked + i::after { left: 18px; }
.insta { display: flex; align-items: center; gap: 8px; color: #e8ecf5; text-decoration: none; background: #0f1626; border: 1px solid #1f2b44; padding: 8px 14px; border-radius: 30px; font-size: 14px; }
.insta img { width: 20px; height: 20px; }

.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 340px; gap: 18px; padding: 18px 24px; }
.sidebar { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 10px; color: #aab4c8; text-decoration: none; font-size: 15px; cursor: pointer; }
.nav:hover, .nav.active { background: #0f1b33; color: #fff; border-left: 3px solid #3b82f6; }
.badge { background: #1a2437; font-size: 12px; padding: 2px 9px; border-radius: 12px; }
.sidequote { font-family: "Brush Script MT", cursive; font-size: 22px; color: #6fa8ff; line-height: 1.2; margin: 10px 0 0; }
.sidefig { width: 100%; border-radius: 12px; opacity: .85; margin-top: auto; }

.player-card, .playlist-card { background: #0a0f1b; border: 1px solid #1a2437; border-radius: 16px; padding: 20px; min-width: 0; }
.player-card { text-align: center; }

/* Hero + visualizer */
.hero { position: relative; height: 300px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(8px) brightness(.45); transform: scale(1.15); transition: opacity .5s ease; }
.disc-wrap { position: relative; width: 240px; height: 240px; z-index: 1; }
#viz { position: absolute; left: -40px; top: -40px; width: calc(100% + 80px); height: calc(100% + 80px); pointer-events: none; z-index: 2; }
.disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; border: 3px solid #3b82f6; box-shadow: 0 0 30px rgba(59,130,246,.5); }
.disc img { width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease; }

#title { font-size: 26px; margin: 18px 0 4px; }
#artist { font-size: 17px; font-weight: normal; color: #8a96b0; margin: 0; }
.pill { display: inline-block; margin-top: 10px; border: 1px solid #3b82f6; color: #6fa8ff; padding: 4px 14px; border-radius: 20px; font-size: 13px; }

.progress { margin: 22px 0 10px; }
.progress input { width: 100%; accent-color: #3b82f6; }
.times { display: flex; justify-content: space-between; font-size: 13px; color: #8a96b0; }
.controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 12px 0 20px; }
.ctl { background: transparent; border: none; color: #fff; font-size: 24px; width: 48px; height: 48px; border-radius: 50%; }
.ctl.small { font-size: 18px; color: #8a96b0; }
.ctl.small.on { color: #3b82f6; }
.ctl.play { width: 74px; height: 74px; border: 2px solid #3b82f6; font-size: 28px; box-shadow: 0 0 20px rgba(59,130,246,.5); }
.ctl:hover { color: #6fa8ff; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { min-width: 0; background: #0f1626; border: 1px solid #1f2b44; border-radius: 12px; padding: 12px; text-align: left; }
.stat small { display: block; color: #8a96b0; font-size: 12px; }
.stat b { font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.pl-head h3 { margin: 0; font-size: 18px; }
#search { background: #0f1626; border: 1px solid #1f2b44; color: #fff; padding: 8px 12px; border-radius: 20px; width: 150px; }
#list { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#list li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; }
#list li:hover { background: #0f1b33; }
#list li.active { background: #13233f; color: #6fa8ff; }
#list .num { width: 26px; color: #8a96b0; font-size: 14px; }
#list .name { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#list .heart { background: none; border: none; color: #55607a; font-size: 16px; }
#list .heart.on { color: #ff4d7d; }
#list .empty { color: #8a96b0; justify-content: center; cursor: default; }
#list .empty:hover { background: none; }

.mini { position: fixed; bottom: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 10px 24px; background: #070b14; border-top: 1px solid #1a2437; z-index: 50; }
.mini img { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #3b82f6; object-fit: cover; }
.mini-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mini-info small { color: #8a96b0; }
.mini-ctl { display: flex; gap: 8px; }
.mini-ctl .ctl { width: 40px; height: 40px; font-size: 18px; }
.mini-ctl .ctl:nth-child(2) { border: 2px solid #3b82f6; }
.vol { display: flex; align-items: center; gap: 8px; }
.vol input { width: 120px; accent-color: #3b82f6; }

/* Medium screens */
@media (max-width: 1100px) and (min-width: 901px) {
  .layout { grid-template-columns: 1fr 320px; }
  .sidebar { display: none; }
}

/* Phones (Android) */
@media (max-width: 900px) {
  #intro video { object-fit: cover; }
  .topbar { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .tagline { display: none; }
  .sidebar { display: none; }
  .vol { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 14px; }
  .player-card, .playlist-card { padding: 14px; }
  .hero { height: 250px; }
  .disc-wrap { width: 200px; height: 200px; }
  #title { font-size: 22px; }
  .controls { gap: 12px; }
  .ctl.play { width: 66px; height: 66px; }
  #list { max-height: 50vh; }
  .app { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .mini { padding: 8px 12px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  .mini img { width: 42px; height: 42px; }
}
@media (max-width: 380px) {
  .insta span { display: none; }
  .toggle span { font-size: 13px; }
  .stat small { font-size: 11px; }
  .stat b { font-size: 13px; }
  .disc-wrap { width: 170px; height: 170px; }
}
