/* The 3D skin stage (static/3d/skins.js, core/skin3d.py). The box is 3:4 and its size is fixed by the CSS before anything loads, so the poster, then
   the canvas, then a model that finishes late never move the page. Without JS or WebGL the poster (the skin's front view) is the picture. */
.sk { position: relative; flex: none; width: var(--sk-w, 240px); max-width: 100%; }
.sk-model { position: relative; aspect-ratio: 3 / 4; isolation: isolate; }

/* a warm glow behind the model, and its shadow on the floor */
.sk-model::before { content: ""; position: absolute; inset: -6% -24% -2%; z-index: -2; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 122, 47, .22), rgba(255, 122, 47, .06) 62%, transparent); }
.sk-model::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 11.5%; height: 5%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent); }

.sk-poster, .sk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sk-poster { object-fit: contain; transition: opacity .5s ease; }
.sk-canvas { width: 100% !important; height: 100% !important; opacity: 0; transition: opacity .5s ease; touch-action: pan-y !important; cursor: grab; -webkit-tap-highlight-color: transparent; border-radius: 12px; }
.sk-canvas.is-grabbing { cursor: grabbing; }
.sk-canvas:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.is-live .sk-canvas { opacity: 1; }
.is-live .sk-poster { opacity: 0; }
.is-lost .sk-canvas { opacity: 0; }
.is-lost .sk-poster { opacity: 1; }

.sk-hint { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 1; text-align: center; font-size: 12px; color: var(--text-2); pointer-events: none; transition: opacity .4s ease; }
.is-touched .sk-hint, .is-lost .sk-hint { opacity: 0; }

/* a person's stage: the hologram floats above their head */
.sk-npc { --sk-w: 300px; padding-top: 58px; }
.sk-tag { position: absolute; top: 14px; left: 50%; width: max-content; transform: translateX(-50%); z-index: 3; pointer-events: none; }
.sk-tag .tag { margin: 0; padding: 6px 14px; }

/* a person with a second hologram (locked, or before and after): a small two-way switch under the model. Native radios, so the arrow keys and Tab
   work and it needs no script; the state picked shows its tag over the head and its caption under the switch */
.sk-npc .sk-tag[data-s="1"], .sk-npc .sk-cap[data-s="1"] { display: none; }
.sk-npc:has(.sk-switch input[value="1"]:checked) .sk-tag[data-s="0"], .sk-npc:has(.sk-switch input[value="1"]:checked) .sk-cap[data-s="0"] { display: none; }
.sk-npc:has(.sk-switch input[value="1"]:checked) .sk-tag[data-s="1"], .sk-npc:has(.sk-switch input[value="1"]:checked) .sk-cap[data-s="1"] { display: block; }
.sk-switch { display: flex; width: max-content; max-width: 100%; margin: 8px auto 0; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; }
.sk-opt { position: relative; cursor: pointer; }
.sk-opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sk-opt span { display: block; padding: 5px 16px; border-radius: 99px; font: 600 13px/1.2 var(--sans); color: var(--text-2); transition: background-color .2s ease, color .2s ease; }
.sk-opt input:checked + span { background: var(--ember); color: #1a0e06; }
.sk-opt input:not(:checked):hover + span { color: var(--text); }
.sk-opt input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }
.sk-cap { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--text-2); }
.sk-tag .tag canvas { max-width: none; flex: none; }

@media (max-width: 480px) { .sk-npc { padding-top: 46px; } .sk-tag { top: 8px; } }
@media (prefers-reduced-motion: reduce) {
  .sk-poster, .sk-canvas, .sk-hint, .sk-opt span { transition: none; }
}
