/* Avatar SVGs + the avatar builder (VN.Avatar.builder). Everything is scoped under av- classes. */
.av-svg { display: block; }

.av-builder {
  container-type: inline-size;
  color: #f5f2e9;
  font: 15px/1.4 Barlow, system-ui, sans-serif;
}
.av-layout {
  display: grid; grid-template-columns: 176px minmax(0, 1fr); grid-template-areas: 'tabs tabs' 'stage grid';
  gap: 14px 16px; align-items: start;
}
.av-tabs { grid-area: tabs; }
.av-stage { grid-area: stage; }
.av-grid { grid-area: grid; }

/* ---- stage: spotlit preview ---- */
.av-stage {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 12px 12px; border-radius: 14px; border: 1px solid #343646; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 50% 18%, rgba(232, 188, 103, 0.18), transparent 70%),
    radial-gradient(ellipse 80% 30% at 50% 100%, rgba(255, 63, 164, 0.16), transparent 70%),
    linear-gradient(180deg, #1c1f2d, #10131d);
}
.av-stage::after {
  content: ''; position: absolute; left: 10%; right: 10%; top: 206px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 188, 103, 0.35), transparent); pointer-events: none;
}
.av-preview { height: 190px; display: flex; align-items: flex-end; justify-content: center; }
.av-preview .av-svg { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45)); }
.av-caption { text-align: center; min-height: 40px; }
.av-name { display: block; font: 400 18px/1.1 Bungee, Impact, sans-serif; color: #e8bc67; letter-spacing: 0.02em; }
.av-sub { display: block; margin-top: 3px; font: 600 12px/1.2 'Barlow Condensed', 'Arial Narrow', sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: #9a9eb0; }

.av-random {
  width: 100%; padding: 9px 12px; border: 1px solid #e8bc67; border-radius: 8px; background: rgba(232, 188, 103, 0.1);
  color: #f3d08a; font: 700 14px/1 'Barlow Condensed', 'Arial Narrow', sans-serif; letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.av-random:hover { background: #e8bc67; color: #171920; }

/* ---- tabs ---- */
.av-tabs {
  display: flex; gap: 4px; padding: 4px; overflow-x: auto; scrollbar-width: none; border-radius: 10px; background: #10131d; border: 1px solid #2c2e3c;
}
.av-tabs::-webkit-scrollbar { display: none; }
.av-tab {
  flex: 1 0 auto; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #9a9eb0;
  font: 600 13px/1 'Barlow Condensed', 'Arial Narrow', sans-serif; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.av-tab:hover { color: #f5f2e9; background: rgba(255, 255, 255, 0.05); }
.av-tab[aria-selected='true'] { background: #e8bc67; color: #171920; }

/* ---- option grid ---- */
.av-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px;
  max-height: 330px; overflow-y: auto; padding: 2px; align-content: start; scrollbar-width: thin; scrollbar-color: #454452 transparent;
}
.av-grid.av-grid-wide { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.av-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 5px;
  border: 1px solid #2f3141; border-radius: 10px; background: linear-gradient(180deg, #222331, #171a26);
  color: #c9cbd6; cursor: pointer; transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.av-opt:hover { border-color: #5a5b6e; transform: translateY(-1px); }
.av-opt[aria-pressed='true'] {
  border-color: #e8bc67; background: linear-gradient(180deg, #2c2a2c, #1d1c22);
  box-shadow: 0 0 0 1px #e8bc67, 0 0 16px rgba(232, 188, 103, 0.25);
}
.av-opt[aria-pressed='true']::after {
  content: ''; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #e8bc67;
}
.av-thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; }
.av-thumb .av-svg { width: auto; height: 100%; max-width: 100%; }
.av-opt-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 11px/1.1 'Barlow Condensed', 'Arial Narrow', sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
}
.av-opt[aria-pressed='true'] .av-opt-name { color: #e8bc67; }

.av-tab:focus-visible, .av-opt:focus-visible, .av-random:focus-visible { outline: 2px solid #e8bc67; outline-offset: 2px; }

/* ---- narrow containers (phones, small dialogs) ---- */
@container (max-width: 440px) {
  .av-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'stage' 'tabs' 'grid'; gap: 10px; }
  .av-tab { padding: 7px 8px; font-size: 12px; letter-spacing: 0.05em; }
  .av-stage { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: 12px 14px; align-items: center; padding: 10px 14px; }
  .av-stage::after { display: none; }
  .av-preview { grid-row: 1 / 3; height: 140px; }
  .av-preview .av-svg { height: 140px; width: auto; }
  .av-caption { text-align: left; min-height: 0; }
  .av-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); max-height: 240px; }
  .av-thumb { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .av-opt, .av-tab, .av-random { transition: none; }
  .av-opt:hover { transform: none; }
}
