.badge-collection {
    margin-top: 1.8rem;
    padding-top: 1.7rem;
    border-top: 1px solid rgba(234, 251, 255, 0.2);
    color: var(--identity-foam);
}
.badge-collection-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; }
.badge-collection-heading h3 { margin: 0; font-size: 1.4rem; }
.badge-collection-count { color: var(--identity-aqua); font-size: 0.8rem; font-weight: 700; }
.badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.badge-grid:empty { margin-top: 0; }
.badge-card { --badge-material: #a9cbd6; min-width: 0; padding: 1.1rem; border: 1px solid rgba(177, 222, 233, 0.25); border-radius: 1.2rem; background: rgba(3, 29, 48, 0.48); }
.badge-card[data-tier="1"] { --badge-material: #eeb286; }
.badge-card[data-tier="2"] { --badge-material: #d3e0ee; }
.badge-card[data-tier="3"] { --badge-material: #ffda77; }
.badge-card[data-tier="4"] { --badge-material: #d6fbff; }
.badge-card[data-tier="5"] { --badge-material: #f3caff; }
.badge-card-header { display: flex; gap: 0.85rem; align-items: center; }
.badge-card-header > div { min-width: 0; }
.badge-title { margin: 0.25rem 0 0; font-size: 1.1rem; line-height: 1.2; overflow-wrap: anywhere; }
.badge-state { margin: 0; color: var(--badge-material); font-size: 0.72rem; font-weight: 800; line-height: 1.4; }
.badge-mark { position: relative; display: block; flex: 0 0 4.6rem; width: 4.6rem; height: 5rem; border: 2px solid var(--badge-material); border-radius: 1.2rem 1.2rem 1.8rem 1.8rem; background: #092c40; }
.badge-mark img { display: block; width: 100%; height: 100%; padding: 0.1rem 0.12rem 0.4rem; object-fit: contain; }
.badge-numeral { position: absolute; bottom: -0.32rem; left: 50%; transform: translateX(-50%); min-width: 2rem; padding: 0.15rem 0.3rem; border: 1px solid var(--badge-material); border-radius: 0.4rem; background: #092c40; color: var(--badge-material); font: 800 0.75rem/1.15 Georgia, serif; text-align: center; }
.badge-card[data-state="locked"] .badge-mark img { filter: saturate(0.2); opacity: 0.7; }
.badge-card[data-tier="2"] .badge-mark { border-style: double; border-width: 3px; }
.badge-card[data-tier="3"] .badge-mark { box-shadow: 0 0 0 2px #092c40, 0 0 0 3px var(--badge-material); }
.badge-card[data-tier="4"] .badge-mark { border-radius: 0.5rem 0.5rem 1.8rem 1.8rem; box-shadow: inset 0 0 0 3px #092c40, inset 0 0 0 4px var(--badge-material); }
.badge-card[data-tier="5"] .badge-mark { border-radius: 0.5rem 1.7rem 0.5rem 1.7rem; box-shadow: 0 0 0 2px #092c40, 0 0 0 3px var(--badge-material), inset 0 0 0 2px #092c40, inset 0 0 0 3px var(--badge-material); }
.badge-description { margin: 1rem 0 0.7rem; color: var(--identity-muted); font-size: 0.82rem; line-height: 1.5; }
.badge-earned-requirement { color: #b8eadc; font-size: 0.74rem; line-height: 1.4; }
.badge-progress-copy { margin: 0.7rem 0 0.35rem; font-size: 0.85rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.badge-progress { display: block; width: 100%; height: 0.4rem; overflow: hidden; border: 0; border-radius: 1rem; color: var(--badge-material); background: #173d50; accent-color: var(--badge-material); }
.badge-progress::-webkit-progress-bar { background: #173d50; }
.badge-progress::-webkit-progress-value { background: var(--badge-material); border-radius: 1rem; }
.badge-progress::-moz-progress-bar { background: var(--badge-material); border-radius: 1rem; }
.badge-next, .badge-maximum { margin: 0.45rem 0 0; color: var(--badge-material); font-size: 0.76rem; font-weight: 700; }
.badge-mode { margin: 0.8rem 0 0; color: var(--identity-muted); font-size: 0.66rem; line-height: 1.4; }
.badge-requirements { margin-top: 0.85rem; border-top: 1px solid rgba(177, 222, 233, 0.16); }
.badge-requirements summary { min-height: 2.75rem; padding-top: 0.85rem; color: var(--identity-foam); cursor: pointer; font-size: 0.78rem; }
.badge-requirements ol { display: grid; gap: 0.65rem; list-style: none; padding: 0; margin: 0.25rem 0 0.7rem; }
.badge-requirements li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 0.5rem; font-size: 0.73rem; line-height: 1.4; }
.badge-requirements li span { color: var(--identity-muted); }
.badge-requirements li strong { font-variant-numeric: tabular-nums; }
.badge-history { margin-top: 1rem; padding: 1.1rem; border: 1px solid rgba(57, 215, 208, 0.4); border-radius: 1rem; background: rgba(14, 100, 110, 0.22); }
.badge-history h4 { margin: 0; font-size: 1rem; line-height: 1.4; }
.badge-history ul { margin: 0.9rem 0; padding-left: 1.2rem; font-size: 0.84rem; line-height: 1.6; }
.badge-history-note { padding-left: 0.85rem; border-left: 2px solid #a7cbd7; }
.badge-collection-status:empty { display: none; }
.badge-collection :is(button, summary):focus-visible { outline: 3px solid var(--identity-gold); outline-offset: 3px; }
@media (max-width: 620px) { .badge-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 360px) { .badge-card { padding: 0.9rem; } .badge-card-header { gap: 0.75rem; } }

/* The original family pictograms keep their silhouettes. Tier relief and
   numerals remain legible at compact size and do not depend on material colour. */
.badge-artwork { --badge-material: #9bbac7; isolation: isolate; flex-shrink: 0; box-sizing: border-box; margin: 0.3rem 0 0.5rem; background: radial-gradient(ellipse at 30% 15%, #24536a, #092c40 70%); }
.badge-artwork[data-tier="1"] { --badge-material: #eeb286; }
.badge-artwork[data-tier="2"] { --badge-material: #d3e0ee; border: 3px double var(--badge-material); }
.badge-artwork[data-tier="3"] { --badge-material: #ffda77; border-radius: 0.85rem 0.85rem 1.9rem 1.9rem; box-shadow: 0 0 0 2px #092c40, 0 0 0 3px var(--badge-material); }
.badge-artwork[data-tier="4"] { --badge-material: #d6fbff; border-radius: 0.45rem 0.45rem 1.7rem 1.7rem; box-shadow: inset 0 0 0 3px #092c40, inset 0 0 0 4px var(--badge-material); }
.badge-artwork[data-tier="5"] { --badge-material: #f3caff; border-radius: 0.45rem 1.7rem 0.45rem 1.7rem; box-shadow: 0 0 0 2px #092c40, 0 0 0 3px var(--badge-material), inset 0 0 0 2px #092c40, inset 0 0 0 3px var(--badge-material); background: linear-gradient(135deg, #42516a, #163d52 40%, #34305b 80%); }
.badge-artwork[data-tier="0"] img { filter: saturate(0.2); opacity: 0.7; }
.badge-artwork > img { padding: 0.5rem 0.15rem 0.6rem; }
.badge-relief { position: absolute; top: -0.23rem; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; gap: 0.19rem; width: 2.7rem; }
.badge-relief i { display: block; width: 0.34rem; height: 0.34rem; border: 1px solid #092c40; border-radius: 50%; background: var(--badge-material); box-sizing: content-box; }
.badge-artwork[data-tier="3"] .badge-relief i { border-radius: 1px; transform: rotate(45deg); }
.badge-artwork[data-tier="4"] .badge-relief i { height: 0.44rem; border-radius: 0; }
.badge-artwork[data-tier="5"] .badge-relief i { height: 0.5rem; border-radius: 0.1rem 0.1rem 0 0; transform: skewY(-14deg); }
.badge-artwork[data-size="large"] { width: 8.6rem; height: 9rem; flex-basis: 8.6rem; }
.badge-artwork[data-size="large"] .badge-numeral { min-width: 2.9rem; font-size: 1.1rem; padding: 0.2rem 0.55rem; }
.badge-artwork[data-size="large"] .badge-relief { width: 4rem; gap: 0.3rem; }
.badge-artwork[data-size="large"] .badge-relief i { width: 0.5rem; height: 0.5rem; }
/* Administrator awards have their own silhouettes and enamel settings. They
   have no numbered tiers, relief counters, or locked variants. */
.badge-artwork[data-kind="special"] { --badge-material: #9aeeff; border-width: 2px; border-radius: 0.5rem; background: linear-gradient(145deg, #164c68, #102d46 70%); box-shadow: inset 0 0 0 3px #092c40, inset 0 0 0 4px #447b96; }
.badge-artwork[data-kind="special"] > img { padding: 0.2rem 0.12rem 0.4rem; }
.badge-artwork[data-special-badge="special_alpha"] { --badge-material: #ffc857; border-radius: 1.5rem 1.5rem 0.6rem 0.6rem; background: linear-gradient(150deg, #674638, #342d35 70%); box-shadow: inset 0 0 0 3px #302b35, inset 0 0 0 4px #ad7948; }
.badge-artwork[data-special-badge="special_beta"] { --badge-material: #ccb4ff; border-radius: 50% 50% 1rem 1rem; background: linear-gradient(150deg, #493c6b, #17374c 75%); box-shadow: inset 0 0 0 3px #202f48, inset 0 0 0 4px #8270aa; }
.badge-special-accent { position: absolute; bottom: -0.28rem; left: 50%; width: 0.55rem; height: 0.55rem; transform: translateX(-50%) rotate(45deg); border: 2px solid #092c40; background: var(--badge-material); }
.badge-artwork[data-special-badge="special_alpha"] .badge-special-accent { width: 1.4rem; height: 0.5rem; border-radius: 0.2rem; transform: translateX(-50%); }
.badge-artwork[data-special-badge="special_beta"] .badge-special-accent { border-radius: 50%; transform: translateX(-50%); }
.badge-special-card { background: linear-gradient(135deg, rgba(28, 62, 85, 0.65), rgba(3, 29, 48, 0.48)); }
.badge-special-card .badge-description { margin-bottom: 0; }
.badge-showcase { margin-top: 1.8rem; padding-top: 1.7rem; border-top: 1px solid rgba(234,251,255,0.2); scroll-margin-top: 1rem; }
.badge-showcase h3 { margin: 0; font-size: 1.4rem; }
.badge-showcase fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.showcase-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; list-style: none; padding: 0; margin: 1.3rem 0 1.5rem; }
.showcase-slot { min-width: 0; padding: 1rem; border: 1px solid rgba(177,222,233,0.3); border-radius: 1rem; background: rgba(3,29,48,0.45); }
.showcase-slot.is-empty { border-style: dashed; background: rgba(3,29,48,0.15); }
.showcase-slot-label { display: block; margin-bottom: 0.65rem; color: var(--identity-aqua); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.showcase-badge { display: flex; flex-direction: column; gap: 0.5rem; }
.showcase-badge-copy { min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; text-align: left; }
.showcase-badge-copy strong { font-size: 0.93rem; line-height: 1.25; overflow-wrap: anywhere; color: var(--identity-foam); }
.showcase-badge-copy .badge-state { color: var(--identity-aqua); }
.showcase-requirement { font-size: 0.72rem; line-height: 1.4; color: var(--identity-muted); }
.showcase-slot-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.8rem; }
.showcase-slot-actions button { min-width: 2.75rem; min-height: 2.75rem; padding: 0.45rem 0.65rem; font-size: 0.7rem; }
.showcase-picker-title { font-size: 1rem; margin: 0; }
/* Keep at most two columns, but let enlarged text request a full-width card. */
.showcase-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(18rem, calc((100% - 0.7rem) / 2))), 1fr)); gap: 0.7rem; margin: 0.8rem 0 1.1rem; }
.showcase-option { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 0.85rem; align-items: center; min-width: 0; min-height: 2.75rem; padding: 0.85rem; border: 1px solid rgba(177,222,233,0.28); border-radius: 1rem; background: #0b354b; color: var(--identity-foam); font: inherit; cursor: pointer; }
.showcase-option-action { grid-column: 2; justify-self: start; color: var(--identity-aqua); font-size: 0.76rem; font-weight: 800; }
.showcase-option[data-highlighted="true"] { outline: 2px solid var(--identity-gold); outline-offset: 2px; }
.showcase-option[aria-pressed="true"] { border-color: var(--identity-aqua); background: #124653; }
.badge-showcase button:disabled { cursor: default; opacity: 0.5; }
.showcase-option[aria-pressed="true"]:disabled { opacity: 0.85; }
.showcase-public-list { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; padding: 0; margin: 1.1rem 0 1.4rem; }
.showcase-public-list[hidden] { display: none; }
.showcase-public-badge { flex: 1 1 10rem; min-width: 0; display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem; border: 1px solid rgba(177,222,233,0.25); border-radius: 1rem; background: rgba(3,29,48,0.4); }
.showcase-public-badge .badge-mark { width: 3.6rem; height: 4rem; flex-basis: 3.6rem; }
.showcase-public-heading { margin: 1.5rem 0 0; font-size: 1.05rem; }
.badge-showcase :is(button, [tabindex]):focus-visible { outline: 3px solid var(--identity-gold); outline-offset: 3px; }
@media (max-width: 720px) {
    .showcase-slots { grid-template-columns: 1fr; }
    .showcase-slot { display: grid; grid-template-columns: 1fr; }
    .showcase-badge { flex-direction: row; align-items: center; gap: 1rem; }
    .showcase-slot-actions { justify-content: flex-end; }
}
@media (max-width: 560px) { .showcase-picker { grid-template-columns: 1fr; } .showcase-public-badge { flex-basis: 100%; } }
