/* AVATAR PICKER (stop J, avatar.js): the lobby's premium gold-glass pop-up (daily.css .dly panel + .dq-tabs), tabs
   FACES / SHOP / PHOTO / BORDER, a big live preview on the left, a big X. Phone-first: 844x390 and 667x375, every
   target >= 44 px. Avatars are canvases from shop.js avatarEl (the one shared avatar). */
.av-ov { z-index: 62; }
.avp { width: min(800px, 100%); height: min(374px, calc(var(--appH, 100vh) - 16px)); max-height: calc(var(--appH, 100vh) - 16px); display: flex; flex-direction: column; padding-bottom: 10px; }
.avp .av-head { flex: none; gap: 8px; }
.avp .av-tabs button { min-width: 76px; padding: 0 10px; }
.avp .av-x { width: 48px; height: 48px; min-width: 48px; font-size: 22px; }
.av-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.av-prev { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 14px; text-align: center;
  border: 1px solid transparent;
  background: radial-gradient(70% 55% at 50% 38%, rgba(255,200,90,.28), transparent 72%) padding-box, linear-gradient(180deg, rgba(40,28,80,.8), rgba(14,9,30,.88)) padding-box,
    linear-gradient(180deg, rgba(255,226,150,.65), rgba(140,90,20,.45)) border-box; }
.av-big canvas { display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.55)); }
.av-nm { font: 700 italic 15px/1.15 var(--namefont, Georgia, serif); color: #fff6e0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-what { font: 600 10.5px/1.3 var(--serif); color: #e8d29a; }
.av-main { min-height: 0; display: flex; flex-direction: column; }
.av-grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 7px; align-content: start; padding: 2px 4px 4px 2px; }
.av-t { position: relative; min-height: 96px; min-width: 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 6px 4px 6px;
  border-radius: 12px; color: #f3e6c4; border: 1px solid transparent; cursor: pointer;
  background: linear-gradient(180deg, rgba(40,28,80,.82), rgba(16,10,34,.9)) padding-box, linear-gradient(180deg, rgba(255,226,150,.45), rgba(140,90,20,.35)) border-box; }
.av-t:active { transform: translateY(1px); }
.av-t > * { flex: none; }
.av-t .av-art { display: grid; place-items: center; width: 64px; height: 64px; }
.av-t .av-art canvas { display: block; }
.av-t.face .av-art canvas { border-radius: 50%; box-shadow: 0 0 0 2px #b9862a, 0 3px 6px rgba(0,0,0,.5); }
.av-t .av-l { font: 700 10.5px/1.1 var(--serif); letter-spacing: .03em; color: #f8dc94; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-t .av-s { font: 700 9px/1 var(--serif); letter-spacing: .06em; color: #9fe6ff; }
.av-t .av-p { display: inline-flex; align-items: center; gap: 3px; font: 700 11px/1 var(--serif); color: var(--gold); }
.av-t .av-p .coin { width: 13px; height: 13px; }
.av-t.on { background: radial-gradient(80% 70% at 50% 35%, rgba(255,210,100,.4), transparent 75%) padding-box, linear-gradient(180deg, rgba(90,60,140,.95), rgba(30,16,56,.95)) padding-box, var(--rimg) border-box;
  border-width: 2px; box-shadow: 0 0 14px rgba(255,200,80,.5); }
.av-t.on::after { content: '\2713'; position: absolute; top: 4px; right: 6px; font: 900 14px/1 system-ui, sans-serif; color: #7dffb5; text-shadow: 0 1px 2px #000; }
.av-t.no .av-art { filter: grayscale(1) brightness(.6); }
.av-t.no .av-l { color: #b9ae96; }
.av-t.auto .av-l { color: #ffd36b; }
.av-shopgo { grid-column: 1 / -1; min-height: 44px; border-radius: 12px; font: 700 12px/1 var(--serif); letter-spacing: .08em; color: #3a1d00;
  background: linear-gradient(#fff3c0, #ffd36b 45%, #f0a020); border: 0; }
.av-empty { grid-column: 1 / -1; padding: 20px; text-align: center; font: 600 12px/1.3 var(--serif); color: #c9bfe6; }
.av-grid.photo { display: block; }
.av-grid.faces { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.av-grid.faces .av-t { min-height: 88px; padding-top: 5px; }
.av-grid.faces .av-art { width: 58px; height: 58px; }
.av-photo { display: flex; gap: 16px; align-items: center; padding: 10px 6px; }
.av-ph { flex: none; }
.av-phr { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.av-pill { padding: 5px 10px; border-radius: 99px; font: 800 11px/1 var(--serif); letter-spacing: .08em; color: #1b1300; background: #cfc4a8; }
.av-pill.wait { background: linear-gradient(#ffd98a, #ff9f1c); }
.av-pill.ok { background: linear-gradient(#b8ffd6, #3ecf8e); }
.av-pill.rejected { color: #fff; background: linear-gradient(#ff8a8a, #d42a2a); }
.av-st { margin: 0; font: 600 12px/1.35 var(--serif); color: #e9e0cc; }
.av-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.av-b { min-height: 46px; min-width: 112px; padding: 0 14px; border-radius: 12px; font: 700 12.5px/1 var(--serif); letter-spacing: .07em; color: #f3e6c4;
  background: rgba(12,8,26,.6); border: 1.5px solid rgba(255,214,120,.55); }
.av-b.gold { color: #3a1d00; background: linear-gradient(#fff3c0, #ffd36b 45%, #f0a020); border-color: transparent; }
.av-b.gold.on, .av-b:disabled { filter: saturate(.6) brightness(.85); }
.av-b.red { color: #ffd6d6; border-color: rgba(255,120,120,.65); background: rgba(70,10,16,.55); }
.av-msg { flex: none; min-height: 16px; padding-top: 4px; font: 600 11.5px/1.3 var(--serif); color: #9fe6ff; }
.av-msg.bad { color: #ff9a9a; }
/* Settings > ACCOUNT row */
.av-setrow .av-setpv { display: grid; place-items: center; width: 46px; height: 46px; cursor: pointer; }
.av-setrow .setlab small { display: block; font-weight: 400; }
#pvAvatar.tap { cursor: pointer; }
/* the result rows: the shared avatar with its border (no clipping circle) */
#result .rs-face.av { overflow: visible; border: 0; background: none; display: grid; place-items: center; }
#result .rs-face.av canvas { width: 100% !important; height: 100% !important; transform: scale(1.12); }
.cmsg canvas.avatar { vertical-align: middle; margin: 0 4px 0 2px; }
.vs-name canvas.avatar { vertical-align: middle; margin-right: 5px; }

@media (max-height: 400px) {
  .avp { padding-left: 12px; padding-right: 12px; }
  .avp .dq-head h2 { font-size: 20px; }
  .av-body { grid-template-columns: 150px minmax(0, 1fr); gap: 10px; margin-top: 6px; }
  .av-big canvas { width: 112px !important; height: 112px !important; }
  .av-t { min-height: 90px; }
}
@media (max-width: 700px) {
  .avp .av-tabs button { min-width: 64px; padding: 0 7px; font-size: 11px; }
  .avp .dq-head h2 { font-size: 18px; }
  .av-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
  .av-photo { gap: 10px; }
  .av-b { min-width: 96px; }
}
