* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: #0d1210;
  color: #d6ddd8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: crosshair;
}

::selection { background: rgba(138, 168, 153, 0.22); }

#scene { position: fixed; inset: 0; }
#scene canvas { display: block; touch-action: none; outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(110% 90% at 50% 46%,
      rgba(13, 18, 16, 0) 45%,
      rgba(7, 10, 9, 0.48) 82%,
      rgba(3, 5, 4, 0.82) 100%);
}

.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.hud {
  position: fixed;
  left: 22px;
  bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(18, 25, 22, 0.58);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid rgba(205, 218, 210, 0.11);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  color: rgba(214, 221, 216, 0.78);
  user-select: none;
}

.hud .stat strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #eef3f0;
}

.hud .divider { opacity: 0.3; }

.hud button {
  all: unset;
  cursor: pointer;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(214, 221, 216, 0.3);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.hud button:hover {
  color: #ffffff;
  border-bottom-color: rgba(238, 243, 240, 0.9);
}

.hud button:active { transform: translateY(1px); }

.corner {
  position: fixed;
  right: 22px;
  bottom: 20px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: rgba(214, 221, 216, 0.65);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(18, 25, 22, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(205, 218, 210, 0.1);
  transition: all 0.22s ease;
  user-select: none;
}

.corner:hover {
  color: #eef3f0;
  background: rgba(26, 36, 32, 0.82);
  border-color: rgba(205, 218, 210, 0.28);
}

.mode-404 .hud { display: none; }
