/**
 * Funquizo Games - Serve It! Shared Styles & Animations
 */

:root {
    --fq-serve-accent: #10b981;
    --fq-serve-error: #ef4444;
    --fq-serve-combo: #f59e0b;
}

/* Override Funquizo base layout main.container */
main.container {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Outer Shell Container for Serve It! playable games - matches 1280px standard */
.gh-game-container {
    width: min(1280px, calc(100% - 48px));
    margin-inline: auto;
    padding: 0.5rem 0 3.5rem;
}

@media (max-width: 760px) {
    .gh-game-container {
        width: calc(100% - 14px);
    }
}

/* Flying served item */
.fq-flying-item {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 2.75rem;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.28s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.28s ease;
    will-change: transform, opacity;
}

.fq-flying-item.arrived {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
}

/* Floating score popup */
.fq-floating-score {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    font-weight: 900;
    font-size: 1.5rem;
    color: #10b981;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: fqFloatUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fq-floating-score.is-combo {
    color: #f59e0b;
    font-size: 1.75rem;
}

.fq-floating-score.is-penalty {
    color: #ef4444;
}

@keyframes fqFloatUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.6);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -15px) scale(1.15);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50px) scale(1);
    }
}

/* Customer bubble pulse */
@keyframes fqCustomerBlink {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.fq-customer-happy {
    animation: fqCustomerBlink 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Shake on mistake */
@keyframes fqShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

.fq-tray-shake {
    animation: fqShake 0.3s ease-in-out;
}

.fq-item-error {
    animation: fqShake 0.3s ease-in-out;
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
}

/* Tray lockout indicator */
.fq-tray-locked {
    pointer-events: none !important;
    opacity: 0.82;
    filter: grayscale(0.2);
}

/* Pop in animation for new fruits unlocking at tier transition */
@keyframes fqItemPopIn {
    0% {
        opacity: 0;
        transform: scale(0.4);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.fq-item-new {
    animation: fqItemPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Tier up announcement banner */
.fq-tier-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    z-index: 50;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fq-tier-banner.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
