html,
body {
  height: 100%;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body {
  min-height: 100vh;
}

.shellOnboardingOverlay {
  position: fixed;
  inset: 0;
  z-index: 997;
  background: #000;
}

.shellBootBanner {
  position: fixed;
  top: 50%;
  left: 50%;
  overflow: hidden;
  z-index: 1200;
  min-width: min(260px, calc(100vw - 24px));
  max-width: min(340px, calc(100vw - 24px));
  padding: 10px 12px;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  transition: border-color 140ms ease, transform 140ms ease;
}

.shellBootBanner[data-state="ready"] {
  border-color: var(--frame);
}

.shellBootBanner[data-state="failed"] {
  border-color: rgba(255, 110, 110, 0.42);
}

.shellBootHead {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.shellBootLoaderWrap {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.shellBootLoader {
  --boot-progress: 0.08;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.10);
  border-top-color: rgba(128, 138, 255, 0.98);
  animation: shellBootSpin 1.1s linear infinite;
}

.shellBootBanner[data-state="ready"] .shellBootLoader {
  animation: none;
  border-color: rgba(132, 232, 164, 0.98);
}

.shellBootBanner[data-state="failed"] .shellBootLoader {
  animation-duration: 2.2s;
  border-color: rgba(255, 110, 110, 0.98);
  border-top-color: rgba(255, 110, 110, 0.98);
}

.shellBootCollapse { display: none; }

.shellBootPhase {
  color: var(--text-strong);
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shellBootDetail {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  max-width: 28ch;
}

.shellBootReadyChip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1199;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

@keyframes shellBootSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.shellStartScreen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 998;
  pointer-events: auto;
  background: transparent;
}

.shellStartScreen.off {
  display: none;
}

.shellStartCard {
  width: min(360px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-sizing: border-box;
}

.shellQrBox {
  width: 280px;
  height: 280px;
  border-radius: 14px;
  border: 1px solid var(--frame);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0 auto;
}

.shellStartQrBox {
  width: 280px;
  height: 280px;
  border-radius: 18px;
  box-sizing: border-box;
}

.shellCalibOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: transparent;
  z-index: 999;
}

.shellCalibOverlay.off {
  display: none;
}

.shellCalibCard {
  width: min(420px, 92vw);
  padding: 18px 16px 16px;
  text-align: center;
}

.shellCalibText {
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 14px;
}

.shellCalibBtn {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 900;
}

.shellCalibBtn:disabled {
  opacity: .5;
  cursor: default;
}

.shellCalibStatus {
  margin-top: 12px;
  color: var(--text-muted);
}

.shellPerfTraceControls {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1100;
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.shellPerfTraceButton {
  min-width: 68px;
  height: 30px;
  border: 1px solid rgba(210, 230, 255, 0.34);
  border-radius: 6px;
  background: rgba(7, 12, 20, 0.78);
  color: rgba(235, 246, 255, 0.96);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.shellPerfTraceButton:active {
  transform: translateY(1px);
}

.shellPerfTraceToggle {
  min-width: 82px;
}

.shellPerfTraceToggle[aria-pressed="true"] {
  border-color: rgba(118, 255, 198, 0.48);
  background: rgba(10, 43, 35, 0.82);
}

.shellPerfTraceToggle[aria-pressed="false"] {
  border-color: rgba(255, 129, 129, 0.42);
  background: rgba(48, 12, 16, 0.82);
  color: rgba(255, 218, 218, 0.96);
}

.stagingShell {
  height: 100vh;
  padding: 18px 18px 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.shellGrid {
  position: relative;
  max-width: 1420px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

html[data-staging-shell-mode="split-lab"] .shellGrid {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  height: calc(100vh - 38px);
}

html[data-staging-shell-mode="game-stage"] .stagingShell {
  padding: 0;
}

html[data-staging-shell-mode="game-stage"] .shellGrid {
  display: block;
  width: 100%;
  max-width: none;
  height: 100vh;
}

.shellMount {
  display: flex;
  align-self: stretch;
}

.shellMountDev,
.shellMountOrb,
.shellMountGame {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.shellMountDev > *,
.shellMountOrb > *,
.shellMountGame > * {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100%;
}

.shellMountDev {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 92, 98, 0.82) rgba(18, 18, 22, 0.88);
}

.shellMountOrb {
  overflow: hidden;
}

.shellMountGame {
  display: none;
  overflow: hidden;
}

html[data-staging-shell-mode="split-lab"] .shellMountGame {
  display: none;
}

html[data-staging-shell-mode="game-stage"] .shellMountOrb {
  display: none;
}

html[data-staging-shell-mode="game-stage"] .shellMountGame {
  display: flex;
  position: absolute;
  inset: 0;
  z-index: 2;
}

html[data-staging-shell-mode="game-stage"] .shellMountDev {
  position: absolute;
  top: 18px;
  left: 18px;
  bottom: 20px;
  width: min(420px, calc(100vw - 36px));
  z-index: 40;
  transition: transform 180ms ease, opacity 180ms ease;
  box-sizing: border-box;
}

html[data-staging-shell-mode="game-stage"][data-dev-stage-visibility="hidden"] .shellMountDev {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

.shellMountDev::-webkit-scrollbar {
  width: 10px;
}

.shellMountDev::-webkit-scrollbar-track {
  background: rgba(18, 18, 22, 0.88);
  border-radius: 999px;
}

.shellMountDev::-webkit-scrollbar-thumb {
  background: rgba(92, 92, 98, 0.82);
  border-radius: 999px;
  border: 2px solid rgba(18, 18, 22, 0.88);
}

.shellMountDev::-webkit-scrollbar-thumb:hover {
  background: rgba(112, 112, 118, 0.9);
}

@media (max-width: 900px) {
  .shellBootBanner {
    min-width: min(260px, calc(100vw - 20px));
    max-width: min(320px, calc(100vw - 20px));
  }

  .shellBootReadyChip {
    top: 10px;
    left: 10px;
  }

  html[data-staging-shell-mode="split-lab"] .shellGrid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .shellMount {
    min-height: auto;
  }

  .shellMountDev,
  .shellMountOrb,
  .shellMountGame {
    overflow: visible;
  }

  html[data-staging-shell-mode="game-stage"] .shellMountDev {
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: auto;
    width: auto;
    max-height: calc(100vh - 20px);
  }

  .shellQrBox {
    width: 240px;
    height: 240px;
  }
}
.sfxStageVoiceFx {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sfxStageVoiceFxButton {
  color: var(--text-strong, #eef8ee);
  background: rgba(129, 224, 184, 0.14);
  border: 1px solid rgba(129, 224, 184, 0.48);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.34);
}

.sfxStageVoiceFxButton[aria-pressed="true"] {
  border-color: rgba(232, 121, 96, 0.72);
  background: rgba(232, 121, 96, 0.14);
}

@media (max-width: 620px) {
  .sfxStageVoiceFx {
    right: 10px;
    bottom: 10px;
  }
}
