/* ============================================
    ACHIEVEMENTS - UI
    Legend + Modal + Particles + Animações + Responsivo
    ============================================ */

/* LEGEND */
.st-ach-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.st-ach-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.st-ach-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.st-ach-legend-dot.unlocked {
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
}

.st-ach-legend-dot.current {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.st-ach-legend-dot.locked { background: var(--text-muted); }

/* MODAL */
.st-ach-modal-content {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-primary) 100%);
    border: 2px solid var(--gold);
    padding: 32px 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    text-align: center;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px var(--gold-glow);
    animation: modalSlideIn 0.4s var(--ease-out);
    max-height: 85vh;
    overflow-y: auto;
}

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

.st-ach-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--metal);
    border: 1.5px solid var(--border-strong);
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    border-radius: 50%;
}

.st-ach-modal-close:hover {
    background: var(--danger);
    color: #FFF;
    border-color: var(--danger);
}

.st-ach-modal-icon {
    width: 130px;
    height: 130px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 4px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: iconFloat 3s ease-in-out infinite;
    padding: 12px;
    overflow: hidden;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.4),
        0 0 30px var(--gold-glow);
    pointer-events: none;
}

.st-ach-modal-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

.st-ach-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(2px 2px 0 #000);
    pointer-events: none;
}

.st-ach-modal-fallback {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 2px 2px 0 #000;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.st-ach-modal-level {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 700;
}

.st-ach-modal-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
    text-shadow: 2px 2px 0 #000;
}

.st-ach-modal-subtitle {
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
}

.st-ach-modal-desc {
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 0 8px;
}

.st-ach-modal-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--metal-dark);
    border: 1px solid var(--border-default);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.st-ach-modal-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-ach-modal-meta-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.st-ach-modal-meta-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    font-weight: 600;
}

.st-ach-modal-meta-value.unlocked { color: var(--success); }

.st-ach-modal-reward {
    padding: 12px;
    background: rgba(201, 169, 97, 0.1);
    border: 1.5px solid var(--gold);
    margin-bottom: 20px;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.st-ach-modal-reward-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.st-ach-modal-reward-value {
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.st-ach-modal-btn { width: 100%; }

/* CELEBRATION PARTICLES */
.st-ach-celebration-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    pointer-events: none;
    z-index: 10000;
    animation: celebrationFly 1.2s ease-out forwards;
    animation-delay: var(--delay);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes celebrationFly {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * 200px),
            calc(sin(var(--angle)) * 200px)
        ) scale(0) rotate(720deg);
        opacity: 0;
    }
}

/* ANIMAÇÕES */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.st-fade-in { animation: fadeIn 0.6s var(--ease-out); }

/* RESPONSIVO */
@media (min-width: 600px) {
    .st-ach-container {
        left: 50% !important;
        transform: translateX(-50%);
        max-width: 480px;
    }
    .st-ach-node-left { margin-right: 20%; }
    .st-ach-node-right { margin-left: 20%; }
    .st-ach-node-circle { width: 90px; height: 90px; }
    .st-ach-node-title { font-size: 1.5rem; }
    .st-ach-modal-icon { width: 150px; height: 150px; }
}

@media (max-width: 380px) {
    .st-ach-node-left { margin-right: 5%; }
    .st-ach-node-right { margin-left: 5%; }
    .st-ach-node-circle { width: 64px; height: 64px; }
    .st-ach-node-title { font-size: 1rem; }
    .st-ach-stat-value { font-size: 1.5rem; }
    .st-ach-legend { flex-direction: column; gap: 10px; align-items: center; }
    .st-ach-modal-icon { width: 110px; height: 110px; }
}