/* Valentine's Game Hub - Main Styles */

:root {
    --primary: #D14D72;
    --secondary: #FFABAB;
    --tertiary: #FCC8D1;
    --accent: #FEF2F4;
    --dark: #2D1B1B;
    --text: #4A2C2C;
    --shadow: rgba(209, 77, 114, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, var(--accent) 0%, var(--tertiary) 50%, var(--secondary) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    position: relative;
}

/* Animated Background */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(209, 77, 114, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(252, 200, 209, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 171, 171, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 60px;
    animation: headerSlideDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes headerSlideDown {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.logo-mini {
    width: 80px;
    height: 80px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 8px 20px rgba(209, 77, 114, 0.4));
    animation: miniLogoFloat 4s ease-in-out infinite;
}

.logo-mini.left {
    animation-delay: 0s;
}

.logo-mini.right {
    animation-delay: 0.5s;
}

@keyframes miniLogoFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        filter: drop-shadow(0 8px 20px rgba(209, 77, 114, 0.4));
    }
    50% { 
        transform: translateY(-8px) rotate(3deg);
        filter: drop-shadow(0 12px 30px rgba(209, 77, 114, 0.6));
    }
}

.logo-mini:hover {
    transform: scale(1.2) rotate(10deg) !important;
    filter: drop-shadow(0 15px 40px rgba(209, 77, 114, 0.7)) !important;
    animation-play-state: paused;
}

.logo-mini i {
    display: block;
}

.heart-icon {
    font-size: 3.5em;
    color: var(--primary);
    animation: heartBeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(209, 77, 114, 0.3));
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.15); }
}

.game-header h1 {
    font-family: 'Righteous', sans-serif;
    font-size: 3.5em;
    color: var(--dark);
    text-shadow: 3px 3px 0 var(--primary), 6px 6px 0 rgba(209, 77, 114, 0.3);
    letter-spacing: 2px;
    animation: textGlow 3s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

.subtitle {
    font-size: 1.3em;
    color: var(--primary);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.9;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

/* Game Cards */
.game-card {
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cardSlideUp 0.6s ease backwards;
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }
.game-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(50px) rotateX(10deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0deg); }
}

.card-inner {
    background: white;
    border-radius: 25px;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 4px solid var(--primary);
    box-shadow: 0 10px 30px var(--shadow);
}

.card-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--tertiary), var(--secondary));
    border-radius: 50%;
    transform: translate(30%, -30%);
    opacity: 0.3;
    transition: all 0.4s ease;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 25px;
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0.4s ease;
    z-index: -1;
}

.game-card:hover {
    transform: translateY(-15px) scale(1.02);
}

.game-card:hover .card-inner {
    border-color: var(--secondary);
    box-shadow: 0 20px 50px rgba(209, 77, 114, 0.4);
}

.game-card:hover .card-glow {
    opacity: 0.6;
}

.game-card:hover .card-bg {
    transform: translate(20%, -20%) scale(1.2);
    opacity: 0.5;
}

.game-card:active {
    transform: translateY(-10px) scale(0.98);
}

.card-icon {
    font-size: 4em;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    transition: all 0.4s ease;
}

.game-card:hover .card-icon {
    transform: scale(1.15) rotate(5deg);
    color: var(--dark);
}

.game-card:hover .card-icon i {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(-5px); }
    75% { transform: translateY(-8px); }
}

.card-title {
    font-family: 'Righteous', sans-serif;
    font-size: 2em;
    color: var(--dark);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.game-card:hover .card-title {
    color: var(--primary);
    transform: translateX(5px);
}

.card-description {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 60px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.game-card:hover .card-description {
    opacity: 1;
}

.card-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--tertiary);
}

.card-stats span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95em;
}

.card-stats i {
    font-size: 1.2em;
}

.card-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.feature i {
    color: var(--primary);
    font-size: 1.1em;
}

.game-card:hover .feature {
    transform: translateX(5px);
}

.play-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--shadow);
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.play-btn:hover::before {
    width: 300px;
    height: 300px;
}

.play-btn span {
    position: relative;
    z-index: 1;
}

.play-btn i {
    font-size: 1.5em;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(209, 77, 114, 0.5);
}

.play-btn:hover i {
    transform: scale(1.2);
}

.play-btn:active {
    transform: scale(0.98);
}

/* Info Panel */
.info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: white;
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 5px solid var(--primary);
    overflow-y: auto;
}

.info-panel.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--shadow);
}

.close-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--dark);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ===== ENHANCED MUSIC PLAYER ===== */
.music-player-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    animation: slideInRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(400px) scale(0.8);
    }
    to { 
        opacity: 1; 
        transform: translateX(0) scale(1);
    }
}

.music-player-inner {
    background: linear-gradient(145deg, #ffffff, #fef5f7);
    border: 6px solid var(--primary);
    border-radius: 30px;
    padding: 35px 25px 25px 25px;
    box-shadow: 
        0 20px 60px rgba(209, 77, 114, 0.5),
        0 0 0 10px rgba(255, 255, 255, 0.9),
        inset 0 2px 10px rgba(255, 255, 255, 1),
        0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 340px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.music-player-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 171, 171, 0.1),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.music-player-widget:hover .music-player-inner {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 70px rgba(209, 77, 114, 0.5),
        0 0 0 12px rgba(255, 255, 255, 0.6),
        inset 0 2px 15px rgba(255, 255, 255, 1);
    border-color: var(--secondary);
}

.music-visual {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.music-visual::before {
    content: '🎵 NOW PLAYING';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.85em;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(209, 77, 114, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

.vinyl-record {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: vinylIdle 4s ease-in-out infinite;
}

.vinyl-record::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, #D14D72, #8B2E4D);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(209, 77, 114, 0.6);
}

.vinyl-record i {
    font-size: 3em;
    color: #666;
    position: relative;
    z-index: 1;
}

@keyframes vinylIdle {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(5deg); }
}

.music-player-widget.playing .vinyl-record {
    animation: vinylSpin 3s linear infinite;
}

@keyframes vinylSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.music-waves {
    display: flex;
    gap: 6px;
    align-items: center;
}

.wave {
    width: 4px;
    height: 20px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 10px;
    animation: waveIdle 1s ease-in-out infinite;
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.2s; }
.wave:nth-child(3) { animation-delay: 0.4s; }

@keyframes waveIdle {
    0%, 100% { height: 15px; opacity: 0.5; }
    50% { height: 30px; opacity: 1; }
}

.music-player-widget.playing .wave {
    animation: wavePulse 0.6s ease-in-out infinite;
}

@keyframes wavePulse {
    0%, 100% { height: 10px; }
    50% { height: 45px; }
}

.music-details {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(209, 77, 114, 0.15), rgba(255, 171, 171, 0.15));
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--primary);
}

.music-title {
    font-size: 1.4em;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 8px;
    text-shadow: 
        2px 2px 0px rgba(255, 255, 255, 0.8),
        0 0 10px rgba(209, 77, 114, 0.3);
    letter-spacing: 0.5px;
}

.music-artist {
    font-size: 1.05em;
    color: var(--primary);
    font-weight: 700;
    text-shadow: 
        1px 1px 0px rgba(255, 255, 255, 0.8),
        0 0 8px rgba(209, 77, 114, 0.2);
}

.music-controls-row {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.music-btn-main {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    color: white;
    border: 5px solid white;
    font-size: 2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 25px rgba(209, 77, 114, 0.5),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.music-btn-main:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 
        0 15px 35px rgba(209, 77, 114, 0.6),
        inset 0 2px 15px rgba(255, 255, 255, 0.4);
}

.music-btn-main:active {
    transform: scale(1.05);
}

.music-btn-main i {
    transition: all 0.3s ease;
}

.music-player-widget.playing .music-btn-main {
    animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 10px 25px rgba(209, 77, 114, 0.5); }
    50% { box-shadow: 0 10px 40px rgba(209, 77, 114, 0.8); }
}

.volume-wrapper {
    flex: 1;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 2px 5px rgba(255, 255, 255, 0.9);
    border: 3px solid var(--tertiary);
    transition: all 0.3s ease;
}

.volume-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(209, 77, 114, 0.3);
    border-color: var(--primary);
}

.volume-wrapper i {
    font-size: 1.4em;
    color: var(--primary);
    flex-shrink: 0;
}

.volume-slider {
    flex: 1;
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(to right, var(--primary), var(--tertiary));
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    cursor: pointer;
    box-shadow: 
        0 3px 10px rgba(209, 77, 114, 0.5),
        0 0 0 4px white;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 
        0 5px 15px rgba(209, 77, 114, 0.7),
        0 0 0 5px white;
}

.volume-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--secondary));
    cursor: pointer;
    border: 4px solid white;
    box-shadow: 0 3px 10px rgba(209, 77, 114, 0.5);
    transition: all 0.3s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.3);
}

.volume-value {
    font-weight: 800;
    color: #1a1a1a;
    font-size: 1.15em;
    min-width: 50px;
    text-align: right;
    text-shadow: 
        1px 1px 0px rgba(255, 255, 255, 0.9),
        0 0 8px rgba(209, 77, 114, 0.4);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#youtube-player {
    display: none;
    visibility: hidden;
    width: 0;
    height: 0;
    position: absolute;
    top: -9999px;
}

/* Footer */
.game-footer {
    margin-top: 80px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(252, 200, 209, 0.6));
    border-radius: 25px 25px 0 0;
    border-top: 4px solid var(--primary);
    animation: footerSlideUp 0.8s ease;
}

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

.footer-content p {
    color: var(--dark);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1em;
}

.footer-content p i {
    color: var(--primary);
    animation: heartBeat 1.5s ease-in-out infinite;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.footer-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--shadow);
    padding: 5px;
}

.footer-link i {
    transition: transform 0.3s ease;
}

.footer-link:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(209, 77, 114, 0.5);
}

.footer-link:hover i {
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2.5em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .logo-mini {
        width: 60px;
        height: 60px;
    }
    
    .heart-icon {
        font-size: 2.5em;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .card-inner {
        padding: 30px 25px;
    }
    
    .card-title {
        font-size: 1.7em;
    }
    
    .info-panel {
        width: 95%;
        padding: 40px 25px;
    }
    
    .music-player-widget {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
    
    .music-player-inner {
        min-width: auto;
        padding: 30px 20px 20px 20px;
    }
    
    .music-btn-main {
        width: 60px;
        height: 60px;
        font-size: 1.6em;
    }
    
    .volume-wrapper {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .logo {
        gap: 15px;
    }
    
    .logo-mini {
        width: 50px;
        height: 50px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
    
    .heart-icon {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 0.9em;
        letter-spacing: 2px;
    }
    
    .card-icon {
        font-size: 3em;
    }
    
    .card-title {
        font-size: 1.5em;
    }
    
    .play-btn {
        font-size: 1em;
        padding: 15px;
    }
    
    .music-visual {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .music-controls-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .volume-wrapper {
        width: 100%;
    }
}