/* Estúdio de avatar CapriGo — interação visual inspirada em criadores gamificados. */
.profile-dialog{width:min(920px,calc(100% - 24px));max-height:calc(100dvh - 20px);border-radius:30px;overflow:hidden}
.profile-dialog form{grid-template-columns:minmax(260px, .86fr) minmax(390px,1.14fr);grid-template-rows:auto auto 1fr auto;column-gap:22px;padding:22px}
.profile-head{grid-column:1/-1}.profile-head h2{font-size:26px}.profile-head p{font-size:12px}
.avatar-stage{grid-column:1;grid-row:2/4;position:sticky;top:0;min-height:510px;border-radius:26px;background:radial-gradient(circle at 50% 38%,#fff 0 29%,transparent 30%),linear-gradient(160deg,#f4dfdc,#fff8f4 58%,#efd2ce);box-shadow:inset 0 0 0 1px rgba(116,21,35,.08)}
.avatar-stage:before{content:"";position:absolute;inset:28px;border:2px dashed rgba(116,21,35,.08);border-radius:50%}
.avatar-stage .capri-avatar.avatar-svg{width:280px;height:295px;transition:transform .18s cubic-bezier(.2,.8,.2,1)}
.avatar-stage .capri-avatar.avatar-svg.is-changing{transform:scale(.96) rotate(-1deg)}
.avatar-stage-label{top:16px;right:16px;bottom:auto;background:#fff7f3;color:#8d202b}
.random-avatar{left:50%;bottom:18px;transform:translateX(-50%);min-width:142px;padding:11px 15px;border:0;background:#fff;color:#741523;box-shadow:0 6px 18px rgba(116,21,35,.12);font-size:10px}
.profile-dialog label:has(#profileName){grid-column:2;grid-row:2;margin:0}.profile-dialog #profileName{min-height:48px;background:#fff}
.avatar-controls{grid-column:2;grid-row:3;min-height:0;padding:0;border:0;background:transparent;overflow:hidden}
.avatar-tabs{position:sticky;top:0;z-index:3;grid-template-columns:repeat(3,1fr);gap:8px;padding:6px;background:#f3e7e5;border-radius:17px}
.avatar-tabs button{min-height:47px;border-radius:13px;font-size:11px}.avatar-tabs button i{width:25px;height:25px;background:#e5d2cf;font-size:11px}
.avatar-tabs button.active{color:#741523;box-shadow:0 4px 13px rgba(116,21,35,.1)}
.avatar-presets{padding:13px;border:0;background:#fff}.avatar-presets>div{gap:9px}.avatar-presets button{min-height:40px;border:2px solid #eadbd9;border-bottom-width:4px;border-radius:12px;color:#70242c}.avatar-presets button:active{transform:translateY(2px);border-bottom-width:2px}
.avatar-panel{max-height:390px;padding:4px 5px 15px;overflow:auto;scrollbar-width:thin;scrollbar-color:#d7b6b2 transparent}
.avatar-option{gap:10px}.avatar-option>span{color:#765d60;font-size:10px}
.avatar-choices{display:grid;grid-template-columns:repeat(4,minmax(76px,1fr));gap:10px;overflow:visible}
.avatar-choices button{position:relative;display:grid;grid-template-rows:64px 20px;place-items:center;align-content:center;gap:4px;width:100%!important;height:104px!important;min-width:0!important;min-height:104px!important;padding:7px;border:2px solid #eadfdd;border-bottom-width:4px;border-radius:16px;background:#fff;color:#60484b;overflow:hidden}
.avatar-choices button:hover{border-color:#d5a9a5;background:#fff8f5;transform:translateY(-1px)}
.avatar-choices button.active{border:3px solid #8d202b;background:#fff4f1;color:#741523;box-shadow:0 0 0 3px rgba(141,32,43,.1)}
.avatar-choices button.active:after{content:"✓";position:absolute;right:6px;top:6px;display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#8d202b;color:#fff;font-size:10px;font-weight:900}
[data-avatar-group="outfit"][data-avatar-value="green"] .avatar-choice-label{font-size:0}[data-avatar-group="outfit"][data-avatar-value="green"] .avatar-choice-label:after{content:"Vinho CQS";font-size:9px}
.avatar-choice-preview{position:relative;display:block;flex:0 0 64px;width:64px!important;height:64px!important;min-width:64px;min-height:64px;overflow:hidden;contain:layout size;pointer-events:none}.avatar-choice-preview svg{position:absolute;left:50%;top:50%;display:block;width:72px!important;height:76px!important;min-width:72px!important;max-width:72px!important;min-height:76px!important;max-height:76px!important;transform:translate(-50%,-46%)}
.avatar-choice-label{font-size:9px;line-height:1.1;font-weight:850;pointer-events:none}
.skin-palette,.hair-color-palette,.eye-palette,.background-palette{display:flex;gap:11px;flex-wrap:wrap}
.skin-palette button,.hair-color-palette button,.eye-palette button,.background-palette button{display:block;min-height:42px;width:42px;height:42px;padding:0;border:4px solid #fff;border-radius:50%;background:var(--swatch);box-shadow:0 0 0 2px #e0d3d1}
.background-palette button{border-radius:13px}.skin-palette button.active,.hair-color-palette button.active,.eye-palette button.active,.background-palette button.active{border-color:#fff;box-shadow:0 0 0 4px #8d202b}.skin-palette button.active:after,.hair-color-palette button.active:after,.eye-palette button.active:after,.background-palette button.active:after{display:none}
.custom-skin,.custom-hair-color{width:42px;height:42px;border:2px dashed #b68d8c;background:#fff}
.profile-actions{grid-column:1/-1;display:grid;grid-template-columns:auto minmax(220px,360px);justify-content:space-between;margin:0 -22px -22px}.profile-save{min-height:50px;border-bottom:4px solid #52101a;font-size:13px}.profile-save:active{transform:translateY(2px);border-bottom-width:2px}
@media(max-width:720px){
  .profile-dialog{width:100%;max-width:none;max-height:100dvh;margin:auto 0 0;border-radius:27px 27px 0 0}
  .profile-dialog form{display:grid;grid-template-columns:1fr;grid-template-rows:auto auto auto auto auto;gap:13px;padding:16px}
  .profile-head{grid-column:1}.profile-head h2{font-size:22px}.profile-head p{display:none}
  .avatar-stage{grid-column:1;grid-row:2;position:relative;min-height:235px;border-radius:22px}
  .avatar-stage:before{inset:14px}.avatar-stage .capri-avatar.avatar-svg{width:190px;height:200px}.random-avatar{bottom:10px;min-width:125px;padding:8px 11px}
  .profile-dialog label:has(#profileName){grid-column:1;grid-row:3}.profile-dialog #profileName{min-height:43px}
  .avatar-controls{grid-column:1;grid-row:4}.avatar-panel{max-height:310px}.avatar-tabs button{min-height:43px;font-size:10px}
  .avatar-presets{padding:10px 0}.avatar-choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.avatar-choices button{height:100px!important;min-height:100px!important;border-radius:14px}
  .profile-actions{grid-column:1;grid-row:5;grid-template-columns:auto 1fr;bottom:-16px;margin:0 -16px -16px;padding:12px 16px max(12px,env(safe-area-inset-bottom))}
}
@media(max-width:390px){.avatar-choices{grid-template-columns:repeat(2,1fr)}.avatar-panel{max-height:280px}.avatar-stage{min-height:215px}.avatar-stage .capri-avatar.avatar-svg{width:170px;height:180px}}
