
        :root {
            --bg-color: #121212;
            --card-bg: #1e1e1e;
            --text-main: #ffffff;
            --text-dim: #b3b3b3;
            --accent: #1db954; 
        }

        body {
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-main);
            margin: 0;
            padding: 20px;
        }

        .header-controls {
            position: sticky;
            top: 0;
            background-color: var(--bg-color);
            padding: 10px 0 20px 0;
            z-index: 100;
            text-align: center;
            border-bottom: 1px solid #333;
        }

#searchInput {
    width: 280px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-column {
    display: contents;
}

.controls-row {
    display: contents;
}

@media screen and (max-width: 600px) {
    .mobile-column {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }
}



@media screen and (max-width: 600px) {
    .controls-row {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        gap: 5px;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 0 !important;
    }

    input[type="text"], select {
        margin: 0 !important;
    }

    h1 {
		margin-top: -5px !important;
		margin-bottom: 0px !important;
}
	
	h2 {
        margin-bottom: -10px !important;
    }

    body {
        padding-top: 14px !important;
    }

    .header-controls {
        padding-top: 0 !important;
    }
}

        input[type="text"], select {
            padding: 12px 20px;
            border-radius: 25px;
            border: 1px solid #444;
            background: var(--card-bg);
            color: white;
            font-size: 15px;
            outline: none;
            margin: 0;
        }

        input[type="text"] { max-width: 100%; }

        #counter {
            margin-top: 15px;
            color: var(--text-dim);
            font-size: 16px;
        }

        /* THE GRID */
		
		.grid-container, 
#recordGrid {
    border-top: none !important;
    padding-top: 10px; /* Optional: adds a tiny bit of air so records don't touch the letters */
    margin-top: 0 !important;
}
		
   #recordGrid {
    display: grid;
    /* FIX: Changed 1fr to a fixed max size (like 220px) */
    grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
    gap: 25px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    
    /* This centers the group of cards within the 1200px container */
    justify-content: center; 
}

.record-card {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
    border: none;
    text-align: left;
}

        .record-card:hover {
            transform: translateY(-5px);
            border-color: #555;
        }

        .record-card img {
            width: 100%;
            aspect-ratio: 1 / 1;
            object-fit: cover;
            display: block;
            background-color: #282828;
        }

        .card-content { padding: 12px; }

        .card-artist {
            display: block;
            font-weight: bold;
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .card-title {
            display: block;
            font-size: 12px;
            color: var(--text-dim);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 8px;
        }

        .search-wrapper:hover #clearSearch {
			color: var(--accent);
		}
		
.alphabet-bar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #121212;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    width: 100%;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.letter-btn,
.alphabet-bar button {
    background: none;
    border: none;
    color: #888;
    font-size: 19px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 6px 2px 6px !important;
    margin: 0;
    line-height: 1;
    height: auto !important;
    display: inline-block;
    transition: color 0.2s;
    border-radius: 4px;
}

.letter-btn:hover {
    color: var(--accent, #1db954);
    background: rgba(255, 255, 255, 0.1);
}

.letter-btn.active {
    color: #000;
    background: var(--accent);
}



.sticky-nav {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #121212;
    border-top: none !important;
    border-bottom: none !important;
    padding: 0 !important;
    margin: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#counter {
    display: block !important;
    text-align: center !important;
    width: 100%;
    font-family: sans-serif;
    font-size: 14px;
    color: var(--text-dim);
    margin: 5px 0 !important;
    padding-bottom: 0px !important;
}




.header-controls {
    position: relative;
    background-color: #121212;
    padding: 0px 0 20px 0;
    z-index: 100;
    text-align: center;
    border-bottom: none !important;
}


.header-controls > div {
    justify-content: center;
}

/* Mobile Styles (Screens smaller than 768px) */
/* --- 1. THE PARENT CONTAINER (The "Traffic Controller") --- */
.header-controls > div {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    height: auto !important;         /* Let the container grow, not the boxes */
}

/* --- 2. THE BOXES (Format, Sort) --- */
#searchType,
#formatInput {
    min-width: 120px;
}

#formatInput, 
#sortInput {
    height: 45px !important; 
    min-height: 45px !important;
    max-height: 45px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}



/* --- 4. PHONE SPECIFIC (The "Snap") --- */
@media screen and (max-width: 600px) {
    .header-controls > div {
        padding: 0 !important;
    }

    /* Row 1: Search box - full width */
    .search-wrapper {
        width: 100% !important;
        max-width: none !important;
        flex: 1 !important;
        height: 45px !important;
    }

    #searchInput {
        width: 100% !important;
    }

    /* Row 2: All Fields + All Formats - equal halves */
    #searchType,
    #formatInput {
        flex: 1 !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 45px !important;
    }

    /* Row 3: Sort - takes remaining space after buttons */
    #sortInput {
        flex: 1 !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 45px !important;
    }

    #resetBtn {
        flex-shrink: 0 !important;
        width: 90px !important;
    }

    #pickRandomBtn {
        flex-shrink: 0 !important;
        width: 45px !important;
        min-width: 45px !important;
    }

    #resetBtn, #pickRandomBtn {
        margin-top: 0 !important;
    }
}

@media screen and (max-width: 600px) {
    /* 1. Target the container that holds all your record cards */
    /* Replace '.record-grid' with the actual class name of your container */
    .recordGrid, #recordGrid, .grid-container {
        display: grid !important;
        /* This creates 3 equal columns, making the images much smaller */
        grid-template-columns: repeat(3, 1fr) !important; 
        gap: 8px !important; /* Tighter gaps look better with smaller images */
        padding: 10px !important;
    }

    /* 2. Ensure the images inside the cards scale down correctly */
    .record-card img, .album-art, .grid-item img {
        width: 100% !important;
        height: auto !important;
        border-radius: 4px !important; /* Slightly rounder corners look better when small */
    }

    /* 3. Optional: Hide or shrink text if it's taking up too much space */
    .record-info {
        font-size: 11px !important; /* Smaller text for smaller cards */
        line-height: 1.2 !important;
    }

   
}

    

/* ==========================================
   2. MOBILE STYLES (Under 600px)
   ========================================== */

  
.grid-img {
    pointer-events: none;
    display: block;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.grid-img[src] {
    opacity: 1;
}

@media (max-width: 600px) {
    /* 1. Force the container to NOT be sticky */
    div[class*="header"], 
    .search-wrapper, 
    .sticky-header {
        position: static !important;
    }

    /* 2. Force the Alphabet Row to be sticky */
    #alphabetRow {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
        background-color: #121212 !important;
        display: block !important;
    }
}

/* Container for Details and Image */
.top-container {
    display: flex; 
    gap: 30px; 
    flex-wrap: wrap; 
    margin-bottom: 30px;
    align-items: flex-start;
}

.details-box {
    flex: 1; 
    min-width: 300px; 
    background: #282828; 
    padding: 15px 20px; 
    border-radius: 8px; 
    border: 1px solid #414141;
    display: flex; 
    flex-direction: column;
}

.image-box {
    flex: 0 0 350px; 
    max-width: 100%;
}

.image-box img {
    width: 100%; 
    display: block; 
    border-radius: 8px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
	margin-bottom: 0px !important;
}

.notes-section {
	border-radius: 8px;
	border: 1px solid #414141;
}

.tracklist-container {
	border-radius: 8px;
	border: 1px solid #414141;
}	


/* Mobile adjustments */

@media (max-width: 600px) {
    /* 1. Use Grid to lock row spacing */
    .top-container {
        display: grid !important;
        grid-template-columns: 100% !important;
        row-gap: 0px !important; 
		margin-left: -10px !important;
		margin-right: -10px !important;
    }

    /* 2. The Image Container - Shrink-wraps any image shape */
    .image-box {
        width: calc(100% - 24px) !important;
        margin: -8px 12px 10px 12px !important; 
        order: 1 !important;
        
        background-color: var(--card-bg) !important; 
        border-radius: 12px !important;
        
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 15px 0 !important; 
        
        height: auto !important;
        min-height: 0 !important;
    }

    .image-box img {
        max-width: 85% !important; 
        max-height: 400px !important; 
        width: auto !important;
        height: auto !important;
        
        display: block !important;
        border-radius: 8px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.6);
        object-fit: contain;
    }

    /* 3. The Details Box - Stays perfectly glued to the image-box */
    .details-box {
        width: calc(100% - 24px) !important; 
        margin: -5px 12px 0 12px !important;
        box-sizing: border-box;
        order: 2 !important;
    }

    /* 4. Notes + Tracklist */
    .notes-section, 
    .tracklist-container {
        width: calc(100% - 5px) !important;
        margin: 15px -5px 0 3px !important;
        box-sizing: border-box;
    }

    /* 5. Text Alignment */
    .album-header h1 {
        padding-left: 7px !important; 
        margin-bottom: 2px !important;
    }

    .album-header h2 {
        padding-left: 10px !important;
        margin-top: 0 !important;
		}
}



/* ==========================================
   Details Page
   ========================================== */

.page-wrapper {
    max-width: 900px;
    margin: -10px auto 0 auto;
    padding: 0 0px 10px 0px;
}

.details-page h1 { margin: 0; color: #1db954; font-size: 2.5em; line-height: 1.1; }
.details-page h2 { margin: 5px 0; color: #eee; font-weight: 300; }

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #1e1e1e;
    padding: 15px 10px 30px 10px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.tracklist {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tracklist td {
    padding: 1px 10px;
    border-bottom: none;
    background: transparent;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pos {
    width: 1% !important; /* This makes it only as wide as the number/text */
    color: #1db954;
    font-size: 1.0em;
    white-space: nowrap !important; /* Keeps "DVD 201" on one line */
    padding-right: 15px !important; /* This controls the gap before the title */
    display: table-cell; /* Ensure it behaves like a table part */
}


.duration {
    text-align: right;
    color: #888;
    width: 1% !important; /* Shrinks to fit the time (e.g., 3:45) */
    white-space: nowrap !important;
    padding-left: 10px; /* Gap between title and time */
}

@media (max-width: 600px) {
    .tracklist td {
        padding: 1px 4px;
    }

    .tracklist td:nth-child(2) {
        padding-top: 0px;
        vertical-align: top;
    }

    .pos {
        width: 30px;
        font-size: 1.0em;
        padding-left: 12px !important;
        margin-top: 0px;
    }

    .duration {
        width: 50px;
        font-size: 1em;
    }

    .tracklist td:nth-child(2) {
        padding-top: 0px;
    }

    .tracklist td:nth-child(1),
    .tracklist td:nth-child(3) {
        padding-top: 3px;
    }

    .container {
        
		margin: 0 -1px 0 -7px !important;
    }

    .tracklist-container {
        padding: 10px 5px !important;
    }

   .tracklist-header {
        padding-left: 12px !important;
    }
}

.album-header h1 {
        margin-bottom: 1px !important;
    }

    .album-header h2 {
        margin-top: 0 !important;
		margin-bottom: 0px !important;
    }
}

/* --- DESKTOP ONLY (Wider than 600px) --- */
@media screen and (min-width: 601px) {
    .record-detail h1, 
    #recordDetail h1 {
        text-align: left !important;
        margin-left: 20px !important;
        margin-top: 15px !important;
        display: block !important;
    }

    .record-detail h2,
    #recordDetail h2 {
        text-align: left !important;
        margin-left: 20px !important;
        margin-top: 0 !important;
    }
}




/* On screens wider than 600px (Desktop), remove that padding */
@media screen and (min-width: 601px) {
    h1 {
        --mobile-gate: 0px !important;
    }
}

/* On Mobile, keep it at 20px */
@media screen and (max-width: 600px) {
    h1 {
        --mobile-gate: 20px !important;
    }
}

.notes-section {
    margin-top: 15px;
    padding: 20px;
    background: #282828;
    border-radius: 8px;
    font-size: 1.0em;
    color: #ccc;
    /*border-left: 4px solid #1db954;*/
}

.loading {
    text-align: center;
    padding: 50px;
    font-style: italic;
    color: #888;
}

/* --- UNIVERSAL HEADER ALIGNMENT (Desktop) --- */
.album-header h1, 
.album-header h2 {
    text-align: left !important;
    /* Use the same margin for both to keep them lined up */
    margin-left: 20px !important; 
    padding-left: 0 !important;
}

.album-header h1 {
    margin-bottom: 2px !important;
    margin-top: -5px !important;
}

.album-header h2 {
    margin-top: 0 !important;
}


@media (max-width: 600px) {
/* Adjust Artist individually (Mobile) */
    .album-header h1 {
        margin-top: -7px !important;
        margin-left: 23px !important; /* Increase this to shift right */
        padding-left: 0 !important;
    }

    /* Adjust Title individually (Mobile)*/
    .album-header h2 {
        margin-top: -4px !important;
		margin-bottom: -3px !important;
        margin-left: 25px !important; /* Increase this to shift right */
        padding-left: 0 !important;
    }