/* UI refresh (docs/design/refresh): settings-profile */

#screen-settings, #screen-theme, #screen-pack, #screen-wardrobe, :is(#screen-profile, #screen-opp-profile), #screen-opp-profile, #screen-edit-profile {
  background: var(--rf-bg-main, var(--rf-bg));
  color: var(--rf-text, var(--rf-text));
  box-sizing: border-box;
}

#screen-settings *, #screen-theme *, #screen-pack *, #screen-wardrobe *, :is(#screen-profile, #screen-opp-profile) *, #screen-opp-profile *, #screen-edit-profile * {
  box-sizing: border-box;
}

/* --- Shared Navigation & Back buttons --- */
.back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid color-mix(in srgb, var(--rf-text) 12%, transparent);
  color: var(--rf-text, var(--rf-text));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

/* 1. SETTINGS: page, lists and toggles are in base.css. */
#screen-settings #set-wardrobe { background: linear-gradient(100deg, color-mix(in srgb, var(--rf-accent) 16%, transparent) 0%, transparent 70%); min-height: 65px; }
#screen-settings #set-wardrobe > .icon { background: var(--rf-accent); color: var(--rf-accent-text); }
#screen-settings #set-wardrobe .text > div { display: flex; align-items: center; gap: 8px; }
.new-badge, .menu-list > .item > .text span.new-badge {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin: 0; border-radius: 9px !important;
  background: var(--rf-accent); color: var(--rf-accent-text); font: 800 10px var(--rf-font-sans); letter-spacing: .06em; line-height: 18px;
}
/* Language picker row */
.lang-row {
  position: relative;
}
#lang-picker, #appearance-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* 2. PROFILE — measured from the design (UI refresh 1, "Profile"). */
:is(#screen-profile, #screen-opp-profile).active {
  position: relative; display: block; padding: 0 0 108px; min-height: 100vh; box-sizing: border-box;
  background: var(--rf-bg); color: var(--rf-text); font-family: var(--rf-font-sans);
}
:is(#screen-profile, #screen-opp-profile) .prof-banner-wrap { position: relative; height: 176px; overflow: hidden; }
:is(#screen-profile, #screen-opp-profile) .prof-banner-wrap .banner { position: absolute; inset: 0; width: 100%; height: 100% !important; }
/* No banner chosen: a quiet accent glow so the page keeps its shape. */
:is(#screen-profile, #screen-opp-profile) .prof-banner-wrap .cx-banner-classic {
  background: radial-gradient(120% 120% at 30% 0%, color-mix(in srgb, var(--rf-accent) 22%, #15130F) 0%, #15130F 70%);
}
:is(#screen-profile, #screen-opp-profile) .prof-banner-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; pointer-events: none;
  background: linear-gradient(rgba(12, 11, 9, 0), var(--rf-bg));
}
:is(#screen-profile, #screen-opp-profile) .prof-top { position: absolute; top: 14px; right: 16px; left: auto; z-index: 3; display: flex; }
#prof-edit {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px !important;
  border-radius: 12px !important; background: color-mix(in srgb, var(--rf-bg) 55%, transparent); border: 1px solid color-mix(in srgb, var(--rf-text) 22%, transparent);
  color: var(--rf-text); font: 700 14px var(--rf-font-sans); backdrop-filter: blur(8px);
}
:is(#screen-profile, #screen-opp-profile) .hero-row {
  position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 16px;
  margin: -64px 0 0; padding: 0 20px; height: 116px;
}
:is(#prof-ava, #opp-prof-ava) { flex: none; width: 116px; height: 116px; }
:is(#prof-ava, #opp-prof-ava) .cx-avatar-inner { border: 3px solid var(--rf-bg); box-sizing: border-box; }
:is(#prof-ava, #opp-prof-ava) .cx-avatar-inner span { font: 700 42px var(--rf-font-display); }
:is(#screen-profile, #screen-opp-profile) .name-container { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-bottom: 8px; }
:is(#screen-profile, #screen-opp-profile) .name { font: 700 30px/1.05 var(--rf-font-display); color: var(--rf-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(#screen-profile, #screen-opp-profile) .prof-sub { font: 700 12px var(--rf-font-sans); color: color-mix(in srgb, var(--rf-accent) 70%, var(--rf-text)); margin: 0; }
:is(#screen-profile, #screen-opp-profile) > .body { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px 0 !important; margin: 0; }
/* The effect plays over the whole header (banner, avatar, name), not in a strip. */
:is(#screen-profile, #screen-opp-profile) :is(#prof-fx, #opp-prof-fx), #screen-opp-profile #opp-prof-fx {
  position: absolute; left: 0; right: 0; top: 0; height: 300px; z-index: 6; pointer-events: none; margin: 0; padding: 0;
}
:is(#screen-profile, #screen-opp-profile) .elo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
:is(#screen-profile, #screen-opp-profile) .elo-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; text-align: left;
  background: color-mix(in srgb, var(--rf-surface) 88%, transparent); border: 1px solid var(--rf-card-line); border-radius: 16px;
}
:is(#screen-profile, #screen-opp-profile) .elo-card span { font: 800 11px var(--rf-font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--rf-sub); white-space: nowrap; }
:is(#screen-profile, #screen-opp-profile) .elo-card b { font: 800 22px var(--rf-font-sans); color: var(--rf-text); }
:is(#screen-profile, #screen-opp-profile) .elo-card:first-child b { color: var(--rf-accent); }
:is(#screen-profile, #screen-opp-profile) .stats-container {
  display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 16px;
  background: color-mix(in srgb, var(--rf-surface) 88%, transparent); border: 1px solid var(--rf-card-line); border-radius: 18px;
}
:is(#screen-profile, #screen-opp-profile) .stats-main-row { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; margin: 0; }
:is(#screen-profile, #screen-opp-profile) .stat-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
:is(#screen-profile, #screen-opp-profile) .stat-item + .stat-item { border-left: 1px solid var(--rf-line); }
:is(#screen-profile, #screen-opp-profile) .stat-item b { font: 800 22px var(--rf-font-sans); color: var(--rf-text); }
:is(#screen-profile, #screen-opp-profile) .stat-item .muted { font: 400 12px var(--rf-font-sans); color: var(--rf-sub); }
.seg-bar-wrap { display: flex; gap: 3px; height: 8px; margin: 0 0 8px; background: none; overflow: visible; }
.seg-bar { height: 8px; border-radius: 4px; background: var(--rf-accent); }
.seg-bar.draw { background: #6B6455; border-radius: 4px; }
.seg-bar.loss { background: var(--rf-hot); border-radius: 4px; }
.seg-bar[style*="width: 0%"] { display: none; }
.seg-labels { display: flex; gap: 16px; align-items: center; font: 400 12px var(--rf-font-sans); color: var(--rf-text-2); }
.seg-labels span { display: inline-flex; align-items: center; gap: 6px; }
.seg-labels span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--rf-accent); }
.seg-labels span.draw-label::before { background: #6B6455; }
.seg-labels span.loss-label::before { background: var(--rf-hot); }
:is(#screen-profile, #screen-opp-profile) .legends-section { display: flex; flex-direction: column; gap: 12px; margin: 0; }
:is(#screen-profile, #screen-opp-profile) .legends-header { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 0; }
:is(#screen-profile, #screen-opp-profile) .legends-header > .muted:first-child { font: 800 12px var(--rf-font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--rf-text-2); }
:is(#screen-profile, #screen-opp-profile) .legends-header b { font: 700 13px var(--rf-font-sans); color: var(--rf-sub); text-transform: none; letter-spacing: 0; }
:is(#screen-profile, #screen-opp-profile) .legends-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 10px; }
.legend-circle {
  position: relative; aspect-ratio: 1; border-radius: 50%; box-sizing: border-box; overflow: visible;
  display: grid; place-items: center; background: var(--rf-surface); border: 1px dashed var(--rf-line-2);
  font: 700 15px var(--rf-font-display); color: #5E584B;
}
.legend-circle.beaten {
  background: var(--rf-surface-elevated); border: 0; color: var(--rf-text); font-size: 16px;
  box-shadow: 0 0 0 2px var(--rf-bg), 0 0 0 4px var(--rf-accent);
}
.legend-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.legend-circle:not(.beaten) img { filter: grayscale(1); opacity: .45; }
.legend-circle .check {
  position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; box-sizing: border-box;
  display: grid; place-items: center; border-radius: 10px; background: var(--rf-accent); color: var(--rf-accent-text);
  border: 2px solid var(--rf-bg);
}

/* ==========================================================================
   3. EDIT PROFILE SHEET
   ========================================================================== */
#screen-edit-profile {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
#screen-edit-profile.active {
  display: flex !important;
  align-items: flex-end;
}
#screen-edit-profile .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}
#screen-edit-profile.sheet-screen .sheet,
#screen-edit-profile .sheet,
.edit-prof-sheet {
  position: relative !important;
  z-index: 10 !important;
  width: 100% !important;
  max-width: 520px !important;
  max-height: 88vh !important;
  height: auto !important;
  background: var(--rf-surface) !important;
  color: var(--rf-text) !important;
  border-top: 1px solid var(--rf-card-line) !important;
  border-radius: 20px 20px 0 0 !important;
  padding: 12px 16px 32px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  margin: 0 auto !important;
}
.edit-prof-sheet .handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--rf-line-2);
  margin: 0 auto 12px;
  flex: 0 0 auto;
}
.edit-prof-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.edit-prof-header .title {
  font-family: var(--rf-font-serif, "Playfair Display", Georgia, serif) !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--rf-text, var(--rf-text)) !important;
  margin: 0 !important;
  text-align: left !important;
}
.done-btn {
  background: var(--rf-accent) !important;
  color: var(--rf-accent-text) !important;
  border: none !important;
  border-radius: 20px !important;
  padding: 8px 18px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.edit-preview-wrap {
  position: relative;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--rf-surface);
}
.edit-preview-wrap .banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.edit-preview-wrap .bigava-wrap {
  position: absolute;
  bottom: 12px;
  left: 16px;
}
.edit-body h3 {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--rf-muted, #8e877e) !important;
  margin: 16px 0 10px !important;
  text-align: left !important;
}
#edit-frames.cosmetics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}
/* Banners scroll sideways in one row (design). */
#edit-banners.cosmetics-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px 12px;
  padding: 2px 16px 4px;
}
#edit-banners .cos-btn { flex: 0 0 124px; width: 124px !important; padding: 6px !important; align-items: stretch !important; gap: 6px !important; border-radius: 14px !important; }
#edit-banners .cos-btn .cx-banner { height: 40px !important; border-radius: 9px; }
#edit-banners .cos-btn div:last-child { text-align: left; padding-left: 2px; font-weight: 700; color: var(--rf-text-2); }
.cos-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--rf-surface) !important;
  border: 1px solid var(--rf-card-line) !important;
  border-radius: 12px !important;
  padding: 10px 4px 8px !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  width: 100% !important;
}
.cos-btn.on {
  border: 2px solid var(--rf-accent) !important;
  box-shadow: 0 0 12px color-mix(in srgb, var(--rf-accent) 20%, transparent) !important;
}
.cos-btn div:last-child {
  font-size: 11px;
  color: #8e877e;
}
.cos-btn.on div:last-child {
  color: var(--rf-text, var(--rf-text));
  font-weight: 700;
}
#edit-frames .cos-btn .cx-avatar-inner {
  background: #232b23 !important;
  color: transparent !important;
}
#edit-frames .cos-btn .cx-avatar-inner span {
  display: none !important;
}
#edit-banners .cos-btn .cx-banner {
  width: 100%;
  height: 48px;
  border-radius: 8px;
}
#edit-banners .cx-banner-classic, .edit-preview-wrap .cx-banner-classic {
  background: #191612 !important;
}
.cosmetics-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cosmetics-chips .chip {
  height: 40px; box-sizing: border-box; font-weight: 700;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--rf-surface);
  border: 1px solid var(--rf-card-line);
  color: var(--rf-text, var(--rf-text));
  font-size: 13px;
  cursor: pointer;
}
.cosmetics-chips .chip.on {
  background: var(--rf-accent);
  color: var(--rf-accent-text);
  font-weight: 700;
  border-color: var(--rf-accent);
}

/* ==========================================================================
   4. OPPONENT PROFILE SCREEN
   ========================================================================== */
#screen-opp-profile {
  position: relative;
  padding-bottom: 70px;
}


#screen-opp-profile .prof-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 10;
}
#opp-prof-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid color-mix(in srgb, var(--rf-text) 10%, transparent);
  color: var(--rf-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}



#screen-opp-profile .prof-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--rf-accent);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
#opp-cosmetics-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 16px 14px;
}
.cosmetic-tag {
  background: var(--rf-surface);
  border: 1px solid var(--rf-card-line);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  color: #8e877e;
}









.opp-actions-row {
  display: flex;
  gap: 12px;
  margin: 0 16px 24px;
}
#opp-challenge-btn {
  background: var(--rf-accent);
  color: var(--rf-accent-text);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--rf-accent) 20%, transparent);
  flex: 1.2;
}
#opp-add-friend-btn {
  background: var(--rf-surface);
  border: 1px solid var(--rf-card-line);
  color: var(--rf-text, var(--rf-text));
  font-size: 14px;
  font-weight: 700;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

/* 5. WARDROBE — measured from the design (UI refresh, "Wardrobe shop"). */
#screen-wardrobe > .body { display: flex; flex-direction: column; gap: 12px; }
#screen-wardrobe .wardrobe-hint { margin: -2px 0 0; padding: 0; font: 400 14px/1.45 var(--rf-font-sans); color: var(--rf-sub); }
/* Segmented control: Wardrobe factions and Theme groups. */
.wardrobe-tabs, #theme-tabs.wardrobe-tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0; padding: 4px; height: 50px; box-sizing: border-box;
  background: var(--rf-surface); border: 1px solid var(--rf-surface-2); border-radius: 14px;
}
.wardrobe-tabs .wardrobe-tab {
  height: 40px; padding: 1px 6px !important; border-radius: 10px !important; background: transparent; color: var(--rf-text-2);
  font: 700 13px var(--rf-font-sans); text-align: center; position: static;
}
.wardrobe-tabs .wardrobe-tab.on { background: var(--rf-accent); color: var(--rf-accent-text); font-weight: 800; }
.wardrobe-tabs .wardrobe-tab.on::after { content: none; }
.wardrobes-list { display: flex; flex-direction: column; gap: 10px; padding: 0; }
.wardrobe-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 14px; width: 100%; height: 110px; padding: 0 16px !important; box-sizing: border-box;
  border: 0 !important; border-radius: 20px !important; text-align: left; cursor: pointer;
  color: var(--text); font-family: var(--rf-font-sans);
  box-shadow: 0 0 0 1px var(--line) !important;
  /* the wardrobe's own board, fading into its background on the left */
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, transparent) 50%, color-mix(in srgb, var(--bg) 45%, transparent) 100%),
    repeating-conic-gradient(var(--sq-dark) 0 25%, color-mix(in srgb, var(--sq-light) 55%, var(--bg)) 0 50%) 0 0 / 28px 28px,
    var(--bg) !important;
}
.wardrobe-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(80% 120% at 100% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
}
.wardrobe-card.on { box-shadow: 0 0 0 2px var(--accent) !important; }
.wardrobe-card .wc-ava {
  flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); color: var(--accent);
  font: 700 22px var(--font-display); text-transform: none; letter-spacing: 0;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--bg), 0 0 12px 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
.wardrobe-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wardrobe-text .title {
  font: 700 24px/24px var(--font-display); color: var(--text); text-transform: var(--title-case, none); letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wardrobe-card.long .wardrobe-text .title { font-size: 19px; line-height: 22px; }
.wardrobe-text .sub {
  font: 400 12px/16.2px var(--rf-font-sans); color: var(--text); opacity: .92;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wardrobe-action-badge {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; box-sizing: border-box;
  border-radius: 16px; border: 0; background: var(--accent); color: var(--accent-text);
  font: 800 13px var(--rf-font-sans); white-space: nowrap;
}
.wardrobe-card.owned .wardrobe-action-badge { background: #F3ECDD; color: #1A1408; font-size: 12px; border: 0; }
.wardrobe-card.owned.on .wardrobe-action-badge { background: var(--accent); color: var(--accent-text); border: 0; }

/* ==========================================================================
   6. THEME SCREEN
   ========================================================================== */
#screen-theme {
  padding-bottom: 70px;
}
#theme-badge {
  margin-left: auto;
  background: var(--rf-surface);
  border: 1px solid var(--rf-card-line);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  color: #8e877e;
}
  color: #8e877e;
}

/* ==========================================================================
   7. PIECE PACK SCREEN
   ========================================================================== */
#screen-pack {
  padding-bottom: 70px;
}
#screen-pack .packs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 16px 20px;
}
.new-pack-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 104px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--rf-card-line);
  background: var(--rf-surface);
  color: var(--rf-text, var(--rf-text));
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}
.new-pack-card.on {
  border: 2px solid var(--rf-accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--rf-accent) 25%, transparent);
}
.new-pack-pv {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 86px;
  border-radius: 11px;
}
.new-pack-pv img {
  width: 46px;
  height: 46px;
}
.new-pack-pv[data-pack="classic"] { background: linear-gradient(160deg, #ecdab9 0%, #c5a076 100%); }
.new-pack-pv[data-pack="samurai"] { background: linear-gradient(160deg, #ef4444 0%, #7f1d1d 100%); }
.new-pack-pv[data-pack="mecha"] { background: linear-gradient(160deg, #38bdf8 0%, #0369a1 100%); }
.new-pack-pv[data-pack="spooky"] { background: linear-gradient(160deg, #a855f7 0%, #581c87 100%); }
.new-pack-pv[data-pack="royal"] { background: linear-gradient(160deg, #f6de8d 0%, #b8862b 60%, #5a3e0e 100%); }
.new-pack-pv[data-pack="frost"] { background: linear-gradient(160deg, #e0f2fe 0%, #7dd3fc 55%, #0c4a6e 100%); }
.new-pack-pv[data-pack="arcade"] { 
  background-color: #166534;
  background-image: repeating-conic-gradient(#14532d 0%, #14532d 25%, #166534 0%, #166534 50%);
  background-size: 16px 16px;
  box-shadow: inset 0 0 0 2px #4ade80;
}
.new-pack-pv[data-pack="sakura"] { background: linear-gradient(160deg, #fdf2f8 0%, #fbcfe8 60%, #9d174d 100%); }
.new-pack-pv[data-pack="druid"] { background: radial-gradient(circle at 50% 40%, #059669 0%, #0f2a1d 80%); }
.new-pack-pv[data-pack="shadow"] { background: radial-gradient(circle at 50% 45%, #312e81 0%, #050508 70%); }
.new-pack-pv[data-pack="custom"] { background: #1f1a10; }

.pack-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.pack-text .name {
  font-size: 15px;
  font-weight: 800;
  color: var(--rf-text, var(--rf-text));
  white-space: normal;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pack-text .sub {
  font-size: 11px;
  line-height: 1.35;
  color: #8e877e;
}

.advanced-style {
  margin: 0 16px 24px;
  background: var(--rf-surf, var(--rf-surface));
  border: 1px dashed var(--rf-line-2);
  border-radius: 16px;
  overflow: hidden;
}
.advanced-style summary {
  padding: 16px;
  font-weight: 700;
  color: var(--rf-text, var(--rf-text));
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.advanced-style summary::-webkit-details-marker {
  display: none;
}
.advanced-style summary::after {
  content: "▾";
  font-size: 16px;
  color: #8e877e;
}
.advanced-style[open] summary::after {
  content: "▴";
}
.advanced-content {
  padding: 0 16px 16px;
  border-top: 1px dashed var(--rf-line-2);
}
.advanced-content h2 {
  font-size: 14px;
  margin: 16px 0 8px;
  color: var(--rf-text, var(--rf-text));
}

/* ==========================================================================
   8. PREMIUM TIER STYLING ([data-tier="premium"])
   ========================================================================== */
html[data-tier="premium"] #screen-settings .menu-list,
html[data-tier="premium"] :is(#screen-profile, #screen-opp-profile) .elo-card,
html[data-tier="premium"] :is(#screen-profile, #screen-opp-profile) .stats-container,
html[data-tier="premium"] #screen-opp-profile .elo-card,
html[data-tier="premium"] #screen-opp-profile .stats-container,
html[data-tier="premium"] .theme-rich-card,
html[data-tier="premium"] .new-pack-card,
[data-tier="premium"] #screen-settings .menu-list,
[data-tier="premium"] :is(#screen-profile, #screen-opp-profile) .elo-card,
[data-tier="premium"] :is(#screen-profile, #screen-opp-profile) .stats-container,
[data-tier="premium"] #screen-opp-profile .elo-card,
[data-tier="premium"] #screen-opp-profile .stats-container,
[data-tier="premium"] .theme-rich-card,
[data-tier="premium"] .new-pack-card {
  border-color: rgba(229, 178, 93, 0.35);
  background: linear-gradient(180deg, #1c1812 0%, #15130f 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html[data-tier="premium"] header.top b,
html[data-tier="premium"] .name,
[data-tier="premium"] header.top b,
[data-tier="premium"] .name {
  color: #f7edd7;
  text-shadow: 0 0 20px rgba(229, 178, 93, 0.2);
}

html[data-tier="premium"] #wardrobe-owned-badge,
html[data-tier="premium"] #theme-badge,
[data-tier="premium"] #wardrobe-owned-badge,
[data-tier="premium"] #theme-badge {
  border-color: rgba(229, 178, 93, 0.4);
  color: #e5b25d;
  background: rgba(229, 178, 93, 0.1);
}

/* Wardrobe detail — a full page in the wardrobe's own theme (design: "Wardrobe
   detail · try on"). Colours and fonts come from [data-theme] on the page. */
#screen-wardrobe-detail.active {
  display: flex; flex-direction: column; min-height: 100dvh; padding: 0 0 100px; box-sizing: border-box;
  background: var(--bg); color: var(--text); font-family: var(--rf-font-sans);
}
#screen-wardrobe-detail .wd-hero {
  position: relative; height: 164px; padding: 14px 16px 0 20px; box-sizing: border-box;
  background: radial-gradient(60% 80% at 50% 120%, color-mix(in srgb, var(--accent) 70%, transparent) 0%, transparent 70%), var(--bg);
}
#screen-wardrobe-detail .wd-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
:is(#screen-wardrobe-detail, #screen-theme-preview) .wd-top { display: flex; align-items: center; justify-content: space-between; margin-left: -4px; }
:is(#screen-wardrobe-detail, #screen-theme-preview) .wd-back {
  width: 46px; height: 46px; padding: 0 !important; display: grid; place-items: center; border-radius: 50% !important;
  background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid color-mix(in srgb, var(--rf-text) 20%, transparent); color: var(--text);
}
#screen-wardrobe-detail .wd-chip {
  display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 16px; box-sizing: border-box;
  background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--line);
  font: 800 11px var(--rf-font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent2, var(--accent));
}
#screen-wardrobe-detail .wd-id { position: absolute; z-index: 1; left: 20px; right: 20px; top: 70px; display: flex; align-items: center; gap: 16px; }
#screen-wardrobe-detail .wd-ava {
  flex: none; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); color: var(--accent); font: 800 34px var(--font-display);
  box-shadow: 0 0 0 3px var(--accent), 0 0 24px 8px color-mix(in srgb, var(--accent) 80%, transparent);
}
:is(#screen-wardrobe-detail, #screen-theme-preview) .wd-names { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:is(#screen-wardrobe-detail, #screen-theme-preview) h1 { margin: 0; font: 800 40px/0.95 var(--font-display); color: var(--text); text-transform: var(--title-case, none); }
#screen-wardrobe-detail #wd-desc { margin: 0; font: 400 13px/1.35 var(--rf-font-sans); color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
#screen-wardrobe-detail .wd-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 20px 100px; }
#screen-wardrobe-detail .wd-moments { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
#screen-wardrobe-detail .wd-moments button {
  flex: none; height: 38px; padding: 0 14px !important; border-radius: 19px !important; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line); color: color-mix(in srgb, var(--text) 85%, var(--muted)); font: 700 13px var(--rf-font-sans);
}
#screen-wardrobe-detail .wd-moments button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 800; }
#screen-wardrobe-detail .wd-board {
  align-self: center; width: 300px; height: 300px; border-radius: 8px; overflow: hidden; position: relative;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .7), 0 0 0 1px var(--line), 0 0 30px color-mix(in srgb, var(--accent) 18%, transparent);
}
#screen-wardrobe-detail .wd-m-cap { margin: -4px 0 0; font: 400 15px/1.4 var(--rf-font-sans); color: var(--text); }
#screen-wardrobe-detail .wd-caption { display: flex; align-items: center; gap: 8px; }
#screen-wardrobe-detail .wd-m-name { font: 800 12px var(--rf-font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
#screen-wardrobe-detail .wd-m-who {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent2, var(--accent));
  font: 800 10px var(--rf-font-sans); letter-spacing: .06em; text-transform: uppercase;
}
#screen-wardrobe-detail .wd-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#screen-wardrobe-detail .wd-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px !important; min-height: 75px; box-sizing: border-box; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px !important; color: var(--text);
  font-family: inherit; margin: 0; cursor: default;
}
#screen-wardrobe-detail button.wd-tile {
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
#screen-wardrobe-detail .wd-tile > span,
#screen-wardrobe-detail .wd-tile-text > span {
  font: 400 11px var(--rf-font-sans); color: var(--muted); line-height: normal;
}
#screen-wardrobe-detail .wd-tile b,
#screen-wardrobe-detail .wd-tile-text b {
  font: 700 13px/1.35 var(--rf-font-sans); color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#screen-wardrobe-detail .wd-sound { flex-direction: row; align-items: center; gap: 8px; }
#screen-wardrobe-detail .wd-sound-play {
  flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: var(--accent-text); font-style: normal;
}
#screen-wardrobe-detail .wd-sound-play svg { display: block; }
#screen-wardrobe-detail .wd-tile-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }

/* A wardrobe's items, each worn on its own (owner, 2026-10-10: cherry-pick):
   profile items on the first row, game items on the second. */
#screen-wardrobe-detail .wd-items-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
#screen-wardrobe-detail .wd-items-head h3 { margin: 0; font: 800 12px var(--rf-font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
#screen-wardrobe-detail .wd-items-whole {
  flex: none; height: 28px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: 700 12px var(--rf-font-sans); cursor: pointer;
}
#screen-wardrobe-detail .wd-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
#screen-wardrobe-detail .wd-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  padding: 6px 4px 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
#screen-wardrobe-detail .wd-item.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
#screen-wardrobe-detail .wd-item .closet-thumb { width: 44px; height: 44px; }
#screen-wardrobe-detail .wd-item .closet-thumb-banner { width: 100%; height: 44px; }
#screen-wardrobe-detail .wd-item .closet-thumb .new-pack-pv { width: 46px; height: 46px; }
#screen-wardrobe-detail .wd-item .closet-thumb .new-pack-pv > * { width: 42px; height: 42px; }
#screen-wardrobe-detail .wd-item.locked .closet-thumb { opacity: .6; }
#screen-wardrobe-detail .wd-item-sound { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
#screen-wardrobe-detail .wd-item-sound svg { width: 24px; height: 24px; }
#screen-wardrobe-detail .wd-item-label {
  max-width: 100%; font: 700 11px/1.2 var(--rf-font-sans); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#screen-wardrobe-detail .wd-item-wear {
  width: 100%; height: 28px; padding: 0 2px; border-radius: 9px; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font: 800 11.5px var(--rf-font-sans);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#screen-wardrobe-detail .wd-item-wear.on { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); cursor: default; }
#screen-wardrobe-detail .wd-item-wear.locked { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
#screen-wardrobe-detail .wd-item-note { margin: 0; min-height: 18px; font: 400 13px/1.4 var(--rf-font-sans); color: color-mix(in srgb, var(--text) 85%, var(--muted)); }

/* Wardrobe Profile Set preview sheet */
#screen-wardrobe-detail .wd-prof-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: auto !important; max-height: none;
  background: var(--card, #171010);
  border-top: 1px solid var(--line, #3a221b);
  border-radius: 20px 20px 0 0;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}
#screen-wardrobe-detail .wd-prof-sheet .title {
  font: 800 15px var(--rf-font-sans);
  color: var(--text);
  text-align: center;
  margin: 0 0 14px;
}
#screen-wardrobe-detail .wd-prof-preview {
  position: relative;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--bg2, #1a1210);
  border: 1px solid var(--line, #3a221b);
}
#screen-wardrobe-detail .wd-prof-banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#screen-wardrobe-detail .wd-prof-ava-box {
  position: absolute;
  bottom: 12px;
  left: 16px;
  z-index: 2;
}
#screen-wardrobe-detail .wd-prof-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 0;
  min-height: 44px;
  box-sizing: border-box;
}
#screen-wardrobe-detail .wd-prof-name {
  font: 700 14px var(--rf-font-sans);
  color: inherit;
}
#screen-wardrobe-detail .wd-prof-actions {
  display: flex;
  gap: 10px;
}
#screen-wardrobe-detail .wd-prof-fx-btn {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-text);
  font: 800 14px var(--rf-font-sans);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
#screen-wardrobe-detail .wd-prof-close {
  flex: none;
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font: 700 14px var(--rf-font-sans);
  cursor: pointer;
}
#screen-wardrobe-detail .wd-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 10px; padding: 12px 20px 24px;
  /* Solid behind the buttons (the moment caption used to show through the
     gaps), with the fade above the bar instead. */
  background: var(--bg);
}
#screen-wardrobe-detail .wd-cta::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 28px; pointer-events: none;
  background: linear-gradient(transparent, var(--bg));
}
#screen-wardrobe-detail .wd-try {
  flex: none; height: 56px; padding: 0 18px !important; border-radius: 16px !important;
  background: var(--card); border: 1px solid var(--line); color: var(--text); font: 700 14px var(--rf-font-sans);
}
:is(#screen-wardrobe-detail, #screen-theme-preview) .wd-buy, :is(#screen-wardrobe-detail, #screen-theme-preview) .wd-wear {
  flex: 1; height: 54px; border-radius: 16px !important; background: var(--accent); color: var(--accent-text);
  font: 800 16px var(--rf-font-sans); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent);
}
#edit-effects .chip {
  height: 40px; padding: 0 14px; border-radius: 20px; background: var(--rf-surface); border: 1px solid var(--rf-card-line);
  color: var(--rf-text-2); font: 700 13px var(--rf-font-sans); letter-spacing: 0; text-transform: none; box-shadow: none;
}
#edit-effects .chip.on { background: var(--rf-accent); border-color: var(--rf-accent); color: var(--rf-accent-text); font-weight: 800; }
@media (max-width: 375px) {
  .wardrobe-text .title { font-size: 20px; line-height: 22px; }
  .wardrobe-card.long .wardrobe-text .title { font-size: 17px; }
}

/* Bought: "It's yours" after a purchase, in the wardrobe's theme (design "Bought"). */
#screen-bought .overlay { position: absolute; inset: 0; display: block; z-index: 0; background: radial-gradient(60% 30% at 50% 20%, color-mix(in srgb, var(--accent) 25%, rgba(5, 4, 3, .9)), rgba(5, 4, 3, .94) 70%); }
#screen-bought .bought-crest { position: fixed; z-index: 2; left: 0; right: 0; top: 70px; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
#screen-bought .bought-crown { color: var(--accent2, var(--accent)); margin-bottom: 4px; filter: drop-shadow(0 0 14px var(--accent)); }
#screen-bought .bought-ava {
  width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--card);
  border: 4px solid var(--accent2, var(--accent)); box-shadow: 0 0 40px 10px color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent); font: 800 44px var(--font-display);
}
#screen-bought .bought-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: auto !important; max-height: none;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 30px 22px 28px !important;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-bottom: 0;
  border-radius: 28px 28px 0 0; color: var(--text); font-family: var(--rf-font-sans);
}
#screen-bought .bought-kicker { font: 800 12px var(--rf-font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent2, var(--accent)); }
#screen-bought h2 { margin: 0; font: 800 40px/1 var(--font-display); color: var(--text); text-transform: var(--title-case, none); }
#screen-bought #bought-desc { margin: 0; font: 400 15px/1.45 var(--rf-font-sans); color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
#screen-bought .bought-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
#screen-bought .bought-chips span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); font: 700 12px var(--rf-font-sans); color: color-mix(in srgb, var(--text) 80%, var(--muted)); }
#screen-bought .bought-wear {
  align-self: stretch; height: 56px; margin-top: 4px; border-radius: 16px !important; background: var(--accent); color: var(--accent-text);
  font: 800 16px var(--rf-font-sans); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent);
}
#screen-bought .bought-later { height: 44px; padding: 0 16px !important; background: none; color: var(--text); font: 700 15px var(--rf-font-sans); }
#screen-bought .bought-note { margin: 4px 0 0; font: 400 12px/1.5 var(--rf-font-sans); color: var(--muted); }

/* Piece pack preview: the pack moving and capturing before you pick it. */
#screen-pack-preview .pp-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: auto !important; max-height: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom)) !important;
  background: var(--rf-surface); border: 1px solid var(--rf-line-2); border-bottom: 0; border-radius: 28px 28px 0 0;
}
#screen-pack-preview .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--rf-line-2); margin: 0 auto 6px; }
#screen-pack-preview h2 { margin: 0; font: 700 24px var(--rf-font-display); color: var(--rf-text); }
#screen-pack-preview #pp-desc { margin: 0; font: 400 13px var(--rf-font-sans); color: var(--rf-sub); }
#screen-pack-preview .pp-board { width: 300px; height: 300px; margin: 6px 0; border-radius: 8px; overflow: hidden; position: relative; box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 0 1px var(--rf-line-2); }
#screen-pack-preview .pp-actions { display: flex; gap: 10px; align-self: stretch; }
#screen-pack-preview .pp-close {
  flex: none; height: 54px; padding: 0 18px !important; border-radius: 14px !important;
  background: var(--rf-surface); border: 1px solid var(--rf-line-2); color: var(--rf-text); font: 700 15px var(--rf-font-sans);
}
#screen-pack-preview .pp-use {
  flex: 1; height: 54px; border-radius: 14px !important; background: var(--rf-accent); color: var(--rf-accent-text);
  font: 800 15px var(--rf-font-sans); letter-spacing: .04em;
}
#screen-pack-preview .pp-use:disabled { background: var(--rf-surface-2); color: var(--rf-sub); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
:is(#screen-wardrobe-detail, #screen-theme-preview) .wd-wear.secondary {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

/* --- Wardrobe screen: live preview + one tab per kind of item (2026-10-08) --- */
#screen-wardrobe .closet-top {
  position: sticky; top: 0; z-index: 4; margin: 0 -16px; padding: 4px 16px 8px;
  background: var(--rf-bg, var(--bg));
}
#screen-wardrobe .closet-pv { display: flex; gap: 10px; align-items: stretch; }
#screen-wardrobe .closet-me { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#screen-wardrobe .wd-prof-preview {
  position: relative; height: 92px; border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--bg2, #1a1210); border: 1px solid var(--line, #3a221b); isolation: isolate;
}
#screen-wardrobe .wd-prof-banner { position: absolute; inset: 0; width: 100%; height: 100%; }
#screen-wardrobe .wd-prof-ava-box { position: absolute; bottom: 10px; left: 12px; z-index: 2; }
#screen-wardrobe .closet-fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#screen-wardrobe .wd-prof-card {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px; border-radius: 10px; min-height: 40px; box-sizing: border-box;
}
#screen-wardrobe .wd-prof-name { font: 700 14px var(--rf-font-sans); color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#screen-wardrobe .closet-board {
  flex: none; width: 138px; height: 138px; border-radius: 10px; overflow: hidden; align-self: center;
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0, 0, 0, .45);
}
#screen-wardrobe .closet-tabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 10px -16px 0; padding: 0 16px;
}
#screen-wardrobe .closet-tabs::-webkit-scrollbar { display: none; }
#screen-wardrobe .closet-tabs .wardrobe-tab { flex: none; white-space: nowrap; padding: 0 14px; }
#screen-wardrobe .closet-faction {
  margin: 14px 2px 6px; font: 800 12px var(--rf-font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--rf-sub, var(--muted));
}
#screen-wardrobe .closet-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 0 110px;
}
#screen-wardrobe .closet-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#screen-wardrobe .closet-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px; border-radius: 14px; border: 1px solid var(--rf-line, var(--rf-card-line));
  background: var(--rf-card, var(--rf-surface)); color: var(--rf-text, var(--rf-text)); cursor: pointer; min-width: 0;
}
#screen-wardrobe .closet-item.current { border-color: var(--accent); }
#screen-wardrobe .closet-item.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--rf-card, var(--rf-surface))); }
#screen-wardrobe .closet-item.locked .closet-thumb { opacity: .55; }
#screen-wardrobe .closet-label {
  max-width: 100%; font: 600 11.5px/1.25 var(--rf-font-sans); text-align: center;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
#screen-wardrobe .closet-mark {
  position: absolute; top: 6px; right: 6px; font-size: 11px; line-height: 1;
  padding: 3px 5px; border-radius: 8px; background: color-mix(in srgb, var(--rf-bg, #000) 70%, transparent);
}
#screen-wardrobe .closet-item.current .closet-mark { color: var(--accent); }
:is(#screen-wardrobe, #screen-wardrobe-detail) .closet-thumb { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex: none; }
:is(#screen-wardrobe, #screen-wardrobe-detail) .closet-thumb .new-pack-pv { width: 52px; height: 52px; display: grid; place-items: center; }
:is(#screen-wardrobe, #screen-wardrobe-detail) .closet-thumb .new-pack-pv > * { width: 46px; height: 46px; }
:is(#screen-wardrobe, #screen-wardrobe-detail) .closet-thumb-banner { position: relative; width: 100%; height: 56px; }
:is(#screen-wardrobe, #screen-wardrobe-detail) .closet-thumb-fx { font-size: 22px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
#screen-wardrobe .closet-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--rf-bg, var(--bg)) 35%);
}
#screen-wardrobe .closet-cta.hidden { display: none; }
#screen-wardrobe .closet-wear {
  width: 100%; height: 54px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-text, #111); font: 800 16px var(--rf-font-sans);
}
#screen-wardrobe .closet-wear.locked { background: var(--rf-card, var(--rf-surface)); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#screen-wardrobe .closet-wear:disabled { background: var(--rf-card, var(--rf-surface)); color: var(--rf-sub, var(--muted)); cursor: default; }
/* The set's world picture behind its card, shaded on the left for the text. */
.wardrobe-card .wc-art { position: absolute; inset: 0; z-index: -1; background: center 40% / cover no-repeat; }
.wardrobe-card .wc-art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 42%, color-mix(in srgb, var(--bg) 25%, transparent) 100%); }
.wardrobe-card .wc-ava.has-face { overflow: hidden; }
.wardrobe-card .wc-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#screen-wardrobe-detail .wd-ava.has-face { overflow: hidden; }
#screen-wardrobe-detail .wd-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* --- Elo details (owner, 2026-10-11): each card's week, and its sheet --- */
:is(#screen-profile, #screen-opp-profile) .elo-card, #screen-opp-profile .elo-card { cursor: pointer; position: relative; }
:is(#screen-profile, #screen-opp-profile) .elo-card::after, #screen-opp-profile .elo-card::after {
  content: "›"; position: absolute; right: 10px; bottom: 8px; font: 700 15px var(--rf-font-sans); color: var(--rf-sub); opacity: .7;
}
.elo-card .elo-wk { font: 700 11px var(--rf-font-sans); color: var(--rf-sub); min-height: 14px; margin-top: -4px; }
.elo-card .elo-wk.up, .elo-sheet .up { color: var(--rf-success, #34C759); }
.elo-card .elo-wk.down, .elo-sheet .down { color: var(--rf-hot, #E8836B); }

#screen-elo.active { display: flex; align-items: flex-end; }
#screen-elo .overlay { background: rgba(0, 0, 0, .72); backdrop-filter: blur(6px); }
#screen-elo .sheet.elo-sheet {
  position: relative; height: auto; max-height: 88vh; overflow-y: auto; width: 100%;
  background: var(--rf-surface); color: var(--rf-text, var(--rf-text)); border-top: 1px solid var(--rf-card-line); border-radius: 20px 20px 0 0;
  padding: 12px 18px calc(24px + env(safe-area-inset-bottom)); gap: 14px; font-family: var(--rf-font-sans);
}
.elo-sheet .elo-head { display: flex; flex-direction: column; gap: 2px; }
.elo-sheet .elo-kind { font: 800 12px var(--rf-font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--rf-sub); }
.elo-sheet .elo-now { display: flex; align-items: baseline; gap: 10px; }
.elo-sheet .elo-now b { font: 700 40px var(--rf-font-display); color: var(--rf-accent); line-height: 1.1; }
.elo-sheet .elo-delta { font: 800 15px var(--rf-font-sans); }
.elo-sheet .elo-graph { color: var(--rf-accent); min-height: 120px; }
.elo-sheet .elo-graph-in { position: relative; height: 130px; }
.elo-sheet .elo-graph-in svg { width: 100%; height: 100%; display: block; overflow: visible; }
.elo-sheet .elo-ax { position: absolute; right: 0; font: 700 10px var(--rf-font-sans); color: var(--rf-sub); background: var(--rf-surface); padding: 0 2px; }
.elo-sheet .elo-ax.hi { top: -4px; }
.elo-sheet .elo-ax.lo { bottom: -4px; }
.elo-sheet .elo-empty { text-align: center; padding: 40px 10px; font-size: 13px; color: var(--rf-sub); margin: 0; }
.elo-sheet .elo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.elo-sheet .elo-grid > div {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 12px;
  background: color-mix(in srgb, var(--rf-text) 4%, transparent); border: 1px solid var(--rf-card-line, var(--rf-card-line)); border-radius: 12px;
}
.elo-sheet .elo-grid b { font: 800 18px var(--rf-font-sans); color: var(--rf-text); }
.elo-sheet .elo-grid span { font: 700 11px var(--rf-font-sans); color: var(--rf-sub); }
.elo-sheet .elo-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: color-mix(in srgb, var(--rf-text) 6%, transparent); }
.elo-sheet .elo-bar i { display: block; min-width: 0; }
.elo-sheet .elo-bar.empty i { display: none; }
.elo-sheet .elo-bar .w, .elo-sheet .elo-legend .w::before { background: var(--rf-success, #34C759); }
.elo-sheet .elo-bar .d, .elo-sheet .elo-legend .d::before { background: var(--rf-sub, #A79E8B); }
.elo-sheet .elo-bar .l, .elo-sheet .elo-legend .l::before { background: var(--rf-hot, #E8836B); }
.elo-sheet .elo-legend { display: flex; gap: 14px; margin-top: 8px; font: 700 12px var(--rf-font-sans); color: var(--rf-text-2, var(--rf-text-2)); }
.elo-sheet .elo-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.elo-sheet .elo-line { font: 700 13px var(--rf-font-sans); color: var(--rf-text-2, var(--rf-text-2)); }
.elo-sheet .elo-line:empty, .elo-sheet .elo-best:empty { display: none; }
.elo-sheet .elo-best {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: color-mix(in srgb, var(--rf-text) 4%, transparent); border: 1px solid var(--rf-card-line, var(--rf-card-line)); border-radius: 12px;
}
.elo-sheet .elo-best .muted { font: 700 12px var(--rf-font-sans); color: var(--rf-sub); }
.elo-sheet .elo-best b { flex: 1; display: flex; align-items: center; gap: 8px; font: 800 14px var(--rf-font-sans); min-width: 0; }
.elo-sheet .elo-best img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.elo-sheet .elo-best-r { font: 800 15px var(--rf-font-sans); color: var(--rf-accent); }
