.cards-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    padding: 20px;
}

/* Enhanced title styling */
.title {
    position: relative;
    font-size: 48px;
    margin-bottom: 60px;
    color: #fff;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
    padding-bottom: 20px;
    text-align: center;
}

.title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4a90e2, transparent);
    animation: lineGlow 2s ease-in-out infinite;
}

.letter-animation {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: letterAppear 0.5s ease-out forwards;
}

@keyframes letterAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
        text-shadow: 0 0 0 rgba(74, 144, 226, 0);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
    }
}

@keyframes lineGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(74, 144, 226, 0.8);
    }
}

/* Add delay for each letter */
.letter-animation:nth-child(1) { animation-delay: 0.1s; }
.letter-animation:nth-child(2) { animation-delay: 0.2s; }
.letter-animation:nth-child(3) { animation-delay: 0.3s; }
.letter-animation:nth-child(4) { animation-delay: 0.4s; }
.letter-animation:nth-child(5) { animation-delay: 0.5s; }
.letter-animation:nth-child(6) { animation-delay: 0.6s; }
.letter-animation:nth-child(7) { animation-delay: 0.7s; }
.letter-animation:nth-child(8) { animation-delay: 0.8s; }
.letter-animation:nth-child(9) { animation-delay: 0.9s; }
.letter-animation:nth-child(10) { animation-delay: 1.0s; }
.letter-animation:nth-child(11) { animation-delay: 1.1s; }
.letter-animation:nth-child(12) { animation-delay: 1.2s; }
.letter-animation:nth-child(13) { animation-delay: 1.3s; }
.letter-animation:nth-child(14) { animation-delay: 1.4s; }
.letter-animation:nth-child(15) { animation-delay: 1.5s; }
.letter-animation:nth-child(16) { animation-delay: 1.6s; }
.letter-animation:nth-child(17) { animation-delay: 1.7s; }
.letter-animation:nth-child(18) { animation-delay: 1.8s; }
.letter-animation:nth-child(19) { animation-delay: 1.9s; }

/* Add subtle background patterns */
.content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(74, 144, 226, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(74, 144, 226, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Enhanced card animations */
.card {
    animation: cardFloat 6s infinite ease-in-out;
}

.card:nth-child(2) {
    animation-delay: -2s;
}

.card:nth-child(3) {
    animation-delay: -4s;
}

/* Statistics animations */
.stat-card {
    animation: cardFloat 6s infinite ease-in-out;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(74, 144, 226, 0.1),
        transparent
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.stat-card:hover::before {
    transform: translateX(100%);
}

.stat-value {
    animation: numberPulse 2s infinite ease-in-out;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.1);
}

@keyframes numberPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(74, 144, 226, 0.8);
    }
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Add pulsing effect to card icons */
.card-icon i {
    animation: iconPulse 2s infinite ease-in-out;
}

@keyframes iconPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(74, 144, 226, 0.8);
    }
}

/* Music Player Styles */
.music-player {
    width: 90%;
    max-width: 900px;
    margin: 0 auto 24px auto;
    display: grid;
    grid-template-columns: minmax(200px, 25%) minmax(300px, 1fr) minmax(100px, 25%);
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    backdrop-filter: blur(6px);
}

.music-player .now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
}

.np-art {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(74,144,226,0.2), rgba(114,137,218,0.2));
    border-radius: 8px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.np-info {
    max-width: 220px;
    min-width: 120px;
    overflow: hidden;
    text-align: left;
}

.track-title, .track-artist {
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.track-title {
    font-weight: 600;
    animation: scrollText 10s linear infinite;
    animation-play-state: paused;
}

.track-artist {
    animation: scrollText 10s linear infinite;
    animation-play-state: paused;
}

.np-info:hover .track-title,
.np-info:hover .track-artist {
    animation-play-state: running;
}

@keyframes scrollText {
    0% {
        transform: translateX(0%);
    }
    45% {
        transform: translateX(0%);
    }
    95% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0%);
    }
}

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.player-center {
    flex: 1 1 300px; /* Fixed width basis to prevent shifting */
    min-width: 300px; /* Ensure minimum width */
    max-width: 400px; /* Limit maximum width */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-wrap {
    width: 100%;
    padding: 0 10px;
}

#progress {
    width: 100%;
    margin: 10px 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 5px;
    outline: none;
}

#progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

#progress::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #5aa0f2;
}

#progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

#progress::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: #5aa0f2;
}

.player-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}

.player-btn:hover { transform: scale(1.08); color: #4a90e2; }

.progress-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.progress-wrap input[type="range"] {
    max-width: 420px;
    width: 100%;
}

.volume-wrap { display: flex; align-items: center; gap: 8px; }

#volume { width: 120px; }

/* Hidden helper */
.hidden { display: none !important; }

/* Stats styles (small tweak) */
.stats-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, rgba(74,144,226,0.14), rgba(114,137,218,0.08));
    color: #fff;
    border: 1px solid rgba(74,144,226,0.25);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stats-button:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(74,144,226,0.08); }

.stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.stats-cards {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    width: 100%;
}

.stat-card { 
    /* match option card size and feel */
    width: 300px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon i { font-size: 36px; color: #4a90e2; }
.stat-card .stat-info { display: flex; flex-direction: column; gap:6px; }
.stat-card .stat-info h3 { margin: 0; font-size: 18px; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; color: #fff; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before { left: 100%; }

.stat-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.35); }

.stat-icon i { font-size: 24px; color: #4a90e2; }

.back-button {
    /* match visual style of .stats-button but do not stretch full row */
    background: linear-gradient(90deg, rgba(74,144,226,0.14), rgba(114,137,218,0.08));
    color: #fff;
    border: 1px solid rgba(74,144,226,0.25);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;

    /* do not force full width; keep content-sized width */
    flex: 0 0 auto;
    justify-content: center;
    align-self: center;
    width: auto;
    max-width: 260px;
    margin-top: 8px;
}

.back-button:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(74,144,226,0.08); color: #fff; }

/* Add a follow hover highlight similar to .card-hover-effect */
.stat-hover-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.18) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    transition: width 0.45s ease, height 0.45s ease;
    pointer-events: none;
}

.stat-card:hover .stat-hover-effect { width: 180%; height: 180%; }

/* Range inputs styling (progress & volume) */
input[type='range'] { -webkit-appearance: none; appearance: none; height: 6px; background: rgba(255,255,255,0.06); border-radius: 6px; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #4a90e2; box-shadow: 0 4px 10px rgba(74,144,226,0.3); cursor: pointer; }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #4a90e2; cursor: pointer; }

/* Small responsive tweak for stats on small screens */
@media (max-width: 560px) {
    .stat-card { min-width: 140px; }
    .music-player { width: 100%; }
    .back-button { max-width: 100%; }
}

@media (max-width: 768px) {
    .cards-container {
        padding: 10px;
    }
    
    .card {
        margin: 10px;
    }
    
    .title {
        font-size: 36px;
        margin-bottom: 40px;
    }
    
    .music-player { flex-direction: column; align-items: stretch; }
    .player-center { order: 3; }
    .progress-wrap input[type="range"] { width: 100%; }
    #volume { width: 100%; }
    
    .stat-card { width: 100%; max-width: 300px; }
}