:root {
  --bg-0: #020611;
  --bg-1: #071533;
  --scan: rgba(30, 233, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 18% 22%, #10305f 0%, var(--bg-1) 28%, var(--bg-0) 72%);
  color: #eaf7ff;
}

body {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
}

.scene-wrap {
  position: fixed;
  inset: 0;
}

.hud {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 1rem;
}

.hud-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
  pointer-events: auto;
  touch-action: none;
  background:
    linear-gradient(to bottom, rgba(30, 233, 255, 0.06), rgba(255, 60, 199, 0.04)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      var(--scan) 2px,
      var(--scan) 3px
    );
}

.font-heading {
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
}

.font-body {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
}

.panel {
  border: 1px solid rgba(30, 192, 255, 0.45);
  background: rgba(5, 11, 30, 0.62);
  box-shadow: 0 0 18px rgba(30, 233, 255, 0.45), inset 0 0 16px rgba(255, 60, 199, 0.08);
  backdrop-filter: blur(6px);
  border-radius: 0.5rem;
  padding: 1rem;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.brand-panel {
  max-width: 20rem;
}

.brand-kicker {
  margin: 0;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: rgba(30, 233, 255, 0.8);
}

.brand-title {
  margin: 0.5rem 0 0;
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.brand-subtitle {
  margin: 0;
  letter-spacing: 0.25em;
  color: rgba(30, 233, 255, 0.85);
  font-size: 0.875rem;
}

.stats-panel {
  width: 14rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.stat-row-gap {
  margin-top: 0.25rem;
}

.stat-label {
  letter-spacing: 0.12em;
  color: rgba(190, 230, 255, 0.78);
  text-transform: uppercase;
  font-size: 0.75rem;
}

.stat-value {
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  color: #e9fbff;
  letter-spacing: 0.12em;
  font-size: 0.92rem;
}

.hud-footer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
}

.hint-panel {
  text-align: center;
  padding: 0.75rem 1rem;
}

.hint-text {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: rgba(30, 233, 255, 0.8);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
  background:
    radial-gradient(circle at 50% 40%, rgba(8, 24, 58, 0.88), rgba(2, 5, 16, 0.98)),
    linear-gradient(90deg, rgba(30, 233, 255, 0.04), rgba(255, 60, 199, 0.04));
  transition: opacity 360ms ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-box {
  width: min(26rem, 82vw);
  border: 1px solid rgba(30, 233, 255, 0.5);
  background: rgba(3, 12, 33, 0.7);
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 0 24px rgba(30, 233, 255, 0.25);
}

.loading-title {
  margin: 0;
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  letter-spacing: 0.2em;
  color: rgba(233, 251, 255, 0.94);
  font-size: 0.8rem;
}

.loading-track {
  width: 100%;
  margin-top: 0.8rem;
  height: 0.58rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.loading-bar {
  width: 2%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, #1ee9ff, #3db9ff, #ff3cc7);
  box-shadow: 0 0 12px rgba(30, 233, 255, 0.7);
  transition: width 220ms ease;
}

.loading-text {
  margin: 0.7rem 0 0;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: rgba(201, 236, 255, 0.82);
}

@media (max-width: 640px) {
  .hud {
    padding: 1rem;
  }

  .hud-header {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-panel,
  .stats-panel {
    width: 100%;
    max-width: none;
  }

  .hint-panel {
    width: 100%;
  }

  .hint-text {
    font-size: 0.7rem;
  }

  .stat-value {
    font-size: 0.82rem;
  }
}
