/* Shared identity cosmetics: preserve each host avatar's existing dimensions. */
.avatar:has(.avatar-decoration) { overflow: visible; background: transparent; }
/* Reserve room for the accessory inside the existing avatar footprint. This
   keeps hats intact even in clipped rows, headers and the mobile navigation. */
.avatar-art { display: inline-grid; place-items: center; width: 60%; height: 60%; align-self: end; margin-bottom: 1%; position: relative; border-radius: 50%; background: var(--text, #f5f5f6); color: var(--bg, #08090a); font-size: .8em; }
.avatar-art > img:not(.avatar-decoration) { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar-art > .avatar-decoration { position: absolute; z-index: 2; pointer-events: none; width: 170%; height: auto; max-width: none; left: -35%; top: -61%; object-fit: contain; border-radius: 0; }
.avatar-art > .decoration-cap2 { width: 160%; left: -30%; top: -60%; }
.username-prefix { display: inline-block; width: 1.15em; height: 1.15em; margin-left: .3em; object-fit: contain; vertical-align: -.15em; flex-shrink: 0; pointer-events: none; }
.customized-name { display: inline-flex; max-width: 100%; min-width: 0; align-items: center; vertical-align: bottom; }
.customized-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-cosmetic-avatar { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; margin-top: 20px; background: #27292e; }
.staff-cosmetic-avatar > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.customization-modal { width: min(1040px, calc(100vw - 40px)); }
.customization-modal .settings-shell { grid-template-columns: 190px minmax(0, 1fr); }
.customization-modal .settings-panel { min-width: 0; gap: 16px; }
.customization-studio { min-width: 0; display: grid; gap: 20px; }
.customization-intro h2 { margin: 0; font-size: 25px; letter-spacing: -.6px; }
.customization-studio .customization-categories { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 4px; background: rgba(255,255,255,.04); border-radius: 12px; }
.customization-studio .customization-categories button { border: 0; border-radius: 9px; background: transparent; font-size: 11px; font-weight: 700; }
.customization-studio .customization-categories button.active { background: rgba(255,255,255,.14); color: var(--text); }
.cosmetic-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cosmetic-section-heading h3 { margin: 0; font-size: 15px; }
.cosmetic-section-heading > span { padding-top: 3px; color: var(--muted-soft); font-size: 10px; white-space: nowrap; }
.cosmetic-site-preview { height: 180px; border-radius: 16px; overflow: hidden; position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; color: white; }
.cosmetic-site-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%,rgba(0,0,0,.5)); pointer-events: none; }
.cosmetic-site-preview > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cosmetic-site-preview > span, .cosmetic-site-preview > small { position: relative; z-index: 1; text-shadow: 0 1px 5px #0006; }
.cosmetic-site-preview > span { font-size: 21px; font-weight: 700; }
.cosmetic-site-preview > small { font-size: 11px; margin-top: 3px; opacity: .85; }
.cosmetic-default { background: #08090a; }
.cosmetic-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.cosmetic-tile { position: relative; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); color: var(--text); text-align: left; }
button.cosmetic-tile:hover { border-color: var(--muted-soft); }
.cosmetic-tile.selected { border-color: #d8dbe1; box-shadow: 0 0 0 1px #d8dbe1; }
.cosmetic-tile-visual { height: 96px; display: grid; place-items: center; overflow: hidden; }
.cosmetic-tile-visual > img { width: 100%; height: 100%; object-fit: cover; }
.cosmetic-tile-visual .avatar { width: 42px; height: 42px; margin-top: 20px; }
.cosmetic-tile-visual .avatar:has(.avatar-decoration) { width: 80px; height: 80px; margin: 0; }
.cosmetic-tile-visual > img.cosmetic-prefix-sample { display: block; width: 80px; height: 80px; margin: 0; place-self: center; object-fit: contain; object-position: center; }
.cosmetic-default-mark { font-size: 30px; font-weight: 800; color: #74767b; }
.cosmetic-tile-label { display: block; padding: 9px 10px; font-size: 11px; font-weight: 700; }
.cosmetic-selected { display: none; position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: #f5f5f6; color: #08090a; text-align: center; font-size: 12px; }
.selected > .cosmetic-selected { display: block; }
.cosmetic-upload-glyph, .cosmetic-none { font-size: 27px; color: var(--muted); }
.cosmetic-placeholder { border-style: dashed; color: var(--muted-soft); background: transparent; }
.cosmetic-placeholder .cosmetic-tile-visual { font-size: 22px; opacity: .45; }
.cosmetic-placeholder .cosmetic-tile-label { font-weight: 400; }
.cosmetic-upload-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.customization-studio .custom-profile-preview { min-height: 210px; border-radius: 16px; }
.customization-studio .custom-profile-content { min-height: 210px; padding: 50px 28px 24px; }
.customization-studio .custom-profile-content .avatar { width: 104px; height: 104px; }
.customization-studio .custom-profile-content h2 { font-size: 22px; overflow-wrap: anywhere; }
.customization-studio .custom-profile-content p { font-size: 12px; margin-top: 8px; }
@media (max-width: 760px) {
  .customization-modal .settings-shell { grid-template-columns: 1fr; }
  .customization-modal .settings-panel { padding: 16px; }
  .customization-studio { gap: 16px; }
  .customization-studio .customization-categories { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cosmetic-options { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .cosmetic-section-heading > span { display: none; }
  .customization-studio .custom-profile-content { padding: 48px 18px 20px; gap: 14px; grid-template-columns: 88px minmax(0,1fr); }
  .customization-studio .custom-profile-content .avatar { width: 88px; height: 88px; }
  .customization-studio .custom-profile-content h2 { font-size: 18px; }
}
