/* Avatar builder (see v2-avatar.js) */
.av-wrap{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom));background:#3a245066}
.av-card{width:min(420px,100%);max-height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:10px;background:#fffaf0;border:3px solid #fff;border-radius:28px;padding:16px;box-shadow:0 8px #dcc7d5}
.av-card h2{margin:0;text-align:center;font-size:24px;color:#58416c}
.av-stage{position:relative;min-height:0;border-radius:22px;background:radial-gradient(circle at 50% 60%,#fff7d8,#f1e7f7 70%);display:grid;place-items:center;overflow:hidden}
.av-doll{position:relative;height:min(42svh,330px);aspect-ratio:2/3}
.av-doll img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.av-doll.av-pop{animation:av-pop .4s cubic-bezier(.3,1.6,.5,1)}
@keyframes av-pop{40%{scale:1.04 .97}}
.av-dice{position:absolute;top:10px;right:10px;width:48px;height:48px;border-radius:50%;border:3px solid #fff;background:#fff3c4;box-shadow:0 3px #e6c35d;font-size:22px;cursor:pointer}
.av-tabs{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.av-tabs button{min-height:46px;border:2px solid #fff;border-radius:14px;background:#f3ecfb;font-size:22px;cursor:pointer}
.av-tabs button.on{background:#ffe9a6;box-shadow:0 3px #e6c35d}
.av-opts{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;min-height:70px;align-content:center}
.av-dot{width:52px;height:52px;border-radius:50%;border:4px solid #fff;box-shadow:0 2px 6px #3a1f5a33;cursor:pointer}
.av-dot.on{outline:3px solid #8c6bc4;outline-offset:2px}
.av-opt{position:relative;width:58px;height:58px;border-radius:16px;border:3px solid #fff;background:#f6eefa;cursor:pointer;overflow:hidden;padding:0}
.av-opt.on{border-color:#ffd56a;box-shadow:0 0 0 3px #ffd56a}
.av-thumb{position:absolute;inset:0;background-repeat:no-repeat}
.av-thumb.head{background-size:220%;background-position:50% 4%}
.av-thumb.body{background-size:170%;background-position:50% 62%}
.av-none{font-size:22px;color:#8a6fa8}
.av-go{min-height:54px;border:3px solid #fff;border-radius:18px;background:linear-gradient(#b8e9d4,#83ceba);box-shadow:0 4px #649f95;font:inherit;font-weight:900;font-size:19px;color:#3d2c52;cursor:pointer}
.kid-custom{background-size:contain!important;background-repeat:no-repeat!important;background-position:center bottom!important}
@media (prefers-reduced-motion:reduce){.av-doll.av-pop{animation:none}}
.av-canvas{position:absolute;inset:0;width:100%;height:100%}

/* Top row: title + skip ✕; then a clear Girl / Boy choice; flat labelled tabs. */
.av-card{grid-template-rows:auto minmax(0,1fr) auto auto auto} /* Girl/Boy row removed until further notice */
.av-top{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:6px}
.av-top h2{grid-column:2;font-size:22px;line-height:1.15;text-wrap:balance}
.av-x{grid-column:3;width:44px;height:44px;border-radius:50%;border:0;background:#f3ecfb;color:#6d5a86;font-size:20px;font-weight:700;cursor:pointer;display:grid;place-items:center;padding:0}
.av-kind{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.av-kind-b{display:flex;align-items:center;justify-content:center;gap:10px;min-height:58px;border-radius:18px;border:0;background:#f3ecfb;font:inherit;font-weight:800;font-size:19px;color:#58416c;cursor:pointer;padding:6px 10px}
.av-kind-b.on{background:#ffe9a6;box-shadow:inset 0 0 0 3px #ffd56a}
.av-kind-face{position:relative;width:42px;height:42px;border-radius:50%;overflow:hidden;background:#fff;flex:none}
.av-tabs{grid-template-columns:repeat(5,1fr)}
.av-tabs button{display:grid;place-items:center;gap:0;min-height:58px;border:0;border-radius:16px;background:transparent;padding:4px 0;color:#7a6690}
.av-tabs button span{font-size:22px;line-height:1.1}
.av-tabs button small{font-size:13px;font-weight:800;line-height:1.2}
.av-tabs button.on{background:#ffe9a6;box-shadow:none;color:#58416c}
.av-doll{height:min(36svh,300px)}
.av-dice{border:0;box-shadow:none;background:#fff3c4}

/* Girl / Boy: a big drawn face in a pink or blue ring. */
.av-kind-b{min-height:68px;gap:12px;font-size:20px}
.av-kind-face{width:54px;height:54px;border:3px solid #ff9cc8;background:#fff}
.av-boy .av-kind-face{border-color:#7fb4ff}
.av-kind-cv{position:absolute;width:110px;height:165px;left:-28px;top:-12px;max-width:none}
.av-kind-b.on.av-girl{background:#ffe3ef;box-shadow:inset 0 0 0 3px #ff9cc8}
.av-kind-b.on.av-boy{background:#e2efff;box-shadow:inset 0 0 0 3px #7fb4ff}

/* Fits one screen, never scrolls: the card is the visible height, the doll takes what's left, options are one swipeable row. */
.av-wrap{height:100dvh;box-sizing:border-box}
.av-card{height:min(100%,780px);box-sizing:border-box;grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:8px;overflow:hidden}
.av-stage{min-height:0;height:100%}
.av-doll{height:100%;max-height:320px;min-height:0}
.av-opts{flex-wrap:nowrap;justify-content:safe center;overflow-x:auto;overflow-y:hidden;min-height:0;padding:4px 2px;scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
.av-opts::-webkit-scrollbar{display:none}
.av-opts>*{flex:none;scroll-snap-align:center}
@media(max-height:700px){.av-kind-b{min-height:56px}.av-kind-face{width:46px;height:46px}.av-kind-cv{width:94px;height:141px;left:-24px;top:-10px}.av-tabs button{min-height:50px}}
/* Player builder is off until further notice (see OFF in v2-avatar.js): hide Grown-ups → Player */
.settings-actions [data-action="changeplayer"]{display:none!important}
