:root {
  --ink: #1b1b1b;
  --forest: #1f5a3b;
  --garden: #4c9a2a;
  --sky: #cce6ff;
  --accent: #ff9f4a;
  --cream: #fff3e4;
  --shadow: rgba(15, 25, 20, 0.35);
  font-family: "Baloo 2", "Fredoka", "Comic Sans MS", cursive;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, #fef6d8, transparent 55%),
    radial-gradient(circle at 80% 10%, #ffe2cc, transparent 60%),
    linear-gradient(180deg, #d2f1ff 0%, #f4fff1 55%, #fef7e5 100%);
  color: var(--ink);
}

.wrap {
  width: min(1100px, 95vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.title {
  text-align: center;
}

.title h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: 0.03em;
}

.subtitle {
  margin: 6px 0 0;
  font-size: 1.05rem;
}

.game-shell {
  position: relative;
  background: var(--cream);
  border-radius: 24px;
  box-shadow: 0 22px 40px var(--shadow);
  padding: 16px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  background: #f8fff4;
}

.hud {
  position: absolute;
  top: 18px;
  left: 28px;
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 14px;
  border-radius: 14px;
  font-weight: 600;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 18, 12, 0.2);
  border-radius: 18px;
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: #fffaf3;
  padding: 22px 26px;
  border-radius: 18px;
  text-align: center;
  width: min(360px, 85%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.overlay-card h2 {
  margin: 0 0 8px;
}

.overlay-card p {
  margin: 0 0 16px;
}

button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2);
}

button:hover {
  transform: translateY(-1px);
}

.controls {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.95rem;
  padding: 0 8px;
}

@media (max-width: 700px) {
  .hud {
    flex-direction: column;
    gap: 6px;
  }

  .controls {
    justify-content: center;
    text-align: center;
  }
}
