/* console-scene.css -- the /console/ takeover surface (K249). Loaded ONLY by
   /console/. K248 painted the scene behind the page; K249 moves the whole
   terminal INSIDE a fixed full-viewport overlay you ENTER -- the successor-
   stage move mirrored. Closed, the page is the plain K235 cover (console.css,
   byte-held, owns that state; script absent or failed = exactly the K235
   page). Open, the procedural scene is the overlay's own full-bleed backdrop
   and the terminal chrome floats over it: the wuld://console head bar as
   glass at the top, the transcript on a glass band anchored low, the input at
   its foot -- the open middle belongs to the room.
   LEGIBILITY FIRST, IMMERSION WITH IT (K249a): the strips are a thin tint
   now -- rgba(5,5,6,0.28/0.34) + blur(2px) -- so the room's grain, fog and
   scanlines stay visible THROUGH the terminal; legibility rides a dark
   text-shadow halo instead of an opaque backing (scene luminance behind the
   band is low by palette construction, so contrast stays far past WCAG AAA).
   No color override touches the terminal's text.
   Z ORDER: the overlay rides at 10000 -- above the ambient bar (100), the
   wrong-hour layers (90..300) and the yurei desk launcher (9998), BELOW the
   wgate curtain (2147483000): locked visitors see the curtain, never the
   console. The desk companion is also suppressed while the takeover is up
   (the K241 successor-stage precedent) so nothing floats over the descent. */

#con-scene {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #050506;
  opacity: 0;
  transition: opacity 0.25s ease;   /* entering fades the room up */
}
#con-scene[hidden] { display: none; }
#con-scene.con-ovl-visible { opacity: 1; }

#con-scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 0.3s ease;    /* the room crossfade */
}
#con-scene canvas.con-scene-live { opacity: 1; }

/* the page parks while the takeover is up; the desk companions step out of
   the frame (and the tab order) -- nothing floats over the descent */
body.con-takeover { overflow: hidden; }
body.con-takeover .yasst-launcher,
body.con-takeover .yasst-panel,
body.con-takeover .oasst-launcher,
body.con-takeover .oasst-panel,
body.con-takeover .persona-switch { display: none; }

/* the terminal slot: a full-height column over the scene */
#con-scene .con-ovl-slot {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* the reparented terminal decomposes into floating strips: transparent frame,
   head pinned top, transcript + input + controls anchored low -- the scene
   owns the middle. Text colors, cursor, blink and the fine scanline weave
   stay console.css's (byte-held). */
#con-scene .con-term {
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  background: transparent;
}
#con-scene .con-out {
  margin-block-start: auto;
  flex: 0 1 auto;
  min-height: 16vh;
  max-height: 38vh;
  background: rgba(5, 5, 6, 0.28);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  border-top: var(--bw-base) solid var(--c-border);
  text-shadow: 0 1px 4px rgba(5, 5, 6, 0.95), 0 0 3px rgba(5, 5, 6, 0.95), 0 0 9px rgba(5, 5, 6, 0.8);
}
#con-scene .con-head,
#con-scene .con-in-row,
#con-scene .con-ctrl {
  background: rgba(5, 5, 6, 0.34);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  text-shadow: 0 1px 4px rgba(5, 5, 6, 0.95), 0 0 3px rgba(5, 5, 6, 0.95), 0 0 9px rgba(5, 5, 6, 0.8);
}
#con-scene .con-head { padding-inline-end: 5.5rem; }   /* room for the [ x ] */

/* leave: overlay-owned chrome above the head bar (console.css styles .con-btn) */
#con-scene .con-ovl-close {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  z-index: 3;
  background: rgba(5, 5, 6, 0.34);
}

/* the cover's enter affordance (unhidden by the script; hidden = plain K235) */
.con-enter { margin-block: var(--s-4) 0; }
.con-enter-btn { font-size: var(--t-sm); padding: var(--s-2) var(--s-4); }

@media (max-width: 520px) {
  #con-scene .con-out { max-height: 46vh; }
  #con-scene .con-head { padding-inline-end: 4.2rem; }
  #con-scene .con-ovl-close { top: 0.45rem; right: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  #con-scene { transition: none; }          /* entering is instant */
  #con-scene canvas { transition: none; }   /* room change = instant swap */
}
