/* ── OFF THE GRID CHAT — MOBILE FIRST ── */

:root {
  --bg:      #080a0f;
  --bg2:     #0d1018;
  --bg3:     #131720;
  --bg4:     #181e2a;
  --accent:  #00e5ff;
  --red:     #cc0018;
  --green:   #4ade80;
  --amber:   #fbbf24;
  --purple:  #7c3aed;
  --text:    #e2e8f0;
  --muted:   #5a6478;
  --border:  rgba(0,229,255,0.1);
  --font:    'Rajdhani', sans-serif;
  --mono:    'Share Tech Mono', monospace;

  /* Safe areas */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  /* Nav heights */
  --top-nav-h: 52px;
  --bot-nav-h: 58px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  height: -webkit-fill-available;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  height: 100%;
  height: -webkit-fill-available;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button {
  font-family: var(--font);
  -webkit-appearance: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
input {
  font-family: var(--font);
  -webkit-appearance: none;
  font-size: 16px; /* prevents iOS zoom */
  border-radius: 0;
}

/* ── APP SHELL ── */
#app {
  width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  position: relative;
  overflow: hidden;
}

/* ── SCREENS ── */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}
.screen.active { display: flex; flex-direction: column; }

/* ── AUTH SCREEN ── */
.auth-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat) + 40px) 24px calc(var(--sab) + 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.auth-logo-text { text-align: center; }
.auth-app-name {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 2px;
}
.auth-app-sub {
  display: block;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 3px;
  margin-top: 2px;
}

.auth-tabs {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  transition: all .15s;
  letter-spacing: .3px;
}
.auth-tab.active { background: rgba(0,229,255,.1); color: var(--accent); }

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.field-hint { font-weight: 400; opacity: .7; text-transform: none; letter-spacing: 0; }
.field input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: rgba(0,229,255,.4); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-eye {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  padding: 4px;
}

.pw-strength {
  height: 3px;
  background: var(--bg4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.pw-strength #pw-bar {
  height: 100%;
  border-radius: 2px;
  width: 0;
  transition: width .3s, background .3s;
}

.forgot-link {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  background: transparent;
  text-align: right;
  text-decoration: underline;
  align-self: flex-end;
  margin-top: -6px;
}

.auth-err {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--red);
  background: rgba(204,0,24,.08);
  border: 1px solid rgba(204,0,24,.2);
  border-radius: 8px;
  padding: 9px 12px;
  display: none;
  line-height: 1.5;
}
.auth-err.show { display: block; }

.auth-ok {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--green);
  background: rgba(74,222,128,.08);
  border: 1px solid rgba(74,222,128,.2);
  border-radius: 8px;
  padding: 9px 12px;
  display: none;
  line-height: 1.5;
}
.auth-ok.show { display: block; }

.auth-desc {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted);
  line-height: 1.6;
}
.auth-terms {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.auth-terms a { color: var(--accent); cursor: pointer; }

/* ── BUTTONS ── */
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--accent));
  color: white;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  transition: opacity .15s;
}
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary:active { opacity: .85; }

.btn-ghost {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.btn-ghost:active { background: var(--bg3); }

/* ── ONBOARDING ── */
.onboard-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat) + 32px) 24px calc(var(--sab) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.onboard-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}
.ob-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bg4);
  border: 1px solid var(--border);
  transition: all .2s;
}
.ob-dot.active { background: var(--accent); border-color: var(--accent); }
.ob-dot.done { background: var(--green); border-color: var(--green); }

.ob-step {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: center;
}
.ob-step.active { display: flex; }
.ob-icon { font-size: 48px; }
.ob-step h2 { font-size: 22px; font-weight: 700; }
.ob-step p { font-size: 13px; font-family: var(--mono); color: var(--muted); line-height: 1.6; }

.age-ctrl {
  display: flex;
  align-items: center;
  gap: 24px;
}
.age-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(0,229,255,.3);
  background: rgba(0,229,255,.08);
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  transition: all .15s;
}
.age-btn:active { background: rgba(0,229,255,.2); }
#age-val {
  font-size: 56px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent);
  min-width: 80px;
  text-align: center;
}
#age-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg4);
  outline: none;
}
#age-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
}
.age-block {
  background: rgba(204,0,24,.08);
  border: 1px solid rgba(204,0,24,.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--red);
  width: 100%;
}

.sex-opts { display: flex; gap: 12px; width: 100%; }
.sex-opt {
  flex: 1;
  padding: 18px 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  transition: all .15s;
}
.sex-opt.selected {
  border-color: var(--accent);
  background: rgba(0,229,255,.1);
  color: var(--accent);
}

.interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.int-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.int-chip.on {
  border-color: var(--accent);
  background: rgba(0,229,255,.1);
  color: var(--accent);
}

/* ── MAIN APP ── */
#screen-app {
  flex-direction: column;
  background: var(--bg);
}

/* ── TOP NAV ── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--top-nav-h) + var(--sat));
  padding-top: var(--sat);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  padding-left: var(--sal);
  padding-right: var(--sar);
}

.top-nav-left { display: flex; align-items: center; }
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
}

.nav-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: all .15s;
  min-width: 56px;
}
.nav-icon-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-icon-btn .nav-ico { font-size: 19px; line-height: 1; }
.nav-icon-btn .nav-lbl { font-size: 9px; font-family: var(--mono); letter-spacing: .3px; }
.nav-badge {
  position: absolute;
  top: 4px; right: 8px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
}

.purge-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: var(--mono);
  color: #ff3cac;
  background: rgba(255,60,172,.08);
  border: 1px solid rgba(255,60,172,.2);
  border-radius: 8px;
  padding: 3px 8px;
}
.purge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #ff3cac;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.token-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-family: var(--mono);
  color: #a78bfa;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.35);
  border-radius: 8px;
  padding: 3px 9px;
  cursor: pointer;
}

/* ── VIEW HOST ── */
.view-host {
  position: fixed;
  top: calc(var(--top-nav-h) + var(--sat));
  bottom: calc(var(--bot-nav-h) + var(--sab));
  left: var(--sal);
  right: var(--sar);
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.view.active { display: flex; }

/* ── CHAT VIEW ── */
.room-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.room-bar span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .3px;
}
.room-online {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--green);
  margin-left: auto;
}

.messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}

.sys-msg {
  text-align: center;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  padding: 6px 12px;
  background: var(--bg3);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.msg.own { flex-direction: row-reverse; }

.av {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg4);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.av svg { width: 30px; height: 30px; display: block; }

.msg-body { display: flex; flex-direction: column; gap: 2px; max-width: 75%; }
.msg-meta {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
}
.msg.own .msg-meta { text-align: right; }

.bubble {
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.bubble.them {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-top-left-radius: 3px;
}
.bubble.own-b {
  background: rgba(0,229,255,.1);
  border: 1px solid rgba(0,229,255,.2);
  color: var(--text);
  border-top-right-radius: 3px;
}

/* ── COMPOSER ── */
.composer {
  padding: 8px 12px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.composer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 8px;
  transition: border-color .15s;
}
.composer-row:focus-within { border-color: rgba(0,229,255,.35); }
.composer-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  padding: 2px 4px;
}
.composer-row input::placeholder { color: var(--muted); }
.composer-btn {
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.send-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), var(--accent));
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── OTHER VIEWS ── */
.view-head {
  padding: 14px 16px 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-transform: uppercase;
}

.card-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.room-card:active { background: var(--bg3); }
.room-card .rc-icon { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.room-card .rc-info { flex: 1; min-width: 0; }
.room-card .rc-name { font-size: 14px; font-weight: 700; color: var(--text); }
.room-card .rc-meta { font-size: 11px; font-family: var(--mono); color: var(--muted); margin-top: 2px; }
.room-card .rc-badge {
  font-size: 9px;
  font-family: var(--mono);
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}
.rc-badge.hot { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.2); color: var(--amber); }
.rc-badge.new { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.2); color: var(--green); }
.save-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--muted);
  transition: all .12s;
}
.save-btn.saved { border-color: rgba(0,229,255,.3); background: rgba(0,229,255,.08); }

.shop-body, .profile-body, .settings-body, .dm-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
}

.empty-state {
  text-align: center;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted);
  padding: 48px 24px;
  line-height: 1.8;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--bot-nav-h) + var(--sab));
  padding-bottom: var(--sab);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 50;
  padding-left: var(--sal);
  padding-right: var(--sar);
}

.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  background: transparent;
  color: var(--muted);
  transition: color .15s;
  min-width: 0;
}
.bnav-btn.active { color: var(--accent); }
.bnav-btn .nav-ico { font-size: 20px; line-height: 1; }
.bnav-btn .nav-lbl { font-size: 9px; font-family: var(--mono); white-space: nowrap; }

/* ── DRAWERS ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border);
  z-index: 101;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--sab);
}
.drawer.open { transform: translateY(0); }

.drawer-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  flex-shrink: 0;
}
.drawer-title { font-size: 16px; font-weight: 700; color: var(--text); }
.drawer-close {
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  padding: 4px 8px;
}
.drawer-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-section {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 4px 4px;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  transition: background .12s;
}
.more-item:active { background: var(--bg4); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: calc(var(--bot-nav-h) + var(--sab) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── USER POPUP ── */
.user-popup {
  position: fixed;
  z-index: 150;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  width: calc(100vw - 32px);
  left: 16px !important;
  bottom: calc(var(--bot-nav-h) + var(--sab) + 12px);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

/* ── DESKTOP OVERRIDES (min 769px) ── */
@media (min-width: 769px) {
  :root {
    --top-nav-h: 56px;
    --bot-nav-h: 56px;
  }
  .auth-wrap, .onboard-wrap { max-width: 480px; }
  .view-host {
    left: 0; right: 240px;
    /* right panel on desktop in future */
  }
}

/* ── PROFILE & AVATAR SYSTEM ── */

.profile-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.profile-section {
  margin-bottom: 14px;
}

.av-preview-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.av-preview {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.av-preview-info { flex: 1; }
.av-preview-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.av-preview-type {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.av-token-bal {
  font-size: 14px;
  font-family: var(--mono);
  color: #a78bfa;
  font-weight: 700;
}

/* Customise tabs */
.cust-tabs {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.cust-tab {
  flex: 1;
  padding: 9px 6px;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}
.cust-tab.active {
  background: rgba(0,229,255,.1);
  color: var(--accent);
}

.cust-panel { display: none; flex-direction: column; gap: 0; }
.cust-panel.active { display: flex; }

.cust-section-lbl {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 10px 0 8px;
}

/* Avatar type grid */
.av-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.av-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .12s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.av-type-card.active {
  border-color: var(--accent);
  background: rgba(0,229,255,.08);
}
.av-type-card:active { opacity: .8; }

.av-type-svg {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
}
.av-type-lbl {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--muted);
  text-align: center;
  text-transform: capitalize;
}
.av-lock {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 8px;
  font-family: var(--mono);
  color: #a78bfa;
  background: rgba(124,58,237,.2);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 4px;
  padding: 1px 4px;
}

/* Eye style grid — same as av-type-grid */
.eye-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

/* Option grids (accessories, scars, etc) */
.opt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

/* Colour swatches */
.colour-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.colour-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .12s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.colour-swatch.active {
  border-color: white;
  transform: scale(1.15);
}

/* ── IMAGE AVATAR PROFILE ── */
.gender-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.gender-btn {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font);
  transition: all .15s;
}
.gender-btn.active-m {
  border-color: var(--accent);
  background: rgba(0,229,255,.08);
  color: var(--accent);
}
.gender-btn.active-f {
  border-color: #ff3cac;
  background: rgba(255,60,172,.08);
  color: #ff3cac;
}

.av-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.av-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .12s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.av-card.active {
  border-color: var(--accent);
  background: rgba(0,229,255,.06);
}
.av-card.placeholder {
  opacity: .45;
  cursor: default;
}
.av-card:active:not(.placeholder) { opacity: .8; }

.av-card-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.av-card-img img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}
.av-card-name {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  text-align: center;
  text-transform: capitalize;
}
.av-card-cost {
  font-size: 9px;
  font-family: var(--mono);
  color: #a78bfa;
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.25);
  border-radius: 4px;
  padding: 1px 5px;
}
.av-card-soon {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--muted);
  opacity: .6;
}
