/* play — minimal dark music player. matches yoshik.xyz dark language. */
:root {
  --bg: #0a0a0a; --panel: #111111; --panel2: #141414;
  --ink: #fafafa; --dim: #a3a3a3; --faint: #6b6b6b;
  --line: #222222; --hover: #1a1a1a;
  --accent: #7d9bff; --accent-soft: rgba(125,155,255,.12);
  --danger: #fb7185;
  --r: 8px;
  --font: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow: hidden; height: 100dvh;
}
.mono, .dim.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; }
::selection { background: var(--accent); color: #0a0a0a; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

#app { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 1fr auto;
  height: 100dvh; }

/* ---------- sidebar ---------- */
#sidebar { border-right: 1px solid var(--line); padding: 20px 12px; display: flex;
  flex-direction: column; gap: 4px; overflow-y: auto; background: var(--bg); }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; padding: 0 12px 16px; }
.brand::after { content: " · yoshik.xyz"; font-weight: 400; font-size: 12px; color: var(--faint); }
#mainnav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border-radius: var(--r); color: var(--dim); font-weight: 500; transition: background .15s ease, color .15s ease; }
#mainnav a:hover { background: var(--hover); color: var(--ink); }
#mainnav a.active { background: var(--hover); color: var(--ink); }
.ni { width: 20px; text-align: center; font-size: 16px; }
.side-sec { margin-top: 20px; }
.side-head { display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 8px; font-size: 12px; text-transform: lowercase; color: var(--faint);
  font-family: var(--mono); }
#sideplaylists a { display: block; padding: 7px 12px; border-radius: var(--r);
  color: var(--dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sideplaylists a:hover { background: var(--hover); color: var(--ink); }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.iconbtn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--dim); font-size: 16px; transition: color .15s ease, background .15s ease; }
.iconbtn:hover { color: var(--ink); background: var(--hover); }
.iconbtn.on { color: var(--accent); }
.pbtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--dim); font-size: 15px; transition: color .15s ease, transform .15s ease; }
.pbtn:hover { color: var(--ink); transform: scale(1.06); }
.pbtn.big { width: 44px; height: 44px; font-size: 17px; background: var(--ink); color: #0a0a0a; }
.pbtn.big:hover { transform: scale(1.05); color: #0a0a0a; }
.pbtn.huge { width: 60px; height: 60px; font-size: 22px; background: var(--ink); color: #0a0a0a; }
.txtbtn { padding: 6px 14px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 13px; color: var(--dim); transition: color .15s ease, border-color .15s ease; }
.txtbtn:hover, .txtbtn.on { color: var(--ink); border-color: var(--faint); }
.txtbtn.on { color: var(--accent); border-color: var(--accent); }

/* ---------- main ---------- */
#main { overflow-y: auto; padding: 28px 32px 140px; }
#view { max-width: 1100px; margin: 0 auto; }
.pagehead { margin-bottom: 24px; }
.pagehead h1 { font-size: 28px; letter-spacing: -0.02em; font-weight: 700; }
.pagehead .sub { color: var(--dim); font-size: 14px; margin-top: 4px; }
.greet { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px; }
.sec { margin-bottom: 32px; }
.sec > h2 { font-size: 17px; font-weight: 600; margin-bottom: 12px; letter-spacing: -0.01em; }

/* track rows */
.trow { display: grid; grid-template-columns: 32px 44px 1fr 1fr 60px 36px; gap: 12px;
  align-items: center; padding: 8px 12px; border-radius: var(--r);
  transition: background .15s ease; cursor: pointer; }
.trow:hover { background: var(--hover); }
.trow.playing .t-title { color: var(--accent); }
.trow img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--panel2); }
.t-num { color: var(--faint); font-family: var(--mono); font-size: 13px; text-align: right; }
.t-title { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-dur { color: var(--faint); font-family: var(--mono); font-size: 12px; text-align: right; }
.t-act { position: relative; }
.menu { position: absolute; right: 0; top: 100%; background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r); min-width: 180px; padding: 6px; z-index: 50;
  box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; font-size: 14px;
  border-radius: 6px; color: var(--ink); }
.menu button:hover { background: var(--hover); }

/* library rows (uploads) */
.trackrow { display: flex; align-items: center; gap: 14px; padding: 10px 12px;
  border-radius: var(--r); cursor: pointer; transition: background .15s ease; }
.trackrow:hover { background: var(--hover); }
.trackrow img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover;
  background: var(--panel2); flex-shrink: 0; }
.trackrow .tinfo { flex: 1; min-width: 0; }
.trackrow .tt { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trackrow .ta { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.trackrow .iconbtn { flex-shrink: 0; }

/* dropzone */
#dropzone { border: 2px dashed var(--line); border-radius: 16px;
  transition: border-color .15s ease, background .15s ease; }
#dropzone.dragover { border-color: var(--accent); background: var(--hover); }

/* persistent upload dropzone (home) */
.uploaddz { width: 200px; height: 200px; border: 2px dashed var(--line); border-radius: 24px;
  background: var(--panel); color: var(--text); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  margin: 16px 0; transition: border-color .15s ease, background .15s ease; }
.uploaddz:hover { border-color: var(--accent); }
.uploaddz.dragover { border-color: var(--accent); background: var(--hover); }
.uploaddz .dz-icon { font-size: 48px; line-height: 1; color: var(--dim); }
.uploaddz .dz-text { font-size: 14px; text-align: center; line-height: 1.4; }

/* cards */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; transition: border-color .15s ease, background .15s ease; cursor: pointer; }
.card:hover { background: var(--hover); border-color: #2e2e2e; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--panel2); margin-bottom: 10px; }
.card .ct { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cs { color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* search */
.searchbox { display: flex; gap: 8px; margin-bottom: 24px; }
.searchbox input { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 16px; color: var(--ink); font: inherit; font-size: 15px; }
.searchbox input::placeholder { color: var(--faint); }
.searchbox input:focus { outline: none; border-color: var(--accent); }
.skel { border-radius: var(--r); background: linear-gradient(90deg, var(--panel) 25%, var(--hover) 50%, var(--panel) 75%);
  background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 60px 20px; color: var(--dim); }
.empty .big { font-size: 40px; margin-bottom: 12px; }
.errbox { border: 1px solid var(--line); border-radius: var(--r); padding: 24px; text-align: center; color: var(--dim); }
.errbox button { margin-top: 12px; }

/* buttons */
.btn { background: var(--ink); color: #0a0a0a; padding: 10px 22px; border-radius: 24px;
  font-weight: 600; font-size: 14px; transition: transform .15s ease; }
.btn:hover { transform: scale(1.03); }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: none; color: var(--danger); border: 1px solid var(--line); }

/* player bar */
#playerbar { grid-column: 1 / -1; border-top: 1px solid var(--line); background: rgba(10,10,10,.97);
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 16px; align-items: center;
  padding: 12px 20px; z-index: 40; }
.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-left img { width: 52px; height: 52px; border-radius: 4px; object-fit: cover; background: var(--panel2); }
.pb-meta { min-width: 0; }
.pb-meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
#pb-title { font-weight: 500; }
.pb-center { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pb-controls { display: flex; align-items: center; gap: 12px; }
.pb-seek { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 12px; }
.pb-right { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px;
  background: #2e2e2e; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: var(--ink); opacity: 0; transition: opacity .15s ease; }
input[type="range"]:hover::-webkit-slider-thumb, input[type="range"]:focus::-webkit-slider-thumb { opacity: 1; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: var(--ink); }
#pb-range { flex: 1; }
#pb-vol { width: 90px; }
#pb-dlstate, #np-dlstate { font-size: 12px; display: flex; align-items: center; gap: 8px; }
.spin { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* mini player (mobile) */
#miniplayer { display: none; }

/* now playing overlay */
#nowplaying { position: fixed; inset: 0; background: var(--bg); z-index: 100;
  display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
#nowplaying[hidden] { display: none; }
#np-close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.np-main { display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; gap: 10px; }
#np-art { width: min(340px, 60vw); aspect-ratio: 1; object-fit: cover; border-radius: 8px;
  background: var(--panel2); box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.np-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; text-align: center; margin-top: 12px; }
.np-artist { font-size: 16px; text-align: center; }
#np-range { width: min(420px, 80vw); margin-top: 8px; }
.np-times { display: flex; justify-content: space-between; width: min(420px, 80vw); font-size: 12px; }
.np-controls { display: flex; align-items: center; gap: 20px; margin-top: 8px; }
.np-row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.np-side { border-left: 1px solid var(--line); overflow-y: auto; padding: 60px 32px 40px; }

/* lyrics */
.lyrics { max-width: 560px; margin: 0 auto; padding: 20px 0 60px; }
.ly-line { padding: 10px 0; color: var(--faint); font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em; transition: color .2s ease; cursor: pointer; line-height: 1.4; }
.ly-line.active { color: var(--ink); }
.ly-line .ch { opacity: .25; transition: opacity .45s ease; }
.ly-line .ch.lit { opacity: 1; }
.ly-line.past { color: var(--dim); }
.ly-compact .ly-line { font-size: 16px; padding: 6px 0; }
.lyrics-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lyrics-head h3 { font-size: 14px; font-family: var(--mono); color: var(--dim); font-weight: 400; }

/* queue */
.q-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r); cursor: pointer; }
.q-item:hover { background: var(--hover); }
.q-item.current { background: var(--hover); }
.q-item img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--panel2); }

/* toast + modal */
#toast { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel2); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 20px; border-radius: 24px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 200; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; width: 100%; max-width: 380px; }
.modal h3 { margin-bottom: 16px; font-size: 17px; }
.modal input { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 14px; color: var(--ink); font: inherit; margin-bottom: 16px; }
.modal input:focus { outline: none; border-color: var(--accent); }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; }

/* settings */
.setrow { display: flex; align-items: center; justify-content: space-between; padding: 14px 0;
  border-bottom: 1px solid var(--line); }
.setrow .lab { font-weight: 500; }
.setrow .desc { color: var(--dim); font-size: 13px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.seg button { padding: 7px 16px; font-size: 13px; color: var(--dim); }
.seg button.on { background: var(--ink); color: #0a0a0a; }

/* login */
.loginwrap { max-width: 420px; margin: 12vh auto; text-align: center; padding: 40px 24px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.loginwrap h1 { font-size: 24px; margin-bottom: 8px; }
.loginwrap p { color: var(--dim); margin-bottom: 24px; font-size: 14px; }

/* mobile nav */
#mobilenav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto auto; }
  #sidebar { display: none; }
  #main { padding: 20px 16px 190px; }
  #mobilenav { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line);
    background: rgba(10,10,10,.97); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  #mobilenav a { display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 18px; color: var(--dim); padding: 6px; }
  #mobilenav a span { font-size: 10px; font-family: var(--mono); }
  #mobilenav a.active { color: var(--ink); }
  #playerbar { display: none; }
  #miniplayer { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line);
    background: rgba(17,17,17,.98); padding: 8px 12px; z-index: 41; cursor: pointer; }
  #miniplayer[hidden] { display: none; }
  #miniplayer img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--panel2); }
  .mp-meta { flex: 1; min-width: 0; font-size: 13px; }
  .mp-meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #mp-status { font-size: 11px; }
  #nowplaying { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .np-side { border-left: none; border-top: 1px solid var(--line); padding: 20px; }
  .np-main { padding: 60px 20px 20px; }
  .trow { grid-template-columns: 40px 1fr 36px; }
  .trow .t-num, .trow .t-album, .trow .t-dur { display: none; }
  .trow img { width: 40px; height: 40px; }
  .pb-right #pb-vol { display: none; }
}
@media (min-width: 901px) {
  #miniplayer { display: none !important; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .ly-line .ch { transition: none; }
}
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation-duration: 0.01ms !important; transition-duration: 0.01ms !important;
}

/* honest loading state (no fake rows) */
.loading { text-align:center; padding:32px 0; color:var(--muted); }
.spinner { width:28px; height:28px; margin:0 auto 12px; border-radius:50%;
  border:3px solid var(--hover); border-top-color:#fff;
  animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* lyrics: hide scrollbar, keep scrollable */
#ly-body { scrollbar-width: none; -ms-overflow-style: none; }
#ly-body::-webkit-scrollbar { display: none; }

/* compact dropzone when library has songs */
.uploaddz.compact { width: 100%; height: 56px; flex-direction: row; gap: 12px; border-radius: 12px; }
.uploaddz.compact .dz-icon { font-size: 24px; }
.uploaddz.compact .dz-text { font-size: 13px; text-align: left; }
.uploaddz.compact .dz-text br { display: none; }

/* song row hover: play affordance */
.trackrow { cursor: pointer; transition: background .15s; }
.trackrow:hover { background: var(--hover); }
.trackrow:hover .tt { color: var(--accent); }
