/* Попап «Новая ачивка!» — layouts/partials/achievement-popup.blade.php */
body.popup-open { overflow: hidden; }

.achievement-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.achievement-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, .55);
}
.achievement-popup__box {
    position: relative;
    width: 100%;
    max-width: 380px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--surface);
    color: var(--text);
    border-radius: 20px;
    padding: 28px 24px 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    box-sizing: border-box;
}

/* Шапка: надпись и счётчик очереди */
.achievement-popup__header { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.achievement-popup__badge-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
}
.achievement-popup__counter { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Значок ачивки */
.achievement-popup__icon-wrap {
    position: relative;
    width: 128px;
    height: 128px;
    margin: 16px auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.achievement-popup__icon { width: 128px; height: 128px; object-fit: contain; position: relative; z-index: 1; }
.achievement-popup__icon-placeholder {
    width: 104px; height: 104px; border-radius: 50%;
    background: var(--bg2); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.achievement-popup__icon-placeholder svg { width: 52px; height: 52px; }
.achievement-popup__shine {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 166, 35, .35) 0%, rgba(245, 166, 35, 0) 70%);
    animation: ap-pulse 2.4s ease-in-out infinite;
}

.achievement-popup__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 6px;
}
.achievement-popup__desc { font-size: .95rem; line-height: 1.45; color: var(--text2); margin: 0 0 12px; }
.achievement-popup__points {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg2); color: var(--accent);
    font-weight: 700; font-size: .95rem;
    border-radius: 999px; padding: 6px 14px;
    margin-bottom: 16px;
}
.achievement-popup__points svg { width: 16px; height: 16px; }
.achievement-popup__more {
    display: block;
    font-size: .88rem;
    color: var(--accent);
    margin: 0 0 14px;
    text-decoration: none;
}
.achievement-popup__more:hover { text-decoration: underline; }

.achievement-popup__actions { display: flex; flex-direction: column; gap: 10px; }
.achievement-popup__actions .btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 8px; }

.achievement-popup__close {
    position: absolute;
    top: 10px; right: 10px;
    width: 36px; height: 36px;
    border: none; background: none; cursor: pointer;
    color: var(--muted); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.achievement-popup__close:hover { background: var(--bg2); color: var(--text); }
.achievement-popup__close svg { width: 20px; height: 20px; }

/* Конфетти */
.achievement-popup__confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: 20px; }
.achievement-popup__confetti-piece {
    position: absolute;
    top: -12px;
    left: var(--x, 50%);
    width: 8px; height: 12px;
    border-radius: 2px;
    background: var(--accent);
    opacity: 0;
    animation: ap-confetti var(--s, 2.2s) ease-in var(--d, 0s) 1 forwards;
}
.achievement-popup__confetti-piece:nth-child(3n)   { background: var(--accent2); }
.achievement-popup__confetti-piece:nth-child(3n+1) { background: var(--accent3); }
.achievement-popup__confetti-piece:nth-child(4n)   { background: var(--accent-light); width: 6px; height: 6px; border-radius: 50%; }

@keyframes ap-confetti {
    0%   { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 0; transform: translateY(420px) rotate(540deg); }
}
@keyframes ap-pulse {
    0%, 100% { transform: scale(.92); opacity: .8; }
    50%      { transform: scale(1.05); opacity: 1; }
}

/* Переходы Alpine */
.ap-enter, .ap-leave { transition: opacity .2s ease; }
.ap-enter .achievement-popup__box, .ap-leave .achievement-popup__box { transition: transform .25s ease; }
.ap-enter-start { opacity: 0; }
.ap-enter-start .achievement-popup__box { transform: scale(.92) translateY(10px); }
.ap-enter-end, .ap-leave-end { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .achievement-popup__confetti, .achievement-popup__shine { display: none; }
}
