/* === SHARED STYLES FOR ALL GAMES === */

/* === COLOR PALETTE === */
:root {
    --primary-blue: #45b7d1;
    --primary-green: #4ecdc4;
    --primary-purple: #667eea;
    --primary-orange: #ffa726;
    --primary-pink: #ff7043;
    --primary-red: #ef5350;
    
    --success-green: #66bb6a;
    --warning-orange: #ffa726;
    --error-red: #ef5350;
    
    --neutral-light: #f8f9fa;
    --neutral-medium: #e9ecef;
    --neutral-dark: #6c757d;
    --text-dark: #333333;
    
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.15);
    --shadow-strong: rgba(0,0,0,0.25);
}

/* === ANIMATION CLASSES === */

/* === POP ANIMATION === */
.pop-animation {
    animation: pop 0.3s ease-out;
    transform-origin: center;
}

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

/* === BOUNCE ANIMATION === */
.bounce {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-5px); }
}

/* === SPARKLE ANIMATION === */
.sparkle {
    animation: sparkle 1s ease-in-out;
    position: relative;
}

@keyframes sparkle {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(90deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    75% { transform: scale(1.1) rotate(270deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* === CELEBRATION ANIMATION === */
.celebration {
    animation: celebration 1.2s ease-in-out;
}

@keyframes celebration {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.3) rotate(-5deg); }
    50% { transform: scale(1.5) rotate(5deg); }
    75% { transform: scale(1.2) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* === FLOAT ANIMATION === */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* === SHAKE ANIMATION === */
.shake {
    animation: shake 0.5s ease-in-out;
}

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

/* === PULSE ANIMATION === */
.pulse {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* === BUTTON STYLES === */

/* === GAME BUTTON === */
.game-button {
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
    /* === BIG TOUCH TARGET === */
    min-width: 80px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-button:hover {
    background: var(--primary-purple);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.game-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--shadow-light);
}

/* === BIG TOUCH TARGET === */
.big-touch-target {
    min-width: 100px;
    min-height: 100px;
    padding: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.big-touch-target:hover {
    transform: scale(1.05);
}

.big-touch-target:active {
    transform: scale(0.95);
}

/* === FEEDBACK STYLES === */

/* === CORRECT FEEDBACK === */
.correct-feedback {
    background: var(--success-green) !important;
    color: white !important;
    box-shadow: 0 0 20px rgba(102, 187, 106, 0.5);
    animation: correct-glow 0.6s ease-out;
}

@keyframes correct-glow {
    0% { box-shadow: 0 0 20px rgba(102, 187, 106, 0.5); }
    50% { box-shadow: 0 0 30px rgba(102, 187, 106, 0.8); }
    100% { box-shadow: 0 0 20px rgba(102, 187, 106, 0.5); }
}

/* === TRY AGAIN FEEDBACK === */
.try-again-feedback {
    background: var(--warning-orange) !important;
    color: white !important;
    animation: try-again-pulse 0.5s ease-out;
}

@keyframes try-again-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === SUCCESS GLOW === */
.success-glow {
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.6);
    animation: success-glow-pulse 1s ease-in-out;
}

@keyframes success-glow-pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(78, 205, 196, 0.6); }
    50% { box-shadow: 0 0 50px rgba(78, 205, 196, 0.9); }
}

/* === LAYOUT HELPERS === */

/* === CENTER STAGE === */
.center-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 20px;
}

/* === GAME CONTAINER === */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow-light);
    position: relative;
}

/* === MOBILE RESPONSIVE === */
.mobile-responsive {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .mobile-responsive {
        padding: 15px;
        margin: 10px;
    }
    
    .game-button {
        font-size: 1.1rem;
        padding: 12px 25px;
    }
    
    .big-touch-target {
        min-width: 80px;
        min-height: 80px;
        padding: 15px;
    }
    
    .game-container {
        padding: 15px;
        margin: 10px;
    }
}

/* === UTILITY CLASSES === */

/* === HIDDEN === */
.hidden {
    display: none !important;
}

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

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

/* === FADE OUT === */
.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

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

/* === DISABLED STATE === */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* === LOADING SPINNER === */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--neutral-medium);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === ACCESSIBILITY === */

/* === HIGH CONTRAST SUPPORT === */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0066cc;
        --primary-green: #008855;
        --success-green: #006600;
        --warning-orange: #cc6600;
        --error-red: #cc0000;
    }
}

/* === REDUCED MOTION SUPPORT === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .float, .pulse {
        animation: none;
    }
}

/* === FOCUS STYLES === */
.game-button:focus,
.big-touch-target:focus {
    outline: 3px solid var(--primary-orange);
    outline-offset: 2px;
}