/* The interactive world is the first screen. This override is intentionally
   small and self-contained so a slow stylesheet request cannot expose a
   browser-default page. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  background: #070914 !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

body {
  position: fixed;
  inset: 0;
}

.background {
  z-index: 0 !important;
}

#world {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: hidden !important;
  touch-action: none !important;
  user-select: none !important;
}

#world canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
}

#world-toggle {
  position: fixed !important;
  z-index: 8 !important;
  top: max(18px, env(safe-area-inset-top)) !important;
  left: 50% !important;
  width: 100px !important;
  height: 77px !important;
  padding: 0 !important;
  transform: translateX(-50%) !important;
  background: transparent !important;
  border: 0 !important;
}

#world-toggle img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

#world-toggle span {
  display: none !important;
}

#world-help {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 7 !important;
}

#landing,
.launch-note {
  display: none !important;
}

#world-status:empty {
  display: none !important;
}

/* Quiet first-load state. The centered mark is intentionally CSS-only so a
   future custom .mov can replace the contents without changing the handoff. */
#world-loading {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(7, 9, 20, 0.68);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  color: #eeeafd;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 520ms cubic-bezier(.16, 1, .3, 1), visibility 0s linear 0s;
}

#world-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 520ms cubic-bezier(.16, 1, .3, 1), visibility 0s linear 520ms;
}

.world-loading__core {
  display: grid;
  justify-items: center;
  gap: 13px;
  min-width: 96px;
  padding: 18px 20px;
  border: 1px solid rgba(233, 226, 255, .18);
  border-radius: 999px;
  background: rgba(17, 18, 32, .24);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.world-loading__ring {
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(234, 226, 255, .28);
  border-top-color: #e7dcff;
  border-right-color: rgba(170, 155, 225, .72);
  border-radius: 50%;
  animation: world-loading-spin 900ms linear infinite;
}

.world-loading__word {
  font: 10px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .2em;
  text-indent: .2em;
  color: rgba(240, 235, 255, .78);
}

@keyframes world-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #world-loading { transition: none; }
  .world-loading__ring { animation: none; }
}

#access {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0 24px;
  border: 0;
  background: transparent;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

#access[open] {
  display: flex;
}

#access::backdrop {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

#access #password-form {
  width: 100%;
  max-width: 280px;
}

#access .password-shell {
  position: relative;
  width: 100%;
  height: 48px;
  overflow: visible;
}

#access #password-input {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 177.7778%;
  height: 177.7778%;
  padding: 0 42.6667px;
  border: 1.7778px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  outline: none;
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  font: 700 16px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  transform: translate(-50%, -50%) scale(0.5625);
  transform-origin: center;
}

#access #password-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#access #password-input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%) scale(0.590625);
}

@media (max-width: 700px) {
  #world-toggle {
    top: max(14px, env(safe-area-inset-top)) !important;
    width: 88px !important;
    height: 70px !important;
  }

  #world-help {
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    width: 95vw !important;
    white-space: normal !important;
  }
}
