@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;900&display=swap');

body {
    font-family: 'Poppins', sans-serif;
}

/* Dark mode background */
body.dark {
    background: linear-gradient(to bottom right, #1a1a2e, #16213e, #0f3460) !important;
}

/* Header letter tile styling */
nav .letter-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: white;
    border: 3px solid transparent;
    background-image: 
        linear-gradient(white, white),
        linear-gradient(135deg, #2563eb 0%, #9333ea 50%, #db2777 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 0.5rem;
    color: #1f2937;
    font-weight: 900;
    font-size: 1rem;
    animation: flipIn 0.6s ease-out;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

nav .letter-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Dark mode tiles */
.dark nav .letter-tile {
    background-image: 
        linear-gradient(#1f2937, #1f2937),
        linear-gradient(135deg, #2563eb 0%, #9333ea 50%, #db2777 100%);
    color: white;
}

@media (min-width: 768px) {
    nav .letter-tile {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        border-radius: 0.5rem;
        border-width: 3px;
    }
}

@keyframes flipIn {
    0% {
        transform: rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: rotateY(0);
        opacity: 1;
    }
}

/* Countdown animation */
.countdown-number {
    animation: countdownPulse 0.8s ease-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Success celebration animation */
.success-celebration {
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Shake animation for wrong answers */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

/* Stat card hover effects */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Pulse glow effect */
.pulse-glow {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.8);
    }
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.hover\:scale-102:hover {
    transform: scale(1.02);
}

/* Accordion animation */
.accordion-content {
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 600px;
    }
}

.accordion-arrow {
    transition: transform 0.3s ease;
}

/* Word screen transitions - instant and smooth */
.word-screen {
    transition: opacity 200ms ease-out;
}

.word-screen.hidden {
    pointer-events: none;
}

.word-screen:not(.hidden):not(.opacity-0) .letter-tile {
    animation: popIn 0.3s ease-out backwards;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Input success flash */
.correct {
    animation: flash-green 0.3s ease-out;
}

@keyframes flash-green {
    0%, 100% {
        background-color: white;
    }
    50% {
        background-color: #86efac;
    }
}

.dark .correct {
    animation: flash-green-dark 0.3s ease-out;
}

@keyframes flash-green-dark {
    0%, 100% {
        background-color: #374151;
    }
    50% {
        background-color: #166534;
    }
}

/* Loading screen tiles */
.loading-tile {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@media (min-width: 768px) {
    .loading-tile {
        width: 56px;
        height: 56px;
        font-size: 2rem;
        border-radius: 10px;
    }
}

@keyframes tile-settle {
    0% {
        transform: scale(1.2) rotate(360deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

