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

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 10%, rgba(238, 98, 73, 0.2), transparent 28%),
    radial-gradient(circle at 82% 4%, rgba(45, 190, 210, 0.18), transparent 24%),
    #081018;
}

.game-shell {
  position: relative;
  width: min(100vw, 1500px);
  height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.loading-screen {
  position: absolute;
  inset: 14px 14px auto;
  z-index: 5;
  display: grid;
  place-items: center;
  height: calc(100vh - 150px);
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background: #081018;
  opacity: 1;
  transition:
    opacity 360ms ease,
    visibility 360ms ease;
}

.loading-screen.is-hidden {
  display: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-card {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  align-content: end;
  padding: clamp(22px, 4vw, 48px);
  isolation: isolate;
}

.loading-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 7, 12, 0.08), rgba(3, 7, 12, 0.82)),
    linear-gradient(90deg, rgba(3, 7, 12, 0.58), rgba(3, 7, 12, 0.04), rgba(3, 7, 12, 0.54));
}

.loading-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loading-copy {
  display: grid;
  gap: 6px;
  max-width: 520px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.loading-copy strong {
  font-size: clamp(24px, 4vw, 48px);
  line-height: 1;
  color: #ffffff;
}

.loading-copy span {
  color: rgba(232, 246, 255, 0.84);
  font-weight: 700;
}

.loading-bar {
  width: min(520px, 72vw);
  height: 10px;
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(2, 8, 13, 0.7);
  overflow: hidden;
}

.loading-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #5bd5ff, #ffffff, #ffb35f);
  box-shadow: 0 0 18px rgba(91, 213, 255, 0.64);
  transition: width 220ms ease;
}

canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #101923;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.hud-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  color: #cfe2ef;
  font-size: 13px;
}

.hud-panel div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(7, 14, 20, 0.72);
}

.hud-panel strong {
  color: #ffffff;
  font-size: 14px;
}

.hud-panel span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .game-shell {
    min-height: 100vh;
    height: auto;
    padding: 8px;
  }

  .loading-screen {
    inset: 8px 8px auto;
    height: calc((100vw - 16px) * 0.5625);
    min-height: 190px;
  }

  .loading-card {
    padding: 18px;
  }

  canvas {
    aspect-ratio: 16 / 9;
    height: auto;
  }

  .hud-panel {
    grid-template-columns: 1fr;
    font-size: 12px;
  }
}
