/* ══════════════════════════════════════════════
   area-celebration.css
   Phase 2.9 — Area Completion Celebration (full‑screen).
   ══════════════════════════════════════════════ */

.ac-celebration-overlay {
    position: fixed;
    inset: 0;
    z-index: 253;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 11, 18, 0.92);
    backdrop-filter: blur(12px);
    padding: var(--space-4);
    animation: acOverlayIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    pointer-events: none;
}

.ac-celebration-overlay.ac-exit {
    animation: acOverlayOut 0.6s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes acOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes acOverlayOut { from { opacity: 1; } to { opacity: 0; } }

.ac-card {
    width: 100%;
    max-width: 440px;
    padding: var(--space-6) var(--space-5) var(--space-6);
    background: var(--surface-deep);
    border: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 80px rgba(226, 176, 74, 0.25);
    text-align: center;
    position: relative;
    animation: acCardIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes acCardIn {
    0%   { opacity: 0; transform: scale(0.85) translateY(30px); }
    60%  { opacity: 1; transform: scale(1.04) translateY(-4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.ac-character-wrap {
    width: 220px;
    height: 220px;
    margin: -30px auto var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.ac-character-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 0 40px rgba(226, 176, 74, 0.6)) drop-shadow(0 12px 24px rgba(0,0,0,0.5));
    animation: acCharPop 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.05s both;
}

@keyframes acCharPop {
    0%   { opacity: 0; transform: scale(0.4) translateY(30px); }
    70%  { opacity: 1; transform: scale(1.15) translateY(-6px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Particles ── */
.ac-particles {
    position: absolute;
    inset: -40px;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.ac-particle {
    position: absolute;
    width: 16px;
    height: 16px;
    color: var(--gold-glow);
    opacity: 0;
    animation: acParticleBurst 1.4s ease-out var(--ac-particle-delay, 0s) forwards;
}

.ac-particle::before {
    content: '✦';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(240, 200, 96, 0.8));
}

@keyframes acParticleBurst {
    0%   { opacity: 0; transform: translate(0, 0) scale(0.3) rotate(0deg); }
    35%  { opacity: 1; transform: translate(var(--ac-tx, 0px), var(--ac-ty, -50px)) scale(1.3) rotate(50deg); }
    100% { opacity: 0; transform: translate(var(--ac-tx, 0px), var(--ac-ty, -100px)) scale(0.5) rotate(100deg); }
}

/* ── Text content ── */
.ac-title {
    font-family: 'Oswald', var(--font), sans-serif;
    font-size: 2.0rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff5d6 0%, #f0c860 40%, #e2b04a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    margin-bottom: var(--space-1);
    animation: acTextIn 0.5s ease-out 0.25s both;
}

.ac-area-name {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: var(--space-2);
    animation: acTextIn 0.5s ease-out 0.35s both;
}

.ac-message {
    font-size: var(--text-xl);
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: var(--space-3);
    animation: acTextIn 0.5s ease-out 0.45s both;
}

.ac-reward-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(92, 201, 138, 0.12);
    border: 1.5px solid rgba(92, 201, 138, 0.4);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-5);
    box-shadow: 0 0 30px rgba(92, 201, 138, 0.15);
    animation: acTextIn 0.5s ease-out 0.55s both;
}

.ac-reward-label {
    font-size: var(--text-base);
    font-weight: 700;
    color: rgba(92, 201, 138, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ac-reward-value {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: var(--text-2xl);
    color: var(--xp-green);
}

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

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .ac-celebration-overlay,
    .ac-celebration-overlay.ac-exit {
        animation: none;
        opacity: 1;
    }
    .ac-celebration-overlay.ac-exit { opacity: 0; }

    .ac-card {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .ac-character-img {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .ac-particle {
        display: none;
    }

    .ac-title,
    .ac-area-name,
    .ac-message,
    .ac-reward-pill {
        animation: none;
        opacity: 1;
        transform: none;
    }
}