/* Basic Reset and Variables */
:root {
    --bg-dark: #0f172a;
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #ec4899;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #312e81, #0f172a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background animated stars */
#stars, #stars2, #stars3 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: transparent;
}

#stars { animation: moveStars 50s linear infinite; }
#stars2 { animation: moveStars 100s linear infinite; }
#stars3 { animation: moveStars 150s linear infinite; }

/* Main Layout */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    width: 95%;
    margin: 2rem auto;
    z-index: 10;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.content-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation-delay: 0.2s;
}

/* Typography & Content Layout */
.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

.glitch {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* Countdown */
.countdown-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.time-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Forms */
.notify-form {
    margin-bottom: 3rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

input[type="email"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.btn-primary {
    position: relative;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    color: white;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.btn-primary .btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover .btn-glow {
    opacity: 1;
}

.form-message {
    margin-top: 1rem;
    font-size: 0.875rem;
    min-height: 1.2rem;
}

.form-message.success {
    color: #4ade80;
}

/* Game Area */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.score-board {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.score-board strong {
    color: var(--text-main);
    font-size: 1.125rem;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 30px var(--primary-glow);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    transition: opacity 0.3s ease;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#overlay-title {
    font-size: 2rem;
    font-weight: 800;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-100vh); }
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .glass-panel {
        padding: 2rem;
    }
    
    .countdown-container {
        gap: 0.75rem;
    }
    
    .time-value {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
    }
    
    input[type="email"] {
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid var(--glass-border);
        border-radius: 999px;
    }
    
    .btn-primary {
        width: 100%;
    }
}
