/* Значки-достижения: кружок с картинкой или цветной кружок с надписью. Размер задаётся переменной --ach-size, цвет — --ach-color. */
.ach-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ach-size, 56px);
    height: var(--ach-size, 56px);
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    vertical-align: middle;
}

.ach-badge img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ach-badge-text {
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 55%), var(--ach-color, #f5b942);
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    color: #fff;
    font-weight: 800;
    font-size: calc(var(--ach-size, 56px) * 0.3);
    letter-spacing: 0.4px;
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.ach-item {
    position: relative;
    display: inline-flex;
}

.ach-count {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 20px;
    padding: 1px 5px;
    border-radius: var(--radius);
    background: #14161c;
    border: 1px solid #2c2f3a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

/* Блок «Достижения» в профиле */
.ach-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ach-all {
    margin-top: 14px;
}

.ach-all > summary {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    list-style: none;
}

.ach-all > summary::-webkit-details-marker {
    display: none;
}

.ach-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.ach-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ach-list-title {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.ach-list-text {
    color: var(--white-1, #959699);
    font-size: 12.5px;
    line-height: 1.45;
}

/* Значки из конструктора (SVG, App\Support\BadgeArt): форма, градиент, иконка или надпись */
.ba {
    display: block;
    flex-shrink: 0;
    overflow: visible;
}

.ba-glow {
    filter: drop-shadow(0 0 5px var(--ba-glow, #f5b942));
}

/* Конструктор значка в менеджерке (public/js/badge-designer.js) */
.ba-studio {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    margin-top: 8px;
    padding: 14px;
    border: 1px solid #22242c;
    border-radius: var(--radius);
    background: #0f1116;
}

.ba-stage {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    width: 150px;
}

.ba-stage-big {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 104px;
}

.ba-stage-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ba-stage-hint {
    margin: 0;
    text-align: center;
    font-size: 11.5px;
}

.ba-controls {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    min-width: 260px;
}

.ba-label {
    display: block;
    margin-bottom: 6px;
    color: var(--white-1, #959699);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ba-hint {
    color: var(--white-1, #959699);
    font-size: 12px;
}

.ba-shapes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}

.ba-shape {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px 6px;
    border: 1px solid #2c2f3a;
    border-radius: var(--radius);
    cursor: pointer;
}

.ba-shape input,
.ba-icon input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ba-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.ba-shape input:checked + .ba-thumb {
    outline: 2px solid #1fd742;
    outline-offset: 3px;
}

.ba-shape input:focus-visible + .ba-thumb {
    outline: 2px dashed #fff;
    outline-offset: 3px;
}

.ba-shape-name {
    color: var(--white-1, #959699);
    font-size: 11.5px;
    text-align: center;
}

.ba-shape input:checked ~ .ba-shape-name {
    color: #fff;
    font-weight: 700;
}

.ba-colors {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
}

.ba-color {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--white-1, #959699);
    font-size: 12px;
}

.ba-color input[type="color"] {
    width: 72px;
    height: 36px;
    padding: 2px;
    border: 1px solid #2c2f3a;
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
}

.ba-color input[type="color"]:disabled {
    opacity: 0.4;
    cursor: default;
}

.ba-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.ba-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.ba-preset {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius);
    cursor: pointer;
}

.ba-preset:hover {
    border-color: #fff;
}

.ba-seg {
    display: flex;
    gap: 18px;
}

.ba-seg label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 13.5px;
    cursor: pointer;
}

.ba-symbol {
    max-width: 140px;
}

.ba-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ba-icon {
    position: relative;
    cursor: pointer;
}

.ba-icon svg {
    display: block;
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid #2c2f3a;
    border-radius: var(--radius);
    color: var(--white-1, #959699);
}

.ba-icon input:checked + svg {
    border-color: #1fd742;
    background: rgba(31, 215, 66, 0.12);
    color: #fff;
}

.ba-icon input:disabled + svg {
    opacity: 0.4;
}

.ba-icon input:focus-visible + svg {
    outline: 2px dashed #fff;
    outline-offset: 2px;
}

.ba-image {
    margin-top: 6px;
}

/* «Классика» — прежняя плашка: форма, второй цвет, иконка и свечение не используются */
.ach-fields.is-classic [data-ba-shape-only] {
    opacity: 0.4;
    pointer-events: none;
}

/* загруженная картинка заменяет оформление */
.ach-fields.has-image .ba-controls {
    opacity: 0.55;
}
