/* v3 scene engine (owner: pixel): plates, hotspots, data lights, pins, sprites, bubbles, the mobile place list and pan. Page-scoped, never in
   site.css (build.mjs PAGE_CSS): every page with a <!-- v3:scene --> marker or scene.js links it (home, coin, gm, city). Split out of world.css
   by atlas (Delta G0). Contract: handoffs/atlas-to-pixel-quiet.md s2; art direction: creative/concept-quiet.md s7, s8.
   The plate is one <img>; everything placed on it is HTML in % of .scene-plate. No animation or filter on the plate, ever. */

/* ---------- scene box ---------- */
.v3 .scene { position: relative; z-index: 0; isolation: isolate; pointer-events: auto; inset: auto; aspect-ratio: var(--ar); background: var(--ground); overflow: hidden; width: 100%; } /* the kit app.css puts .scene at z-index -1 */
.v3 .scene-plate { position: absolute; inset: 0; }
.v3 .scene-plate picture, .v3 .scene-plate img { display: block; width: 100%; height: 100%; }
.v3 .scene-tint { position: absolute; inset: 0; pointer-events: none; }
/* data lights (lights.js): HTML shapes clipped to mark's polygons, created only when a field turns them on; no animation, no glow */
.v3 .lt { position: absolute; inset: 0; pointer-events: none; }
.v3 .lt--m { display: none; }
@media (max-width: 47.99em) { .v3 .lt--d { display: none; } .v3 .lt--m { display: block; } }
.v3 .hot-list { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.v3 .hot-list > li { display: contents; }
.v3 .hot { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: calc(var(--w) * 1%); height: calc(var(--h) * 1%);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: var(--s-1); padding: 0; background: none; border: 0; text-align: left; color: var(--c-text);
  border-radius: var(--step); outline: 1px solid transparent; outline-offset: -1px; cursor: pointer; text-decoration: none; }
.v3 .hot:hover { outline-color: var(--c-bg); }
.v3 .hot:focus-visible { outline: none; box-shadow: var(--map-ring); } /* two-tone ring on the dusk plates (Delta 3 s3.9): ivory alone is < 3:1 on four tops */
.v3 .hot-name, .v3 .hot-state { background: var(--c-surface); border: 1px solid var(--c-edge); padding: var(--s-1) var(--s-3); max-width: 100%; }
.v3 .hot .hot-name { font-family: var(--head); font-weight: var(--w-head); font-size: var(--t-plate-name); line-height: 1.1; letter-spacing: -0.01em; border-radius: var(--step) var(--step) 0 0; border-bottom: 0; }
.v3 .hot .hot-state { font-size: var(--t-hud-meta); line-height: var(--lh-hud-meta); min-height: 18px; color: var(--c-muted); border-radius: 0 var(--step) var(--step) var(--step); }
.v3 .hot .hot-state:empty { display: none; }
.v3 .hot .chip { margin: var(--s-1) 0; }
.v3 .hot:hover .hot-name, .v3 .hot:focus-visible .hot-name { border-color: var(--c-text); }
.v3 .hot:hover .hot-state, .v3 .hot:focus-visible .hot-state { border-color: var(--c-text); }
.v3 .hot:active .hot-name { background: var(--hud-bg-hover); }
@media (max-width: 89.99em) { .v3 .hot[data-hot="silence"] .hot-name, .v3 .hot[data-hot="silence"] .hot-state { max-width: 148px; } }
.v3 .hot-card { position: absolute; left: calc(var(--x) * 1%); top: calc((var(--y) + var(--h)) * 1%); z-index: 3; max-width: 240px; background: var(--c-surface); border: 1px solid var(--c-edge); border-radius: var(--step);
  padding: var(--s-3) var(--s-4); color: var(--c-text-read); font-size: var(--t-small); }
.v3 .scene[data-hot-debug] .hot { outline: 1px dashed var(--c-accent); background: color-mix(in srgb, var(--c-accent) 10%, transparent); }
.v3 .pins, .v3 .bubbles { position: absolute; inset: 0; pointer-events: none; }
/* pins (components C4): <button> 24 with a 32 hit area, ground mark under it, name tag on hover and focus when the pin has no bubble */
.v3 .pin { position: absolute; left: calc(var(--ax) * 1%); top: calc(var(--ay) * 1%); width: var(--pin); height: var(--pin); padding: 0; border: 0; background: none; transform: translate(-50%, -100%);
  pointer-events: auto; cursor: pointer; color: var(--c-text); }
.v3 .pin::before { content: ""; position: absolute; inset: -4px; }
.v3 .pin::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 12px; height: 6px; transform: translateX(-50%); background: color-mix(in srgb, var(--c-bg) 60%, transparent); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.v3 .pin svg { width: 100%; height: 100%; position: relative; z-index: 1; display: block; }
.v3 .pin:focus-visible { outline: none; box-shadow: var(--map-ring); }
.v3 .pin-tag { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); display: none; white-space: nowrap; z-index: 2;
  font-family: var(--sans); font-weight: var(--w-strong); font-size: var(--t-hud-meta); line-height: var(--lh-hud-meta); color: var(--c-text);
  background: var(--hud-bg); border: var(--hud-edge); border-radius: var(--hud-step); padding: 2px 8px; }
.v3 .pin:hover .pin-tag, .v3 .pin:focus-visible .pin-tag { display: block; }
.v3 .pin[data-bubble] .pin-tag { display: none; }
.v3 .pin[data-state="asleep"] svg, .v3 .pin[data-state="paused"] svg { filter: grayscale(1); }
.v3 .sprite { position: absolute; left: calc(var(--ax) * 1%); top: calc(var(--ay) * 1%); transform: translate(-50%, -100%); width: 32px; height: 48px; }
.v3 .sprite svg { width: 32px; height: 28px; position: absolute; top: 0; left: 0; }
/* bubbles (components C5): rectangle, still, max 2 lines; tail = 8 x 8 three-step wedge, --ln2 outer layer and --sf inner layer, tip 8 px above the pin */
.v3 .bubble { position: absolute; left: calc(var(--ax) * 1%); top: calc(var(--ay) * 1%); transform: translate(-12px, calc(-100% - var(--pin) - var(--bubble-gap) - 8px)); max-width: var(--bubble-max); width: max-content;
  background: var(--hud-bg); border: var(--hud-edge); border-radius: var(--hud-step); padding: var(--bubble-pad); font-size: var(--t-hud); line-height: var(--lh-hud); color: var(--c-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v3 .bubble-tail, .v3 .bubble-tail::after { position: absolute; width: 8px; height: 8px; clip-path: polygon(0 0, 100% 0, 100% 34%, 67% 34%, 67% 67%, 34% 67%, 34% 100%, 0 100%); }
.v3 .bubble-tail { left: calc(var(--ax) * 1%); top: calc(var(--ay) * 1%); transform: translate(-4px, calc(-1 * (var(--pin) + var(--bubble-gap) + 9px))); background: var(--c-edge); }
.v3 .bubble-tail::after { content: ""; left: 1px; top: -1px; background: var(--hud-bg); }
.v3 .bubble .chip { margin-left: var(--s-2); }
/* the map swaps to the place list under 48em: one accessible set of links per viewport (echo world.md s7) */
.v3 .hot-list-m { display: none; }
@media (max-width: 47.99em) {
  .v3 .scene { aspect-ratio: var(--ar-m, var(--ar)); }
  .v3 .hot { left: calc(var(--xm) * 1%); top: calc(var(--ym) * 1%); width: calc(var(--wm) * 1%); height: calc(var(--hm) * 1%); }
  .v3 .hot--off-m { display: none; }
  .v3 .hot-list-m { display: block; margin-top: var(--s-5); }
  .v3 .scene--pan .scene-plate { width: calc(var(--pan-w) * 1%); right: auto; transform: translateX(calc(var(--pan-x) * -1%)); }
  .v3 .scene--pan .hot { display: none; }
  .v3 .bubble { font-size: var(--t-hud-meta); line-height: var(--lh-hud-meta); }
}
.v3 .hot-list-m h2 { font-family: var(--sans); font-weight: var(--w-strong); font-size: var(--t-stat); letter-spacing: 0; }
.v3 .hot-list-m > p { color: var(--c-muted); font-size: var(--t-small); margin: var(--s-2) 0 var(--s-4); }
.v3 .hot-list-m ul { display: grid; gap: var(--s-3); }
.v3 a.hot-row:active { background: var(--hud-bg-hover); }
.v3 .hot-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-3); align-items: center; min-height: 56px; padding: var(--s-3) var(--s-4); background: var(--c-surface);
  border: 1px solid var(--c-edge); border-radius: var(--step); color: var(--c-text); }
.v3 a.hot-row:hover { border-color: var(--c-control); }
.v3 .hot-row .hot-name { font-family: var(--head); font-weight: var(--w-head); font-size: 1.0625rem; line-height: 20px; border: 0; padding: 0; background: none; }
.v3 .hot-row .hot-state { grid-column: 1 / -1; color: var(--c-muted); font-size: var(--t-hud-meta); line-height: var(--lh-hud-meta); border: 0; padding: 0; background: none; }
.v3 .hot-row .chip { justify-self: end; }
/* a bubble for a pin left of the plate centre opens to the left, so it covers less of the Core and Archives plates */
.v3 .bubble--l { transform: translate(calc(-100% + 12px), calc(-100% - var(--pin) - var(--bubble-gap) - 8px)); }
/* the free plot is a small marker in Homes: its name shows on hover and focus only (components C4 empty state) */
.v3 .hot[data-hot="plot"] { justify-content: center; align-items: center; }
.v3 .hot[data-hot="plot"] .hot-name { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; border-bottom: var(--hud-edge); border-radius: var(--hud-step); display: none; font-size: var(--t-hud-meta); }
.v3 .hot[data-hot="plot"]::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--c-control); }
.v3 .hot[data-hot="plot"]:hover .hot-name, .v3 .hot[data-hot="plot"]:focus-visible .hot-name { display: block; }
.v3 .bubble { max-height: calc(2 * var(--lh-hud) + 18px); }
@media (max-width: 47.99em) { .v3 .bubble { max-height: calc(2 * var(--lh-hud-meta) + 18px); } }
/* bubble: the bottom padding is a border in the panel colour, so the clamped third line can never show through it */
.v3 .bubble { padding-bottom: 0; border-bottom: 8px solid var(--hud-bg); box-shadow: 0 1px 0 0 var(--c-edge); }
@media (max-width: 47.99em) { .v3 .bubble--l { transform: translate(-12px, calc(-100% - var(--pin) - var(--bubble-gap) - 8px)); max-width: min(var(--bubble-max), 60vw); } }
