: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%, #14532d 0%, #0b1020 58%);
  color: #f0fdf4;
}

.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: #bbf7d0;
  font-weight: 700;
  text-decoration: none;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-weight: 800;
}

.hud div {
  background: rgba(8, 24, 16, 0.72);
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
}

.stage {
  position: relative;
  width: min(960px, 100%);
  margin: 0 auto;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #14532d;
  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(6, 24, 16, 0.86);
  border-radius: 14px;
}

.overlay.hidden { display: none; }

#overlay-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 800;
}

.hint {
  max-width: 36rem;
  margin: 0.2rem 0 0.4rem;
  line-height: 1.4;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

#start, #next {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.3rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: #facc15;
  color: #422006;
}

#next { background: #4ade80; color: #052e16; }

.is-hidden { display: none !important; }

.controls {
  opacity: 0.75;
  font-size: 0.92rem;
}

.loft {
  width: min(960px, 100%);
  margin: 0.35rem auto 0;
  padding: 0 0.8rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.loft button {
  border: 1px solid rgba(134, 239, 172, 0.35);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: rgba(8, 24, 16, 0.72);
  color: #bbf7d0;
}

.loft button.on {
  background: #facc15;
  color: #422006;
  border-color: transparent;
}
