/* 3D model viewer (model-viewer.php): the canvas beside a list of costumes / emotes. Tokens and section styles: home.css. */
.vw-top { display: grid; gap: 6px; margin-bottom: 18px; }
.vw-title { margin: 0; font: 400 clamp(2rem, 6vw, 3.4rem)/0.95 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; text-shadow: 4px 4px 0 var(--ink), 6px 6px 0 var(--red); transform: skewX(-6deg); }

.vw-stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 991px) { .vw-stage { grid-template-columns: minmax(0, 1fr); } }

.vw-canvas-box { position: relative; min-width: 0; height: min(78vh, 820px); min-height: 420px; border: 3px solid var(--ink); background: radial-gradient(ellipse at 50% 35%, #2a2f3d 0%, #14161c 70%); box-shadow: 6px 6px 0 var(--yellow); overflow: hidden; }
.vw-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.vw-canvas:active { cursor: grabbing; }
.vw-status { position: absolute; left: 50%; top: 50%; margin: 0 !important; padding: 8px 16px; border: 2px solid var(--ink); background: var(--panel); color: var(--text); font: 400 0.95rem/1 var(--font-head); letter-spacing: 0.06em; text-transform: uppercase; transform: translate(-50%, -50%); pointer-events: none; }
.vw-status[hidden] { display: none !important; }
.vw-tools { position: absolute; top: 12px; right: 12px; left: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; pointer-events: none; }
.vw-tools > * { pointer-events: auto; }
.hm .vw-tool[hidden] { display: none; }
.hm .vw-snd { padding: 4px 8px; }
.vw-snd svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.vw-snd .vw-snd-off, .vw-snd.is-off .vw-snd-on { display: none; }
.vw-snd.is-off .vw-snd-off { display: inline; }
.hm .vw-snd.is-off:not(.is-on) { color: var(--dim); }
/* sound panel: under the tool buttons */
.vw-mix { position: absolute; top: 56px; right: 12px; z-index: 3; width: min(280px, calc(100% - 24px)); padding: 12px 14px 14px; border: 2px solid var(--ink); background: var(--panel); box-shadow: 4px 4px 0 var(--ink); }
.vw-mix[hidden] { display: none; }
.vw-mix-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.vw-mix-head b { font: 400 0.9rem/1 var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; }
.hm .vw-mix-mute, .hm .vw-seg button { padding: 5px 9px 4px; border: 2px solid var(--ink); background: transparent; color: var(--text); font: 400 0.72rem/1 var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; }
.hm .vw-mix-mute:hover, .hm .vw-seg button:hover { border-color: var(--yellow); }
.hm .vw-mix-mute.is-on, .hm .vw-seg button.is-on { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.vw-mix-row { display: grid; grid-template-columns: 64px 1fr 40px; align-items: center; gap: 8px; margin: 0; padding: 6px 0; color: var(--text); font-size: 0.82rem; }
.vw-mix-row span { color: var(--dim); }
.vw-mix-row output { text-align: right; font-variant-numeric: tabular-nums; }
.vw-mix-lang { grid-template-columns: 1fr auto; border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 4px; padding-top: 10px; }
.vw-mix-lang[hidden] { display: none; }
.vw-seg { display: flex; gap: 4px; }
.vw-mix input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; background: transparent; cursor: pointer; --fill: 80%; }
.vw-mix input[type="range"]::-webkit-slider-runnable-track { height: 6px; border: 1px solid var(--ink); background: linear-gradient(90deg, var(--yellow) var(--fill), rgba(255, 255, 255, 0.14) var(--fill)); }
.vw-mix input[type="range"]::-moz-range-track { height: 6px; border: 1px solid var(--ink); background: rgba(255, 255, 255, 0.14); }
.vw-mix input[type="range"]::-moz-range-progress { height: 6px; background: var(--yellow); }
.vw-mix input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 18px; margin-top: -7px; border: 2px solid var(--ink); background: var(--text); }
.vw-mix input[type="range"]::-moz-range-thumb { width: 12px; height: 16px; border: 2px solid var(--ink); border-radius: 0; background: var(--text); }
.vw-mix input[type="range"]:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.hm .vw-tool { padding: 7px 12px 6px; border: 2px solid var(--ink); background: var(--panel); color: var(--text); font: 400 0.82rem/1 var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; box-shadow: 3px 3px 0 var(--ink); }
.hm .vw-tool:hover, .hm .vw-tool.is-on { background: var(--yellow); color: var(--ink); }
.vw-hint { position: absolute; left: 12px; bottom: 10px; margin: 0 !important; color: var(--dim); font-size: 0.8rem; pointer-events: none; text-shadow: 1px 1px 0 var(--ink); }
.vw-hint-touch { display: none; }
@media (pointer: coarse) { .vw-hint-mouse { display: none; } .vw-hint-touch { display: inline; } .vw-canvas { touch-action: pan-y; } }

.vw-side { display: grid; gap: 12px; min-width: 0; padding: 14px; border: 3px solid var(--ink); background: var(--panel); box-shadow: 6px 6px 0 var(--red); }
.vw-pick { display: grid; gap: 4px; }
.vw-pick span { color: var(--dim); font: 400 0.8rem/1 var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; }
.vw-pick select { padding: 8px 10px; border: 2px solid var(--ink); background: var(--panel-2); color: var(--text); }
.vw-tabs { display: flex; gap: 8px; }
.hm .vw-tab { flex: 1; padding: 9px 10px 8px; border: 2px solid var(--ink); background: var(--panel-2); color: var(--text); font: 400 0.95rem/1 var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; transform: skewX(-9deg); }
.hm .vw-tab small { color: var(--dim); font-size: 0.75em; }
.hm .vw-tab.is-on { background: var(--yellow); color: var(--ink); }
.hm .vw-tab.is-on small { color: var(--ink); }

.hm .vw-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: min(66vh, 700px); margin: 0; padding: 0 4px 4px 0; overflow-y: auto; list-style: none; }
.vw-list[hidden] { display: none !important; }
.hm .vw-item { position: relative; display: grid; gap: 4px; width: 100%; padding: 4px 4px 6px; border: 2px solid var(--ink); background: var(--panel-2); color: var(--text); text-align: left; }
.vw-item img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #0d0f13; }
.vw-item span { overflow: hidden; font-size: 0.72rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vw-item em { position: absolute; top: 6px; left: 6px; padding: 1px 6px; background: var(--blue); color: #fff; font: 400 0.65rem/1.4 var(--font-head); font-style: normal; text-transform: uppercase; }
.hm .vw-item:hover { border-color: var(--yellow); }
.hm .vw-item.is-on { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.vw-r-sr img { background: linear-gradient(160deg, #2c2f6e, #0d0f13); }
.vw-r-ssr img, .vw-r-essr img { background: linear-gradient(160deg, #6b4a12, #0d0f13); }

/* Voice lines tab: groups (battle, with <character>, quick chat ...) with a play button per recording */
.vw-list.vw-lines { display: block; max-height: 640px; overflow-y: auto; padding: 0; }
.vw-list.vw-lines[hidden] { display: none; }
.vw-lgroup { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.vw-lgroup > summary { cursor: pointer; padding: 10px 6px; font-weight: 700; list-style: none; }
.vw-lgroup > summary::-webkit-details-marker { display: none; }
.vw-lgroup > summary::before { content: '▸'; display: inline-block; width: 1em; transition: transform 0.15s; }
.vw-lgroup[open] > summary::before { transform: rotate(90deg); }
.vw-lgroup > summary small { opacity: 0.6; font-weight: 400; }
.vw-lgroup ul { list-style: none; margin: 0; padding: 0 0 8px; }
.vw-lgroup li { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 22px; }
.vw-lgroup li span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 0.92em; }
.vw-lgroup li q { display: block; opacity: 0.7; font-size: 0.92em; quotes: none; }
.vw-lplay { min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: inherit; cursor: pointer; font: inherit; font-size: 0.85em; }
.vw-lplay:hover, .vw-lplay:focus-visible { background: rgba(255, 255, 255, 0.14); }
.vw-lplay.is-on { background: #ffd400; color: #111; border-color: #ffd400; }
