html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  background: #7ec8e3;
  font-family: "Chalkboard SE", "Comic Sans MS", "Trebuchet MS", "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

canvas { display: block; }

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 14px 20px;
  pointer-events: none;
  z-index: 5;
}
#hearts { font-size: 30px; letter-spacing: 4px; }
#hearts .heart { color: #ff4d6d; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
#hearts .heart.empty { color: rgba(30,30,50,.35); text-shadow: none; }
#counters {
  display: flex;
  gap: 18px;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(30,60,90,.55);
}
#crystal-counter { color: #aef4ff; }
#puffkin-counter { color: #ffd9ec; }

/* ---------- pop-up message ---------- */
#message {
  position: fixed;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  color: #fff;
  background: rgba(40, 90, 60, .75);
  border: 3px solid rgba(255,255,255,.7);
  border-radius: 18px;
  padding: 8px 26px;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
}
#message.show { opacity: 1; }

/* ---------- full screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
  background: linear-gradient(180deg, rgba(64,140,200,.88) 0%, rgba(70,170,150,.88) 100%);
  color: #fff;
  padding: 20px;
}
.screen.transparent {
  background: linear-gradient(180deg, rgba(30,60,90,.35) 0%, rgba(30,80,70,.45) 100%);
}

.screen h1 {
  font-size: clamp(56px, 10vw, 110px);
  margin: 0 0 8px;
  color: #ffe066;
  text-shadow: 0 4px 0 #d98e04, 0 9px 22px rgba(0,0,0,.35);
  letter-spacing: 2px;
  transform: rotate(-2deg);
}
.screen h1.small { font-size: clamp(44px, 7vw, 80px); }
.screen h2 {
  font-size: clamp(36px, 6vw, 60px);
  margin: 0 0 10px;
  color: #ffe066;
  text-shadow: 0 3px 0 rgba(120,60,0,.6);
}

.subtitle { font-size: 22px; margin: 4px 0 22px; text-shadow: 0 2px 4px rgba(0,0,0,.3); line-height: 1.5; }
.big { font-size: 28px; }
.hint { font-size: 16px; opacity: .85; margin-top: 18px; }

.controls {
  font-size: 17px;
  line-height: 1.8;
  background: rgba(0, 40, 60, .35);
  border-radius: 14px;
  padding: 10px 24px;
  margin: 10px 0 6px;
}

.credits { font-size: 13px; opacity: .75; margin-top: 26px; }

.blink { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* intro */
#intro-screen .spacer { flex: 1 1 55%; }
#intro-text {
  font-size: clamp(20px, 2.6vw, 28px);
  max-width: 780px;
  line-height: 1.55;
  background: rgba(20, 40, 60, .6);
  border-radius: 16px;
  padding: 16px 28px;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  min-height: 3em;
}
#intro-screen .hint { margin-bottom: 24px; }
