/* Tạo nhân vật (js/31): màn toàn trang, xem trước 3D bên trái (điện thoại: trên), lựa chọn bên phải (dưới) */
.tnv{position:fixed;inset:0;z-index:300;display:grid;place-items:center;background:radial-gradient(120% 90% at 30% 20%,#FBF3E4,#EAD9BC);color:#2B1606}
.tnv[hidden]{display:none}
.tnv-hop{width:min(1040px,100%);height:min(680px,100%);display:grid;grid-template-columns:1.1fr 1fr;gap:0;border-radius:24px;overflow:hidden;background:rgba(255,252,246,.6);box-shadow:0 20px 60px rgba(90,60,20,.18)}
.tnv-xem{position:relative;min-height:0;background:radial-gradient(60% 50% at 50% 62%,rgba(255,255,255,.85),rgba(255,255,255,0) 70%)}
.tnv-xem canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
.tnv-xem canvas:active{cursor:grabbing}
.tnv-goi{position:absolute;left:0;right:0;bottom:14px;margin:0;text-align:center;font-size:12.5px;opacity:.55;pointer-events:none}
.tnv.khong-3d .tnv-goi{display:none}
.tnv-ben{display:flex;flex-direction:column;min-height:0;padding:22px 22px 18px;background:#FFFBF4}
.tnv-ben header{position:relative;padding-right:40px}
.tnv-ben h2{margin:0;font-family:var(--f-display);font-weight:500;font-size:24px}
.tnv-ben header p{margin:4px 0 0;font-size:13.5px;opacity:.72;line-height:1.45}
.tnv-dong{position:absolute;top:-4px;right:-4px;width:40px;height:40px;border:0;border-radius:50%;background:transparent;font-size:26px;line-height:1;color:inherit;cursor:pointer}
.tnv-dong:hover{background:#F4EDE0}
.tnv-tab{display:flex;gap:4px;margin:16px 0 4px;padding:4px;border-radius:999px;background:#F4EDE0}
.tnv-tab button{flex:1;display:grid;place-items:center;min-height:42px;border:0;border-radius:999px;background:transparent;color:inherit;cursor:pointer;opacity:.6}
.tnv-tab svg{width:24px;height:24px}
.tnv-tab button[aria-selected="true"]{opacity:1;color:#8A5F17}
.tnv-tab button[aria-selected="true"]{background:#fff;box-shadow:0 1px 4px rgba(90,60,20,.15)}
.tnv-bang{flex:1;min-height:0;overflow:auto;padding:12px 2px}
.tnv-chon{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:10px;margin-top:14px}
.tnv-chon button{position:relative;aspect-ratio:1;padding:0;border:2px solid #EFE4D0;border-radius:18px;background:radial-gradient(70% 70% at 50% 40%,#fff,#F6EEDF);cursor:pointer;overflow:hidden}
.tnv-chon canvas{display:block;width:100%;height:100%}
.tnv-chon span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}   /* chữ chỉ cho trình đọc màn hình */
.tnv.khong-3d .tnv-chon button{aspect-ratio:auto;min-height:46px}
.tnv.khong-3d .tnv-chon canvas{display:none}
.tnv.khong-3d .tnv-chon span{position:static;width:auto;height:auto;clip:auto;font-size:14px}
.tnv-chon button[aria-pressed="true"]{border-color:#B8862F;box-shadow:0 0 0 2px #F3DDAA}
.tnv-chon.k-d{grid-template-columns:repeat(2,minmax(0,150px))}
.tnv-chon.k-d button{display:grid;place-items:center;color:#2F6DB5}
.tnv-chon.k-d svg{width:46%;height:46%}
.tnv-chon.k-d button[data-v="nu"]{color:#B0476A}
.tnv.khong-3d .tnv-chon.k-d button{aspect-ratio:1}
.tnv-mau{display:flex;flex-wrap:wrap;gap:10px}
.tnv-mau button{width:38px;height:38px;border-radius:50%;border:2px solid #fff;background:var(--m);box-shadow:0 0 0 1.5px #E7D9C0;cursor:pointer}
.tnv-mau button[aria-pressed="true"]{box-shadow:0 0 0 3px #B8862F}
.tnv button:focus-visible{outline:2px solid #B8862F;outline-offset:2px}
.tnv-ben footer{display:flex;gap:10px;padding-top:12px;border-top:1px solid #F0E6D4}
.tnv-ben footer button{min-height:46px;padding:0 18px;border-radius:999px;font:inherit;font-size:15px;cursor:pointer}
.tnv-nn{display:grid;place-items:center;width:52px;padding:0!important;border:1.5px solid #E7D9C0;background:#fff;color:inherit}
.tnv-nn svg{width:24px;height:24px}
.tnv-xong{flex:1;border:0;background:#B8862F;color:#fff;font-weight:600}
.tnv-xong:hover{background:#A47527}
@media (max-width:760px){
 .tnv{place-items:stretch}
 .tnv-hop{height:100%;border-radius:0;grid-template-columns:1fr;grid-template-rows:40% 60%}
 .tnv-ben{padding:16px 16px calc(14px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0}
 .tnv-ben h2{font-size:21px}
 .tnv-tab{margin-top:12px}
 .tnv-chon{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .tnv-chon.k-d{grid-template-columns:repeat(2,minmax(0,120px))}
}
