/* ═══════════════════════════════════════════════════════════
   FLOATING BUTTON
   ═══════════════════════════════════════════════════════════ */
#ach-floating-btn {
    position: fixed;
    right: 16px;
    bottom: 90px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.6), 0 0 0 3px rgba(245, 158, 11, 0.15);
    transition: transform 0.15s;
}
#ach-floating-btn:active { transform: scale(0.93); }
.ach-btn-icon { line-height: 1; pointer-events: none; }
.ach-btn-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fbbf24;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1.5px solid #f59e0b;
    white-space: nowrap;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.ach-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: achFadeIn 0.2s ease-out;
}
@keyframes achFadeIn { from { opacity: 0; } to { opacity: 1; } }
.ach-modal {
    background: linear-gradient(180deg, #1a1a2e, #0f0f1e);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 60px rgba(245, 158, 11, 0.15);
    overflow: hidden;
}
.ach-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
    flex-shrink: 0;
}
.ach-title {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ach-counter {
    font-size: 14px;
    color: #8b8ba7;
}
.ach-counter b {
    color: #fbbf24;
    font-size: 16px;
    font-weight: 900;
}
.ach-close {
    background: transparent;
    border: none;
    color: #8b8ba7;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
}
.ach-close:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* Filter */
.ach-filter {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.ach-filter::-webkit-scrollbar { display: none; }
.ach-filter-btn {
    padding: 8px 14px;
    background: rgba(60, 60, 90, 0.5);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #a0a0c0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
}
.ach-filter-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-color: #fbbf24;
}
.ach-filter-cnt {
    opacity: 0.7;
    margin-left: 2px;
    font-weight: 800;
}

/* Grid */
.ach-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    scrollbar-width: thin;
}

/* Card */
.ach-card {
    background: rgba(30, 30, 50, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    position: relative;
    transition: transform 0.12s;
}
.ach-card.ach-locked {
    opacity: 0.45;
    filter: grayscale(0.9);
}
.ach-card.ach-locked .ach-card-icon { opacity: 0.6; }

.ach-card.ach-rarity-common { border-color: rgba(160, 160, 190, 0.25); }
.ach-card.ach-rarity-rare { border-color: rgba(96, 165, 250, 0.5); box-shadow: 0 0 20px rgba(96, 165, 250, 0.15); }
.ach-card.ach-rarity-epic { border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 0 24px rgba(168, 85, 247, 0.25); }

.ach-card-icon {
    font-size: 36px;
    margin-bottom: 8px;
    line-height: 1;
}
.ach-card-name {
    font-size: 13px;
    font-weight: 800;
    color: #e8e8f0;
    margin-bottom: 4px;
}
.ach-card-desc {
    font-size: 10px;
    color: #8b8ba7;
    line-height: 1.35;
    margin-bottom: 8px;
    min-height: 27px;
}
.ach-card-rarity {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 6px;
    border-radius: 6px;
    display: inline-block;
}
.ach-rarity-common .ach-card-rarity { background: rgba(160, 160, 190, 0.2); color: #c0c0d0; }
.ach-rarity-rare .ach-card-rarity { background: rgba(96, 165, 250, 0.2); color: #60a5fa; }
.ach-rarity-epic .ach-card-rarity { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

/* ═══════════════════════════════════════════════════════════
   POPUP
   ═══════════════════════════════════════════════════════════ */
.ach-popup {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: linear-gradient(135deg, #1a1a2e, #0f0f1e);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 90vw;
    width: 340px;
    z-index: 2147483100;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(245, 158, 11, 0.4);
    transition: transform 0.4s cubic-bezier(0.2, 1.1, 0.4, 1);
}
.ach-popup.ach-popup-in { transform: translateX(-50%) translateY(0); }
.ach-popup-icon {
    font-size: 42px;
    line-height: 1;
    flex-shrink: 0;
    animation: achPopBounce 0.6s ease-out;
}
@keyframes achPopBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.ach-popup-body { flex: 1; min-width: 0; }
.ach-popup-title {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.ach-popup-name {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 2px;
}
.ach-popup-desc {
    font-size: 11px;
    color: #8b8ba7;
    line-height: 1.3;
}
.ach-popup.ach-rarity-rare { border-color: #60a5fa; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(96, 165, 250, 0.5); }
.ach-popup.ach-rarity-epic { border-color: #c084fc; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 40px rgba(168, 85, 247, 0.6); }

/* ─── PNG-иконки ─── */
.ach-card-icon img,
.ach-popup-icon img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    image-rendering: -webkit-optimize-contrast;
}
.ach-card.ach-locked .ach-card-icon img {
    filter: grayscale(1) opacity(0.4);
}

/* ─── PNG-иконки ─── */
.ach-card-icon img,
.ach-popup-icon img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    image-rendering: -webkit-optimize-contrast;
}
.ach-card.ach-locked .ach-card-icon img {
    filter: grayscale(1) opacity(0.4);
}

/* ─── PNG-иконки ─── */
.ach-card-icon img,
.ach-popup-icon img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    image-rendering: -webkit-optimize-contrast;
}
.ach-card.ach-locked .ach-card-icon img {
    filter: grayscale(1) opacity(0.4);
}


/* Кнопка закрытия всплывающего достижения */
.ach-popup-close {
    position: absolute;
    top: 5px;
    right: 7px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    color: #b8b8ca;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}
.ach-popup-close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
