html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
  background: #0b0c10;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: grid;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: visible;
  place-items: center;
  place-items: safe center;
  padding:
    max(24px, env(safe-area-inset-top, 0px))
    max(24px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px))
    max(24px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  color: #f4f5f7;
  font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hub-sso-status {
  max-width: 420px;
  margin: 0;
  text-align: center;
  color: #aeb5c2;
}

.hub-sso-status[data-failed="true"] {
  color: #ff9b9b;
}

@media (max-height: 520px) {
  body {
    place-items: start center;
  }
}

body:has(main[data-slug="freecam"]) { height: 100dvh; min-height: 100dvh; padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
/* FreeCam retains one launch appearance through the SSO exchange. */
html:has(main[data-slug="freecam"]), body:has(main[data-slug="freecam"]) { background: #090a0c; }
main[data-slug="freecam"] { display: grid; justify-items: center; gap: 16px; text-align: center; }
main[data-slug="freecam"]:has(#hub-sso-status:not([data-failed="true"]))::before { content: ''; width: 38px; height: 38px; box-sizing: border-box; border: 5px solid rgba(255,255,255,.2); border-top-color: #f7f7f4; border-radius: 50%; animation: freecam-sso-spin 850ms linear infinite; }
main[data-slug="freecam"] #hub-sso-status { margin: 0; max-width: 420px; color: #f7f7f4; font-size: 17px; font-weight: 760; letter-spacing: -.015em; }
main[data-slug="freecam"] #hub-sso-status:not([data-failed="true"]) { font-size: 0; }
main[data-slug="freecam"] #hub-sso-status:not([data-failed="true"])::after { content: 'Запускаем FreeCam…'; font-size: 17px; }
main[data-slug="freecam"] #hub-sso-status[data-failed="true"] { color: #ff9b9b; }
@keyframes freecam-sso-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { main[data-slug="freecam"]::before { animation: none !important; } }
