/* CLA-625: fill the usable landscape viewport around the Godot canvas.
 * Host chrome only. Portrait rotate mask (CLA-553) stays above this.
 * Backdrop paints overscroll / notch; the canvas itself is not 16:9 contain. */

html.hv-landscape-active {
  background: #12081f;
  --hv-safe-top: env(safe-area-inset-top, 0px);
  --hv-safe-right: env(safe-area-inset-right, 0px);
  --hv-safe-bottom: env(safe-area-inset-bottom, 0px);
  --hv-safe-left: env(safe-area-inset-left, 0px);
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

html.hv-landscape-active body {
  background: #12081f;
  overflow: hidden;
  touch-action: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
}

html.hv-landscape-active #canvas {
  position: fixed !important;
  z-index: 1;
  display: block;
  margin: 0 !important;
  padding: 0;
  border: 0;
  max-width: none !important;
  max-height: none !important;
  background: #12081f;
  /* CLA-792: a canvas is a replaced element. width/height:auto uses the
   * bitmap (window CSS px × devicePixelRatio). That !important beat Godot's
   * non-important inline CSS size, so mobile Safari showed the top-left of
   * the design at 1 bitmap px per CSS px. Pin the used box; Godot keeps the
   * DPR backing store.
   * Full bleed: the box is the whole layout viewport (what Godot sizes the
   * bitmap from), never viewport minus safe-area. Godot keeps HUD chrome out
   * of the notch via Layout.safe_rect (shell publishes __hvSafeInsets). */
  top: var(--hv-canvas-top, 0px) !important;
  left: var(--hv-canvas-left, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--hv-canvas-w, 100vw) !important;
  height: var(--hv-canvas-h, 100dvh) !important;
}

/* CLA-781: host funnel matches the visible box. JS pins left/top/width/height
 * to visualViewport minus safe-area; do not pad safe-area again. */
html.hv-landscape-active .hv-funnel {
  box-sizing: border-box;
  overflow: hidden;
}

html.hv-landscape-active .hv-funnel-card {
  max-height: 100%;
  overflow-y: auto;
}

.hv-landscape-shell {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hv-landscape-shell[hidden] {
  display: none !important;
}

.hv-landscape-letterbox {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, #1b1230 0%, #12081f 58%, #07040e 100%);
}
