/**
 * ==========================================
 * CoinRain Win Celebration Styles
 * ==========================================
 * Jutalompont.com - 2025
 * 
 * Győzelmi animáció stílusok a Szerencsehullás játékhoz.
 * Modern, reszponzív design Bootstrap 5 kompatibilitással.
 */

/* ==========================================
   OVERLAY ALAP
   ========================================== */

#coinrain-celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    background: radial-gradient(ellipse at center, 
        rgba(99, 102, 241, 0.15) 0%, 
        rgba(15, 15, 35, 0.98) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#coinrain-celebration-overlay.visible {
    opacity: 1;
    visibility: visible;
}

#coinrain-celebration-overlay.hiding {
    opacity: 0;
}

/* ==========================================
   KONFETTI CANVAS
   ========================================== */

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   FŐ TARTALOM
   ========================================== */

.celebration-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem 2rem;
    max-width: 600px;
    width: 90%;
}

/* ==========================================
   HÁTTÉR GLOW
   ========================================== */

.celebration-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, 
        rgba(99, 102, 241, 0.4) 0%, 
        rgba(139, 92, 246, 0.2) 40%, 
        transparent 70%);
    filter: blur(60px);
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ==========================================
   CÍM SZEKCIÓ
   ========================================== */

.celebration-title-container {
    margin-bottom: 2rem;
    animation: titleSlideIn 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(-30px);
}

#coinrain-celebration-overlay.visible .celebration-title-container {
    animation: titleSlideIn 0.8s ease-out forwards;
}

@keyframes titleSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.celebration-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    text-shadow: 
        0 0 20px rgba(99, 102, 241, 0.8),
        0 0 40px rgba(99, 102, 241, 0.5);
    letter-spacing: -0.02em;
}

.celebration-title.excellent {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #fcd34d 50%, #f59e0b 75%, #fbbf24 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.5));
}

@keyframes shimmer {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

.celebration-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ==========================================
   PONTSZÁM MEGJELENÍTÉS
   ========================================== */

.celebration-score-container {
    position: relative;
    margin: 2.5rem auto;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: scorePopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
    opacity: 0;
    transform: scale(0.5);
}

#coinrain-celebration-overlay.visible .celebration-score-container {
    animation: scorePopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s forwards;
}

@keyframes scorePopIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.score-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #6366f1,
        #8b5cf6,
        #a855f7,
        #ec4899,
        #f43f5e,
        #f97316,
        #eab308,
        #22c55e,
        #06b6d4,
        #6366f1
    );
    animation: ringRotate 4s linear infinite;
    filter: blur(4px);
    opacity: 0.8;
}

@keyframes ringRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.score-glow-ring::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: rgba(15, 15, 35, 0.95);
    border-radius: 50%;
}

.celebration-score {
    position: relative;
    z-index: 2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.8);
}

.celebration-score-label {
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.25rem;
}

.score-multiplier {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 3;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f2937;
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    animation: multiplierBounce 1s ease infinite;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
}

@keyframes multiplierBounce {
    0%, 100% {
        transform: scale(1) rotate(-5deg);
    }
    50% {
        transform: scale(1.05) rotate(5deg);
    }
}

/* ==========================================
   STATISZTIKÁK
   ========================================== */

.celebration-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.celebration-stats.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    min-width: 90px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-label {
    font-size: 0.75rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.rank-item .stat-value {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   BADGES (KITÜNTETÉSEK)
   ========================================== */

.celebration-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.celebration-badges.visible {
    opacity: 1;
    transform: scale(1);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: badgeFloat 2s ease-in-out infinite;
}

.badge-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1f2937;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
}

.badge-silver {
    background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%);
    color: #1f2937;
    box-shadow: 0 4px 20px rgba(156, 163, 175, 0.4);
}

.badge-diamond {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #a78bfa 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    animation: diamondShine 2s ease-in-out infinite;
}

@keyframes badgeFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes diamondShine {
    0%, 100% {
        filter: brightness(1) hue-rotate(0deg);
    }
    50% {
        filter: brightness(1.2) hue-rotate(10deg);
    }
}

/* ==========================================
   FOLYTATÁS GOMB
   ========================================== */

.celebration-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 100px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity 0.5s ease, 
        transform 0.5s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.celebration-continue-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.celebration-continue-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.6);
}

.celebration-continue-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.celebration-continue-btn svg {
    transition: transform 0.3s ease;
}

.celebration-continue-btn:hover svg {
    transform: translateX(4px);
}

/* ==========================================
   RESZPONZÍV STÍLUSOK
   ========================================== */

/* Tablet */
@media (max-width: 768px) {
    .celebration-content {
        padding: 2rem 1.5rem;
    }

    .celebration-score-container {
        width: 160px;
        height: 160px;
    }

    .score-glow-ring {
        width: 140px;
        height: 140px;
    }

    .celebration-stats {
        gap: 1rem;
    }

    .stat-item {
        min-width: 80px;
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .celebration-glow {
        width: 300px;
        height: 300px;
    }
}

/* Mobil */
@media (max-width: 480px) {
    .celebration-content {
        padding: 1.5rem 1rem;
    }

    .celebration-title {
        font-size: 1.75rem;
    }

    .celebration-subtitle {
        font-size: 0.95rem;
    }

    .celebration-score-container {
        width: 140px;
        height: 140px;
        margin: 1.5rem auto;
    }

    .score-glow-ring {
        width: 120px;
        height: 120px;
    }

    .celebration-score {
        font-size: 2rem;
    }

    .celebration-stats {
        gap: 0.5rem;
    }

    .stat-item {
        min-width: 70px;
        padding: 0.6rem;
    }

    .stat-icon {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .celebration-continue-btn {
        padding: 0.85rem 2rem;
        font-size: 1rem;
    }

    .celebration-glow {
        width: 250px;
        height: 250px;
    }

    .score-multiplier {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        top: -5px;
        right: -5px;
    }
}

/* Nagyon kis képernyők */
@media (max-width: 360px) {
    .celebration-stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-item {
        width: 100%;
        max-width: 200px;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .stat-icon {
        margin-bottom: 0;
    }

    .stat-label {
        margin-top: 0;
        order: 2;
    }

    .stat-value {
        order: 3;
    }
}

/* Landscape mobil */
@media (max-height: 500px) and (orientation: landscape) {
    .celebration-content {
        padding: 1rem;
    }

    .celebration-score-container {
        width: 100px;
        height: 100px;
        margin: 1rem auto;
    }

    .score-glow-ring {
        width: 90px;
        height: 90px;
    }

    .celebration-score {
        font-size: 1.5rem;
    }

    .celebration-stats {
        margin: 0.5rem 0;
    }

    .stat-item {
        min-width: 60px;
        padding: 0.5rem;
    }

    .celebration-title {
        font-size: 1.5rem;
    }

    .celebration-continue-btn {
        margin-top: 0.5rem;
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ==========================================
   REDUCED MOTION (Akadálymentesség)
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .celebration-glow,
    .score-glow-ring,
    .score-multiplier,
    .badge,
    .celebration-title.excellent {
        animation: none !important;
    }

    .celebration-title-container,
    .celebration-score-container,
    .celebration-stats,
    .celebration-badges,
    .celebration-continue-btn {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    #coinrain-celebration-overlay {
        transition-duration: 0.1s;
    }
}

/* ==========================================
   DARK MODE TÁMOGATÁS
   ========================================== */

@media (prefers-color-scheme: light) {
    /* Ha valaki világos módot használ, a celebration mégis sötét marad
       mert az overlay átfedi az egész képernyőt */
}

/* ==========================================
   PRINT STÍLUSOK
   ========================================== */

@media print {
    #coinrain-celebration-overlay {
        display: none !important;
    }
}
