* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #7ec8e3;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  touch-action: none;
}

#game-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#bfe9ff, #7ec8e3);
}

#game {
  width: 100%;
  max-width: 900px;
  height: auto;
  aspect-ratio: 800 / 450;
  background: #bfe9ff;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

#hud {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 860px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-weight: 700;
  color: #4a2f16;
  text-shadow: 0 1px 2px rgba(255,255,255,0.6);
  font-size: clamp(14px, 2.2vw, 20px);
}

#hud-level, #hud-peanuts {
  background: rgba(255,255,255,0.75);
  padding: 4px 12px;
  border-radius: 20px;
}

#overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 20, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 24px;
  border-radius: 8px;
}

#overlay.hidden { display: none; }

#overlay-title {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffd27f;
}

#overlay-sub {
  max-width: 520px;
  font-size: clamp(13px, 2.5vw, 17px);
  margin-bottom: 20px;
  line-height: 1.4;
}

#overlay-btn {
  background: #ff9f43;
  border: none;
  color: #3a2100;
  font-weight: 800;
  font-size: 18px;
  padding: 12px 32px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 0 #c76f16;
  transition: transform 0.1s;
}

#overlay-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #c76f16;
}

#touch-controls {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.tbtn {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.55);
  color: #3a2100;
  font-size: 24px;
  font-weight: 800;
  user-select: none;
  -webkit-user-select: none;
}

.tbtn:active { background: rgba(255,255,255,0.85); }

.tbtn-jump {
  width: 72px;
  height: 72px;
  background: rgba(255,159,67,0.85);
  color: #fff;
}

@media (min-width: 900px) {
  #touch-controls { display: none; }
}
