:root {
  --bg-deep: #03120e;
  --bg-panel: rgba(4, 28, 24, 0.78);
  --c-moss: #2de2a6;
  --c-aurora: #7b2cbf;
  --c-dew: #4cc9f0;
  --c-thorn: #d00000;
  --c-gold: #ffd700;
  --c-ice: #e0fff7;
  --c-dim: rgba(224, 255, 247, 0.55);
  --glow-moss: 0 0 18px rgba(45, 226, 166, 0.55), 0 0 42px rgba(45, 226, 166, 0.22);
  --glow-aurora: 0 0 24px rgba(123, 44, 191, 0.5), 0 0 52px rgba(123, 44, 191, 0.2);
  --font-display: "Cinzel Decorative", Georgia, serif;
  --font-body: "Josefin Sans", system-ui, sans-serif;
  --radius: 20px;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--c-ice);
  font-family: var(--font-body);
  touch-action: none;
}

.game-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette,
.spore-dust {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.vignette {
  background: radial-gradient(circle at 50% 30%, transparent 20%, rgba(3, 18, 14, 0.75) 100%);
}

.spore-dust {
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  animation: drift 18s linear infinite;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-60px); }
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 26px 34px;
  gap: 22px;
  pointer-events: none;
}

.hud-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-block--right {
  align-items: flex-end;
}

.hud-block--center {
  align-items: center;
}

.hud-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-dim);
}

.hud-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-moss);
  text-shadow: var(--glow-moss);
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--c-ice);
  text-shadow: 0 0 18px rgba(224, 255, 247, 0.35), 0 0 36px rgba(45, 226, 166, 0.2);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(3, 18, 14, 0.55) 0%, rgba(3, 18, 14, 0.92) 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 380ms ease, visibility 380ms ease;
  backdrop-filter: blur(5px);
}

.overlay--active {
  opacity: 1;
  visibility: visible;
}

.overlay__panel {
  width: min(500px, 90vw);
  padding: 46px 40px;
  border: 1px solid rgba(45, 226, 166, 0.3);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: var(--glow-moss), inset 0 0 50px rgba(45, 226, 166, 0.06);
  text-align: center;
  transform: translateY(16px) scale(0.98);
  transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay--active .overlay__panel {
  transform: translateY(0) scale(1);
}

.overlay__kicker {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--c-moss);
  text-shadow: var(--glow-moss);
  margin-bottom: 14px;
}

.overlay__kicker--alert {
  color: var(--c-thorn);
  text-shadow: 0 0 18px rgba(208, 0, 0, 0.55);
}

.overlay__title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
  color: var(--c-ice);
  text-shadow: 0 0 22px rgba(224, 255, 247, 0.28);
}

.overlay__copy {
  font-size: 17px;
  line-height: 1.5;
  color: var(--c-dim);
  margin-bottom: 26px;
}

.overlay__stat {
  color: var(--c-gold);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.overlay__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  font-size: 13px;
  color: var(--c-dim);
}

kbd {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(45, 226, 166, 0.35);
  background: rgba(45, 226, 166, 0.08);
  color: var(--c-moss);
}

.garden-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 17px 42px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(45, 226, 166, 0.18), rgba(123, 44, 191, 0.18));
  box-shadow: 0 0 0 1px rgba(45, 226, 166, 0.4), var(--glow-moss);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.garden-btn--secondary {
  background: linear-gradient(135deg, rgba(208, 0, 0, 0.16), rgba(123, 44, 191, 0.16));
  box-shadow: 0 0 0 1px rgba(208, 0, 0, 0.4), 0 0 20px rgba(208, 0, 0, 0.25);
}

.garden-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 0 1px rgba(45, 226, 166, 0.65), 0 0 32px rgba(45, 226, 166, 0.4);
}

.garden-btn--secondary:hover {
  box-shadow: 0 0 0 1px rgba(208, 0, 0, 0.65), 0 0 32px rgba(208, 0, 0, 0.4);
}

.garden-btn__text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--c-ice);
}

@media (max-width: 640px) {
  .hud {
    padding: 18px 20px;
  }
  .hud-value {
    font-size: 28px;
  }
  .logo {
    font-size: 16px;
  }
  .overlay__title {
    font-size: 32px;
  }
  .overlay__panel {
    padding: 34px 24px;
  }
}
