/* Glue between the Generals.zone launcher and the existing real-game harness. */

/* Mobile keyboards commonly shrink 100dvh. Keep the launcher and transferred
   game canvas at their pre-keyboard geometry; touch-controls.mjs separately
   positions its native text proxy above the visible keyboard. */
:root.touch-keyboard-open {
  --desktop-viewport-height: var(--touch-frozen-viewport-height);
}

html,
body {
  width: 100%;
  height: var(--desktop-viewport-height);
  overflow: hidden;
}

body {
  display: block;
  min-height: var(--desktop-viewport-height);
}

#overlay.boot-sentinel,
#progress.boot-sentinel {
  display: none;
}

.launch-overlay .playShell {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  pointer-events: none;
  background: transparent;
}

.launch-overlay.is-running .playShell {
  pointer-events: auto;
  background: #000;
}

.launch-overlay:not(.is-running) .touchControls {
  display: none;
}

.launch-overlay .launch-loader {
  z-index: 4;
}

.launch-overlay #viewport[hidden] {
  display: none;
}

.launch-overlay #performanceOverlay {
  position: absolute;
}

.binkPreparationOverlay {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 32px));
  padding: 14px 16px;
  transform: translateX(-50%);
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(28, 28, 30, .94);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .55);
  pointer-events: auto;
}

.binkPreparationOverlay[hidden] { display: none; }
.binkPreparationOverlay > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.binkPreparationOverlay strong { color: #f5f5f7; font-size: 13px; font-weight: 600; }
.binkPreparationOverlay > div:first-child span { overflow: hidden; color: #a1a1a6; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.binkPreparationOverlay p { margin: 8px 88px 0 0; color: #a1a1a6; font-size: 12px; }
.binkPreparationOverlay button { position: absolute; right: 16px; bottom: 12px; min-height: 30px; padding: 0 12px; color: #f5f5f7; border: 0; border-radius: 999px; background: #3a3a3c; cursor: pointer; }
.binkPreparationOverlay button:disabled { opacity: .55; cursor: wait; }
.binkPreparationProgress { height: 4px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #3a3a3c; }
.binkPreparationProgress span { display: block; width: 0; height: 100%; border-radius: 999px; background: #0a84ff; transition: width .18s linear; }

#consolePanel {
  z-index: 22010;
}

#issueModal {
  z-index: 22020;
}
