:root {
    --bg-color: #0b0f19;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(20, 30, 48, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* State Colors */
    --color-idle: #3b82f6;
    --color-wait: #ef4444;
    --color-go: #10b981;
    --color-early: #f59e0b;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    user-select: none;
}

/* Background Animated Orbs */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out alternate;
}

.bg-shape-1 {
    width: 400px;
    height: 400px;
    background: var(--color-idle);
    top: -10%;
    left: 10%;
    animation-delay: 0s;
}

.bg-shape-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    bottom: -20%;
    right: 5%;
    animation-delay: -5s;
}

.bg-shape-3 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 50px) scale(1.1); }
    100% { transform: translate(-50px, 100px) scale(0.9); }
}

/* Main Container and Glass Panel */
.container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 10;
}

.glass-panel {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 16/10;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* Content visibility based on state */
.content {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease-out forwards;
    width: 100%;
    height: 100%;
    padding: 40px;
}

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

.icon {
    font-size: 4rem;
    margin-bottom: 20px;
    font-style: normal;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Buttons */
.glass-btn {
    margin-top: 30px;
    padding: 16px 40px;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.glass-btn:active {
    transform: translateY(1px);
}

/* State Specifics */
.glass-panel.state-idle .idle-content { display: flex; }
.glass-panel.state-wait .wait-content { display: flex; }
.glass-panel.state-go .go-content { display: flex; }
.glass-panel.state-result .result-content { display: flex; }
.glass-panel.state-early .early-content { display: flex; }

.glass-panel.state-idle {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 60px -15px rgba(59, 130, 246, 0.2);
}
.glass-panel.state-idle:hover {
    box-shadow: 0 0 80px -10px rgba(59, 130, 246, 0.3);
}

.glass-panel.state-wait {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 100px -20px rgba(239, 68, 68, 0.4);
    animation: pulseObj 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.glass-panel.state-go {
    background: rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 120px -10px rgba(16, 185, 129, 0.6);
    transform: scale(1.02);
}

.glass-panel.state-result {
    border-color: rgba(59, 130, 246, 0.3);
}

.glass-panel.state-early {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
}

@keyframes pulseObj {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

#time-display {
    color: var(--color-go);
}

.best-score {
    margin-top: 15px;
    padding: 8px 20px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-go);
    display: inline-block;
}

/* Responsive */
@media (max-width: 640px) {
    h1 { font-size: 2.25rem; }
    .glass-panel { max-width: 90vw; aspect-ratio: 1/1; }
    .icon { font-size: 3rem; }
}
