/* BOTB Record Store Styles v30 - Scroll to top, favorites, default playlists */

/* Hide the default mobile nav - record store has its own player-nav */
body:has(.record-store) .mobile-nav {
    display: none !important;
}

/* Fallback for browsers without :has() support */
.record-store ~ .mobile-nav {
    display: none !important;
}

/* =========================================
   FIXED NAVBAR ON DESKTOP (Records page is tall)
   ========================================= */
@media (min-width: 769px) {
    body:has(.record-store) .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    /* Add padding to body to account for fixed navbar height */
    body:has(.record-store) {
        padding-top: 76px; /* Navbar height + border */
    }

    /* Fallback for browsers without :has() support */
    body.records-page .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    body.records-page {
        padding-top: 76px;
    }
}

/* =========================================
   CSS VARIABLES
   ========================================= */
:root {
    --vinyl-outer: #1a1a1a;
    --vinyl-groove: #2a2a2a;
    --vinyl-black: #1a1a1a;
    --vinyl-label: var(--primary, #e85d04);
    --vinyl-hole: #0a0a0a;
    --neon-glow: rgba(232, 93, 4, 0.6);
    --neon-pink: #ff6b9d;
    --neon-blue: #4ecdc4;
    --store-wood: #8b4513;
    --store-wood-dark: #5c2e0a;
}

[data-theme="dark"] {
    --vinyl-outer: #0f0f0f;
    --vinyl-groove: #1a1a1a;
    --vinyl-black: #0f0f0f;
    --neon-glow: rgba(232, 93, 4, 0.8);
}

/* =========================================
   STORE LAYOUT
   ========================================= */
.record-store {
    padding: 0;
    padding-bottom: 180px;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   STORE BANNER - Realistic Neon Sign
   ========================================= */
.store-banner {
    background: #0a0a0a;
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--store-wood);
}

/* Brick wall texture background */
.store-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* Brick pattern */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 28px,
            rgba(80, 40, 20, 0.4) 28px,
            rgba(80, 40, 20, 0.4) 30px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(60, 30, 15, 0.5) 0px,
            rgba(40, 20, 10, 0.5) 60px,
            rgba(60, 30, 15, 0.5) 120px
        );
    opacity: 0.6;
    pointer-events: none;
}

/* Neon glow reflection on wall */
.store-banner::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(
        ellipse 60% 40% at 50% 30%,
        rgba(232, 93, 4, 0.25) 0%,
        rgba(232, 93, 4, 0.1) 30%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

.store-neon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 1;
    padding: var(--space-lg);
}

/* Neon tube text - "RECORD" */
.neon-text {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    /* Tube color - bright white core */
    color: #fff;
    /* Realistic neon layering: white core → color transition → outer glow */
    text-shadow:
        /* Inner white glow - the bright tube itself */
        0 0 2px #fff,
        0 0 4px #fff,
        0 0 6px #fff,
        /* Color transition layer */
        0 0 10px #ff9966,
        0 0 20px #ff6633,
        /* Main color glow */
        0 0 35px var(--primary),
        0 0 50px var(--primary),
        /* Outer atmospheric glow */
        0 0 75px var(--primary),
        0 0 100px rgba(232, 93, 4, 0.5),
        0 0 150px rgba(232, 93, 4, 0.3);
    /* Slight stroke to simulate tube edge */
    -webkit-text-stroke: 1px rgba(255, 150, 100, 0.3);
    animation: neon-glow 3s ease-in-out infinite alternate;
}

/* Neon tube text - "STORE" */
.neon-text.accent {
    font-size: clamp(1.8rem, 6vw, 3rem);
    letter-spacing: 0.25em;
    /* Different color for second word - cyan/teal */
    color: #fff;
    text-shadow:
        /* Inner white glow */
        0 0 2px #fff,
        0 0 4px #fff,
        0 0 6px #fff,
        /* Color transition */
        0 0 10px #7fdbda,
        0 0 20px #4ecdc4,
        /* Main color glow */
        0 0 35px #4ecdc4,
        0 0 50px #4ecdc4,
        /* Outer glow */
        0 0 75px #4ecdc4,
        0 0 100px rgba(78, 205, 196, 0.5),
        0 0 150px rgba(78, 205, 196, 0.3);
    -webkit-text-stroke: 1px rgba(127, 219, 218, 0.3);
    animation: neon-glow-accent 3s ease-in-out infinite alternate;
    animation-delay: 0.5s;
}

/* Smooth pulsing glow animation */
@keyframes neon-glow {
    0% {
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 6px #fff,
            0 0 10px #ff9966,
            0 0 20px #ff6633,
            0 0 35px var(--primary),
            0 0 50px var(--primary),
            0 0 75px var(--primary),
            0 0 100px rgba(232, 93, 4, 0.5),
            0 0 150px rgba(232, 93, 4, 0.3);
        opacity: 1;
    }
    50% {
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 8px #fff,
            0 0 12px #ff9966,
            0 0 25px #ff6633,
            0 0 40px var(--primary),
            0 0 60px var(--primary),
            0 0 90px var(--primary),
            0 0 120px rgba(232, 93, 4, 0.6),
            0 0 180px rgba(232, 93, 4, 0.4);
        opacity: 1;
    }
    100% {
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 6px #fff,
            0 0 10px #ff9966,
            0 0 18px #ff6633,
            0 0 32px var(--primary),
            0 0 45px var(--primary),
            0 0 70px var(--primary),
            0 0 95px rgba(232, 93, 4, 0.45),
            0 0 140px rgba(232, 93, 4, 0.25);
        opacity: 0.98;
    }
}

@keyframes neon-glow-accent {
    0% {
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 6px #fff,
            0 0 10px #7fdbda,
            0 0 20px #4ecdc4,
            0 0 35px #4ecdc4,
            0 0 50px #4ecdc4,
            0 0 75px #4ecdc4,
            0 0 100px rgba(78, 205, 196, 0.5),
            0 0 150px rgba(78, 205, 196, 0.3);
        opacity: 1;
    }
    50% {
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 8px #fff,
            0 0 12px #7fdbda,
            0 0 25px #4ecdc4,
            0 0 40px #4ecdc4,
            0 0 60px #4ecdc4,
            0 0 90px #4ecdc4,
            0 0 120px rgba(78, 205, 196, 0.6),
            0 0 180px rgba(78, 205, 196, 0.4);
        opacity: 1;
    }
    100% {
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 6px #fff,
            0 0 10px #7fdbda,
            0 0 18px #4ecdc4,
            0 0 32px #4ecdc4,
            0 0 45px #4ecdc4,
            0 0 70px #4ecdc4,
            0 0 95px rgba(78, 205, 196, 0.45),
            0 0 140px rgba(78, 205, 196, 0.25);
        opacity: 0.98;
    }
}

/* Occasional realistic flicker */
.neon-text:nth-child(1) {
    animation: neon-glow 3s ease-in-out infinite alternate, neon-flicker 8s linear infinite;
}

@keyframes neon-flicker {
    0%, 18.99%, 19.99%, 21.99%, 22.99%, 45.99%, 46.99%, 100% {
        opacity: 1;
    }
    19%, 22%, 46% {
        opacity: 0.85;
    }
    19.5%, 22.5%, 46.5% {
        opacity: 0.95;
    }
}

.store-vinyl-decor {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.2;
}

.vinyl-stack {
    width: 120px;
    height: 120px;
    background: repeating-conic-gradient(
        from 0deg,
        #1a1a1a 0deg 10deg,
        #252525 10deg 20deg
    );
    border-radius: 50%;
    box-shadow:
        10px 5px 0 #1a1a1a,
        20px 10px 0 #181818,
        30px 15px 0 #151515;
    /* Subtle glow from neon reflection */
    filter: drop-shadow(0 0 10px rgba(232, 93, 4, 0.2));
}

/* Left side vinyl stack */
.store-banner .store-vinyl-decor::before {
    content: '';
    position: absolute;
    left: -200px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    background: repeating-conic-gradient(
        from 0deg,
        #1a1a1a 0deg 10deg,
        #252525 10deg 20deg
    );
    border-radius: 50%;
    box-shadow:
        -10px 5px 0 #1a1a1a,
        -20px 10px 0 #181818;
    filter: drop-shadow(0 0 10px rgba(78, 205, 196, 0.2));
}

/* =========================================
   STORE HEADER
   ========================================= */
.store-header {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    background: var(--surface);
    border-bottom: 2px solid var(--border);
}

.store-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: var(--space-sm);
}

.store-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-divider {
    color: var(--border);
}

/* =========================================
   SEARCH & CONTROLS
   ========================================= */
.store-controls {
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.search-bar {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-md);
    padding-left: calc(var(--space-md) * 2 + 20px);
    padding-right: calc(var(--space-md) + 30px);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-full, 50px);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--neon-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.search-clear.visible {
    display: flex;
}

.search-clear:hover {
    background: var(--error);
    color: white;
}

/* =========================================
   FILTERS
   ========================================= */
.store-filters {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-group label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.filter-select {
    padding: var(--space-sm) var(--space-md);
    padding-right: var(--space-xl);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}

.filter-select:hover {
    border-color: var(--primary);
}

/* =========================================
   QUEUE PANEL (Slide-up from player bar)
   ========================================= */
.queue-panel {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 2px solid var(--primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

.queue-panel.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.queue-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.queue-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.queue-count {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-full, 50px);
}

.queue-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.queue-close:hover {
    background: var(--primary);
    color: white;
}

.queue-close svg {
    width: 20px;
    height: 20px;
}

.queue-actions {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.queue-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.queue-action-btn:hover {
    background: var(--surface-hover, var(--surface));
    border-color: var(--primary);
    color: var(--primary);
}

.queue-action-btn svg {
    width: 14px;
    height: 14px;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.queue-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.queue-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.queue-empty p {
    margin: 0;
    font-weight: 600;
    color: var(--text-secondary);
}

.queue-empty span {
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.queue-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item:hover {
    background: var(--surface-hover, var(--bg-secondary));
}

.queue-item.current {
    background: linear-gradient(90deg, rgba(232, 93, 4, 0.15) 0%, transparent 100%);
    border-left: 3px solid var(--primary);
    padding-left: calc(var(--space-lg) - 3px);
}

.queue-item-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.queue-item.current .queue-item-num {
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.queue-item-art {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item.current .queue-item-title {
    color: var(--primary);
}

.queue-item-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.queue-item-duration {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.queue-item-round {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

/* Queue badge on player button */
.queue-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50%;
    padding: 0 4px;
}

.queue-badge:empty,
.queue-badge[data-count="0"] {
    display: none;
}

#btn-queue {
    position: relative;
}

#btn-queue.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

#btn-queue.active .queue-badge {
    background: white;
    color: var(--primary);
}

/* =========================================
   RECORD CRATES (Artist Sections)
   ========================================= */
.record-crates {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    padding: var(--space-lg) var(--space-md);
}

.artist-crate {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-secondary) 100%);
    border: 3px solid var(--store-wood);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-fast);
}

.artist-crate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--store-wood-dark), var(--store-wood), var(--store-wood-dark));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.artist-crate:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.2);
}

.artist-crate.hidden {
    display: none;
}

.crate-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px dashed var(--border);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.crate-artist-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.crate-artist-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.crate-artist-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.crate-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full, 50px);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 2px solid currentColor;
}

.crate-status.eliminated {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error, #ef4444);
}

.crate-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success, #10b981);
}

.crate-status.playing-today {
    background: rgba(232, 93, 4, 0.15);
    color: var(--primary, #E85D04);
    font-weight: 600;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 93, 4, 0); }
    50% { box-shadow: 0 0 8px 2px rgba(232, 93, 4, 0.3); }
}

/* =========================================
   RECORD SLEEVES (Browse Grid)
   ========================================= */
.crate-records {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-lg);
}

.record-sleeve {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform var(--transition-normal, 200ms ease);
}

.record-sleeve:hover {
    transform: translateY(-8px) scale(1.02);
}

.record-sleeve:hover .sleeve-vinyl {
    transform: translateX(25%);
}

.record-sleeve:active {
    transform: translateY(-4px) scale(1.01);
}

/* Album Art */
.sleeve-art {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2;
    background: var(--surface-alt, var(--surface));
}

.sleeve-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.record-sleeve:hover .sleeve-art img {
    transform: scale(1.05);
}

.sleeve-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover, #d45003) 100%);
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

/* Vinyl Record peeking out (browse grid) */
.sleeve-vinyl {
    position: absolute;
    top: 5%;
    right: -5%;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: var(--vinyl-outer);
    z-index: 1;
    transition: transform var(--transition-normal);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.vinyl-grooves {
    position: absolute;
    inset: 5%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        var(--vinyl-groove) 0px,
        var(--vinyl-outer) 1px,
        var(--vinyl-outer) 2px,
        var(--vinyl-groove) 3px
    );
}

.sleeve-vinyl .vinyl-label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 35%;
    height: 35%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--vinyl-label);
}

.sleeve-vinyl .vinyl-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8%;
    height: 8%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--vinyl-hole);
}

/* Song Info Overlay */
.sleeve-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 3;
}

.sleeve-title {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.sleeve-meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-xs);
}

.sleeve-round,
.sleeve-duration {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
}

/* No Audio Overlay */
.sleeve-no-audio {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    z-index: 4;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.record-sleeve:hover .sleeve-no-audio {
    opacity: 1;
}

.sleeve-no-audio span {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Playing State - grid sleeve */
.record-sleeve.playing {
    transform: translateY(-8px) scale(1.02);
}

.record-sleeve.playing .sleeve-art {
    box-shadow: 0 0 0 3px var(--primary), 0 8px 24px rgba(232, 93, 4, 0.3);
}

.record-sleeve.playing .sleeve-vinyl {
    transform: translateX(25%);
    animation: vinyl-spin-slow 3s linear infinite;
}

@keyframes vinyl-spin-slow {
    from { transform: translateX(25%) rotate(0deg); }
    to { transform: translateX(25%) rotate(360deg); }
}

/* =========================================
   COMBINED PLAYER BAR
   Fixed at bottom with proper mobile viewport handling
   ========================================= */
.records-player-bar {
    position: fixed;
    bottom: 0;
    left: env(safe-area-inset-left, 0);
    right: env(safe-area-inset-right, 0);
    background: var(--bg-elevated, var(--surface));
    border-top: 1px solid var(--border);
    /* Must be higher than mobile-nav (1000) and mini-player (200) */
    z-index: 1100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    /* Ensure proper stacking above browser chrome */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Add safe area padding for notched devices */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Now Playing Row */
.player-now-playing {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
}

/* Small Vinyl Animation Container */
.player-vinyl-container {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    cursor: pointer;
}

.player-vinyl {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        var(--vinyl-groove) 0px,
        var(--vinyl-black) 1px,
        var(--vinyl-black) 2px,
        var(--vinyl-groove) 3px
    );
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.player-vinyl-label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 40%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--vinyl-label);
}

.player-vinyl-label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20%;
    height: 20%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--vinyl-hole);
}

/* Spinning animation when playing */
.records-player-bar.playing .player-vinyl {
    animation: vinyl-spin 2s linear infinite;
}

@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Album Artwork (shown when paused for 10s) */
.player-artwork {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    background-color: var(--surface-alt, var(--surface));
    opacity: 0;
    z-index: 5;
    transition: opacity 0.5s ease;
}

.records-player-bar.show-artwork .player-artwork {
    opacity: 1;
}

.records-player-bar.show-artwork .player-vinyl {
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Song Info */
.player-song-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
}

.player-song-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-song-artist {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Queue Buttons (Shuffle/Repeat) */
.player-queue-btns {
    display: flex;
    gap: var(--space-xs);
}

.player-queue-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.player-queue-btn:hover {
    background: var(--surface-hover, var(--surface));
    border-color: var(--primary);
    color: var(--primary);
}

.player-queue-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.player-queue-btn svg {
    width: 16px;
    height: 16px;
}

/* Repeat badge for "1" indicator */
.repeat-badge {
    display: none;
}

#btn-repeat.repeat-one .repeat-badge {
    display: block;
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    font-size: 8px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    color: var(--primary);
}

#btn-repeat.repeat-one .repeat-badge::after {
    content: '1';
}

/* Audio Controls Row */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
}

/* Skip Buttons (10s) - inline layout like voting page */
.player-skip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 36px;
    padding: 0 var(--space-sm);
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.player-skip-btn:hover {
    background: var(--surface-hover, var(--surface));
    border-color: var(--primary);
    color: var(--primary);
}

.player-skip-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.player-skip-btn .skip-label {
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
}

/* Prev/Next Buttons */
.player-prev-btn,
.player-next-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.player-prev-btn:hover,
.player-next-btn:hover {
    background: var(--surface-hover, var(--surface));
    border-color: var(--primary);
    color: var(--primary);
}

.player-prev-btn svg,
.player-next-btn svg {
    width: 18px;
    height: 18px;
}

/* Play/Pause Button */
.player-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-fast);
    margin: 0 var(--space-xs);
}

.player-play-btn:hover {
    background: var(--primary-hover, #d45003);
    transform: scale(1.05);
}

/* Play/Pause icon toggle */
.player-play-btn .icon-play {
    display: block;
    width: 0;
    height: 0;
    border-left: 16px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 4px;
}

.player-play-btn .icon-pause {
    display: none;
    width: 16px;
    height: 16px;
}

.player-play-btn .icon-pause::before,
.player-play-btn .icon-pause::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 16px;
    background: white;
    margin: 0 2px;
}

.records-player-bar.playing .player-play-btn .icon-play {
    display: none;
}

.records-player-bar.playing .player-play-btn .icon-pause {
    display: flex;
}

/* Progress Bar Row */
.player-progress {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-sm);
}

.player-time {
    font-size: 0.7rem;
    font-family: var(--font-mono, monospace);
    color: var(--text-muted);
    min-width: 36px;
    text-align: center;
}

.player-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.player-progress-bar:hover {
    height: 8px;
}

.player-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    border-radius: 3px;
    position: relative;
    transition: width 0.1s linear;
}

/* Draggable thumb */
.player-progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.player-progress-bar:hover .player-progress-fill::after,
.player-progress-bar.dragging .player-progress-fill::after {
    opacity: 1;
}

/* Navigation Row (Mobile) */
.player-nav {
    display: none;
}

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-store {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
}

.empty-store-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    opacity: 0.5;
}

.empty-store h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-store p {
    margin: var(--space-xs) 0;
}

/* =========================================
   RESPONSIVE - TABLET
   ========================================= */
@media (max-width: 900px) {
    .crate-records {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-md);
    }

    .store-banner {
        padding: var(--space-xl) var(--space-md);
    }

    .vinyl-stack {
        width: 80px;
        height: 80px;
    }
}

/* =========================================
   RESPONSIVE - MOBILE
   ========================================= */
@media (max-width: 768px) {
    .record-store {
        padding: 0;
        /* Account for player bar height + safe area for notched devices */
        padding-bottom: calc(220px + env(safe-area-inset-bottom, 0));
    }

    .store-banner {
        padding: var(--space-xl) var(--space-sm);
    }

    .neon-text {
        letter-spacing: 0.08em;
        /* Reduce glow intensity on mobile for performance but keep the effect */
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 8px #ff9966,
            0 0 15px var(--primary),
            0 0 30px var(--primary),
            0 0 50px rgba(232, 93, 4, 0.4);
        /* Keep animation with reduced keyframes */
        animation: neon-glow-mobile 3s ease-in-out infinite alternate, neon-flicker-mobile 10s linear infinite;
    }

    .neon-text.accent {
        letter-spacing: 0.12em;
        text-shadow:
            0 0 2px #fff,
            0 0 4px #fff,
            0 0 8px #7fdbda,
            0 0 15px #4ecdc4,
            0 0 30px #4ecdc4,
            0 0 50px rgba(78, 205, 196, 0.4);
        animation: neon-glow-accent-mobile 3s ease-in-out infinite alternate;
        animation-delay: 0.5s;
    }

    .store-vinyl-decor {
        display: none;
    }

    /* Mobile-optimized pulsing glow (fewer shadow layers) */
    @keyframes neon-glow-mobile {
        0% {
            text-shadow:
                0 0 2px #fff,
                0 0 4px #fff,
                0 0 8px #ff9966,
                0 0 15px var(--primary),
                0 0 30px var(--primary),
                0 0 50px rgba(232, 93, 4, 0.4);
        }
        50% {
            text-shadow:
                0 0 3px #fff,
                0 0 6px #fff,
                0 0 12px #ff9966,
                0 0 22px var(--primary),
                0 0 40px var(--primary),
                0 0 60px rgba(232, 93, 4, 0.5);
        }
        100% {
            text-shadow:
                0 0 2px #fff,
                0 0 4px #fff,
                0 0 7px #ff9966,
                0 0 14px var(--primary),
                0 0 28px var(--primary),
                0 0 45px rgba(232, 93, 4, 0.35);
        }
    }

    @keyframes neon-glow-accent-mobile {
        0% {
            text-shadow:
                0 0 2px #fff,
                0 0 4px #fff,
                0 0 8px #7fdbda,
                0 0 15px #4ecdc4,
                0 0 30px #4ecdc4,
                0 0 50px rgba(78, 205, 196, 0.4);
        }
        50% {
            text-shadow:
                0 0 3px #fff,
                0 0 6px #fff,
                0 0 12px #7fdbda,
                0 0 22px #4ecdc4,
                0 0 40px #4ecdc4,
                0 0 60px rgba(78, 205, 196, 0.5);
        }
        100% {
            text-shadow:
                0 0 2px #fff,
                0 0 4px #fff,
                0 0 7px #7fdbda,
                0 0 14px #4ecdc4,
                0 0 28px #4ecdc4,
                0 0 45px rgba(78, 205, 196, 0.35);
        }
    }

    /* Mobile flicker - less frequent */
    @keyframes neon-flicker-mobile {
        0%, 24.99%, 25.99%, 100% {
            opacity: 1;
        }
        25%, 25.5% {
            opacity: 0.88;
        }
    }

    .store-header {
        padding: var(--space-md);
    }

    .store-stats {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .stat-divider {
        display: none;
    }

    .store-controls {
        padding: var(--space-md);
    }

    .store-filters {
        flex-direction: row;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: var(--space-xs);
        -webkit-overflow-scrolling: touch;
    }

    .filter-group {
        flex-shrink: 0;
    }

    .filter-select {
        min-width: 110px;
        font-size: 0.8rem;
        padding: var(--space-xs) var(--space-sm);
        padding-right: var(--space-lg);
    }

    .record-crates {
        padding: var(--space-md);
    }

    .crate-records {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--space-sm);
    }

    .sleeve-title {
        font-size: 0.7rem;
    }

    .sleeve-round,
    .sleeve-duration {
        font-size: 0.6rem;
    }

    .crate-artist-name {
        font-size: 1.2rem;
    }

    .crate-artist-icon {
        width: 36px;
        height: 36px;
    }

    .queue-panel {
        max-height: 50vh; /* Fallback */
        max-height: 50svh; /* Small viewport - stable height */
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .queue-header {
        padding: var(--space-sm) var(--space-md);
    }

    .queue-title {
        font-size: 1rem;
    }

    .queue-actions {
        padding: var(--space-xs) var(--space-md);
    }

    .queue-item {
        padding: var(--space-sm) var(--space-md);
    }

    .queue-item-art {
        width: 36px;
        height: 36px;
    }

    .queue-item-title {
        font-size: 0.85rem;
    }

    /* Combined Player Bar - Mobile Layout */
    .records-player-bar {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .player-now-playing {
        padding: var(--space-xs) var(--space-sm);
    }

    .player-vinyl-container {
        width: 38px;
        height: 38px;
    }

    .player-song-title {
        font-size: 0.85rem;
    }

    .player-queue-btns {
        gap: 4px;
    }

    .player-queue-btn {
        width: 32px;
        height: 32px;
    }

    .player-queue-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Controls Row */
    .player-controls {
        padding: var(--space-xs) var(--space-sm);
    }

    .player-skip-btn {
        height: 32px;
        padding: 0 var(--space-xs);
        gap: 2px;
    }

    .player-skip-btn .skip-label {
        font-size: 0.6rem;
    }

    .player-prev-btn,
    .player-next-btn {
        width: 36px;
        height: 36px;
    }

    .player-play-btn {
        width: 48px;
        height: 48px;
    }

    .player-play-btn .icon-play {
        border-left-width: 14px;
        border-top-width: 8px;
        border-bottom-width: 8px;
    }

    /* Progress */
    .player-progress {
        padding: 0 var(--space-sm) var(--space-xs);
    }

    /* Navigation Row - Show on Mobile */
    .player-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: var(--space-xs) var(--space-sm);
        border-top: 1px solid var(--border);
        background: var(--bg-secondary, var(--surface));
    }

    .player-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--space-xs);
        color: var(--text-secondary);
        text-decoration: none;
        transition: color var(--transition-fast);
        min-width: 48px;
    }

    .player-nav-item svg {
        width: 24px;
        height: 24px;
    }

    .player-nav-item.active {
        color: var(--primary);
    }

    .player-nav-item:hover {
        color: var(--primary);
    }
}

@media (max-width: 480px) {
    .record-store {
        padding-bottom: 200px;
    }

    .store-banner {
        padding: var(--space-lg) var(--space-sm);
    }

    .neon-text {
        font-size: 2rem;
        letter-spacing: 0.05em;
        /* Minimal glow on small screens */
        text-shadow:
            0 0 2px #fff,
            0 0 5px #ff9966,
            0 0 15px var(--primary),
            0 0 30px rgba(232, 93, 4, 0.4);
        /* Keep subtle animation on small screens */
        animation: neon-glow-small 3s ease-in-out infinite alternate, neon-flicker-small 12s linear infinite;
    }

    .neon-text.accent {
        font-size: 1.3rem;
        letter-spacing: 0.1em;
        text-shadow:
            0 0 2px #fff,
            0 0 5px #7fdbda,
            0 0 15px #4ecdc4,
            0 0 30px rgba(78, 205, 196, 0.4);
        animation: neon-glow-accent-small 3s ease-in-out infinite alternate;
        animation-delay: 0.5s;
    }

    /* Small screen optimized animations */
    @keyframes neon-glow-small {
        0% {
            text-shadow:
                0 0 2px #fff,
                0 0 5px #ff9966,
                0 0 15px var(--primary),
                0 0 30px rgba(232, 93, 4, 0.4);
        }
        50% {
            text-shadow:
                0 0 3px #fff,
                0 0 8px #ff9966,
                0 0 20px var(--primary),
                0 0 38px rgba(232, 93, 4, 0.5);
        }
        100% {
            text-shadow:
                0 0 2px #fff,
                0 0 4px #ff9966,
                0 0 13px var(--primary),
                0 0 26px rgba(232, 93, 4, 0.35);
        }
    }

    @keyframes neon-glow-accent-small {
        0% {
            text-shadow:
                0 0 2px #fff,
                0 0 5px #7fdbda,
                0 0 15px #4ecdc4,
                0 0 30px rgba(78, 205, 196, 0.4);
        }
        50% {
            text-shadow:
                0 0 3px #fff,
                0 0 8px #7fdbda,
                0 0 20px #4ecdc4,
                0 0 38px rgba(78, 205, 196, 0.5);
        }
        100% {
            text-shadow:
                0 0 2px #fff,
                0 0 4px #7fdbda,
                0 0 13px #4ecdc4,
                0 0 26px rgba(78, 205, 196, 0.35);
        }
    }

    /* Rare flicker on small screens */
    @keyframes neon-flicker-small {
        0%, 29.99%, 30.99%, 100% {
            opacity: 1;
        }
        30%, 30.4% {
            opacity: 0.9;
        }
    }

    .crate-records {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .sleeve-placeholder {
        font-size: 2rem;
    }

    .crate-label {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .player-vinyl-container {
        width: 34px;
        height: 34px;
    }

    .player-skip-btn {
        height: 28px;
        padding: 0 6px;
    }

    .player-skip-btn svg {
        width: 12px;
        height: 12px;
    }

    .player-skip-btn .skip-label {
        font-size: 0.55rem;
    }

    .player-prev-btn,
    .player-next-btn {
        width: 32px;
        height: 32px;
    }

    .player-prev-btn svg,
    .player-next-btn svg {
        width: 16px;
        height: 16px;
    }

    .player-play-btn {
        width: 44px;
        height: 44px;
    }
}

/* =========================================
   SONG INFO MODAL
   ========================================= */
.song-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.song-modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.song-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s ease;
}

.song-modal-overlay.open .song-modal {
    transform: scale(1) translateY(0);
}

.song-modal-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.song-modal-close:hover {
    background: var(--error);
}

/* Art Group */
.song-modal-art-group {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary);
}

.song-modal-artwork {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-alt, var(--surface));
}

.song-modal-artist-icon {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-md);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--surface);
    border: 3px solid var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Song Info */
.song-modal-info {
    padding: var(--space-lg);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.song-modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
}

.song-modal-artist {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-sm);
}

.song-modal-round {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Matchup Stats */
.song-modal-matchup {
    padding: var(--space-lg);
}

.song-modal-matchup-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.matchup-result {
    font-weight: 700;
    font-size: 1.1rem;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
}

.matchup-result.won {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.matchup-result.lost {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.matchup-vs {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Opponent info with artwork */
.matchup-opponent-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.matchup-opponent-art {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    background-color: var(--surface);
    flex-shrink: 0;
}

.matchup-opponent-details {
    flex: 1;
    min-width: 0;
}

.matchup-opponent-song {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matchup-opponent-artist {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Vote Bar */
.song-modal-vote-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border);
    margin-bottom: var(--space-md);
}

.vote-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.vote-bar-fill.artist-fill {
    background: var(--primary);
}

.vote-bar-fill.opponent-fill {
    background: var(--text-muted);
}

/* Scores */
.song-modal-scores {
    display: flex;
    justify-content: space-between;
}

.score-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.score-side.opponent {
    align-items: flex-end;
    color: var(--text-muted);
}

.score-votes {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.score-side.opponent .score-votes {
    color: var(--text-secondary);
}

.score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-avg {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* No matchup message */
.song-modal-no-matchup {
    display: none;
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.song-modal-no-matchup p {
    margin: 0;
}

/* Hide matchup section when no matchup */
.song-modal-matchup.hidden {
    display: none;
}

.song-modal-no-matchup.visible {
    display: block;
}

/* Mobile */
@media (max-width: 480px) {
    .song-modal {
        max-width: 100%;
        margin: var(--space-sm);
    }

    .song-modal-title {
        font-size: 1.25rem;
    }

    .song-modal-artist-icon {
        width: 48px;
        height: 48px;
    }
}

/* =========================================
   ANIMATIONS - Reduced Motion
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    .record-sleeve,
    .sleeve-vinyl,
    .sleeve-art img,
    .player-vinyl {
        transition: none;
    }

    .record-sleeve.playing .sleeve-vinyl,
    .records-player-bar.playing .player-vinyl {
        animation: none;
    }

    .song-modal-overlay,
    .song-modal {
        transition: none;
    }

    /* Disable neon animations */
    .neon-text,
    .neon-text.accent {
        animation: none !important;
    }
}

/* =========================================
   PLAYLIST FEATURES
   ========================================= */

/* Add to Playlist Button on Record Sleeve */
.sleeve-add-playlist {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-fast);
    z-index: 5;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sleeve-add-playlist svg {
    width: 18px;
    height: 18px;
}

.record-sleeve:hover .sleeve-add-playlist {
    opacity: 1;
    transform: scale(1);
}

.sleeve-add-playlist:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.sleeve-add-playlist:active {
    transform: scale(0.95);
}

/* =========================================
   PLAYLIST MODAL
   ========================================= */
.playlist-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.playlist-modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.playlist-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 380px;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.playlist-modal-overlay.open .playlist-modal {
    transform: scale(1) translateY(0);
}

.playlist-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.playlist-modal-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.playlist-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.playlist-modal-close:hover {
    background: var(--error);
    color: white;
}

.playlist-modal-close svg {
    width: 20px;
    height: 20px;
}

/* Playlist List in Modal */
.playlist-modal-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-sm) 0;
}

.playlist-modal-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
}

.playlist-modal-item:hover {
    background: var(--surface-hover, var(--bg-secondary));
}

.playlist-modal-item-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover, #d45003) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.playlist-modal-item-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.playlist-modal-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-modal-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-modal-item-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.playlist-modal-item-add {
    color: var(--text-muted);
    flex-shrink: 0;
}

.playlist-modal-item-add svg {
    width: 20px;
    height: 20px;
}

.playlist-modal-item:hover .playlist-modal-item-add {
    color: var(--primary);
}

/* Empty playlist list */
.playlist-modal-empty {
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
}

.playlist-modal-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.playlist-modal-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Create Playlist Form */
.playlist-modal-create {
    border-top: 1px solid var(--border);
    padding: var(--space-md) var(--space-lg);
    flex-shrink: 0;
}

.playlist-create-form {
    display: flex;
    gap: var(--space-sm);
}

.playlist-create-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.playlist-create-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}

.playlist-create-input::placeholder {
    color: var(--text-muted);
}

.playlist-create-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.playlist-create-btn:hover {
    background: var(--primary-hover, #d45003);
}

.playlist-create-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================================
   MY PLAYLISTS SECTION
   ========================================= */
.playlists-section {
    padding: var(--space-xl) var(--space-md);
    background: var(--bg-secondary);
    border-top: 3px solid var(--store-wood);
}

.playlists-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.playlists-section-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.playlists-section-header h2 svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.playlist-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 2px solid var(--border);
    transition: all var(--transition-fast);
    position: relative;
}

.playlist-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.playlist-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover, #d45003) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.playlist-card-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.playlist-card-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 var(--space-md);
}

.playlist-card-actions {
    display: flex;
    gap: var(--space-sm);
}

.playlist-card-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.playlist-card-btn svg {
    width: 16px;
    height: 16px;
}

.playlist-card-btn.play-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.playlist-card-btn.play-btn:hover {
    background: var(--primary-hover, #d45003);
    border-color: var(--primary-hover, #d45003);
}

.playlist-card-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* Empty Playlists State */
.playlists-empty {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.playlists-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.playlists-empty p {
    margin: 0 0 var(--space-sm);
    font-size: 1rem;
    color: var(--text-secondary);
}

.playlists-empty span {
    font-size: 0.85rem;
}

/* =========================================
   PLAYLIST TOAST
   ========================================= */
.playlist-toast {
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full, 50px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.playlist-toast.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.playlist-toast.success {
    border-color: #22c55e;
}

.playlist-toast.error {
    border-color: var(--error);
}

/* =========================================
   PLAYLIST RESPONSIVE - MOBILE
   ========================================= */
@media (max-width: 768px) {
    .sleeve-add-playlist {
        width: 28px;
        height: 28px;
    }

    .sleeve-add-playlist svg {
        width: 14px;
        height: 14px;
    }

    .playlist-modal {
        max-width: 100%;
        margin: var(--space-sm);
        max-height: 85vh;
    }

    .playlist-modal-header {
        padding: var(--space-md);
    }

    .playlist-modal-header h3 {
        font-size: 1.1rem;
    }

    .playlist-modal-item {
        padding: var(--space-sm) var(--space-md);
    }

    .playlist-modal-item-icon {
        width: 40px;
        height: 40px;
    }

    .playlist-modal-create {
        padding: var(--space-sm) var(--space-md);
    }

    .playlists-section {
        padding: var(--space-lg) var(--space-md);
    }

    .playlists-section-header h2 {
        font-size: 1.25rem;
    }

    .playlists-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-sm);
    }

    .playlist-card {
        padding: var(--space-md);
    }

    .playlist-card-icon {
        width: 48px;
        height: 48px;
    }

    .playlist-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .playlist-card-name {
        font-size: 1rem;
    }

    .playlist-card-actions {
        flex-direction: column;
    }

    .playlist-toast {
        bottom: 230px;
        max-width: calc(100% - var(--space-lg) * 2);
    }
}

@media (max-width: 480px) {
    .playlists-grid {
        grid-template-columns: 1fr;
    }

    .playlist-card-actions {
        flex-direction: row;
    }
}

/* =========================================
   PLAYLIST UI ENHANCEMENTS
   ========================================= */

/* Song title in modal header */
.modal-song-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

/* Playlists Section Header */
.playlists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.playlists-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.playlists-title svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.playlists-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.playlists-toggle:hover {
    background: var(--surface-hover, var(--surface));
    color: var(--primary);
}

.playlists-toggle svg {
    width: 20px;
    height: 20px;
}

.playlists-toggle .icon-collapse {
    display: none;
}

.playlists-section.collapsed .playlists-toggle .icon-expand {
    display: none;
}

.playlists-section.collapsed .playlists-toggle .icon-collapse {
    display: block;
}

.playlists-section.collapsed .playlists-grid {
    display: none;
}

.playlists-section.hidden {
    display: none;
}

/* Loading states */
.playlist-modal-item.loading,
.playlist-play-btn.loading,
.playlist-delete-btn.loading,
.playlist-create-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.playlist-modal-item.loading::after,
.playlist-play-btn.loading::after,
.playlist-delete-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success state for add button */
.sleeve-add-playlist.success {
    background: #22c55e !important;
    transform: scale(1.2) !important;
    opacity: 1 !important;
}

.sleeve-add-playlist.success svg {
    color: white;
}

/* Shake animation for empty input */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease;
    border-color: var(--error) !important;
}

/* Removing animation for cards */
.playlist-card.removing {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
    transition: all 0.3s ease;
}

/* Modal list item styling improvements */
.playlist-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.playlist-modal-item:last-child {
    border-bottom: none;
}

.playlist-modal-item:hover {
    background: linear-gradient(90deg, rgba(232, 93, 4, 0.1) 0%, transparent 100%);
}

.playlist-modal-item:active {
    background: rgba(232, 93, 4, 0.2);
}

.playlist-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: var(--space-md);
    white-space: nowrap;
}

/* Modal create section styling */
.playlist-modal-create {
    display: flex;
    gap: var(--space-sm);
    border-top: 1px solid var(--border);
    padding: var(--space-md) var(--space-lg);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

#new-playlist-name {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px; /* Prevents iOS zoom on focus */
    transition: all var(--transition-fast);
}

#new-playlist-name:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}

#new-playlist-name::placeholder {
    color: var(--text-muted);
}

#playlist-create-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-width: 80px;
}

#playlist-create-btn:hover:not(:disabled) {
    background: var(--primary-hover, #d45003);
    transform: translateY(-1px);
}

#playlist-create-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Empty playlist modal message */
.playlist-modal-empty {
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Playlist card improvements */
.playlist-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.playlist-card-art {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover, #d45003) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    flex-shrink: 0;
}

.playlist-card-art svg {
    width: 28px;
    height: 28px;
    color: white;
}

.playlist-card-info {
    flex: 1;
    min-width: 0;
    margin-bottom: var(--space-md);
}

.playlist-play-btn,
.playlist-delete-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.playlist-play-btn svg,
.playlist-delete-btn svg {
    width: 18px;
    height: 18px;
}

.playlist-play-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.playlist-play-btn:hover {
    background: var(--primary-hover, #d45003);
    border-color: var(--primary-hover, #d45003);
    transform: scale(1.05);
}

.playlist-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.playlist-card-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* Toast type colors */
.playlist-toast.success {
    border-color: #22c55e;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(34, 197, 94, 0.1) 100%);
}

.playlist-toast.error {
    border-color: var(--error);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(239, 68, 68, 0.1) 100%);
}

.playlist-toast.info {
    border-color: var(--primary);
}

/* Mobile enhancements */
@media (max-width: 768px) {
    .modal-song-title {
        max-width: 200px;
    }

    .playlists-header {
        margin-bottom: var(--space-md);
    }

    .playlists-title {
        font-size: 1.25rem;
    }

    .playlists-title svg {
        width: 20px;
        height: 20px;
    }

    .playlist-card-art {
        width: 48px;
        height: 48px;
    }

    .playlist-card-art svg {
        width: 24px;
        height: 24px;
    }

    .playlist-play-btn,
    .playlist-delete-btn {
        width: 36px;
        height: 36px;
    }

    .playlist-play-btn svg,
    .playlist-delete-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* =========================================
   PLAYLIST ADD MODAL - Checkbox Style Items
   ========================================= */
.playlist-modal-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 100px;
    max-height: 300px;
}

.playlist-modal-loading {
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
}

.playlist-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.playlist-checkbox-item:last-child {
    border-bottom: none;
}

.playlist-checkbox-item:hover {
    background: var(--surface-hover, var(--bg-secondary));
}

.playlist-checkbox-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

.playlist-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.playlist-checkbox-item.checked .playlist-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.playlist-checkbox svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.playlist-checkbox-item.checked .playlist-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.playlist-checkbox-info {
    flex: 1;
    min-width: 0;
}

.playlist-checkbox-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: block;
}

.playlist-checkbox-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =========================================
   PLAYLIST DETAIL MODAL
   ========================================= */
.playlist-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.playlist-detail-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.playlist-detail-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.playlist-detail-overlay.open .playlist-detail-modal {
    transform: scale(1) translateY(0);
}

.playlist-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.playlist-detail-info {
    flex: 1;
    min-width: 0;
}

.playlist-detail-info h3 {
    margin: 0 0 var(--space-xs);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-detail-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.playlist-detail-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-left: var(--space-md);
}

.playlist-detail-close:hover {
    background: var(--error);
    color: white;
}

.playlist-detail-actions {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.playlist-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.playlist-action-btn svg {
    width: 16px;
    height: 16px;
}

.playlist-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.playlist-action-btn.play-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.playlist-action-btn.play-btn:hover {
    background: var(--primary-hover, #d45003);
}

.playlist-action-btn.shuffle-btn:hover {
    background: rgba(78, 205, 196, 0.1);
    border-color: #4ecdc4;
    color: #4ecdc4;
}

.playlist-action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.playlist-detail-songs {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.playlist-detail-loading,
.playlist-detail-empty {
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
}

.playlist-song-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.playlist-song-item:last-child {
    border-bottom: none;
}

.playlist-song-item:hover {
    background: var(--surface-hover, var(--bg-secondary));
}

.playlist-song-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.playlist-song-art {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    flex-shrink: 0;
    cursor: pointer;
}

.playlist-song-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.playlist-song-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-song-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-song-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    margin-right: var(--space-xs);
}

.playlist-song-duration {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.playlist-song-round {
    font-family: var(--font-mono, monospace);
    font-size: 0.65rem;
    color: var(--accent);
    background: var(--accent-dim, rgba(232, 93, 4, 0.15));
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.playlist-song-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    opacity: 0;
}

.playlist-song-item:hover .playlist-song-remove {
    opacity: 1;
}

.playlist-song-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.playlist-song-remove svg {
    width: 16px;
    height: 16px;
}

/* =========================================
   RENAME MODAL
   ========================================= */
.rename-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.rename-modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rename-modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.25s ease;
}

.rename-modal-overlay.open .rename-modal {
    transform: scale(1);
}

.rename-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.rename-modal-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rename-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.rename-modal-close:hover {
    background: var(--error);
    color: white;
}

.rename-modal-content {
    padding: var(--space-lg);
}

#rename-playlist-input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px; /* Prevents iOS zoom */
    margin-bottom: var(--space-lg);
    transition: all var(--transition-fast);
}

#rename-playlist-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.15);
}

.rename-modal-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.rename-cancel-btn,
.rename-save-btn {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rename-cancel-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.rename-cancel-btn:hover {
    background: var(--surface-hover, var(--surface));
    color: var(--text-primary);
}

.rename-save-btn {
    background: var(--primary);
    border: none;
    color: white;
}

.rename-save-btn:hover {
    background: var(--primary-hover, #d45003);
}

/* Mobile adjustments for playlist modals */
@media (max-width: 768px) {
    .playlist-detail-modal {
        max-width: 100%;
        margin: var(--space-sm);
        max-height: 90vh;
    }

    .playlist-detail-info h3 {
        font-size: 1.25rem;
    }

    .playlist-detail-actions {
        padding: var(--space-sm) var(--space-md);
    }

    .playlist-action-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8rem;
    }

    .playlist-song-item {
        padding: var(--space-sm) var(--space-md);
    }

    .playlist-song-art {
        width: 40px;
        height: 40px;
    }

    .playlist-song-meta {
        margin-right: 0;
    }

    .playlist-song-duration {
        font-size: 0.7rem;
    }

    .playlist-song-round {
        font-size: 0.6rem;
    }

    .playlist-song-remove {
        opacity: 1;
    }

    .rename-modal {
        max-width: calc(100% - var(--space-lg));
    }
}

/* =========================================
   PWA / STANDALONE MODE
   ========================================= */
@media (max-width: 768px) {
    /* When in standalone/PWA mode on mobile */
    .pwa-standalone .records-player-bar {
        /* Ensure proper safe area handling in standalone */
        padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom, 8px));
    }

    /* Adjust content area for standalone (full viewport available) */
    .pwa-standalone .record-store {
        min-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
}

/* =========================================
   SCROLL TO TOP BUTTON
   ========================================= */
.scroll-to-top {
    position: fixed;
    bottom: 200px;
    right: var(--space-md);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.25s ease;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--primary-hover, #d45003);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.scroll-to-top:active {
    transform: translateY(0);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 220px;
        right: var(--space-sm);
        width: 44px;
        height: 44px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* =========================================
   FAVORITES BUTTON & BADGE
   ========================================= */
.favorites-btn {
    position: relative;
}

.favorites-btn svg {
    transition: all var(--transition-fast);
}

.favorites-btn.active svg {
    fill: #ff6b9d;
    stroke: #ff6b9d;
}

.favorites-btn:hover svg {
    stroke: #ff6b9d;
}

.favorites-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff6b9d;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.favorites-btn.has-favorites .favorites-badge {
    opacity: 1;
    transform: scale(1);
}

/* =========================================
   SLEEVE FAVORITE BUTTON (HEART)
   ========================================= */
.sleeve-favorite {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-fast);
    z-index: 5;
}

.record-sleeve:hover .sleeve-favorite {
    opacity: 1;
    transform: scale(1);
}

.sleeve-favorite svg {
    width: 18px;
    height: 18px;
    transition: all var(--transition-fast);
}

.sleeve-favorite .heart-outline {
    color: white;
}

.sleeve-favorite .heart-filled {
    color: #ff6b9d;
    display: none;
}

.sleeve-favorite.favorited .heart-outline {
    display: none;
}

.sleeve-favorite.favorited .heart-filled {
    display: block;
}

.sleeve-favorite.favorited {
    opacity: 1;
    background: rgba(255, 107, 157, 0.2);
}

.sleeve-favorite:hover {
    background: rgba(255, 107, 157, 0.3);
    transform: scale(1.1);
}

.sleeve-favorite:hover .heart-outline {
    color: #ff6b9d;
}

/* Pop animation when favoriting */
@keyframes heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.sleeve-favorite.just-favorited {
    animation: heart-pop 0.3s ease;
}

/* Touch devices - always show heart button */
@media (hover: none) {
    .sleeve-favorite {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .sleeve-favorite {
        width: 28px;
        height: 28px;
    }

    .sleeve-favorite svg {
        width: 14px;
        height: 14px;
    }
}

/* =========================================
   FAVORITES PLAYLIST CARD SPECIAL STYLING
   ========================================= */
.playlist-card.favorites-playlist .playlist-card-art.favorites-art {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff4081 100%);
}

.playlist-card.favorites-playlist:hover {
    border-color: #ff6b9d;
}

.playlist-card.favorites-playlist .playlist-play-btn {
    background: #ff6b9d;
    border-color: #ff6b9d;
}

.playlist-card.favorites-playlist .playlist-play-btn:hover {
    background: #ff4081;
    border-color: #ff4081;
}

/* =========================================
   DEFAULT PLAYLIST CARD STYLING
   ========================================= */
.playlist-card.default-playlist {
    opacity: 0.9;
}

.playlist-card.default-playlist:hover {
    opacity: 1;
}

/* Trophy icon - Tournament Songs */
.playlist-card.trophy-playlist .playlist-card-art.trophy-art {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.playlist-card.trophy-playlist:hover {
    border-color: #fbbf24;
}

.playlist-card.trophy-playlist .playlist-play-btn {
    background: #fbbf24;
    border-color: #fbbf24;
}

.playlist-card.trophy-playlist .playlist-play-btn:hover {
    background: #f59e0b;
    border-color: #f59e0b;
}

/* Headphones icon - Unheard Songs */
.playlist-card.headphones-playlist .playlist-card-art.headphones-art {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.playlist-card.headphones-playlist:hover {
    border-color: #8b5cf6;
}

.playlist-card.headphones-playlist .playlist-play-btn {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.playlist-card.headphones-playlist .playlist-play-btn:hover {
    background: #7c3aed;
    border-color: #7c3aed;
}

/* Round icon - Round playlists */
.playlist-card.round-playlist .playlist-card-art.round-art {
    background: linear-gradient(135deg, #4ecdc4 0%, #26a69a 100%);
}

.playlist-card.round-playlist:hover {
    border-color: #4ecdc4;
}

.playlist-card.round-playlist .playlist-play-btn {
    background: #4ecdc4;
    border-color: #4ecdc4;
}

.playlist-card.round-playlist .playlist-play-btn:hover {
    background: #26a69a;
    border-color: #26a69a;
}

/* Default playlist - no delete button, just play */
.playlist-card.default-playlist .playlist-card-actions {
    justify-content: center;
}

/* Hidden class for action buttons */
.playlist-action-btn.hidden {
    display: none !important;
}
