:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #4c1d95 0%, #0b1020 58%);
  color: #f5f3ff;
}

.header, .hud, .controls {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0.6rem 0.8rem;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1rem;
}

.header h1, .header p { margin: 0; }
.header p { opacity: 0.8; }

.back {
  color: #ddd6fe;
  font-weight: 700;
  text-decoration: none;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-weight: 800;
}

.hud div, .hud button {
  background: rgba(24, 16, 48, 0.72);
  border: 1px solid rgba(196, 181, 253, 0.35);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.stage {
  position: relative;
  width: min(960px, 100%);
  margin: 0 auto;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #1e1b4b;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  touch-action: none;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.2rem;
  text-align: center;
  background: rgba(15, 10, 36, 0.88);
  border-radius: 14px;
}

.overlay.hidden { display: none; }

.overlay p { margin: 0.2rem 0; }

#overlay-title {
  font-size: 1.8rem;
  font-weight: 800;
}

.hint {
  max-width: 36rem;
  line-height: 1.45;
  opacity: 0.9;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.6rem;
}

.overlay button, .controls {
  font: inherit;
}

.overlay button {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 800;
  cursor: pointer;
  background: #c4b5fd;
  color: #2e1065;
}

.controls {
  opacity: 0.75;
  text-align: center;
}

.eco-shop {
  width: min(960px, 100%);
  margin: 0.4rem auto 2rem;
  padding: 0 0.8rem 1rem;
}
