* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #000;
  color: #fff;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: "Comic Sans MS", "Comic Neue", "Chalkboard SE", "Segoe Print", cursive, sans-serif;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

body.idle { cursor: none; }

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #000;
  transition: opacity 0.8s ease;
}
#loading .bar {
  width: min(320px, 70vw);
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
#loading .fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  transition: width 0.25s ease;
}
#loading .message { font-family: system-ui, sans-serif; font-size: 16px; opacity: 0.75; min-height: 1.5em; }
#loading.done { opacity: 0; pointer-events: none; }

/* Alphabet bar: appears when the mouse moves or the screen is touched. */
#letters {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  max-width: calc(100vw - 24px);
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(10, 20, 40, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#letters.show { opacity: 1; pointer-events: auto; }
#letters button {
  font: inherit;
  font-size: 15px;
  min-width: 30px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  cursor: pointer;
}
#letters button:hover,
#letters button:focus-visible { background: rgba(255, 255, 255, 0.18); outline: none; }
#letters button:disabled { opacity: 0.3; cursor: default; background: transparent; }

#toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(10, 20, 40, 0.8);
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
#toast.show { opacity: 1; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.noscript { position: fixed; inset: 0; display: grid; place-items: center; font-size: 20px; }

@media (max-width: 600px) {
  #letters button { min-width: 26px; font-size: 13px; }
}
