/* ============================================
   SNG WRESTLING BASH - ANIMATIONS
   Scroll reveals, pyrotechnics, wrestling effects
   ============================================ */

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.slam-in {
    transform: translateY(-60px) scale(1.3);
}

.scroll-reveal.slam-in.revealed {
    transform: translateY(0) scale(1);
}

.scroll-reveal.slide-left {
    transform: translateX(-60px);
}

.scroll-reveal.slide-left.revealed {
    transform: translateX(0);
}

.scroll-reveal.slide-right {
    transform: translateX(60px);
}

.scroll-reveal.slide-right.revealed {
    transform: translateX(0);
}

.scroll-reveal.zoom-in {
    transform: scale(0.5);
}

.scroll-reveal.zoom-in.revealed {
    transform: scale(1);
}

.scroll-reveal.flip-in {
    transform: perspective(600px) rotateX(30deg);
}

.scroll-reveal.flip-in.revealed {
    transform: perspective(600px) rotateX(0);
}

/* ============================================
   PYROTECHNICS / FIRE EFFECTS
   ============================================ */
.hero-pyro {
    position: absolute;
    width: 120px;
    height: 200px;
    pointer-events: none;
}

.pyro-left {
    left: 5%;
    bottom: 20%;
}

.pyro-right {
    right: 5%;
    bottom: 20%;
}

.hero-pyro::before,
.hero-pyro::after {
    content: '';
    position: absolute;
    width: 6px;
    border-radius: 3px;
    animation: pyroShoot 1.5s ease-out infinite;
}

.hero-pyro::before {
    left: 30%;
    background: linear-gradient(to top, var(--color-fire-red), var(--color-fire-orange), transparent);
    animation-delay: 0s;
    height: 80px;
}

.hero-pyro::after {
    left: 60%;
    background: linear-gradient(to top, var(--color-fire-orange), var(--color-gold), transparent);
    animation-delay: 0.3s;
    height: 100px;
}

@keyframes pyroShoot {
    0% {
        transform: translateY(0) scaleY(0);
        opacity: 0;
    }
    20% {
        transform: translateY(-40px) scaleY(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-180px) scaleY(0.3);
        opacity: 0;
    }
}

/* Spark particles */
.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-gold);
    pointer-events: none;
    animation: sparkFly 1s ease-out forwards;
}

@keyframes sparkFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--spark-x, 50px), var(--spark-y, -80px)) scale(0);
        opacity: 0;
    }
}

/* ============================================
   EXPLOSION EFFECT
   ============================================ */
.explosion {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
}

.explosion-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid var(--color-fire-orange);
    animation: explosionRing 0.8s ease-out forwards;
}

@keyframes explosionRing {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

.explosion-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-gold), var(--color-fire-orange), transparent);
    animation: explosionFlash 0.4s ease-out forwards;
}

@keyframes explosionFlash {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* ============================================
   WRESTLING RING ENTRANCE
   ============================================ */
.ring-entrance {
    animation: ringEntrance 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ringEntrance {
    0% {
        transform: translateY(100vh) scale(0.8);
        opacity: 0;
    }
    40% {
        transform: translateY(-20px) scale(1.05);
        opacity: 1;
    }
    60% {
        transform: translateY(10px) scale(0.98);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   VS ANIMATION
   ============================================ */
.vs-container .vs-wrestler-left {
    animation: vsSlideLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.vs-container .vs-wrestler-right {
    animation: vsSlideRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.vs-container .vs-middle {
    animation: vsAppear 0.6s ease 0.5s both;
}

@keyframes vsSlideLeft {
    from { transform: translateX(-100vw) rotate(-5deg); opacity: 0; }
    to { transform: translateX(0) rotate(0); opacity: 1; }
}

@keyframes vsSlideRight {
    from { transform: translateX(100vw) rotate(5deg); opacity: 0; }
    to { transform: translateX(0) rotate(0); opacity: 1; }
}

@keyframes vsAppear {
    from { transform: scale(3) rotate(10deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

/* VS Text Pulse */
.vs-text {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 10vw, 6rem);
    animation: vsPulse 1.5s ease-in-out infinite;
}

.vs-v {
    color: var(--color-fire-red);
    text-shadow: 0 0 20px rgba(255, 51, 51, 0.8);
}

.vs-s {
    color: var(--color-fire-orange);
    text-shadow: 0 0 20px rgba(255, 102, 0, 0.8);
}

@keyframes vsPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
}

/* ============================================
   WINNER CELEBRATION
   ============================================ */
.match-winner-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: winnerFadeIn 0.5s ease;
}

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

.winner-content {
    text-align: center;
    animation: winnerSlam 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes winnerSlam {
    0% {
        transform: scale(3) rotate(10deg);
        opacity: 0;
    }
    50% {
        transform: scale(0.9) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.winner-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--color-gold);
    object-fit: cover;
    margin: 20px auto;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: winnerGlow 2s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 60px rgba(255, 215, 0, 0.8), 0 0 100px rgba(255, 102, 0, 0.4); }
}

.winner-name {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-gold);
    letter-spacing: 4px;
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */
.card-tilt {
    transition: transform var(--transition-medium);
    transform-style: preserve-3d;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(-3deg) translateY(-5px);
}

/* ============================================
   SHATTER EFFECT
   ============================================ */
.shatter-piece {
    position: absolute;
    background: inherit;
    animation: shatterFly 0.8s ease-out forwards;
}

@keyframes shatterFly {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--fly-x, 100px), var(--fly-y, -100px)) rotate(var(--fly-rot, 45deg)) scale(0);
        opacity: 0;
    }
}

/* ============================================
   PULSE BORDER EFFECT
   ============================================ */
.pulse-border {
    position: relative;
}

.pulse-border::after {
    content: '';
    position: absolute;
    top: -3px; right: -3px; bottom: -3px; left: -3px;
    border-radius: inherit;
    border: 2px solid var(--color-fire-red);
    animation: pulseBorder 2s ease-in-out infinite;
}

@keyframes pulseBorder {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.02); }
}

/* ============================================
   SPOTLIGHT EFFECTS
   ============================================ */
.entrance-lights {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    pointer-events: none;
    overflow: hidden;
}

.spotlight {
    position: absolute;
    width: 200px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.1), transparent 70%);
    animation: spotlightSweep 4s ease-in-out infinite;
}

.spotlight-left {
    left: -50px;
    top: -100px;
    animation-direction: normal;
}

.spotlight-right {
    right: -50px;
    top: -100px;
    animation-direction: reverse;
}

@keyframes spotlightSweep {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

/* ============================================
   SCREEN SHAKE
   ============================================ */
.screen-shake {
    animation: screenShake 0.5s ease;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5px, 3px); }
    20% { transform: translate(5px, -3px); }
    30% { transform: translate(-3px, 5px); }
    40% { transform: translate(3px, -5px); }
    50% { transform: translate(-5px, 2px); }
    60% { transform: translate(5px, -2px); }
    70% { transform: translate(-2px, 5px); }
    80% { transform: translate(2px, -5px); }
    90% { transform: translate(-3px, 3px); }
}

/* ============================================
   CHAMPION BELT ANIMATION
   ============================================ */
.champion-belt {
    margin-top: 30px;
    perspective: 800px;
}

.belt-plate {
    background: linear-gradient(135deg, #b8860b, #ffd700, #daa520, #ffd700, #b8860b);
    padding: 20px 40px;
    border-radius: 100px;
    border: 3px solid #8b6914;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
    animation: beltShine 3s ease-in-out infinite;
}

.belt-text {
    font-family: var(--font-heading);
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
    letter-spacing: 4px;
    color: #1a1100;
    text-shadow: 0 1px 0 rgba(255, 215, 0, 0.5);
}

@keyframes beltShine {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 60px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.3);
    }
}

/* ============================================
   CHAMPION PAGE
   ============================================ */
.champion-arena {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a1000 0%, #0a0a0a 70%);
}

#confetti-canvas {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.champion-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px;
}

.champion-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 4rem);
    margin-bottom: 20px;
    letter-spacing: 8px;
}

.champion-photo-wrap {
    position: relative;
    display: inline-block;
}

.champion-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 5px solid var(--color-gold);
    object-fit: cover;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.6);
}

.champion-name {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: 6px;
    margin: 20px 0;
}

.champion-catchphrase {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--color-gray-light);
    font-style: italic;
}

/* ============================================
   PAGE TRANSITION
   ============================================ */
.page-enter {
    animation: pageEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.page-exit {
    animation: pageExit 0.3s ease forwards;
}

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

/* ============================================
   MATCH PYRO BACKGROUND
   ============================================ */
.match-pyro {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 90%, rgba(255, 51, 51, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(255, 102, 0, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    animation: pyroFlicker 3s ease-in-out infinite alternate;
}

@keyframes pyroFlicker {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.counter-animate {
    display: inline-block;
    animation: counterPop 0.3s ease;
}

@keyframes counterPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: var(--color-gold); }
    100% { transform: scale(1); }
}

/* ============================================
   REDUCE MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}
