/* =========================================
   LIQUID GLASS DESIGN SYSTEM
========================================= */

:root {
    --bg: #07060c;
    --bg-raise: #0d0a16;

    --glass: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    --glass-strong: linear-gradient(160deg, rgba(38, 32, 58, 0.78), rgba(16, 13, 28, 0.82));
    --surface: rgba(255, 255, 255, 0.055);
    --surface-strong: rgba(255, 255, 255, 0.09);

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #f5f3fa;
    --text-dim: #a49fb8;
    --text-faint: #6e687f;

    --accent: #8b5cf6;
    --accent-soft: #a78bfa;
    --accent-2: #d946ef;
    --gradient: linear-gradient(135deg, #8b5cf6, #c026d3 55%, #d946ef);
    --glow: 0 10px 40px -6px rgba(139, 92, 246, 0.55);

    --danger: #fb7185;

    --radius: 18px;
    --spring: cubic-bezier(0.34, 1.4, 0.44, 1);
    --ease-out: cubic-bezier(0.22, 0.9, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: contain;
    overflow-x: hidden;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
}

input {
    font-family: inherit;
}

.hidden {
    display: none !important;
}

.ic {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

::selection {
    background: rgba(139, 92, 246, 0.45);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    background-clip: padding-box;
    border: 3px solid transparent;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
    background-clip: padding-box;
}

:focus-visible {
    outline: 2px solid var(--accent-soft);
    outline-offset: 2px;
    border-radius: 12px;
}


/* =========================================
   BACKGROUND SCENE (aurora + grain)
========================================= */

.bg-scene {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(120% 70% at 50% -20%, #12101f 0%, var(--bg) 60%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.orb.o1 {
    width: 85vmin;
    height: 85vmin;
    top: -28vmin;
    right: -20vmin;
    background: radial-gradient(closest-side, rgba(139, 92, 246, 0.5), transparent 72%);
    animation: drift-1 34s ease-in-out infinite alternate;
}

.orb.o2 {
    width: 75vmin;
    height: 75vmin;
    bottom: -26vmin;
    left: -22vmin;
    background: radial-gradient(closest-side, rgba(217, 70, 239, 0.34), transparent 72%);
    animation: drift-2 40s ease-in-out infinite alternate;
}

.orb.o3 {
    width: 52vmin;
    height: 52vmin;
    top: 34%;
    left: -30vmin;
    background: radial-gradient(closest-side, rgba(76, 61, 205, 0.42), transparent 72%);
    animation: drift-3 46s ease-in-out infinite alternate;
}

@keyframes drift-1 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-9vmin, 7vmin, 0) scale(1.15); }
}

@keyframes drift-2 {
    from { transform: translate3d(0, 0, 0) scale(1.1); }
    to   { transform: translate3d(11vmin, -8vmin, 0) scale(0.94); }
}

@keyframes drift-3 {
    from { transform: translate3d(0, 0, 0) scale(0.95); }
    to   { transform: translate3d(13vmin, 9vmin, 0) scale(1.12); }
}

.grain {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* =========================================
   LAYOUT
========================================= */

.app {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    padding:
        calc(env(safe-area-inset-top, 0px) + 20px)
        18px
        calc(env(safe-area-inset-bottom, 0px) + 124px);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.hello {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 5px;
}

.header h1 {
    font-size: clamp(26px, 7vw, 31px);
    font-weight: 800;
    letter-spacing: -1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 24px rgba(139, 92, 246, 0.35));
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--glass);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--text-dim);
    transition: transform 0.25s var(--spring), color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:active {
    transform: scale(0.88);
    color: var(--text);
}


/* =========================================
   SEARCH
======================================== */

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.search-ic {
    position: absolute;
    left: 16px;
    width: 19px;
    height: 19px;
    color: var(--text-faint);
    pointer-events: none;
    transition: color 0.15s ease;
}

.search-wrap input {
    width: 100%;
    height: 50px;
    padding: 0 46px;
    border-radius: 17px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -8px 20px rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap input::placeholder {
    color: var(--text-faint);
}

.search-wrap input:focus {
    border-color: rgba(167, 139, 250, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 4px rgba(139, 92, 246, 0.16),
        0 12px 36px -10px rgba(139, 92, 246, 0.35);
}

.search-wrap input:focus ~ .search-ic,
.search-wrap:focus-within .search-ic {
    color: var(--accent-soft);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--text-dim);
    transition: color 0.15s ease, transform 0.2s var(--spring);
}

.search-clear:active {
    transform: scale(0.85);
    color: var(--text);
}

.search-clear .ic {
    width: 15px;
    height: 15px;
}


/* =========================================
   BANNER
========================================= */

.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(251, 113, 133, 0.13), rgba(251, 113, 133, 0.05));
    border: 1px solid rgba(251, 113, 133, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 13.5px;
    line-height: 1.45;
    color: #fecdd3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.banner button {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 11px;
    background: rgba(251, 113, 133, 0.16);
    color: #fecdd3;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.2s var(--spring), background 0.15s ease;
}

.banner button:active {
    transform: scale(0.94);
    background: rgba(251, 113, 133, 0.26);
}

.banner button .ic {
    width: 15px;
    height: 15px;
}


/* =========================================
   SECTION HEAD
========================================= */

.section-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
}

.section-head h2 {
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.4px;
}

.count-badge {
    min-width: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    text-align: center;
}


/* =========================================
   SKELETON
========================================= */

.sk {
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0.04) 30%,
        rgba(167, 139, 250, 0.13) 48%,
        rgba(255, 255, 255, 0.04) 62%
    );
    background-size: 300% 100%;
    animation: shimmer 1.6s ease infinite;
    border-radius: 9px;
}

@keyframes shimmer {
    0% { background-position: 110% 50%; }
    100% { background-position: -10% 50%; }
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 9px 0;
}

.sk-cover {
    width: 56px;
    height: 56px;
    border-radius: 16px;
}

.sk-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sk-line {
    height: 12px;
}

.w70 { width: 70%; }
.w55 { width: 55%; }
.w75 { width: 75%; }
.w60 { width: 60%; }
.w45 { width: 45%; }
.w65 { width: 65%; }
.w40 { width: 40%; }
.w50 { width: 50%; }


/* =========================================
   TRACK LIST
========================================= */

.track {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.25s var(--spring);
    user-select: none;
}

.track:active {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(0.985);
}

.track.playing {
    background: linear-gradient(160deg, rgba(139, 92, 246, 0.13), rgba(217, 70, 239, 0.06));
    border-color: rgba(167, 139, 250, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.t-cover {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 15px;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.t-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t-cover .ic {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.g0 { background: linear-gradient(135deg, #7c3aed, #db2777); }
.g1 { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.g2 { background: linear-gradient(135deg, #db2777, #ea580c); }
.g3 { background: linear-gradient(135deg, #059669, #2563eb); }
.g4 { background: linear-gradient(135deg, #d97706, #dc2626); }
.g5 { background: linear-gradient(135deg, #4f46e5, #0ea5e9); }

.t-meta {
    flex: 1;
    min-width: 0;
}

.t-title {
    font-size: 15px;
    font-weight: 640;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.t-artist {
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track.playing .t-title {
    background: linear-gradient(90deg, #c4b5fd, #f0abfc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.play-indicator {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    background: rgba(7, 6, 12, 0.45);
}

.eq {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 16px;
    filter: drop-shadow(0 0 6px rgba(217, 70, 239, 0.7));
}

.eq i {
    width: 3px;
    border-radius: 2px;
    background: var(--accent-2);
    animation: eq-bounce 0.9s ease-in-out infinite;
}

.eq i:nth-child(1) { height: 55%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 100%; animation-delay: 0.25s; }
.eq i:nth-child(3) { height: 70%; animation-delay: 0.5s; }

.eq.paused i {
    animation-play-state: paused;
    opacity: 0.45;
}

@keyframes eq-bounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}


/* =========================================
   EMPTY STATE
========================================= */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 46px 24px 30px;
    gap: 8px;
}

.empty-art {
    width: 88px;
    height: 88px;
    border-radius: 30px;
    display: grid;
    place-items: center;
    background: var(--glass);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 44px rgba(0, 0, 0, 0.4);
    color: var(--accent-soft);
    margin-bottom: 14px;
    animation: float 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.empty-art .ic {
    width: 38px;
    height: 38px;
}

.empty strong {
    font-size: 17px;
    font-weight: 700;
}

.empty p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-dim);
    max-width: 280px;
    margin-bottom: 14px;
}


/* =========================================
   BUTTONS
========================================= */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 22px;
    border-radius: 16px;
    background: var(--gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), var(--glow);
    transition: transform 0.25s var(--spring), box-shadow 0.2s ease, filter 0.15s ease;
}

.btn-primary:active {
    transform: scale(0.96);
    filter: brightness(1.12);
}

.btn-primary:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.btn-primary .ic {
    width: 18px;
    height: 18px;
}

.btn-primary.wide {
    width: 100%;
    margin-bottom: 10px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 47px;
    border-radius: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 14.5px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, transform 0.2s var(--spring);
}

.btn-ghost:active {
    background: var(--surface-strong);
    color: var(--text);
    transform: scale(0.97);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    height: 50px;
    border-radius: 15px;
    background: linear-gradient(160deg, rgba(251, 113, 133, 0.18), rgba(251, 113, 133, 0.08));
    border: 1px solid rgba(251, 113, 133, 0.32);
    color: var(--danger);
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.2s var(--spring), filter 0.15s ease;
}

.btn-danger:active {
    transform: scale(0.96);
    filter: brightness(1.2);
}

.btn-danger .ic {
    width: 17px;
    height: 17px;
}


/* =========================================
   FAB
========================================= */

.fab {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    z-index: 60;
    width: 58px;
    height: 58px;
    border-radius: 19px;
    display: grid;
    place-items: center;
    background: var(--gradient);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 14px 40px rgba(139, 92, 246, 0.5),
        0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s var(--spring), bottom 0.3s var(--ease-out), filter 0.15s ease;
}

.fab:active {
    transform: scale(0.9) rotate(90deg);
    filter: brightness(1.15);
}

body.has-player .fab {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 108px);
}


/* =========================================
   MINI PLAYER (liquid glass bar)
========================================= */

.mini-player {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 50;
    width: min(calc(100% - 28px), 492px);
    border-radius: 24px;
    overflow: hidden;
    background: var(--glass-strong);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 20px 50px rgba(0, 0, 0, 0.55),
        0 4px 80px rgba(139, 92, 246, 0.12);
    animation: rise-up 0.32s var(--spring);
}

@keyframes rise-up {
    from { transform: translate(-50%, 28px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.mini-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
}

.mini-progress i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #a78bfa, #e879f9);
    box-shadow: 0 0 12px rgba(217, 70, 239, 0.8);
    transition: width 0.25s linear;
}

.mini-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 10px;
}

.mini-cover {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.mini-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cover .ic {
    width: 21px;
    height: 21px;
}

.mini-meta {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.mini-title {
    font-size: 14.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-artist {
    font-size: 12.5px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.mini-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: #14101f;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
    transition: transform 0.25s var(--spring);
}

.mini-btn:active {
    transform: scale(0.86);
}

.mini-btn.dim {
    width: 38px;
    height: 38px;
    background: transparent;
    color: var(--text-dim);
    box-shadow: none;
}

.mini-btn.dim:active {
    color: var(--text);
}

.mini-btn .ic {
    width: 20px;
    height: 20px;
}


/* =========================================
   FULL PLAYER
========================================= */

.full-player {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding:
        calc(env(safe-area-inset-top, 0px) + 14px)
        26px
        calc(env(safe-area-inset-bottom, 0px) + 22px);
    background: linear-gradient(180deg, rgba(18, 13, 30, 0.82), rgba(8, 6, 14, 0.93));
    backdrop-filter: blur(32px) saturate(150%);
    -webkit-backdrop-filter: blur(32px) saturate(150%);
    transform: translateY(105%);
    transition: transform 0.42s cubic-bezier(0.32, 0.72, 0.22, 1);
    visibility: hidden;
}

.full-player.open {
    transform: translateY(0);
    visibility: visible;
}

.fp-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(64% 38% at 50% -2%, rgba(139, 92, 246, 0.22), transparent 65%),
        radial-gradient(50% 30% at 82% 104%, rgba(217, 70, 239, 0.12), transparent 65%);
}

.fp-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.icon-btn.dark {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.fp-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 2.6px;
    text-transform: uppercase;
    color: var(--text-faint);
}

.fp-top-spacer {
    width: 42px;
}

.fp-cover-area {
    position: relative;
    flex: 1;
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 16px 0;
}

.fp-aura {
    position: absolute;
    width: min(92vw, 430px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(139, 92, 246, 0.5), rgba(217, 70, 239, 0.2) 46%, transparent 70%);
    opacity: 0.4;
    transition: opacity 0.6s ease;
    animation: aura-breathe 6s ease-in-out infinite;
}

body.is-playing .fp-aura {
    opacity: 0.85;
    animation-duration: 3.6s;
}

@keyframes aura-breathe {
    0%, 100% { transform: scale(0.92); }
    50% { transform: scale(1.05); }
}

.fp-cover {
    position: relative;
    z-index: 1;
    width: min(70vw, 320px);
    aspect-ratio: 1;
    max-height: 100%;
    border-radius: 32px;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.85);
    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: transform 0.3s ease;
}

.fp-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fp-cover .ic {
    width: 76px;
    height: 76px;
}

.full-player.open .fp-cover {
    animation: cover-in 0.5s var(--spring);
}

@keyframes cover-in {
    from { transform: scale(0.84) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.fp-meta {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.fp-names {
    flex: 1;
    min-width: 0;
}

.fp-names h2 {
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-names p {
    font-size: 14.5px;
    color: var(--text-dim);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn.heart.active {
    color: var(--danger);
    border-color: rgba(251, 113, 133, 0.3);
}

.icon-btn.heart.active .ic path {
    fill: currentColor;
    filter: drop-shadow(0 0 8px rgba(251, 113, 133, 0.6));
}

.fp-seek {
    position: relative;
    margin-bottom: 8px;
}

.seek-track {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.seek-track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.seek-fill {
    position: absolute;
    left: 0;
    height: 5px;
    width: 0%;
    border-radius: 5px;
    background: linear-gradient(90deg, #a78bfa, #e879f9);
    box-shadow: 0 0 14px rgba(217, 70, 239, 0.55);
}

.seek-knob {
    position: absolute;
    left: 0%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transform: translateX(-50%) scale(0);
    transition: transform 0.18s var(--spring);
    box-shadow:
        0 0 0 5px rgba(232, 121, 249, 0.18),
        0 3px 10px rgba(0, 0, 0, 0.5);
}

.seek-track.dragging .seek-knob,
.seek-track:active .seek-knob {
    transform: translateX(-50%) scale(1.12);
}

.times {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    color: var(--text-faint);
}

.fp-controls {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 0;
}

.ctrl {
    display: grid;
    place-items: center;
    position: relative;
    color: var(--text);
    transition: transform 0.22s var(--spring), color 0.15s ease;
}

.ctrl:active {
    transform: scale(0.86);
}

.ctrl.side {
    width: 44px;
    height: 44px;
    color: var(--text-dim);
}

.ctrl.side.active {
    color: #f0abfc;
    filter: drop-shadow(0 0 10px rgba(217, 70, 239, 0.65));
}

.ctrl.big-dim {
    width: 52px;
    height: 52px;
}

.ctrl.big-dim .ic {
    width: 30px;
    height: 30px;
}

.ctrl.play {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #fff;
    color: #14101f;
    box-shadow:
        inset 0 -2px 6px rgba(0, 0, 0, 0.08),
        0 16px 40px rgba(255, 255, 255, 0.2);
}

body.is-playing .ctrl.play {
    animation: play-pulse 2.6s ease-in-out infinite;
}

@keyframes play-pulse {
    0%, 100% { box-shadow: 0 16px 40px rgba(255, 255, 255, 0.2), 0 0 0 0 rgba(217, 70, 239, 0.35); }
    50% { box-shadow: 0 16px 44px rgba(255, 255, 255, 0.26), 0 0 0 14px rgba(217, 70, 239, 0); }
}

.ctrl.play .ic {
    width: 28px;
    height: 28px;
}

.repeat-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-2);
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.7);
}

.fp-volume {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 0 4px;
}

.vol-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: transform 0.22s var(--spring), color 0.15s ease;
}

.vol-btn:active {
    transform: scale(0.86);
}

.vol-btn.muted {
    color: var(--danger);
    filter: drop-shadow(0 0 8px rgba(251, 113, 133, 0.5));
}

.vol-btn .ic {
    width: 20px;
    height: 20px;
}

.vol-track {
    position: relative;
    flex: 1;
    height: 26px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.vol-track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 4.5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.vol-fill {
    position: absolute;
    left: 0;
    height: 4.5px;
    width: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #a78bfa, #e879f9);
    box-shadow: 0 0 12px rgba(217, 70, 239, 0.45);
}

.vol-knob {
    position: absolute;
    left: 100%;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    transform: translateX(-50%) scale(0);
    transition: transform 0.18s var(--spring);
    box-shadow:
        0 0 0 4px rgba(232, 121, 249, 0.16),
        0 3px 10px rgba(0, 0, 0, 0.5);
}

.vol-track.dragging .vol-knob,
.vol-track:active .vol-knob {
    transform: translateX(-50%) scale(1.12);
}

.fp-bottom {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pill-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 600;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.2s var(--spring);
}

.pill-danger .ic {
    width: 16px;
    height: 16px;
}

.pill-danger:active {
    transform: scale(0.95);
    color: var(--danger);
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.3);
}


/* =========================================
   SHEETS
========================================= */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(4, 3, 8, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.overlay.open {
    opacity: 1;
    visibility: visible;
}

.sheet {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 105%);
    width: min(100%, 520px);
    max-height: 86vh;
    overflow-y: auto;
    padding:
        10px 20px
        calc(env(safe-area-inset-bottom, 0px) + 20px);
    border-radius: 28px 28px 0 0;
    background: var(--glass-strong);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 -24px 70px rgba(0, 0, 0, 0.55);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0.22, 1);
}

.overlay.open .sheet.active {
    transform: translate(-50%, 0);
}

.grabber {
    width: 40px;
    height: 4.5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.16);
    margin: 4px auto 18px;
}

.sheet h3 {
    font-size: 19px;
    font-weight: 750;
    margin-bottom: 6px;
}

.sheet-hint {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.url-row input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -8px 18px rgba(0, 0, 0, 0.18);
    color: var(--text);
    font-size: 14.5px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-row input:focus {
    border-color: rgba(167, 139, 250, 0.6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 4px rgba(139, 92, 246, 0.16);
}

.url-row input::placeholder {
    color: var(--text-faint);
}

.job-box {
    padding: 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.job-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13.5px;
}

.job-stage {
    color: var(--text-dim);
}

.job-percent {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.job-bar {
    position: relative;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.job-bar i {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: var(--gradient);
    box-shadow: 0 0 14px rgba(192, 38, 211, 0.7);
    transition: width 0.4s ease;
}

.job-bar i::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    background-size: 220% 100%;
    animation: shimmer 1.4s ease infinite;
}

.job-error {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--danger);
}

.confirm-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.confirm-row .btn-ghost {
    flex: 1;
    height: 50px;
}

.help-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.help-item {
    display: flex;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-dim);
}

.help-item b {
    color: var(--accent-soft);
}


/* =========================================
   TOASTS
========================================= */

#toastWrap {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 40px);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    background: linear-gradient(160deg, rgba(46, 40, 68, 0.92), rgba(24, 20, 38, 0.94));
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 14px 36px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 550;
    animation: toast-in 0.35s var(--spring), toast-out 0.3s ease 2.3s forwards;
}

.toast.error {
    border-color: rgba(251, 113, 133, 0.4);
    color: #fecdd3;
}

.toast.success {
    border-color: rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}

@keyframes toast-in {
    from { transform: translateY(16px) scale(0.94); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toast-out {
    to { transform: translateY(10px); opacity: 0; }
}


/* =========================================
   DESKTOP / POINTER DEVICES
========================================= */

@media (hover: hover) and (pointer: fine) {

    .track:hover {
        background: rgba(255, 255, 255, 0.045);
        border-color: var(--border);
        transform: translateY(-1px);
    }

    .track.playing:hover {
        background: linear-gradient(160deg, rgba(139, 92, 246, 0.16), rgba(217, 70, 239, 0.08));
    }

    .btn-primary:hover {
        filter: brightness(1.1);
        transform: translateY(-1px);
    }

    .btn-primary:active {
        transform: scale(0.97);
    }

    .fab:hover {
        filter: brightness(1.12);
        transform: translateY(-2px);
    }

    .icon-btn:hover {
        color: var(--text);
        border-color: var(--border-strong);
    }

    .ctrl.side:hover,
    .mini-btn.dim:hover,
    .vol-btn:hover,
    .pill-danger:hover,
    .banner button:hover,
    .btn-ghost:hover {
        color: var(--text);
    }

    .pill-danger:hover {
        border-color: rgba(251, 113, 133, 0.3);
    }

    .mini-player:hover {
        border-color: rgba(255, 255, 255, 0.22);
    }

    .seek-knob,
    .vol-knob {
        transform: translateX(-50%) scale(0.9);
    }
}


/* =========================================
   WIDE SCREENS
========================================= */

@media (min-width: 720px) {

    .app {
        max-width: 600px;
        padding-top: calc(env(safe-area-inset-top, 0px) + 34px);
    }

    .full-player {
        padding-left: 40px;
        padding-right: 40px;
    }

    .fp-cover-area {
        padding: 26px 0;
    }

    .fp-cover {
        width: min(46vh, 340px);
    }

    .fp-aura {
        width: min(56vh, 460px);
    }

    /* Sheets become centered floating cards */
    .sheet {
        bottom: auto;
        top: 50%;
        width: min(480px, calc(100% - 48px));
        max-height: min(80vh, 640px);
        border-radius: 28px;
        border-bottom: 1px solid var(--border-strong);
        padding-bottom: 24px;
        transform: translate(-50%, calc(-50% + 26px)) scale(0.96);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.34s cubic-bezier(0.32, 0.72, 0.22, 1), opacity 0.25s ease, visibility 0.25s;
    }

    .overlay.open .sheet.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        visibility: visible;
    }

    #toastWrap {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 34px);
    }
}


/* =========================================
   SMALL SCREENS
========================================= */

@media (max-width: 360px) {
    .app {
        padding-left: 14px;
        padding-right: 14px;
    }

    .header h1 {
        font-size: 25px;
    }

    .full-player {
        padding-left: 18px;
        padding-right: 18px;
    }

    .fp-controls {
        gap: 2px;
    }
}


/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .orb,
    .empty-art,
    .fp-aura {
        animation: none !important;
    }
}
