.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--tg-theme-bg-color, #fff);
    border-radius: 12px;
    padding: 20px;
    max-width: 90%;
    width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--tg-theme-text-color, #000);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--tg-theme-hint-color, #999);
    padding: 5px;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.badge-card {
    background: var(--tg-theme-secondary-bg-color, #f5f5f5);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease;
}

.badge-card:hover {
    transform: translateY(-2px);
}

.badge-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.badge-icon {
    width: 24px;
    height: 24px;
    margin-right: 5px;
}

.badge-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 10px 0;
    color: var(--tg-theme-text-color, #000);
}

.badge-duration {
    font-size: 0.9rem;
    color: var(--tg-theme-hint-color, #999);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}