/* 答題回饋共用樣式：連勝里程碑慶祝動畫（彩紙屑＋徽章）與答對/答錯時的
   卡片動畫，由 /games/js/game-feedback.js 動態建立/移除或加上 class。 */

.confetti-piece {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    pointer-events: none;
    opacity: 1;
    will-change: transform, opacity;
    animation: confetti-burst 0.9s ease-out forwards;
    z-index: 1000;
}

@keyframes confetti-burst {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.4);
        opacity: 0;
    }
}

.milestone-badge {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.4);
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid var(--accent-green, #8E9E82);
    color: var(--accent-blue, #7C909C);
    font-family: 'Varela Round', sans-serif;
    font-size: 28px;
    font-weight: bold;
    padding: 16px 32px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(100, 100, 100, 0.25);
    pointer-events: none;
    z-index: 1001;
    white-space: nowrap;
    animation: milestone-pop 1.1s ease-out forwards;
}

@keyframes milestone-pop {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
    15%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    30%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

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

@keyframes bounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    70%  { transform: scale(0.96); }
    100% { transform: scale(1); }
}

.shake-animation  { animation: shake  0.4s ease-in-out; }
.bounce-animation { animation: bounce 0.4s ease-out; }
