/* General Body Styles */
html {
    background-color: #000; /* Prevent white showing during screen shake */
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100vh; /* Lock body height to viewport */
    height: 100dvh; /* Use dynamic viewport unit for mobile */
    overflow: hidden; /* Prevent body scroll */
    contain: layout style;
}

body.screen-shake {
    animation: screenShake 0.5s ease-in-out;
    overflow: hidden;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(calc(var(--shake-intensity, 5px) * -1), calc(var(--shake-intensity, 5px) * -1)); }
    20% { transform: translate(var(--shake-intensity, 5px), calc(var(--shake-intensity, 5px) * -1)); }
    30% { transform: translate(calc(var(--shake-intensity, 5px) * -1), var(--shake-intensity, 5px)); }
    40% { transform: translate(var(--shake-intensity, 5px), var(--shake-intensity, 5px)); }
    50% { transform: translate(calc(var(--shake-intensity, 5px) * -1), calc(var(--shake-intensity, 5px) * -1)); }
    60% { transform: translate(var(--shake-intensity, 5px), calc(var(--shake-intensity, 5px) * -1)); }
    70% { transform: translate(calc(var(--shake-intensity, 5px) * -1), var(--shake-intensity, 5px)); }
    80% { transform: translate(var(--shake-intensity, 5px), var(--shake-intensity, 5px)); }
    90% { transform: translate(calc(var(--shake-intensity, 5px) * -1), 0); }
}

/* Header Styles */
header {
    flex-shrink: 0; /* Prevent header from shrinking */
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 75%; /* Match the header width to the main content */
    max-width: 1400px; /* Optional maximum width */
    margin: 0 auto; /* Center the header */
    position: relative; /* For absolute positioning of combo display */
}

header h1 {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

header img {
    width: 4em;
    height: 4em;
}

/* Logo Shake Animation for Combo Game Activation */
#logo.shaking {
    animation: logoShake 0.1s infinite;
}

@keyframes logoShake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(var(--shake-intensity, 2px), var(--shake-intensity, 2px)); }
    75% { transform: translate(calc(var(--shake-intensity, 2px) * -1), calc(var(--shake-intensity, 2px) * -1)); }
}

/* Combo Counter (Easter Egg) */
#combo-display {
    position: absolute;
    right: 9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid;
    transition: opacity 5s ease, color 5s ease, border-color 5s ease;
    animation: pulse 0.5s ease-in-out;
    opacity: 1;
}

#combo-display.hidden {
    opacity: 0;
    pointer-events: none;
}

#combo-display.color-red {
    color: #FF383F;
    border-color: #FF383F;
}

#combo-display.color-green {
    color: #FFFFA3;
    border-color: #FFFFA3;
}

#combo-display.color-blue {
    color: #694EFF;
    border-color: #694EFF;
}

/* High Score Counter */
#high-score-display {
    position: absolute;
    left: 7.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #888;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

#high-score-display:hover {
    background: rgba(105, 78, 255, 0.2);
    border-color: #694EFF;
    color: #694EFF;
}

#high-score-display.hidden {
    display: none;
}

/* Combo Stats Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: #000000;
    border: 2px solid #694EFF;
    border-radius: 0;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #888;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #fff;
}

.modal-content h2 {
    color: #694EFF;
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-row {
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
    gap: 10px;
}

.stat-label {
    color: #FFFFA3;
    font-weight: bold;
    font-size: 1rem;
    text-align: right;
}

.stat-bar-container {
    background: #222;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #333;
}

.stat-bar {
    height: 100%;
    background: #694EFF;
    transition: width 0.5s ease;
    border-radius: 3px;
}

.stat-count {
    color: #888;
    font-weight: bold;
    text-align: left;
}

.stats-summary {
    border-top: 1px solid #333;
    padding-top: 1rem;
    display: flex;
    justify-content: space-around;
    color: #FFFFA3;
}

.stats-summary p {
    margin: 0.5rem 0;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.share-stats-btn {
    flex: 1;
    padding: 10px 20px;
    background: #694EFF;
    border: 2px solid #694EFF;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.share-stats-btn:hover {
    background: #000;
    color: #694EFF;
}

.share-stats-btn:active {
    background: #000;
    color: #694EFF;
}

.reset-stats-btn {
    flex: 1;
    padding: 10px 20px;
    background: #FF383F;
    border: 2px solid #FF383F;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.reset-stats-btn:hover {
    background: #000;
    color: #FF383F;
}

.reset-stats-btn:active {
    background: #000;
    color: #FF383F;
}

@keyframes pulse {
    0%, 100% { 
        transform: translateY(-50%) scale(1); 
    }
    50% { 
        transform: translateY(-50%) scale(1.1); 
    }
}

/* Combo Popup */
.combo-popup {
    position: fixed;
    font-size: 3rem;
    font-weight: bold;
    pointer-events: none;
    z-index: 9999;
    animation: comboFloat 1s ease-out forwards;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.combo-popup.color-red {
    color: #FF383F;
}

.combo-popup.color-green {
    color: #FFFFA3;
}

.combo-popup.color-blue {
    color: #694EFF;
}

@keyframes comboFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
    }
}

#logo-link {
    display: inline-block;
}

#logo {
    transition: transform 0.2s ease; /* Smooth animation for scaling */
    will-change: transform;
}

#logo:hover:not(.shaking) {
    transform: scale(1.1); /* Grow the logo slightly on hover (when not shaking) */
}

/* Nav Styles */
nav a {
    color: #FFFFA3;
    text-decoration: none;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    transition: color 0.2s ease;
}

nav a:hover {
    color: #694EFF; /* Blue accent color */
}

/* Main Content and Album Grid */
main {
    padding: 2rem;
    padding-bottom: 100px; /* Ensure space for fixed footer on desktop */
    position: relative;
    /* Removed min-height, now determined by flex */
    width: 75%; /* Increase from 66.67% to 75% */
    max-width: 1400px; /* Optional maximum width */
    margin: 0 auto; /* Center the content */
    flex: 1; /* Allow the main content to grow and push the footer to the bottom */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    justify-content: flex-start; /* Default alignment */
    overflow-y: auto; /* Enable scrolling within main */
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

/* Search Bar Styles */
#search-container {
    margin: 0 2rem;
    display: flex;
    justify-content: center;
    flex: 1; /* Allow it to take up available space */
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

#search-bar {
    width: 100%;
    /* max-width removed as it is controlled by wrapper */
    padding: 10px 15px;
    padding-right: 40px; /* Make room for the clear button */
    font-size: 1rem;
    border: 1px solid #333;
    border-radius: 4px; /* Ensure border-radius is applied */
    background-color: #111;
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box; /* Ensure padding doesn't affect width */
}

#search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: block; /* Ensure it takes up space when not hidden */
}

#search-clear:hover {
    color: #fff;
}

#search-clear.hidden {
    display: none;
}

#search-bar:focus {
    border-color: #694EFF; /* Match accent color */
    box-shadow: 0 0 5px rgba(105, 78, 255, 0.5);
}

#now-playing {
    font-size: 0.9rem;
    color: #FFFFA3;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 15px;
    max-width: 800px; /* Increased from 300px to allow longer titles */
    display: flex;
    align-items: center;
}

.now-playing-label {
    color: #FF383F; /* Changed to red accent */
    white-space: nowrap;
    margin-right: 5px;
    flex-shrink: 0;
}

.now-playing-scroll-container {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    min-width: 0; /* Allow flex child to shrink below content size */
    position: relative;
}

.now-playing-scroll-container.mask-enabled {
    mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.now-playing-content {
    display: inline-block;
}

.scrolling-text {
    animation: scroll-text var(--scroll-duration, 10s) linear infinite alternate;
}

@keyframes scroll-text {
    0%, 20% { transform: translateX(0); }
    80%, 100% { transform: translateX(var(--scroll-distance, -100%)); }
}

#now-playing.hidden {
    display: none;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Increase image size */
    gap: 0.5rem; /* Reduce space between entries */
}

.album {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid transparent; /* Hidden border by default */
    box-sizing: border-box; /* Include border in element's total width and height */
    transition: border-color 0.2s ease; /* Smooth border color transition */
    contain: layout style paint;
}

.album.game-active {
    border-width: 3px; /* Larger border when game is active */
}

.album.game-active:hover {
    animation: impact 0.1s ease-out;
}

@keyframes impact {
    0% {
        transform: scale(var(--impact-scale, 1.05));
    }
    100% {
        transform: scale(1);
    }
}

.album.color-red {
    border-color: #FF383F;
}

.album.color-green {
    border-color: #FFFFA3;
}

.album.color-blue {
    border-color: #694EFF;
}

.album-info .color-red {
    color: #FF383F;
}

.album-info .color-green {
    color: #FFFFA3;
}

.album-info .color-blue {
    color: #694EFF;
}

.album img {
    width: 100%;
    height: auto;
    display: block;
}

.album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    transform: translateY(100%);
    text-align: center;
    transition: transform 0.2s ease, color 0.2s ease; /* Transition transform for slide effect */
    will-change: transform;
    contain: layout style;
}

.album:hover .album-info {
    transform: translateY(0);
}

.album-info h3, .album-info p {
    margin: 0;
}

.album-info h3 {
    font-size: 1.2rem;
}

.album-info p {
    font-size: 1rem;
    color: #aaa;
}

/* Album Details (In-Page) */
#album-details {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    opacity: 1;
}

.album-details-cover {
    flex: 1;
    max-width: 800px;
}

.album-details-cover img {
    width: 100%;
    height: auto;
}

.album-details-info {
    flex: 2;
}

#album-details h2 {
    margin-top: 0;
    color: #FF383F;
}

#album-details h3 {
    margin-top: 0;
    color: #FF383F;
}

#album-details p {
    margin-top: 0;
    color: #FFFFA3;
}

#track-list {
    list-style: none;
    padding: 0;
    color:#FFFFA3;
}

#track-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center; /* Ensure track name stays aligned with track number */
    justify-content: flex-start; /* Align items to the start */
}

#track-list li:last-child {
    border-bottom: none;
}

#track-list li span {
    color: #888;
}

#track-list li span.track-number {
    color: #694EFF; /* Different color for track number */
    margin-right: 1rem; /* Optional spacing */
    flex-shrink: 0; /* Prevent the track number from shrinking */
}

#track-list li span.track-length {
    color: #694EFF; /* Match track length color to track number */
    margin-left: auto; /* Push the track length to the far right */
}

/* Featured/Clickable Track Style */
.featured-track {
    cursor: pointer;
    color: #694EFF; /* Blue accent */
    font-weight: bold;
    transition: color 0.2s ease;
}

.featured-track:hover {
    color: #fff; /* White on hover */
    background-color: rgba(255, 255, 255, 0.05); /* Subtle background to indicate interactivity */
}
.featured-track:hover span.track-number,
.featured-track:hover span.track-length {
    color: #fff; /* Also whiten the numbers on hover */
}

.album-credits {
    list-style: none;
    padding: 0;
    color:#FFFFA3
}

.album-credits li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
}

.album-credits li:last-child {
    border-bottom: none;
}

.album-credits li span {
    color: #888;
}

.album-credits, .artist-links {
    margin-bottom: 20px;
}

.artist-links {
    display: flex;
    justify-content: flex-start; /* Align buttons to the left */
    gap: 1rem; /* Add spacing between buttons */
    margin-top: 1rem;
}

.streaming-button img {
    width: 50px; /* Set a uniform size for all buttons */
    height: 50px;
    object-fit: contain; /* Ensure the image fits within the bounds */
    transition: transform 0.2s ease; /* Add hover effect */
}

.streaming-button img:hover {
    transform: scale(1.1); /* Slightly enlarge on hover */
}

.artist-links a {
    color: #694EFF;
    text-decoration: none;
    margin-right: 1rem;
}

.artist-links a:hover {
    text-decoration: underline;
}

#back-button, #close-expanded-btn {
    background: #694EFF;
    border: 2px solid #694EFF; /* Add border to prevent layout shift on hover */
    color: #000;
    padding: 10px 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease; /* Fade transition */
    font-weight: bold;
}

#back-button:hover, #close-expanded-btn:hover {
    background: #000;
    color: #694EFF;
}

#back-button {
    margin-bottom: 20px;
}

/* Hidden class for SPA-like transitions */
.hidden {
    display: none;
}

/* Animation for page transitions */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.album-grid:not(.hidden), 
#album-details:not(.hidden) {
    animation: fadeIn 0.2s ease-out forwards; /* Apply fade-in effect when visible */
    will-change: opacity, transform;
}

/* Ensure these are hidden correctly without layout shifts */
.album-grid.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

#album-details {
    opacity: 1;
}

#album-details.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* About Page Styles */
#about-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.2s ease;
}

#about-page.hidden {
    display: none;
    opacity: 0;
}

#about-page h2 {
    color: #FF383F; /* Red accent */
    font-size: 2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#about-page h3 {
    color: #FFFFA3; /* Green accent */
    margin-top: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

#about-page h4 {
    color: #694EFF; /* Blue accent */
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

#about-page p {
    line-height: 1.6;
    color: #FFFFA3;
}

#about-page .text-link {
    color: #FFFFA3;
    text-decoration: none;
    font-weight: bold;
    margin-right: 1.5rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

#about-page .text-link:hover {
    border-color: #fff;
}

/* Artists Grid Layout */
#about-page .artists-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 1.5rem;
}

#about-page .artist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#about-page .artist-card .artist-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

#about-page .artist-card h4 {
    margin: 0.5rem 0 0.25rem 0;
    font-size: 1.2rem;
}

#about-page .artist-card p {
    margin: 0 0 1rem 0;
    color: #aaa;
    font-size: 0.9rem;
}

#about-page .artist-card .artist-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

/* Legacy support for old artist-entry class */
#about-page .artist-entry {
    margin-bottom: 2rem;
}

#about-page .artist-image {
    display: block;
    max-width: 100%;
    width: 400px; /* Medium size */
    height: auto;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* Responsive: single column on smaller screens */
@media (max-width: 768px) {
    #about-page .artists-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* Reusing animation for about page */
#about-page:not(.hidden) {
    animation: fadeIn 0.2s ease-out forwards;
}

#about-page .artist-entry {
    margin-bottom: 2rem;
}

footer {
    position: fixed; /* Ensure the footer is always fixed at the bottom */
    bottom: 0;
    left: 0;
    background-color: #000; /* Match the header color */
    color: #fff;
    text-align: center;
    padding: 1rem;
    width: 100%; /* Ensure the footer spans the full width */
    z-index: 1000; /* Ensure it stays above other elements */
    box-sizing: border-box; /* Ensure padding doesn't affect width */
}

footer a {
    text-decoration: none;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Match the font style */
    font-size: 1rem; /* Adjust font size */
}

footer a:hover {
    text-decoration: underline; /* Underline on hover */
}

.footer-email {
    color: #333;
}

/* Default footer email segment color */
.footer-email span {
    color: #333;
}

/* Ensure accent spans keep their intended colors */
.footer-email span.color-red {
    color: #FF383F;
}

.footer-email span.color-green {
    color: #FFFFA3;
}

.footer-email span.color-blue {
    color: #694EFF;
}

.footer-email.hidden {
    display: none;
}

#game-footer-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 75%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

#game-footer-ui.hidden {
    display: none;
}

.game-footer-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#shop-button-footer {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #FFFFA3;
    color: #FFFFA3;
    cursor: pointer;
    transition: all 0.2s ease;
}

#shop-button-footer:hover {
    background: rgba(255, 255, 163, 0.2);
    border-color: #fff;
    color: #fff;
}

#shop-button-footer.hidden {
    display: none;
}

#stats-button-footer {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #888;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

#stats-button-footer:hover {
    background: rgba(105, 78, 255, 0.2);
    border-color: #694EFF;
    color: #694EFF;
}

#stats-button-footer.hidden {
    display: none;
}

#combo-display-footer {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid;
    animation: pulse 0.5s ease-in-out;
}

#combo-display-footer.hidden {
    opacity: 0;
    visibility: hidden;
}

#combo-display-footer.color-red {
    color: #FF383F;
    border-color: #FF383F;
}

#combo-display-footer.color-green {
    color: #FFFFA3;
    border-color: #FFFFA3;
}

#combo-display-footer.color-blue {
    color: #694EFF;
    border-color: #694EFF;
}

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

@media (max-width: 768px) {
    header, main {
        width: 100%; /* Maximize width on mobile */
        padding-left: 15px; /* Reduce horizontal padding */
        padding-right: 15px;
        box-sizing: border-box; /* Ensure padding doesn't cause overflow */
    }

    header {
        padding-top: 15px;
        padding-bottom: 15px;
        flex-wrap: wrap; /* Allow items to wrap */
        gap: 1rem;
    }

    #logo-link {
        order: 1; /* Keep logo first */
    }

    nav {
        order: 2; /* Move nav to the right of logo */
    }

    #search-container {
        margin: 0;
        width: 100%;
        order: 3; /* Move search bar to the bottom */
    }

    main {
        padding-top: 1rem;
        padding-bottom: 120px; /* Increase to ensure space for footer controls */
    }

    #album-details {
        flex-direction: column; /* Stack content vertically */
        align-items: center; /* Center content horizontally */
        text-align: center; /* Center text */
        padding: 0; /* Remove inner padding so it relies on main's padding */
        gap: 1rem; /* Reduce gap */
    }

    #about-page {
        padding: 0; /* Remove inner padding so it relies on main's padding */
    }

    .album-details-cover {
        max-width: 100%; /* Ensure the image fits the screen */
        margin-bottom: 1rem; /* Add spacing below the image */
    }

    .album-details-info {
        width: 100%; /* Make the info take full width */
    }

    #track-list li {
        justify-content: center; /* Center track list items */
    }

    .album-credits li {
        justify-content: space-between; /* Ensure credits align left and right */
        text-align: left; /* Maintain left alignment for text */
    }

    .artist-links {
        justify-content: center; /* Center buttons on mobile */
    }

    /* Disable hover effects on mobile */
    .album-info {
        display: none !important;
    }

    .album {
        border-color: transparent !important;
    }
}

/* Expanded Album Art View */
@keyframes fadeInExpanded {
    from { 
        opacity: 0; 
        transform: translateY(5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

#album-details.expanded-view {
    animation: fadeInExpanded 0.2s ease-out forwards;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    width: 100%;
    flex: 1;
    max-height: none; /* Remove calculated constraint */
    overflow: visible; /* Allow 3D transforms to extend outside */
}

#album-details.expanded-view .album-details-info {
    display: none; /* Hide the info section */
}

#album-details.expanded-view .album-details-cover {
    width: 100%;
    height: 100%;
    max-width: none; /* Remove max-width restriction */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 1000px; /* Enable 3D space */
}

#audio-controls {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content */
    gap: 15px;
    padding: 0; /* Remove padding */
    width: 100%; /* Take up full footer width */
}

#audio-controls.hidden {
    display: none;
}

#play-pause-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: transform 0.2s ease;
    will-change: transform;
}

#play-pause-btn:hover {
    transform: scale(1.1);
    color: #694EFF; 
}

#timeline-slider, #volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #555;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#timeline-slider {
    width: 250px;
}

#volume-slider {
    width: 80px;
}

#timeline-slider::-webkit-slider-thumb, #volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

#timeline-slider::-moz-range-thumb, #volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

#timeline-slider::-webkit-slider-thumb:hover, #volume-slider::-webkit-slider-thumb:hover {
    background: #694EFF;
}

#timeline-slider::-moz-range-thumb:hover, #volume-slider::-moz-range-thumb:hover {
    background: #694EFF;
}

#current-time, #total-time {
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    color: #FFFFA3;
    min-width: 35px;
    text-align: center;
}

#album-details.expanded-view img {
    max-height: 100%; /* Fit within the container */
    max-width: 100%; 
    width: auto; /* Maintain aspect ratio */
    height: auto;
    object-fit: contain;
    cursor: pointer; /* click again to return */
    transition: transform 0.05s linear; /* Smooth, quick updates for 3D effect */
    transform-style: preserve-3d;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); /* Enhance depth */
    will-change: transform;
}

#album-cover-image {
    cursor: pointer; /* Indicate clickability */
}

/* Close button removed: clicking the image toggles expanded view */
#close-expanded-btn,
#close-expanded-btn.hidden {
    display: none;
}

@media (max-width: 1024px) {
    #album-details.expanded-view img {
        max-width: 85%; /* Add space on sides for sway animation */
        max-height: 70vh; /* Ensure controls are visible */
    }

    #audio-controls {
        gap: 10px; /* Reduce gap on mobile/tablet */
        padding: 0 5px; /* Add slight horizontal padding inside controls */
        box-sizing: border-box;
        flex-wrap: wrap; 
    }

    #now-playing {
        width: 100%;
        justify-content: center; /* Center flex items */
        margin-right: 0;
        margin-bottom: 5px;
        max-width: none;
    }

    #timeline-slider {
        width: auto; /* Override fixed width */
        flex: 1; /* Let it fill available space */
        min-width: 60px; /* Prevent it from disappearing */
    }

    #volume-slider {
        width: 60px; /* Reduce volume slider size */
    }

    #current-time, #total-time {
        font-size: 0.8rem;
        min-width: 30px;
    }
}

/* Shop Modal Styles */
.shop-modal-content {
    max-width: 700px;
    max-height: 90vh;
}

.shop-header {
    background: rgba(105, 78, 255, 0.1);
    border: 1px solid #694EFF;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.shop-balance {
    color: #FFFFA3;
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.shop-balance strong {
    color: #FFD700;
    font-size: 1.4rem;
}

.shop-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 0.75rem 0;
}

.shop-stat {
    color: #888;
    font-size: 0.95rem;
    margin: 0;
}

.shop-stat strong {
    color: #fff;
}

.shop-info {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.view-combo-values-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(105, 78, 255, 0.2);
    border: 2px solid #694EFF;
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.75rem;
}

.view-combo-values-btn:hover {
    background: rgba(105, 78, 255, 0.3);
    transform: translateY(-2px);
}

.combo-values-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}

.combo-value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid #333;
    transition: all 0.2s ease;
}

.combo-value-row:hover {
    background: rgba(105, 78, 255, 0.05);
    border-color: #694EFF;
}

.combo-value-label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    flex: 0 0 auto;
}

.combo-value-odds {
    font-size: 0.95rem;
    font-weight: bold;
    color: #888;
    flex: 1;
    text-align: center;
}

.combo-value-amount {
    font-size: 1.1rem;
    font-weight: bold;
    color: #FFFFA3;
    flex: 0 0 auto;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-item {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid #333;
    padding: 1rem;
    transition: all 0.2s ease;
}

.shop-item.affordable {
    border-color: #694EFF;
}

.shop-item.affordable:hover {
    background: rgba(105, 78, 255, 0.05);
    transform: translateX(5px);
}

.shop-item.purchased {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.05);
}

.shop-item.purchased .shop-item-owned {
    color: #FFD700;
}

.shop-item.locked {
    opacity: 0.6;
    border-color: #444;
}

.shop-item.locked h3 {
    color: #888;
}

.shop-requirement {
    color: #ff9800;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    font-style: italic;
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.shop-item h3 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
}

.shop-item-owned {
    color: #FFFFA3;
    font-weight: bold;
    font-size: 0.9rem;
}

.shop-item-description {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem 0;
}

.shop-item-stats {
    color: #4CAF50;
    font-size: 0.85rem;
    font-weight: bold;
    margin: 0.25rem 0 0.5rem 0;
}

.clicker-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.clicker-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #694EFF, #9C7FFF);
    border-radius: 4px;
    width: 0%;
    transition: width 0.05s linear;
}

.shop-buy-btn {
    width: 100%;
    padding: 0.75rem;
    background: #694EFF;
    border: none;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-buy-btn:hover:not(:disabled) {
    background: #7d5fff;
    transform: scale(1.02);
}

.shop-buy-btn:active:not(:disabled) {
    background: #5a3fe6;
    transform: scale(0.98);
}

.shop-buy-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.shop-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: #000;
    border: 2px solid #FFD700;
    border-radius: 0;
    color: #FFD700;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.shop-btn:active {
    background: rgba(255, 215, 0, 0.2);
}
