:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071718;
  color: #f4e9cf;
}

* {
  box-sizing: border-box;
}

html,
body,
.game-shell {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 24% 18%, rgb(64 103 84 / 42%), transparent 38%),
    radial-gradient(circle at 82% 78%, rgb(15 69 73 / 54%), transparent 42%),
    #071718;
}

.game-shell {
  position: relative;
  min-width: 320px;
  min-height: 320px;
}

#roamcube {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

#roamcube:focus-visible {
  box-shadow: inset 0 0 0 2px #e3b557;
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 32px;
  background:
    linear-gradient(145deg, rgb(7 23 24 / 88%), rgb(16 43 43 / 76%)),
    repeating-linear-gradient(90deg, transparent 0 31px, rgb(255 255 255 / 2%) 31px 32px);
  text-align: center;
  transition: opacity 220ms ease;
}

.loading[hidden] {
  display: none;
}

.eyebrow {
  margin: 0;
  color: #92b89d;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.32em;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 11vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 0.86;
  text-shadow: 0 8px 38px rgb(0 0 0 / 35%);
}

h1 span {
  color: #dfad4f;
}

.loading > p:last-child {
  margin: 0;
  color: #c7d6c8;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.loading-track {
  width: min(280px, 72vw);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
}

.loading-track span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d77a4d, #e8c76e);
  animation: loading 1.15s ease-in-out infinite alternate;
}

.web-hint {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  padding: 7px 10px;
  border: 1px solid rgb(222 193 124 / 18%);
  border-radius: 7px;
  background: rgb(5 17 18 / 58%);
  color: rgb(223 231 216 / 72%);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.075em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.web-hint span {
  color: #e6bd67;
}

noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 32px;
  background: #071718;
  text-align: center;
}

@keyframes loading {
  from {
    transform: translateX(-10%);
  }
  to {
    transform: translateX(148%);
  }
}

@media (max-width: 680px), (max-height: 520px) {
  .web-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-track span {
    animation-duration: 2.5s;
  }
}
