* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    background: #0f172a;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.bg-grid {
    background-image: 
        linear-gradient(rgba(100, 200, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 200, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.timer-pulse {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    }
    50% {
        opacity: 0.8;
        text-shadow: 0 0 40px rgba(0, 255, 255, 0.8);
    }
}

.alarm-flash {
    animation: alarm-bg 0.5s ease-in-out infinite alternate;
}

@keyframes alarm-bg {
    0% {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    }
    100% {
        background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 50%, #4c1d95 100%);
    }
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.speech-bubble {
    position: relative;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: rgba(30, 41, 59, 0.8) transparent transparent;
}

.confetti-particle {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .text-5xl {
        font-size: 2rem;
    }
    
    .text-4xl {
        font-size: 1.5rem;
    }
}

/* Focus states */
button:focus-visible {
    outline: 2px solid #22d3ee;
    outline-offset: 2px;
}

input:focus-visible {
    outline: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: rgba(168, 85, 247, 0.4);
    color: #fff;
}