/* NEON ENGINE house — the switch medallion (v1.24.168).
   P1 FLOATING MEDALLION, the design picked 2026-10-18: a 58px circle
   floating bottom-right inside the app, wearing the OTHER world's
   designated mark, ringed in the HOST app's accent with a soft halo in
   the same accent; pressed = 92% shrink + brightness flare. No words —
   a mark, not a label (button law). Geometry and treatment replicate
   the approved prototype plates (switch-prototypes/plates/p1-*).
   v1.24.169: the bottom offset is 132px, not the prototype's 92px —
   at 92px the disc sat exactly on the console's corner-button row
   (power/reset at bottom:92, 32px tall) and covered both buttons'
   tap centres on the dashboard (measured). At 132px it floats just
   above that row, over the dashboard's empty corner, and covers no
   control's tap centre in the dashboard, the menus or the lobbies
   (covered-centre scan in the house proof).
   v1.24.171: two placement defects from the owner's phone, measured.
   (1) The corner-button row is placed with
   bottom: calc(env(safe-area-inset-bottom) + 92px) — on a phone with
   a home indicator the row rises by the inset (34px) while a plain
   bottom:132px medallion did not, so on-device the disc covered the
   power and reset tap centres again. The medallion now shares the
   row's reference frame (inset + offset on both axes): the validated
   clearance above the row holds at every inset, and on a zero-inset
   screen the box is exactly the spec box (right:16, bottom:132).
   (2) The game's global button rule (style.css) gives every button a
   hard 5px 5px offset shadow; this button never declared its own, so
   the square shadow leaked out from behind the disc as a square
   outline. box-shadow: none below is load-bearing. */
.house-med {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 132px);
  /* v1.24.184: the box IS the pick-C disc — 32px (was the 58px P1 disc). */
  width: 32px; height: 32px;
  z-index: 9500; margin: 0; padding: 0; border: 0; background: none;
  box-shadow: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  appearance: none; -webkit-appearance: none;
  /* v1.24.178 (drag): the browser must not steal the gesture for
     scrolling or zooming, and a press must never select — the drag
     in house.js runs on pointer events with capture. */
  touch-action: none; user-select: none; -webkit-user-select: none;
}
/* v1.24.178 (drag): the grab target is the disc plus a 10px margin —
   a near-miss press still catches the medallion (forgiveness). The
   ring is invisible and carries no rendering of its own.
   v1.24.184: the ring now also carries the size guarantee — the
   button box is the 32px disc (below), so disc + this 10px margin
   is a 52px touch target, still ≥44px. */
.house-med::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
}
.house-med.house-med-drag { cursor: grabbing; }
/* v1.24.184 — PICK C (owner, 2026-10-22, from
   teleport-prototypes/teleport-outline-v2.html): the medallion is a
   32px round PLATE and nothing else. No halo, no ring, no border,
   no slab: the plate finish is a surface radial gradient with an
   inset rim light and a soft elevation shadow. The mark inside is
   zoomed ≈1.9x to its INSIDE MIDDLE, round-clipped by the disc's
   overflow, so the artwork's outer band and its baked ring sit out
   of frame. The same construction ships on the I:V side (srv211) —
   the pair stays matched. Placement anchors are unchanged from the
   58px era: the smaller box's footprint is a subset of the old one
   at the same corner anchor, so the covered-centre clearance
   measured for v1.24.169/171 still holds. */
.house-med .house-med-disc {
  position: relative; display: block; overflow: hidden;
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(120% 120% at 32% 26%, #2b3652 0%, #1a2236 52%, #11182a 100%);
  box-shadow: 0 8px 18px rgba(0,0,0,.55),
    inset 0 1px 1px rgba(255,255,255,.14),
    inset 0 -6px 10px rgba(0,0,0,.35),
    inset 0 -8px 14px rgba(0,0,0,.35),
    inset 0 0 0 1px rgba(255,255,255,.05);
  transition: transform .12s ease, filter .12s ease;
}
.house-med .house-med-disc img {
  width: 100%; height: 100%; display: block; border-radius: 50%;
  transform: scale(1.9);
  pointer-events: none;
}
.house-med:active .house-med-disc { transform: scale(.92); filter: brightness(1.4); }
/* Combat rule (ruling, 2026-10-18): hidden during ACTIVE combat —
   the rule lives in house.js; this class is its only visual effect. */
.house-med.house-med-off { display: none; }

/* ── the host layer (the teleport build): when the standalone game
   hosts I:V, the framed world covers the game page whole. The
   z-index sits above every game surface (the medallion rides at
   9500, game overlays reach 9950) because a world in front is in
   front of everything, this page's medallion included — the
   switch back belongs to the framed world's own medallion, the
   same shape as the shell. */
#houseHostLayer {
  position: fixed; inset: 0; z-index: 20000; background: #04050d;
}
#houseHostLayer[hidden] { display: none; }
#houseHostLayer iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; display: block;
}
html.house-locked, html.house-locked body { overflow: hidden; }
