:root {
    --bg: #0a0a0a;
    --surface: #121212;
    --surface-light: #1e1e1e;
    --surface-hover: #2a2a2a;
    --text: #ffffff;
    --text-secondary: #a7a7a7;
    --accent: #1DB954;
    --accent-hover: #1ed760;
    --accent-glow: rgba(29,185,84,0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --player-height: 100px;
    --header-height: 56px;
    --glass-bg: rgba(18,18,18,0.72);
    --glass-border: rgba(255,255,255,0.08);
}

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

html {
    height: 100%;
    height: 100dvh;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    min-height: 100dvh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(29,185,84,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(29,185,84,0); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes playing-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.stagger-in > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.04s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.12s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.16s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.20s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.24s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.28s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.32s; }
.stagger-in > *:nth-child(9) { animation-delay: 0.36s; }
.stagger-in > *:nth-child(10) { animation-delay: 0.40s; }
.stagger-in > *:nth-child(11) { animation-delay: 0.44s; }
.stagger-in > *:nth-child(12) { animation-delay: 0.48s; }

/* Scroll-triggered reveals */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== LAYOUT ========== */
/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 90;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.menu-toggle, .mobile-search {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
    text-decoration: none;
}
.menu-toggle:active, .mobile-search:active { background: rgba(255,255,255,0.1); }

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}
.mobile-logo svg { color: var(--accent); }
.mobile-spacer { flex: 1; }

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity .3s;
}
.mobile-overlay.open { display: block; opacity: 1; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: calc(var(--player-height) + env(safe-area-inset-bottom));
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid rgba(255,255,255,0.04);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-scroll {
    padding: 24px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    padding: 0 8px;
}
.logo svg { color: var(--accent); flex-shrink: 0; }

.nav-links { list-style: none; }
.nav-links li { margin-bottom: 4px; }
.nav-links a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    transition: all .2s ease;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text);
    background: rgba(255,255,255,0.07);
    transform: translateX(2px);
}
.nav-links a svg { opacity: .7; flex-shrink: 0; transition: opacity .2s; }
.nav-links a:hover svg, .nav-links a.active svg { opacity: 1; }

.library h3 {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding: 0 12px;
    font-weight: 700;
}
.library ul { list-style: none; }
.library li { margin-bottom: 2px; }
.library a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .85rem;
    transition: all .2s ease;
    font-weight: 500;
}
.library a:hover { color: var(--text); background: rgba(255,255,255,0.05); transform: translateX(2px); }

.user-menu {
    margin-top: auto;
    padding: 16px 12px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: .8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.user-menu span { font-weight: 600; color: var(--text); }
.user-menu a { color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: color .2s; }
.user-menu a:hover { color: var(--accent); }

/* ========== ACCORDION SIDEBAR ========== */
.accordion-sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.accordion-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all .2s ease;
    text-align: left;
}

.accordion-header:hover {
    color: var(--text);
    background: rgba(255,255,255,0.07);
}

.accordion-header[aria-expanded="true"] {
    color: var(--text);
    background: rgba(255,255,255,0.07);
}

.accordion-header[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .7;
    flex-shrink: 0;
    transition: opacity .2s;
}

.accordion-header:hover .accordion-icon,
.accordion-header[aria-expanded="true"] .accordion-icon {
    opacity: 1;
}

.accordion-title {
    flex: 1;
}

.accordion-chevron {
    flex-shrink: 0;
    opacity: .5;
    transition: transform .3s cubic-bezier(0.4,0,0.2,1), opacity .2s;
}

.accordion-header:hover .accordion-chevron {
    opacity: .8;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(0.4,0,0.2,1), opacity .25s ease;
    opacity: 0;
}

.accordion-item.open .accordion-content {
    opacity: 1;
}

.accordion-list {
    list-style: none;
    padding: 4px 0 8px 46px;
}

.accordion-list li {
    margin-bottom: 2px;
}

.accordion-list a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .85rem;
    transition: all .2s ease;
    font-weight: 500;
}

.accordion-list a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
    transform: translateX(2px);
}

.accordion-list a.active {
    color: var(--accent);
    background: rgba(29,185,84,0.08);
    font-weight: 600;
}

.accordion-subhead {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    opacity: .6;
    padding: 10px 12px 4px;
    font-weight: 700;
    pointer-events: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 32px calc(var(--player-height) + env(safe-area-inset-bottom) + 24px) 32px;
    background: linear-gradient(180deg, rgba(30,30,30,0.6) 0%, var(--bg) 400px);
    min-height: 100dvh;
}

.main-content.logged-out {
    margin-left: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
}

.content-spacer { height: 24px; }

/* ========== HERO & SECTIONS ========== */
.hero { margin-bottom: 40px; animation: fadeInUp 0.6s ease both; }
.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}
.hero p { color: var(--text-secondary); font-size: 1rem; font-weight: 400; }

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 500px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all .25s cubic-bezier(0.4,0,0.2,1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.hero-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.hero-btn:active { transform: scale(0.97); }

.section { margin-bottom: 48px; animation: fadeInUp 0.6s ease both; }
.section:nth-of-type(2) { animation-delay: 0.1s; }
.section:nth-of-type(3) { animation-delay: 0.2s; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}
.section-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.show-all {
    font-size: .75rem;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    padding: 4px 0;
    transition: color .2s;
}
.show-all:hover { color: var(--text); }

/* ========== CARDS ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.card {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    transition: all .3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.03);
    will-change: transform;
}
.card:hover {
    background: var(--surface-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.06);
}
.card:active { transform: translateY(-2px) scale(0.98); }
.card-img {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: box-shadow .3s;
}
.card:hover .card-img { box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.card-img img, .card-img {
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s;
}
.card:hover .card-img {
    transform: scale(1.03);
}

/* Icon fallback for missing covers */
.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    z-index: 1;
    transition: color 0.3s;
}
.card:hover .card-icon {
    color: rgba(255,255,255,0.7);
}

/* When card-img has a background-image, fade out the text thumb */
.card-img[style*="background-image"] .card-text-thumb {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card:hover .card-img[style*="background-image"] .card-text-thumb {
    opacity: 0;
}
.card-play {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: all .3s cubic-bezier(0.4,0,0.2,1);
    color: #000;
}
.card:hover .card-play { opacity: 1; transform: translateY(0) scale(1); }
.card-play:hover { transform: scale(1.08); background: var(--accent-hover); }
.card-play:active { transform: scale(0.95); }

/* Text thumbnail on cards instead of music icon */
.card-text-thumb {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    text-transform: none;
    letter-spacing: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    line-height: 1.3;
    text-align: center;
    padding: 12px;
    word-break: break-word;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.card-text-thumb .sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255,255,255,0.88);
    text-transform: none;
    letter-spacing: 0;
}
.card-text-thumb.small {
    font-size: 0.8rem;
}
.card-text-thumb.small .sub {
    font-size: 0.65rem;
}

.card-title {
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.card-meta {
    font-size: .8rem;
    color: #c5c5c5;
    font-weight: 500;
}

/* Horizontal scroll carousel for Recently Played */
.card-scroll-wrap {
    position: relative;
}
.card-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 4px 12px;
    margin: -4px -4px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.card-scroll::-webkit-scrollbar { display: none; }
.card-scroll .card {
    scroll-snap-align: start;
    flex: 0 0 170px;
    min-width: 170px;
}
.card-scroll .card-img {
    margin-bottom: 12px;
}
.scroll-hint {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 40px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    background: linear-gradient(to right, transparent, var(--bg) 70%);
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 1;
    transition: opacity .4s ease;
    z-index: 2;
}
.scroll-hint.is-hidden {
    opacity: 0;
}
.scroll-hint svg {
    animation: bounce-x 1.5s infinite ease-in-out;
}
@keyframes bounce-x {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

.resume-badge {
    display: inline-block;
    margin-top: 10px;
    font-size: .7rem;
    background: var(--accent);
    color: #000;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ========== SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton.card-img { aspect-ratio: 1; margin-bottom: 16px; }
.skeleton.text { height: 16px; margin-bottom: 8px; width: 80%; }
.skeleton.text.short { width: 50%; }

/* ========== PLAYER BAR ========== */
.player-bar {
    position: fixed;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    right: 0;
    height: var(--player-height);
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
    z-index: 80;
    transition: transform .3s cubic-bezier(0.4,0,0.2,1);
}
.player-bar.hidden-bar { transform: translateY(100%); }

.player-track {
    flex: 0 1 260px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background .2s;
}
.player-track:hover { background: rgba(255,255,255,0.04); }
.track-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform .3s ease;
}
.player-track:hover .track-img { transform: scale(1.04); }
.track-info { min-width: 0; }
.track-title {
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    transition: color .2s;
}
.player-track:hover .track-title { color: var(--accent); }
.track-artist {
    font-size: .72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.track-fav {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: all .2s;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.track-fav:hover, .track-fav.active { color: #e22134; }
.track-fav.active svg { fill: #e22134; stroke: #e22134; }
.track-fav:active { transform: scale(0.85); }

.player-center {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 560px;
}
.control-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}
.control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: all .2s ease;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    position: relative;
    flex-shrink: 0;
}
.control-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}
.control-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); transform: scale(1.1); }
.control-btn:active { transform: scale(0.9); }
.control-btn.active { color: var(--accent); }
.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--text);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
    flex-shrink: 0;
}
.play-btn svg {
    display: block;
}
.play-btn:hover { transform: scale(1.08); background: var(--accent); }
.play-btn:active { transform: scale(0.95); }
.play-btn.pulse { animation: pulse-glow 2s infinite; }

.progress-area {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: .7rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.progress-area.is-idle {
    color: rgba(167,167,167,0.4);
    pointer-events: none;
}
.progress-area.is-idle .progress-bar {
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite;
    cursor: default;
}
.progress-area.is-idle .progress-fill,
.progress-area.is-idle .progress-buffer,
.progress-area.is-idle .progress-handle {
    opacity: 0;
}
.progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    touch-action: none;
    overflow: hidden;
}
.progress-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 3px;
}
.progress-buffer {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    width: 0%;
    transition: width .2s linear;
}
.progress-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: var(--text);
    border-radius: 3px;
    width: 0%;
    transition: width .05s linear;
    box-shadow: 0 0 8px rgba(255,255,255,0.15);
}
.progress-bar:hover .progress-fill, .progress-bar:active .progress-fill {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}
.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%) scale(0);
    width: 14px;
    height: 14px;
    background: var(--text);
    border-radius: 50%;
    transition: transform .15s;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.progress-bar:hover .progress-handle, .progress-bar:active .progress-handle { transform: translate(-50%, -50%) scale(1); }

.player-right {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    gap: 8px;
    padding-right: 4px;
}
.player-right > .control-btn,
.player-right > .volume-control,
.player-right > .settings-control {
    flex-shrink: 0;
}
.settings-control {
    position: relative;
    display: flex;
    align-items: center;
}
.speed-btn {
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    font-size: .8rem;
}

/* Voice selector */
.voice-selector { position: relative; }
.voice-selector #btn-voice {
    background: rgba(29, 185, 84, 0.15);
    color: var(--accent);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all .2s;
}
.voice-selector #btn-voice:hover {
    background: rgba(29, 185, 84, 0.25);
    transform: scale(1.05);
}
.voice-dropdown {
    position: absolute;
    bottom: 52px;
    right: 0;
    width: 300px;
    max-height: 360px;
    overflow-y: auto;
    background: rgba(30,30,30,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 8px;
    display: none;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.06);
    animation: fadeInUp 0.2s ease;
}
.voice-dropdown.open { display: block; }
.voice-dropdown-header {
    padding: 10px 12px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 4px;
}
.voice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
}
.voice-item:hover { background: rgba(255,255,255,0.06); transform: translateX(2px); }
.voice-item.active { color: var(--accent); }
.voice-item span { font-size: .9rem; font-weight: 500; }
.voice-play-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: .2s;
}
.voice-play-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* Sleep Timer Dropdown */
.sleep-dropdown {
    position: fixed;
    bottom: calc(var(--player-height) + env(safe-area-inset-bottom) + 12px);
    right: 20px;
    width: 220px;
    background: rgba(30,30,30,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 12px;
    display: none;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.06);
    animation: fadeInUp 0.2s ease;
}
.sleep-dropdown.open { display: block; }
.sleep-header {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sleep-options { display: flex; flex-direction: column; gap: 4px; }
.sleep-options button {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    font-size: .9rem;
    font-weight: 500;
    transition: all .2s;
    font-family: inherit;
}
.sleep-options button:hover { background: rgba(255,255,255,0.06); transform: translateX(2px); }
.sleep-options button.cancel { color: #e22134; }

/* Queue Panel */
.queue-panel {
    position: fixed;
    bottom: calc(var(--player-height) + env(safe-area-inset-bottom));
    right: 0;
    width: 340px;
    max-height: 60dvh;
    background: rgba(30,30,30,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius) var(--radius) 0 0;
    display: none;
    flex-direction: column;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    z-index: 85;
    border: 1px solid rgba(255,255,255,0.06);
    border-bottom: none;
    transform: translateY(10px);
    opacity: 0;
    transition: all .3s cubic-bezier(0.4,0,0.2,1);
}
.queue-panel.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}
.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-weight: 700;
    font-size: 1rem;
}
.queue-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: color .2s;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.queue-header button:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.queue-list {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}
.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .2s;
}
.queue-item:hover { background: rgba(255,255,255,0.05); transform: translateX(2px); }
.queue-item.active { color: var(--accent); }
.queue-item-img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--surface-hover);
    flex-shrink: 0;
    background-size: cover;
}
.queue-item-info { flex: 1; min-width: 0; }
.queue-item-title {
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.queue-item-meta {
    font-size: .75rem;
    color: var(--text-secondary);
}

/* ========== LOGIN ========== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px;
    background: linear-gradient(180deg, rgba(30,30,30,0.8) 0%, var(--bg) 100%);
}
.login-box {
    background: var(--surface);
    padding: 48px 40px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: fadeInUp 0.6s ease;
}
.logo-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}
.logo-large svg { color: var(--accent); }
.logo-large h1 { font-size: 1.6rem; font-weight: 800; }
.subtitle { color: var(--text-secondary); margin-bottom: 32px; font-size: .95rem; }
.login-form { text-align: left; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.form-group input {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: .95rem;
    outline: none;
    transition: .2s;
    font-family: inherit;
}
.form-group input:focus { border-color: var(--accent); background: rgba(255,255,255,0.05); box-shadow: 0 0 0 3px rgba(29,185,84,0.1); }
.btn-primary {
    width: 100%;
    padding: 16px;
    border-radius: 500px;
    border: none;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
    margin-top: 8px;
    font-family: inherit;
}
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.02); }
.btn-primary:active { transform: scale(0.98); }
.error {
    background: #e22134;
    color: #fff;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    margin-bottom: 16px;
    font-weight: 500;
    animation: fadeInUp 0.3s ease;
}

/* ========== DETAIL PAGE ========== */
.detail-hero {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    margin: -32px -32px 40px;
    padding: 48px 32px 36px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, var(--bg) 100%);
    animation: fadeIn 0.8s ease;
}
.detail-cover {
    width: 232px;
    height: 232px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    transition: transform .4s cubic-bezier(0.4,0,0.2,1), box-shadow .4s;
}
.detail-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}
.detail-cover:hover {
    transform: scale(1.02);
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.detail-cover .cover-icon {
    position: relative;
    z-index: 1;
    transition: opacity .3s;
}
.detail-cover.has-image .cover-icon {
    opacity: 0;
}
.detail-info { flex: 1; min-width: 0; animation: fadeInUp 0.6s ease 0.1s both; }
.detail-type {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}
.detail-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 16px;
    word-break: break-word;
    letter-spacing: -0.03em;
}
.detail-meta {
    font-size: .9rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-weight: 500;
}
.detail-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.btn-play-large {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    border-radius: 500px;
    border: none;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all .25s cubic-bezier(0.4,0,0.2,1);
    font-family: inherit;
    box-shadow: 0 8px 24px var(--accent-glow);
    position: relative;
    overflow: hidden;
}
.btn-play-large:hover { background: var(--accent-hover); transform: scale(1.04); box-shadow: 0 12px 32px var(--accent-glow); }
.btn-play-large:active { transform: scale(0.97); }
.btn-play-large:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all .2s ease;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); transform: scale(1.08); }
.btn-icon:active { transform: scale(0.92); }
.btn-icon.active { color: #e22134; border-color: #e22134; }

.detail-content { max-width: 900px; animation: fadeInUp 0.6s ease 0.2s both; }
.story-list { display: flex; flex-direction: column; gap: 12px; }
.story-item {
    display: flex;
    gap: 16px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface-light);
    transition: all .25s ease;
    border: 1px solid rgba(255,255,255,0.03);
    align-items: flex-start;
    animation: fadeInUp 0.4s ease both;
}
.story-item:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.06); transform: translateX(4px); }
.story-item:nth-child(1) { animation-delay: 0.05s; }
.story-item:nth-child(2) { animation-delay: 0.10s; }
.story-item:nth-child(3) { animation-delay: 0.15s; }
.story-item:nth-child(4) { animation-delay: 0.20s; }
.story-item:nth-child(5) { animation-delay: 0.25s; }
.story-item:nth-child(6) { animation-delay: 0.30s; }
.story-item:nth-child(7) { animation-delay: 0.35s; }
.story-item:nth-child(8) { animation-delay: 0.40s; }
.story-item:nth-child(9) { animation-delay: 0.45s; }
.story-item:nth-child(10) { animation-delay: 0.50s; }
.story-num {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 2px;
}
.story-title { font-weight: 600; margin-bottom: 6px; font-size: 1rem; }
.story-summary { font-size: .88rem; color: var(--text-secondary); line-height: 1.6; }
.story-link { font-size: .82rem; color: var(--accent); text-decoration: none; margin-top: 10px; display: inline-block; font-weight: 600; transition: opacity .2s; }
.story-link:hover { text-decoration: underline; opacity: .8; }

.empty-state {
    grid-column: 1 / -1;
    color: var(--text-secondary);
    font-size: .95rem;
    padding: 32px 24px;
    text-align: center;
    background: var(--surface-light);
    border-radius: var(--radius);
    border: 1px dashed rgba(255,255,255,0.08);
}
.empty-state code {
    background: var(--surface-hover);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: .85rem;
    font-family: 'SF Mono', monospace;
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: all .25s ease;
    cursor: pointer;
    margin-bottom: 24px;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: rgba(29,185,84,0.05);
    transform: scale(1.01);
}
.upload-area input { display: none; }
.upload-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.upload-hint { font-size: .85rem; color: var(--text-secondary); }

/* Search */
.search-box {
    position: relative;
    margin-bottom: 32px;
}
.search-box input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.08);
    background: var(--surface-light);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    transition: all .2s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,185,84,0.08); }
.search-box svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Modal / Dropdown overlay for Add to Playlist */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s;
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal-box {
    background: rgba(30,30,30,0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.06);
    transform: scale(0.95);
    opacity: 0;
    transition: all .3s cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.open .modal-box {
    transform: scale(1);
    opacity: 1;
}
.modal-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.modal-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.modal-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-hover);
    cursor: pointer;
    transition: all .2s;
    font-weight: 500;
}
.modal-item:hover { background: #3a3a3a; transform: translateX(4px); }
.modal-input {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: .9rem;
    margin-bottom: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; }
.modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.modal-actions button:hover { transform: scale(1.02); }
.modal-actions button:active { transform: scale(0.98); }
.modal-cancel { background: var(--surface-hover); color: var(--text); }
.modal-confirm { background: var(--accent); color: #000; }

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --player-height: 90px;
    }

    .mobile-header { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(0.4,0,0.2,1);
        bottom: env(safe-area-inset-bottom);
        width: 280px;
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .sidebar.open { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        padding: 80px 16px calc(var(--player-height) + env(safe-area-inset-bottom) + 16px) 16px;
        background: linear-gradient(180deg, rgba(30,30,30,0.5) 0%, var(--bg) 200px);
    }
    .main-content.logged-out { padding: 16px 16px calc(var(--player-height) + env(safe-area-inset-bottom) + 16px) 16px; }

    .hero { margin-bottom: 28px; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: .9rem; }

    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .card { padding: 12px; border-radius: var(--radius-sm); }
    .card-img { margin-bottom: 12px; border-radius: 8px; }
    .card-scroll .card { flex: 0 0 150px; min-width: 150px; }
    .card-scroll { gap: 12px; padding: 4px 4px 10px; margin: -4px -4px 0; }
    .scroll-hint { width: 40px; }
    .card-play {
        width: 40px;
        height: 40px;
        opacity: 1;
        transform: none;
        bottom: 6px;
        right: 6px;
    }
    .card-title { font-size: .85rem; }
    .card-meta { font-size: .75rem; }

    .detail-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin: -80px -16px 24px;
        padding: 100px 16px 24px;
    }
    .detail-cover { width: 160px; height: 160px; }
    .detail-title { font-size: 2rem; }
    .detail-meta { font-size: .85rem; margin-bottom: 20px; }
    .btn-play-large { padding: 12px 28px; font-size: .95rem; }

    .story-item { padding: 14px; gap: 12px; }
    .story-title { font-size: .92rem; }
    .story-summary { font-size: .82rem; }

    /* ===== MOBILE PLAYER: CLEAN TWO-ROW LAYOUT ===== */
    .player-bar {
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-template-rows: auto auto;
        align-items: center;
        padding: 8px 12px 8px;
        gap: 6px 0;
        height: auto;
        min-height: calc(var(--player-height) + 8px);
        background: linear-gradient(180deg, rgba(18,18,18,0.95) 0%, rgba(10,10,10,0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255,255,255,0.06);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    }
    .player-track {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        align-self: center;
        gap: 10px;
        max-width: none;
        min-width: 0;
        padding-right: 8px;
    }
    .track-img {
        width: 44px;
        height: 44px;
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        flex-shrink: 0;
    }
    .track-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        gap: 2px;
    }
    .track-title {
        font-size: 0.8rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 26vw;
        color: var(--text);
        letter-spacing: -0.01em;
    }
    .track-artist {
        font-size: 0.7rem;
        color: var(--text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 26vw;
    }
    .track-fav {
        display: flex;
        width: 30px;
        height: 30px;
        flex-shrink: 0;
        margin-left: 2px;
    }

    /* Break .player-center so its children become direct grid items */
    .player-center {
        display: contents;
    }
    .control-buttons {
        grid-column: 2 / 4;
        grid-row: 1;
        justify-self: center;
        gap: 10px;
        align-self: center;
        padding-bottom: 0;
    }
    .progress-area {
        grid-column: 1 / 3;
        grid-row: 2;
        justify-self: center;
        width: 100%;
        max-width: 100%;
        gap: 6px;
        padding: 0 4px;
    }

    .player-right {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        display: flex;
        gap: 6px;
        align-items: center;
        align-self: center;
    }

    /* Slightly smaller but still comfortable touch targets */
    .control-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
        border-radius: 50%;
        transition: all 0.15s ease;
    }
    .control-btn:active {
        transform: scale(0.88);
        background: rgba(255,255,255,0.08);
    }
    .control-btn svg {
        width: 17px;
        height: 17px;
    }
    .play-btn {
        width: 40px;
        height: 40px;
        background: var(--text);
        color: #000;
        box-shadow: 0 2px 12px rgba(255,255,255,0.15);
    }
    .play-btn:active {
        transform: scale(0.9);
        box-shadow: 0 1px 6px rgba(255,255,255,0.1);
    }
    .play-btn svg {
        width: 18px;
        height: 18px;
    }

    .track-fav svg, .np-extra-btn svg {
        width: 20px;
        height: 20px;
    }

    .settings-dropdown {
        right: -40px;
        bottom: 56px;
        width: 260px;
    }
    .volume-slider-wrap {
        bottom: 56px;
    }
    .progress-bar { height: 3px; }
    .progress-bar:hover { height: 4px; }

    .queue-panel { width: 100%; max-height: 50dvh; }
    .sleep-dropdown { right: 12px; bottom: calc(var(--player-height) + env(safe-area-inset-bottom) + 12px); }
}

/* Very small screens: tighten gaps further */
@media (max-width: 380px) {
    .card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { padding: 10px; }
    .hero h1 { font-size: 1.4rem; }

    .player-bar { padding: 4px 8px; gap: 2px 6px; }
    .control-buttons { gap: 6px; }
    .control-btn { width: 28px; height: 28px; }
    .play-btn { width: 32px; height: 32px; }
    .player-right { gap: 4px; }
    .progress-area { gap: 6px; padding: 0 2px; }
}

/* ========== NOW PLAYING FULLSCREEN (PREMIUM) ========== */
.now-playing-view {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1), visibility 0.4s;
    overflow: hidden;
}
.now-playing-view.open {
    opacity: 1;
    visibility: visible;
}
.now-playing-bg {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(90px) brightness(0.35) saturate(1.2);
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.8s ease, transform 1.2s ease;
}
.now-playing-view.open .now-playing-bg {
    opacity: 1;
    transform: scale(1);
}
.now-playing-bg-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent), #121212);
    opacity: 0;
    transition: opacity 0.6s;
}
.now-playing-view.open .now-playing-bg-fallback {
    opacity: 1;
}
.now-playing-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    opacity: 0;
    transform: scale(0.96) translateY(20px);
    transition: all 0.5s cubic-bezier(0.4,0,0.2,1) 0.1s;
}
.now-playing-view.open .now-playing-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.now-playing-header {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 2;
}
.now-playing-close {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all .2s;
    backdrop-filter: blur(10px);
}
.now-playing-close:hover { background: rgba(255,255,255,0.15); transform: scale(1.08); }
.now-playing-close:active { transform: scale(0.92); }
.now-playing-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    margin-top: 40px;
}
.now-playing-cover-wrap {
    position: relative;
    perspective: 1000px;
}
.now-playing-cover {
    width: min(58vw, 380px);
    height: min(58vw, 380px);
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #121212);
    background-size: cover;
    background-position: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
    transition: all .5s cubic-bezier(0.4,0,0.2,1);
    transform-style: preserve-3d;
    position: relative;
}
.now-playing-view.open .now-playing-cover {
    animation: scaleIn 0.6s cubic-bezier(0.4,0,0.2,1) 0.15s both;
}
.now-playing-cover.is-playing {
    animation: float 6s ease-in-out infinite;
}
.now-playing-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.08);
    pointer-events: none;
}
.now-playing-cover.spin-slow {
    animation: spin 20s linear infinite;
}
.now-playing-info {
    text-align: center;
    width: 100%;
    animation: fadeInUp 0.5s ease 0.3s both;
}
.now-playing-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.now-playing-artist {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 500;
}
.now-playing-progress-area {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeInUp 0.5s ease 0.4s both;
}
.now-playing-progress-area span {
    font-size: .75rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.now-playing-progress-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    position: relative;
    cursor: pointer;
    touch-action: none;
    overflow: hidden;
}
.now-playing-progress-bg {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
}
.now-playing-progress-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    width: 0%;
    transition: width .2s linear;
}
.now-playing-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: var(--text);
    border-radius: 3px;
    transition: width 0.1s linear;
}
.now-playing-progress-bar:hover .now-playing-progress-fill { background: var(--accent); }
.now-playing-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 16px;
    height: 16px;
    background: var(--text);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform .2s, background .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    pointer-events: none;
}
.now-playing-progress-bar:hover .now-playing-progress-handle,
.now-playing-progress-bar:active .now-playing-progress-handle {
    transform: translate(-50%, -50%) scale(1);
}
.now-playing-progress-bar:active .now-playing-progress-handle { background: var(--accent); }
.now-playing-controls {
    display: flex;
    align-items: center;
    gap: 28px;
    animation: fadeInUp 0.5s ease 0.5s both;
}
.np-control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all .2s ease;
    flex-shrink: 0;
}
.np-control-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}
.np-control-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); transform: scale(1.12); }
.np-control-btn:active { transform: scale(0.9); }
.np-control-btn.active { color: var(--accent); }
.np-play-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--text);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    position: relative;
    flex-shrink: 0;
}
.np-play-btn:hover { transform: scale(1.08); background: #fff; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.np-play-btn:active { transform: scale(0.95); }
.np-play-btn svg { transition: transform .2s; }
.np-play-btn:hover svg { transform: scale(1.05); }

/* Extra NP controls row */
.now-playing-extras {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: -8px;
    animation: fadeInUp 0.5s ease 0.55s both;
}
.np-extra-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}
.np-extra-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}
.np-extra-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); transform: scale(1.1); }
.np-extra-btn.active { color: var(--accent); }

/* Favorite button premium styling */
#np-favorite.active, #btn-favorite.active {
    color: #e22134 !important;
}
#np-favorite.active svg, #btn-favorite.active svg {
    fill: #e22134;
    stroke: #e22134;
    filter: drop-shadow(0 0 6px rgba(226,33,52,0.4));
}
#np-favorite:active, #btn-favorite:active {
    transform: scale(0.85);
}

/* Bookmark button premium styling */
#np-bookmark.active {
    color: var(--accent) !important;
}
#np-bookmark.active svg {
    fill: var(--accent);
    stroke: var(--accent);
}

/* Chapter list in Now Playing */
.np-chapter-list {
    width: 100%;
    max-width: 480px;
    max-height: 280px;
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    margin-top: 16px;
    animation: fadeInUp 0.5s ease 0.6s both;
}
.np-chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    background: rgba(18,18,18,0.95);
    backdrop-filter: blur(10px);
}
.np-chapter-items {
    padding: 4px;
}
.np-chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.np-chapter-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
}
.np-chapter-item.active {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-weight: 500;
}
.np-chapter-item.active .np-chapter-num {
    color: var(--accent);
}
.np-chapter-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.np-chapter-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.np-chapter-dur {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Chapter badge on audiobook cards */
.chapter-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Voice dropdown current label */
.voice-current-label {
    padding: 6px 12px;
    font-size: .75rem;
    color: var(--accent);
    font-weight: 600;
}

/* Detail action buttons */
.detail-actions .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 500px;
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    min-width: 44px;
    height: 44px;
}
.detail-actions .btn-icon.icon-only {
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}
.detail-actions .btn-icon:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.06);
    border-color: rgba(255,255,255,0.2);
}
.detail-actions .btn-icon:active { transform: scale(0.94); }
.detail-actions .btn-icon.active {
    color: var(--accent);
    border-color: var(--accent);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: calc(var(--player-height) + env(safe-area-inset-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30,30,30,0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 500px;
    font-size: .9rem;
    font-weight: 600;
    z-index: 250;
    opacity: 0;
    pointer-events: none;
    transition: all .4s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: rgba(29,185,84,0.3); color: var(--accent); }
.toast.error { border-color: rgba(226,33,52,0.3); color: #ff6b7a; }

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* MediaSession artwork fallback fix */
@media (max-width: 768px) {
    .now-playing-view.open ~ .player-bar { display: none; }
    .now-playing-body { margin-top: 60px; gap: 24px; }
    .now-playing-controls { gap: 16px; }
    .np-play-btn { width: 60px; height: 60px; }
    .now-playing-progress-area { padding: 0 8px; }
    .now-playing-cover { width: min(72vw, 300px); height: min(72vw, 300px); }
    .now-playing-title { font-size: 1.4rem; }
    .now-playing-content { padding: 20px; gap: 20px; }
    .now-playing-header { top: 12px; left: 12px; }
}

/* ========== VOLUME SLIDER ========== */
.volume-control {
    position: relative;
    display: flex;
    align-items: center;
}
#btn-volume {
    position: relative;
}
.volume-slider-wrap {
    position: absolute;
    bottom: 52px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 36px;
    height: 120px;
    background: rgba(30,30,30,0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all .25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    z-index: 100;
}
.volume-control:hover .volume-slider-wrap,
.volume-slider-wrap:hover,
.volume-slider-wrap.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    outline: none;
    transform: rotate(-90deg);
    cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: background .2s, transform .2s;
}
.volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent);
    transform: scale(1.2);
}
.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ========== BUFFERING SPINNER ========== */
.play-btn .spinner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #000;
    display: none;
}
.play-btn.is-loading .spinner {
    display: block;
}
.play-btn.is-loading svg {
    display: none !important;
}
.np-play-btn .spinner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #000;
    display: none;
}
.np-play-btn.is-loading .spinner {
    display: block;
}
.np-play-btn.is-loading svg {
    display: none !important;
}

/* ========== SMOOTH PAGE TRANSITIONS ========== */
.main-content {
    animation: fadeIn 0.4s ease;
}

/* ========== IMPROVED MOBILE PLAYER ========== */
@media (max-width: 768px) {
    .volume-control { display: none; }
    .now-playing-cover.is-playing {
        animation: float 5s ease-in-out infinite;
    }
}


/* ========== SETTINGS DROPDOWN ========== */
.settings-control {
    position: relative;
}
.settings-dropdown {
    position: absolute;
    bottom: 52px;
    right: 0;
    width: 280px;
    max-height: 420px;
    overflow-y: auto;
    background: rgba(24,24,24,0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius);
    padding: 16px;
    display: none;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.06);
    animation: fadeInUp 0.2s ease;
}
.settings-dropdown.open { display: block; }
.settings-section { margin-bottom: 16px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.settings-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 12px 0;
}
.speed-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.speed-opt {
    flex: 1;
    min-width: 44px;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.speed-opt:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.speed-opt.active { background: var(--accent); color: #000; border-color: var(--accent); }
.sleep-options-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sleep-opt {
    flex: 1;
    min-width: 36px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.sleep-opt:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.sleep-opt.active { background: var(--accent); color: #000; border-color: var(--accent); }
.sleep-opt.cancel { color: #e22134; }
.sleep-opt.cancel:hover { background: rgba(226,33,52,0.1); }

/* Voice list inside settings */
.settings-dropdown .voice-list {
    max-height: 160px;
    overflow-y: auto;
}
.settings-dropdown .voice-item {
    padding: 8px 10px;
    font-size: .85rem;
}

/* ========== NOW PLAYING FALLBACK COVER ========== */
.np-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255,255,255,0.9);
    text-align: center;
    padding: 24px;
    opacity: 1;
    transition: opacity .3s;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #121212);
}
.np-cover-fallback svg {
    opacity: .6;
}
.np-fallback-cat {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.np-fallback-date {
    font-size: .9rem;
    font-weight: 500;
    opacity: .7;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.now-playing-cover.has-image .np-cover-fallback {
    opacity: 0;
    pointer-events: none;
}

/* ========== SVG ICON NORMALIZATION ========== */
.control-btn svg, .np-control-btn svg, .np-extra-btn svg, .track-fav svg {
    display: block;
}
.track-fav {
    display: flex;
    align-items: center;
    justify-content: center;
}
.track-fav.active svg {
    fill: #e22134;
    stroke: #e22134;
}
.np-extra-btn.active svg {
    fill: var(--accent);
    stroke: var(--accent);
}

/* ========== SECONDARY BUTTON ========== */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 500px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all .25s cubic-bezier(0.4,0,0.2,1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.btn-secondary:active { transform: scale(0.97); }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ========== OLD VOICE SELECTOR CLEANUP ========== */
.voice-selector { display: none; }

/* ========== DETAIL PAGE ACTION ICONS ========== */
.detail-actions .btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ========== CHAPTER SHEET (Bottom Sheet for Multi-Chapter Audiobooks) ========== */
.np-chapter-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 210;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1), visibility 0.35s;
}
.np-chapter-sheet-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.np-chapter-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 75vh;
    background: rgba(24,24,24,0.98);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 24px 24px 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -16px 64px rgba(0,0,0,0.7);
    z-index: 211;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32,0.72,0,1);
}
.np-chapter-sheet.open {
    transform: translateY(0);
}

.np-chapter-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    margin: 12px auto 8px;
    flex-shrink: 0;
}

.np-chapter-sheet-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 20px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.np-chapter-sheet-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8E24AA, #121212);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.np-chapter-sheet-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.np-chapter-sheet-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.np-chapter-sheet-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.np-chapter-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.np-chapter-sheet-close:hover {
    background: rgba(255,255,255,0.14);
    color: var(--text);
    transform: scale(1.08);
}
.np-chapter-sheet-close:active {
    transform: scale(0.92);
}

.np-chapter-sheet-list {
    overflow-y: auto;
    padding: 8px 16px 24px;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.np-chapter-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}
.np-chapter-sheet-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.np-chapter-sheet-item:hover {
    background: rgba(255,255,255,0.05);
}
.np-chapter-sheet-item:hover::before {
    transform: translateY(-50%) scaleY(0.5);
}
.np-chapter-sheet-item.active {
    background: rgba(255,255,255,0.07);
}
.np-chapter-sheet-item.active::before {
    transform: translateY(-50%) scaleY(1);
}

.np-chapter-sheet-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.np-chapter-sheet-item.active .np-chapter-sheet-num {
    color: var(--accent);
    display: none;
}

.np-chapter-sheet-item-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.18s;
}
.np-chapter-sheet-item:hover .np-chapter-sheet-item-title {
    color: var(--text);
}
.np-chapter-sheet-item.active .np-chapter-sheet-item-title {
    color: var(--text);
    font-weight: 600;
}

.np-chapter-sheet-dur {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    flex-shrink: 0;
    transition: color 0.18s;
}
.np-chapter-sheet-item.active .np-chapter-sheet-dur {
    color: var(--accent);
}

/* Playing equalizer indicator for active chapter */
.np-playing-indicator {
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 2.5px;
    width: 28px;
    height: 18px;
    flex-shrink: 0;
}
.np-chapter-sheet-item.active .np-playing-indicator {
    display: flex;
}
.np-playing-indicator span {
    width: 2.5px;
    background: var(--accent);
    border-radius: 2px;
    animation: eq-bar 0.55s ease-in-out infinite alternate;
    transform-origin: bottom;
}
.np-playing-indicator span:nth-child(1) { height: 6px; animation-delay: 0s; }
.np-playing-indicator span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.np-playing-indicator span:nth-child(3) { height: 9px; animation-delay: 0.3s; }
.np-playing-indicator span:nth-child(4) { height: 12px; animation-delay: 0.1s; }

@keyframes eq-bar {
    0% { transform: scaleY(0.25); }
    100% { transform: scaleY(1); }
}

/* Stagger animation for chapter items when sheet opens */
.np-chapter-sheet.open .np-chapter-sheet-item {
    opacity: 0;
    transform: translateY(10px);
    animation: sheetItemIn 0.35s cubic-bezier(0.4,0,0.2,1) forwards;
}
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(1) { animation-delay: 0.04s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(2) { animation-delay: 0.08s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(3) { animation-delay: 0.12s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(4) { animation-delay: 0.16s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(5) { animation-delay: 0.20s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(6) { animation-delay: 0.24s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(7) { animation-delay: 0.28s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(8) { animation-delay: 0.32s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(9) { animation-delay: 0.36s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(10) { animation-delay: 0.40s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(11) { animation-delay: 0.44s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(12) { animation-delay: 0.48s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(13) { animation-delay: 0.52s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(14) { animation-delay: 0.56s; }
.np-chapter-sheet.open .np-chapter-sheet-item:nth-child(15) { animation-delay: 0.60s; }

@keyframes sheetItemIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sheet header animation */
.np-chapter-sheet.open .np-chapter-sheet-header {
    animation: fadeInUp 0.4s cubic-bezier(0.4,0,0.2,1) 0.05s both;
}

/* Hide old inline chapter list (legacy, kept hidden) */
.np-chapter-list { display: none !important; }

/* ========== MOBILE CHAPTER SHEET ========== */
@media (max-width: 768px) {
    .np-chapter-sheet {
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
    }
    .np-chapter-sheet-list {
        padding: 6px 12px 20px;
    }
    .np-chapter-sheet-item {
        padding: 14px 12px;
        gap: 12px;
    }
    .np-chapter-sheet-header {
        padding: 6px 16px 14px;
    }
    .np-chapter-sheet-title {
        font-size: 0.9rem;
    }
    .np-chapter-sheet-author {
        font-size: 0.75rem;
    }
}

/* ========== COVER FIX: JS toggles .np-bg-hidden class on fallback ========== */
.now-playing-bg-fallback.np-bg-hidden {
    opacity: 0 !important;
}

/* ========== CATEGORY BROWSE GRID (Spotify-like) ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.category-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 20px;
    border-radius: var(--radius);
    height: 160px;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    border: 1px solid rgba(255,255,255,0.04);
}
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
}
.category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.08);
}
.category-card:active {
    transform: translateY(-2px) scale(0.98);
}
.category-card-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.category-card-count {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .category-card {
        height: 120px;
        padding: 16px;
    }
    .category-card-name {
        font-size: 0.95rem;
    }
}

/* ───────────────────────────────────────────────
   Live Radio Styles
   ─────────────────────────────────────────────── */

/* Live badge on cards */
.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 3;
    pointer-events: none;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #ff3b30;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* Card logo image */
.card-logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.2));
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), filter 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.radio-card:hover .card-logo {
    transform: scale(1.06);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* Radio card specific enhancements */
.radio-card {
    cursor: default;
}
.radio-card .card-body {
    min-height: 0;
}

/* Live mode progress bar */
.progress-area.is-live .progress-bg {
    background: rgba(255, 59, 48, 0.2);
}

.progress-area.is-live .progress-fill {
    background: linear-gradient(90deg, #ff3b30, #ff6b61);
}

/* Radio nav link icon */
.nav-links li a svg {
    flex-shrink: 0;
}

/* Card description on radio page */
.card-desc {
    font-size: 12px;
    color: #a7a7a7;
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
