:root {
  color-scheme: dark;
  --ink: #edf3f8;
  --muted: #9aa9b7;
  --muted-dark: #657482;
  --page: #060a10;
  --panel: rgba(13, 22, 32, .82);
  --panel-strong: #0d1722;
  --line: rgba(224, 239, 250, .12);
  --line-bright: rgba(224, 239, 250, .23);
  --yellow: #ffd24a;
  --yellow-hot: #ff9d29;
  --cyan: #54d8db;
  --red: #ff6d70;
  --green: #79d79a;
  --radius: 24px;
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 3% -8%, rgba(79, 182, 210, .22), transparent 34rem),
    radial-gradient(circle at 100% 10%, rgba(255, 168, 47, .18), transparent 28rem),
    linear-gradient(155deg, #08101b 0%, var(--page) 50%, #09121b 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.page-glow { position: fixed; z-index: -1; width: 22rem; height: 22rem; border-radius: 50%; filter: blur(4px); pointer-events: none; opacity: .36; }
.page-glow-a { left: -12rem; top: 30vh; background: #007c93; }
.page-glow-b { right: -12rem; bottom: 10vh; background: #ba4e00; }

.app-shell { width: min(100%, 760px); margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px calc(34px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.brand { display: inline-flex; align-items: center; min-width: 0; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 43px; height: 43px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.brand span { display: grid; min-width: 0; gap: 1px; }
.brand strong { font-size: 16px; line-height: 1; letter-spacing: .03em; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.install-trigger { padding: 9px 13px; border: 1px solid rgba(255,210,74,.65); border-radius: 999px; color: var(--yellow); background: rgba(255,210,74,.06); font-weight: 800; font-size: 12px; letter-spacing: .03em; transition: transform .2s ease, background .2s ease; }
.install-trigger:hover { background: rgba(255,210,74,.16); transform: translateY(-1px); }

.network-state { margin: 0 0 14px; padding: 10px 13px; border: 1px solid rgba(255,109,112,.45); border-radius: 13px; color: #ffd9da; background: rgba(138, 33, 38, .35); font-size: 13px; }

.player-card, .catalog-panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(140deg, rgba(20, 32, 44, .94), rgba(8, 14, 22, .92)); box-shadow: 0 24px 64px rgba(0,0,0,.31); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.player-card { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; overflow: hidden; padding: 18px clamp(17px, 5vw, 32px) 23px; scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 8px); transition: padding .22s ease, border-radius .22s ease, background .22s ease, box-shadow .22s ease; }
.player-card::before { position: absolute; inset: 0; z-index: 0; background: linear-gradient(118deg, rgba(84,216,219,.07), transparent 42%, rgba(255,210,74,.06)); content: ""; pointer-events: none; }
.player-card > * { position: relative; z-index: 1; }
.player-card.is-compact { padding: 8px 12px 10px; border-radius: 0 0 19px 19px; background: linear-gradient(140deg, rgba(18, 32, 45, .985), rgba(5, 11, 18, .985)); box-shadow: 0 13px 30px rgba(0,0,0,.52), 0 1px 0 rgba(255,255,255,.08); }
.player-card.is-compact .player-topline { min-height: 0; justify-content: flex-end; }
.player-card.is-compact .live-mark,
.player-card.is-compact .cover-wrap,
.player-card.is-compact .player-note { display: none; }
.player-card.is-compact .mode-button { padding: 4px 7px; border-radius: 9px; font-size: 9px; }
.player-card.is-compact .mode-button svg { width: 14px; height: 14px; }
.player-card.is-compact .now-playing { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 7px; margin-top: 2px; text-align: left; }
.player-card.is-compact .now-playing .eyebrow { overflow: hidden; font-size: 9px; letter-spacing: .09em; white-space: nowrap; }
.player-card.is-compact .now-playing h1 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.22; }
.player-card.is-compact .seek-block { margin-top: 6px; }
.player-card.is-compact .progress { height: 17px; }
.player-card.is-compact .progress::-webkit-slider-runnable-track { height: 5px; }
.player-card.is-compact .progress::-webkit-slider-thumb { width: 15px; height: 15px; margin-top: -5px; }
.player-card.is-compact .progress::-moz-range-track,
.player-card.is-compact .progress::-moz-range-progress { height: 5px; }
.player-card.is-compact .progress::-moz-range-thumb { width: 11px; height: 11px; }
.player-card.is-compact .time-row { padding-top: 0; font-size: 10px; }
.player-card.is-compact .transport { max-width: 400px; gap: clamp(5px, 2vw, 11px); margin: 7px auto 8px; }
.player-card.is-compact .transport-button { width: 37px; height: 37px; }
.player-card.is-compact .transport-button svg { width: 19px; height: 19px; }
.player-card.is-compact .transport-button small { right: 5px; bottom: 3px; font-size: 7px; }
.player-card.is-compact .play-button { width: 48px; height: 48px; }
.player-card.is-compact .play-button svg { width: 25px; height: 25px; }
.player-card.is-compact .song-actions { gap: 4px; padding-top: 7px; border-top: 0; }
.player-card.is-compact .song-action { min-height: 34px; gap: 4px; padding: 5px 3px; border-radius: 10px; font-size: 9px; }
.player-card.is-compact .song-action svg { width: 15px; height: 15px; }
.player-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 27px; }
.live-mark, .eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.live-mark { display: inline-flex; align-items: center; gap: 7px; }
.live-mark i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 5px rgba(255,210,74,.12); }
.icon-button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.icon-button svg { width: 16px; height: 16px; fill: currentColor; }
.mode-button[data-mode="one"] { color: var(--yellow); border-color: rgba(255,210,74,.42); }
.mode-button[data-mode="random"] { color: var(--cyan); border-color: rgba(84,216,219,.42); }

.cover-wrap { position: relative; display: block; width: min(58vw, 288px); aspect-ratio: 1; margin: 17px auto 19px; overflow: hidden; padding: 0; border: 0; border-radius: 26px; background: #020406; box-shadow: 0 17px 38px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.12); }
.cover-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2,.8,.2,1); }
.cover-wrap:hover img { transform: scale(1.04); }
.cover-wrap.is-playing { animation: cover-breathe 3s ease-in-out infinite; }
.cover-shine { position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.24) 50%, transparent 64%); transform: translateX(-100%) rotate(6deg); pointer-events: none; }
.cover-wrap:hover .cover-shine { animation: cover-shine .8s ease; }
@keyframes cover-breathe { 0%, 100% { box-shadow: 0 17px 38px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.12); } 50% { box-shadow: 0 17px 38px rgba(0,0,0,.48), 0 0 0 1px rgba(255,210,74,.5), 0 0 30px rgba(255,210,74,.16); } }
@keyframes cover-shine { to { transform: translateX(100%) rotate(6deg); } }

.now-playing { text-align: center; }
.now-playing h1 { max-width: 640px; margin: 6px auto; font-size: clamp(21px, 5.4vw, 33px); line-height: 1.08; letter-spacing: -.025em; }
.player-note { min-height: 1.2em; margin: 0; color: var(--muted); font-size: 13px; }
.seek-block { margin-top: 22px; }
.progress { --progress-value: 0%; display: block; width: 100%; height: 22px; margin: 0; padding: 0; appearance: none; background: transparent; cursor: pointer; }
.progress::-webkit-slider-runnable-track { height: 6px; border-radius: 100px; background: linear-gradient(90deg, var(--yellow) 0 var(--progress-value), #3a4655 var(--progress-value) 100%); }
.progress::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6px; border: 3px solid #fff7d2; border-radius: 50%; appearance: none; background: var(--yellow-hot); box-shadow: 0 2px 9px rgba(0,0,0,.48); }
.progress::-moz-range-track { height: 6px; border-radius: 100px; background: #3a4655; }
.progress::-moz-range-progress { height: 6px; border-radius: 100px; background: var(--yellow); }
.progress::-moz-range-thumb { width: 13px; height: 13px; border: 3px solid #fff7d2; border-radius: 50%; background: var(--yellow-hot); }
.time-row { display: flex; justify-content: space-between; padding: 3px 2px 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.transport { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1fr 1fr; align-items: center; gap: clamp(8px, 2vw, 17px); max-width: 460px; margin: 15px auto 20px; }
.transport-button, .play-button { position: relative; display: inline-grid; width: 48px; height: 48px; place-items: center; justify-self: center; border: 1px solid var(--line-bright); border-radius: 50%; color: var(--ink); background: linear-gradient(150deg, rgba(255,255,255,.13), rgba(255,255,255,.025)); box-shadow: inset 0 1px rgba(255,255,255,.11), 0 8px 18px rgba(0,0,0,.2); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.transport-button:hover, .play-button:hover { border-color: rgba(255,210,74,.6); transform: translateY(-2px); }
.transport-button svg, .play-button svg { width: 24px; height: 24px; fill: currentColor; }
.transport-button small { position: absolute; right: 7px; bottom: 5px; color: var(--yellow); font-size: 8px; font-weight: 900; }
.play-button { width: 64px; height: 64px; border: 0; color: #151005; background: linear-gradient(135deg, #fff08b, var(--yellow) 53%, var(--yellow-hot)); box-shadow: inset 0 1px rgba(255,255,255,.7), 0 10px 25px rgba(255,178,47,.25); }
.play-button svg { width: 31px; height: 31px; }
.play-button .pause-icon { display: none; }
.play-button.is-playing .play-icon { display: none; }
.play-button.is-playing .pause-icon { display: block; }

.song-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
#blockButton { order: 1; }
#offlineButton { order: 2; }
#shareButton { order: 3; }
#likeButton { order: 4; }
.song-action { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 6px; padding: 8px 5px; border: 1px solid transparent; border-radius: 13px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; transition: background .2s ease, color .2s ease, border-color .2s ease; }
.song-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.song-action:hover:not(:disabled), .song-action.is-active { color: var(--yellow); border-color: rgba(255,210,74,.3); background: rgba(255,210,74,.08); }
.song-action.danger:hover:not(:disabled), .song-action.danger.is-active { color: var(--red); border-color: rgba(255,109,112,.3); background: rgba(255,109,112,.08); }
.song-action:disabled { opacity: .35; }

.catalog-panel { margin-top: 17px; padding: 20px clamp(15px, 4vw, 29px) 24px; }
.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-head h2 { margin: 4px 0 0; font-size: 25px; letter-spacing: -.02em; }
.refresh-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(84,216,219,.28); border-radius: 50%; color: var(--cyan); background: rgba(84,216,219,.06); transition: transform .2s ease, background .2s ease; }
.refresh-button:hover { transform: rotate(45deg); background: rgba(84,216,219,.13); }
.refresh-button.is-loading svg { animation: spin .8s linear infinite; }
.refresh-button svg { width: 20px; height: 20px; fill: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

.search-wrap { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 0 11px; border: 1px solid var(--line-bright); border-radius: 14px; background: rgba(255,255,255,.045); }
.search-wrap:focus-within { border-color: rgba(255,210,74,.72); box-shadow: 0 0 0 3px rgba(255,210,74,.09); }
.search-wrap > svg { width: 20px; height: 20px; flex: 0 0 auto; fill: var(--muted); }
.search-wrap input { width: 100%; min-width: 0; padding: 14px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.search-wrap input::placeholder { color: var(--muted-dark); }
.search-wrap button { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; color: white; background: #b94349; font-size: 20px; line-height: 1; }

.repeat-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 9px 11px; border-left: 3px solid var(--yellow); border-radius: 0 10px 10px 0; color: #e9edf0; background: rgba(255,210,74,.07); font-size: 12px; }
.repeat-status button { padding: 0; border: 0; color: var(--yellow); background: transparent; font-size: 12px; font-weight: 800; }
.tabs { display: grid; grid-template-columns: 1.15fr 1.5fr 1fr 1.3fr; gap: 6px; margin-top: 15px; }
.tab { min-width: 0; padding: 10px 5px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.tab span { color: var(--muted-dark); font-variant-numeric: tabular-nums; }
.tab.is-active { border-color: var(--line); color: var(--ink); background: rgba(255,255,255,.055); }
.tab.is-active span { color: var(--yellow); }
.catalog-summary { min-height: 1.2em; margin: 17px 2px 10px; color: var(--muted); font-size: 12px; }

.song-list { display: grid; gap: 8px; }
.song-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 54px; align-items: center; gap: 10px; width: 100%; min-height: 61px; padding: 8px 7px 8px 9px; border: 1px solid var(--line); border-radius: 16px; color: inherit; text-align: left; background: linear-gradient(130deg, rgba(255,255,255,.045), rgba(255,255,255,.018)); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.song-row:hover { transform: translateX(2px); border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.075); }
.song-row.is-current { border-color: rgba(255,210,74,.72); background: linear-gradient(105deg, rgba(255,210,74,.14), rgba(84,216,219,.06)); }
.song-row.is-loading .row-play { color: var(--cyan); animation: pulse-ring .9s ease-in-out infinite; }
.song-row.is-playing .row-play svg:first-child { display: none; }
.song-row.is-playing .row-play svg:last-child { display: block; }
.row-play { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line-bright); border-radius: 50%; color: var(--yellow); background: rgba(0,0,0,.15); }
.row-play svg { width: 18px; height: 18px; fill: currentColor; }
.row-play svg:last-child { display: none; }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 5px rgba(84,216,219,.18); } }
.row-copy { min-width: 0; }
.row-track { display: block; margin-bottom: 2px; color: var(--yellow); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.row-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--ink); font-size: 14px; line-height: 1.2; }
.row-meta { display: grid; justify-items: center; gap: 3px; color: var(--muted-dark); font-size: 9px; font-weight: 800; }
.row-meta svg { width: 15px; height: 15px; fill: currentColor; }
.row-meta.is-offline { color: var(--green); }
.row-meta.is-liked { color: var(--yellow); }
.empty-state { padding: 32px 16px; border: 1px dashed var(--line-bright); border-radius: 18px; color: var(--muted); text-align: center; font-size: 14px; }
.more-button { width: 100%; margin-top: 13px; padding: 13px; border: 1px solid rgba(255,210,74,.55); border-radius: 14px; color: #171005; background: linear-gradient(115deg, #ffe980, var(--yellow), #ffb333); font-size: 14px; font-weight: 900; box-shadow: 0 8px 22px rgba(255,180,34,.14); }

.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: end center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: rgba(1,5,9,.72); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { position: relative; width: min(100%, 590px); padding: 26px 22px 22px; border: 1px solid rgba(255,255,255,.17); border-radius: 23px; background: linear-gradient(145deg, #1a2734, #0d151e); box-shadow: 0 26px 70px rgba(0,0,0,.6); animation: sheet-up .25s ease-out; }
@keyframes sheet-up { from { transform: translateY(18px); opacity: 0; } }
.modal-card h2 { max-width: 90%; margin: 6px 0 15px; font-size: 25px; line-height: 1.1; letter-spacing: -.02em; }
.modal-card ol { display: grid; gap: 10px; margin: 0; padding-left: 21px; color: #dce6ed; line-height: 1.38; }
.modal-note { margin: 17px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.modal-close { position: absolute; top: 13px; right: 13px; width: 31px; height: 31px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: rgba(255,255,255,.04); font-size: 23px; line-height: 1; }
.share-track-title { margin: -7px 0 16px; color: var(--muted); font-size: 14px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-grid > * { display: flex; min-height: 48px; align-items: center; justify-content: center; padding: 9px 10px; border: 1px solid var(--line-bright); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.045); font-size: 13px; font-weight: 800; text-align: center; text-decoration: none; }
.share-grid > .modal-primary { border-color: rgba(255,210,74,.45); color: #1a1000; background: linear-gradient(120deg, var(--yellow), var(--yellow-hot)); }
.share-grid > .modal-danger { border-color: rgba(255,109,112,.55); color: #fff; background: linear-gradient(120deg, #bd454e, #ef7272); }
.share-grid > *:hover { border-color: var(--cyan); }

.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 480px); padding: 13px 15px; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; color: #fff; background: rgba(14,23,33,.95); box-shadow: 0 14px 38px rgba(0,0,0,.42); transform: translateX(-50%); font-size: 13px; text-align: center; }
.toast[hidden] { display: none; }

@media (min-width: 720px) {
  .app-shell { padding-left: 22px; padding-right: 22px; }
  .modal-backdrop { place-items: center; }
  .song-actions { max-width: 540px; margin: 0 auto; }
}
@media (max-width: 390px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .player-card, .catalog-panel { border-radius: 20px; }
  .song-actions { gap: 3px; }
  .song-action { gap: 3px; font-size: 10px; }
  .song-action svg { width: 16px; height: 16px; }
  .tabs { gap: 3px; }
  .tab { font-size: 9px; letter-spacing: -.01em; }
  .player-card.is-compact { padding-right: 9px; padding-left: 9px; }
  .player-card.is-compact .song-action { gap: 2px; font-size: 8px; }
}
