.badge-medal, .badge-slot, .badge-detail { --metal: #808080; }
.badge-medal, .badge-slot {
    box-sizing: border-box;
    width: 32px;
    height: 36px;
    display: inline-grid;
    flex: none;
    place-items: center;
    vertical-align: middle;
    clip-path: polygon(50% 0, 96% 22%, 92% 72%, 50% 100%, 8% 72%, 4% 22%);
    background: var(--metal);
    position: relative;
    isolation: isolate;
}
.badge-medal::before, .badge-slot::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 2px;
    clip-path: inherit;
    background: linear-gradient(155deg, #192434, #081018 70%);
}
.badge-medal i { color: color-mix(in srgb, var(--metal) 65%, white); font-size: 14px; }
.badge-slot { --metal: #384451; }
.badge-rare { --metal: #0066ff; }
.badge-mythic { --metal: #bc13fe; }
.badge-legendary { --metal: #ffcc00; }
.badge-secret { --metal: #ff003c; }
.badge-rack { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.badge-rack:empty { display: none; }
.badge-edit, .badge-choice, .badge-save { cursor: pointer; font: inherit; }
.badge-edit {
    display: grid; justify-items: center; gap: 4px;
    min-height: 36px; padding: 5px 10px; color: #abd0e3;
    border: 1px solid #31444f; border-radius: 9px; background: #0d1922;
    font-size: 12px; font-weight: 650;
}
.badge-portrait { display: grid; justify-items: center; gap: 4px; max-width: 100%; }
.badge-pin { display: grid; place-items: center; min-width: 40px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.badge-pin .badge-medal { width: 27px; height: 30px; }
.badge-pin .badge-medal i { font-size: 12px; }
.badge-editor { color: #e3eff8; text-align: start; }
.badge-editor p { margin: 0 0 12px; color: #b9c8d8; font-size: 14px; line-height: 1.5; }
.badge-preview {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 12px 9px; border-block: 1px solid #2a3d4b; background: #0b151e;
}
.badge-preview output { white-space: nowrap; font: 600 12px var(--mono, monospace); }
.badge-preview .badge-rack { justify-content: flex-start; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: 6px; margin: 12px 0; }
.badge-entry { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 4px; }
.badge-choice {
    width: 44px; min-height: 48px; padding: 4px; color: #e5eff8; background: #101a24;
    border: 1px solid #314354; border-radius: 8px; font-size: 13px; font-weight: 650;
}
.badge-choice strong { font: 700 13px var(--mono, monospace); color: #a5b6c8; }
.badge-choice[aria-pressed="true"] { background: #102a32; border-color: #49ccca; }
.badge-choice[aria-pressed="true"] strong { color: #a3ffed; }
.badge-editor .badge-feedback:empty { display: none; }
.badge-save { width: 100%; min-height: 44px; padding: 8px; background: #16404a; color: #d8fffa; border: 1px solid #65bcbf; border-radius: 8px; }
.badge-choice:disabled, .badge-save:disabled { opacity: .55; cursor: default; }
:is(.badge-choice,.badge-save,.badge-edit,.badge-pin,.badge-detail summary):focus-visible { outline: 2px solid #9ffae9; outline-offset: 2px; }
.badge-public { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); align-items: start; gap: 6px; }
.badge-detail { min-width: 0; border: 1px solid #354453; border-inline-start: 3px solid var(--metal); border-radius: 8px; background: #0d1720; text-align: start; }
.badge-detail summary { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 5px 8px; box-sizing: border-box; border-radius: 5px; list-style: none; cursor: pointer; }
.badge-detail summary::-webkit-details-marker { display: none; }
.badge-caption { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.badge-caption strong { color: #ecf2f7; font: 650 13px/1.25 var(--sans, sans-serif); }
.badge-caption small { color: color-mix(in srgb, var(--metal) 55%, white); font: 600 10px/1.3 var(--mono, monospace); }
.badge-chevron { color: #a9bbca; font-size: 10px; }
.badge-detail[open] .badge-chevron { transform: rotate(180deg); }
.badge-detail > p { margin: 0; padding: 8px 10px 10px; border-top: 1px solid #293743; color: #c9d9e6; font: 400 14px/1.45 var(--sans, sans-serif); overflow-wrap: anywhere; }

.p-identity-console:has(.badge-pin[data-badge="school_final"]), .public-operator-profile:has(.badge-detail[data-badge="school_final"]) { outline:2px solid #e6c775; outline-offset:-2px; }
