:root {
    --primary: #f39c12;
    --secondary: #e74c3c;
    --accent: #f1c40f;
    --dark: #0f1115;
    --light: #ffffff;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background: var(--dark);
    color: var(--light);
    height: 100vh;
    overflow: hidden;
    perspective: 1200px;
}

/* Dynamic Animated Background Grid - Optimized */
.background-grid {
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background-image: 
        linear-gradient(rgba(243, 156, 18, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 156, 18, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: gridMove 20s linear infinite;
    will-change: transform;
    z-index: 0;
}
@keyframes gridMove {
    0% { transform: rotateX(60deg) translateY(0) translateZ(-200px); }
    100% { transform: rotateX(60deg) translateY(50px) translateZ(-200px); }
}

/* Floating Glowing Blobs - Optimized (No blur filter) */
.blob {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    animation: floatBlob 10s ease-in-out infinite alternate;
    will-change: transform;
}
.blob-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(231, 76, 60, 0.15) 0%, transparent 70%); top: -10%; left: -10%; animation-delay: 0s; }
.blob-2 { width: 800px; height: 800px; background: radial-gradient(circle, rgba(243, 156, 18, 0.1) 0%, transparent 70%); bottom: -20%; right: -10%; animation-delay: -3s; }
.blob-3 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(52, 152, 219, 0.1) 0%, transparent 70%); top: 30%; left: 40%; animation-delay: -6s; }
@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 25px) scale(1.1); }
}

/* Canvas for Sparks */
#sparks {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 5;
    pointer-events: none;
}

.container {
    position: relative;
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    z-index: 10;
}

/* Ultra Glass Card - Optimized */
.glass-card {
    background: rgba(20, 25, 30, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 50px 70px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
    transform-style: preserve-3d;
    will-change: transform;
    animation: cardEntrance 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes cardEntrance {
    0% { opacity: 0; transform: translateY(100px) rotateX(20deg) scale(0.8); }
    100% { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

/* Logo with Glare - Optimized */
.logo-container {
    position: relative;
    margin-bottom: 10px;
    transform: translateZ(30px);
    display: inline-block;
    border-radius: 20px;
    overflow: hidden;
}

.main-logo {
    width: 380px;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.5));
    will-change: transform;
}

.glare {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg) translate(-100%, -100%);
    pointer-events: none;
    z-index: 2;
    will-change: transform;
}

.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2em;
    color: var(--accent);
    margin-bottom: 30px;
    letter-spacing: 6px;
    text-transform: uppercase;
    transform: translateZ(20px);
}

/* Advanced Countdown */
.countdown {
    display: flex; justify-content: center; gap: 20px; margin-bottom: 40px;
    transform: translateZ(25px);
}

.time-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.3));
    padding: 20px;
    border-radius: 16px;
    min-width: 90px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.digit-wrap {
    perspective: 400px;
}

.time-box span {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5em;
    font-weight: 900;
    background: linear-gradient(to bottom, #ffffff, #a4b0be);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.time-box span.flip {
    transform: rotateX(-360deg);
}

.time-box p {
    margin: 10px 0 0;
    font-size: 0.8em;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary);
}

/* Cyberpunk Progress Bar */
.progress-container {
    margin-top: 20px;
    transform: translateZ(15px);
}
.progress-header {
    display: flex; justify-content: space-between;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85em; color: #a4b0be; letter-spacing: 2px;
    margin-bottom: 8px;
}
.progress-bar {
    width: 100%; height: 12px;
    background: rgba(0,0,0,0.6);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden; position: relative;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary), var(--accent));
    width: 0%;
    border-radius: 6px;
    position: relative;
    transition: width 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.progress-glow {
    position: absolute;
    top: 0; right: 0; width: 30px; height: 100%;
    background: white; filter: blur(5px);
    opacity: 0.8;
}

/* Insane 3D Bricks - Optimized */
.wall-container {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100%;
    z-index: 2; pointer-events: none;
    transform-style: preserve-3d;
}

.brick {
    position: absolute; width: 120px; height: 45px;
    border-radius: 4px;
    /* Simplified background for speed */
    background-color: #c0392b; 
    box-shadow: 
        inset 1px 1px 2px rgba(255,255,255,0.2),
        inset -2px -2px 4px rgba(0,0,0,0.4),
        3px 5px 10px rgba(0,0,0,0.5);
    opacity: 0;
    will-change: transform, opacity;
}

.brick.laid {
    animation: smashBrick 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes smashBrick {
    0% {
        opacity: 0;
        transform: translateY(-500px) translateZ(300px) rotateX(90deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateZ(0) rotateX(0) scale(1);
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .glass-card {
        padding: 30px 20px;
        width: 90%;
        box-sizing: border-box;
    }
    .main-logo {
        width: 250px;
    }
    .subtitle {
        font-size: 0.9em;
        letter-spacing: 3px;
        margin-bottom: 20px;
    }
    .countdown {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 25px;
    }
    .time-box {
        min-width: 65px;
        padding: 10px;
    }
    .time-box span {
        font-size: 2em;
    }
    .progress-header {
        font-size: 0.7em;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    .blob {
        display: none; /* Hide heavy blobs on mobile */
    }
    .action-container .glow-button {
        padding: 12px 25px !important;
        font-size: 1em !important;
    }
}
