/* ===== DICE ROLL ===== */
/* 3D roll handled via JS transitions on .die-cube + dieBounce in components.css */

/* ===== SCORE CHANGE ===== */
@keyframes scoreUp {
    0% { transform: scale(1); color: var(--accent); }
    50% { transform: scale(1.3); color: var(--success); }
    100% { transform: scale(1); }
}

@keyframes scoreDown {
    0% { transform: scale(1); color: var(--accent); }
    50% { transform: scale(1.3); color: var(--danger-light); }
    100% { transform: scale(1); }
}

.score-up {
    animation: scoreUp 0.6s ease-out;
}

.score-down {
    animation: scoreDown 0.6s ease-out;
}

/* ===== REFLEX FLASH ===== */
@keyframes reflexPulse {
    0%, 100% { box-shadow: 0 0 20px var(--gold-glow); border-color: var(--gold); }
    50% { box-shadow: 0 0 40px rgba(180, 150, 110, 0.8); border-color: var(--accent); }
}

@keyframes reflexUrgent {
    0%, 100% { background-color: rgba(122, 40, 20, 0.1); }
    50% { background-color: rgba(122, 40, 20, 0.25); }
}

.reflex-active {
    animation: reflexPulse 0.8s infinite;
}

/* ===== COMBINATION ANNOUNCE ===== */
@keyframes comboReveal {
    0% { opacity: 0; transform: scale(0.5) translateY(10px); }
    60% { opacity: 1; transform: scale(1.15) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.combo-reveal {
    animation: comboReveal 0.5s ease-out;
}

/* ===== FADE IN/OUT ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.fade-in-up { animation: fadeInUp 0.4s ease-out; }

/* ===== SLIDE ===== */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-left { animation: slideInLeft 0.4s ease-out; }
.slide-in-right { animation: slideInRight 0.4s ease-out; }

/* ===== VICTORY ===== */
@keyframes victoryGlow {
    0%, 100% { text-shadow: 0 0 10px var(--gold-glow); }
    50% { text-shadow: 0 0 30px var(--gold), 0 0 60px rgba(180, 150, 110, 0.5); }
}

.victory-text {
    animation: victoryGlow 1.5s infinite;
}

/* ===== TIMER BAR ===== */
@keyframes timerShrink {
    from { width: 100%; }
    to { width: 0%; }
}

.timer-bar {
    height: 4px;
    background: var(--gold);
    border-radius: 2px;
}

.timer-bar.active {
    animation: timerShrink linear forwards;
}

/* ===== PARTICLES (Cul de Chouette celebration) ===== */
@keyframes particleFly {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0); }
}

.particle {
    position: absolute;
    pointer-events: none;
    font-size: 1.5rem;
    animation: particleFly 1.5s ease-out forwards;
}

/* ===== SHAKE (bevue) ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake { animation: shake 0.5s ease-out; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--parchment-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transition: width 0.1s linear;
}

/* ===== DICE WOBBLE ===== */
@keyframes diceWobble {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    50% { transform: rotate(-2deg); }
    75% { transform: rotate(1deg); }
    100% { transform: rotate(0deg); }
}
.dice-wobble { animation: diceWobble 0.3s ease-out; }

/* ===== CANDLE FLICKER ===== */
@keyframes candleFlicker {
    0%, 100% { box-shadow: 0 0 8px rgba(180, 150, 110, 0.15); }
    25% { box-shadow: 0 0 12px rgba(180, 150, 110, 0.25); }
    50% { box-shadow: 0 0 6px rgba(180, 150, 110, 0.1); }
    75% { box-shadow: 0 0 14px rgba(180, 150, 110, 0.3); }
}

/* ===== TORCH FLAME ===== */
@keyframes flameFlicker {
    0%, 100% {
        filter: drop-shadow(0 0 4px #e8942e) drop-shadow(0 0 8px #c0500a);
        transform: scaleY(1) scaleX(1);
    }
    25% {
        filter: drop-shadow(0 0 6px #f0a030) drop-shadow(0 0 12px #d06010);
        transform: scaleY(1.08) scaleX(0.95);
    }
    50% {
        filter: drop-shadow(0 0 3px #e08020) drop-shadow(0 0 10px #b04008);
        transform: scaleY(0.94) scaleX(1.03);
    }
    75% {
        filter: drop-shadow(0 0 7px #f0a840) drop-shadow(0 0 14px #d86818);
        transform: scaleY(1.05) scaleX(0.97);
    }
}

.torch-flame {
    transform-origin: center bottom;
    animation: flameFlicker 1.5s ease-in-out infinite;
}

/* ===== TORCH LIGHTING PULSE (tavern table) ===== */
@keyframes torchLighting {
    0%, 100% {
        box-shadow:
            inset 0 0 40px rgba(0,0,0,0.5),
            inset 0 2px 0 rgba(180,150,110,0.15),
            inset 0 0 80px rgba(232,148,46,0.04),
            0 0 0 2px #b4966e,
            0 8px 30px rgba(0,0,0,0.6);
    }
    50% {
        box-shadow:
            inset 0 0 40px rgba(0,0,0,0.45),
            inset 0 2px 0 rgba(180,150,110,0.2),
            inset 0 0 100px rgba(232,148,46,0.1),
            0 0 0 2px #b4966e,
            0 8px 30px rgba(0,0,0,0.6),
            0 0 40px rgba(232,148,46,0.06);
    }
}

/* ===== DICE LANDING BOUNCE ===== */
@keyframes diceBounce {
    0% { transform: translateY(0); }
    20% { transform: translateY(-8px); }
    40% { transform: translateY(0); }
    55% { transform: translateY(-3px); }
    70% { transform: translateY(0); }
    82% { transform: translateY(-1px); }
    100% { transform: translateY(0); }
}
.dice-bounce { animation: diceBounce 0.5s ease-out; }

/* ===== TURN INFO TRANSITION ===== */
@keyframes turnFlash {
    0% { opacity: 0; transform: scale(0.8); filter: brightness(2); }
    30% { opacity: 1; transform: scale(1.08); filter: brightness(1.5); }
    60% { transform: scale(0.97); filter: brightness(1.1); }
    100% { transform: scale(1); filter: brightness(1); }
}
.turn-flash { animation: turnFlash 0.6s ease-out; }

/* ===== FULL SCREEN SHAKE (bevue) ===== */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-6px, -2px) rotate(-0.5deg); }
    20% { transform: translate(5px, 3px) rotate(0.5deg); }
    30% { transform: translate(-4px, 1px) rotate(-0.3deg); }
    40% { transform: translate(4px, -2px) rotate(0.3deg); }
    50% { transform: translate(-3px, 2px) rotate(-0.2deg); }
    60% { transform: translate(3px, -1px) rotate(0.2deg); }
    70% { transform: translate(-2px, 1px) rotate(-0.1deg); }
    80% { transform: translate(2px, 0px) rotate(0.1deg); }
    90% { transform: translate(-1px, 0px) rotate(0deg); }
}
.screen-shake { animation: screenShake 0.6s ease-out; }

/* ===== SCORE ENTRY SLIDE IN ===== */
@keyframes scoreEntryIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.score-entry-anim {
    animation: scoreEntryIn 0.35s ease-out both;
}

/* ===== SCORE POP IN ===== */
@keyframes scorePopIn {
    0% { transform: scale(1); }
    40% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ===== DUST PARTICLES (dice impact) ===== */
@keyframes dustFloat {
    0% { opacity: 0.8; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}
.dust-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    animation: dustFloat 0.8s ease-out forwards;
}

/* ===== VICTORY CONFETTI ===== */
@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(var(--spin, 720deg)); opacity: 0; }
}
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 250;
    animation: confettiFall linear forwards;
}
.confetti.square { border-radius: 0; }
.confetti.circle { border-radius: 50%; }
.confetti.strip { width: 4px; height: 14px; border-radius: 2px; }
.confetti.confetti-symbol {
    width: auto;
    height: auto;
    background: none !important;
    font-size: 1.2rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

/* ===== COMBO CARD ENTRANCE ===== */
@keyframes comboCardIn {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    60% { transform: scale(1.08) translateY(-5px); }
    80% { transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes comboIconBounce {
    0% { transform: scale(0) rotate(-15deg); }
    50% { transform: scale(1.3) rotate(5deg); }
    70% { transform: scale(0.9) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes comboGlowPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ===== AMBIENT FLOATING DUST ===== */
@keyframes ambientFloat {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    20% { opacity: 0.4; }
    80% { opacity: 0.3; }
    100% { transform: translate(var(--float-x), var(--float-y)) rotate(180deg); opacity: 0; }
}
.ambient-particle {
    position: fixed;
    width: 3px;
    height: 3px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 0;
    animation: ambientFloat linear infinite;
}

/* ===== FLOATING SCORE CHANGE ===== */
@keyframes scoreFloatUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-40px); }
}
@keyframes scoreFloatDown {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}
.score-float {
    position: absolute;
    right: 0;
    top: -5px;
    font-family: var(--font-score);
    font-size: 0.9rem;
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}
.score-float-up {
    color: var(--success);
    animation: scoreFloatUp 1.2s ease-out forwards;
}
.score-float-down {
    color: var(--danger-light);
    animation: scoreFloatDown 1.2s ease-out forwards;
}

/* Large floating score above dice area */
.score-float-big {
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translateX(-50%);
    font-family: var(--font-score);
    font-size: 1.6rem;
    font-weight: bold;
    pointer-events: none;
    white-space: nowrap;
    z-index: 20;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.score-float-big.score-float-up {
    color: var(--success);
    animation: scoreFloatUp 1.8s ease-out forwards;
}
.score-float-big.score-float-down {
    color: var(--danger-light);
    animation: scoreFloatDown 1.8s ease-out forwards;
}

/* ===== EPILOGUE ===== */
@keyframes epilogueFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes epiloguePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}
@keyframes epilogueScreenFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.epilogue-fade-out {
    animation: epilogueScreenFadeOut 1.2s ease-in forwards;
}

/* ===== AI SPEECH BUBBLE ANIMATIONS ===== */
@keyframes speechBubbleIn {
    0% { opacity: 0; transform: translateY(10px) scale(0.9); }
    50% { transform: translateY(-2px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes speechBubbleOut {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
@keyframes portraitPopIn {
    0% { opacity: 0; transform: scale(0) rotate(-10deg); }
    60% { transform: scale(1.15) rotate(3deg); }
    80% { transform: scale(0.95) rotate(-1deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ===== SCREEN SHAKE ===== */
.shake-light {
    animation: screenShakeLight 0.4s ease-out;
}
.shake-medium {
    animation: screenShakeMedium 0.5s ease-out;
}
.shake-heavy {
    animation: screenShakeHeavy 0.6s ease-out;
}

@keyframes screenShakeLight {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-2px, 1px); }
    30% { transform: translate(2px, -1px); }
    45% { transform: translate(-1px, 1px); }
    60% { transform: translate(1px, 0); }
}

@keyframes screenShakeMedium {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-4px, 2px); }
    20% { transform: translate(4px, -2px); }
    30% { transform: translate(-3px, 2px); }
    40% { transform: translate(3px, -1px); }
    50% { transform: translate(-2px, 1px); }
    60% { transform: translate(1px, -1px); }
}

@keyframes screenShakeHeavy {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    8% { transform: translate(-6px, 3px) rotate(-0.5deg); }
    16% { transform: translate(6px, -3px) rotate(0.5deg); }
    24% { transform: translate(-5px, 2px) rotate(-0.3deg); }
    32% { transform: translate(5px, -2px) rotate(0.3deg); }
    40% { transform: translate(-3px, 2px); }
    50% { transform: translate(3px, -1px); }
    60% { transform: translate(-2px, 1px); }
    70% { transform: translate(1px, 0); }
}
