* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

:root {
  --sky-top: #87ceeb;
  --sky-mid: #b3e0ff;
  --sky-bottom: #f7d488;
  --panel-border: #ffce4d;
  --panel-text: #d2691e;
  --accent-pink: #ff5577;
  --button-green: #6cc24a;
  --button-orange: #ff8a3d;
  --shadow: rgba(0, 0, 0, 0.2);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Comic Sans MS", "Trebuchet MS", sans-serif;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 60%, var(--sky-bottom) 100%);
  touch-action: manipulation;
}

body {
  color: #222;
}

button {
  font: inherit;
}

#game {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#hud {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
  z-index: 5;
}

.pill {
  background: rgba(255, 255, 255, 0.85);
  border: 4px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 28px;
  font-weight: bold;
  color: var(--panel-text);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

#controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  height: 28%;
  z-index: 4;
}

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  color: white;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  background: transparent;
  border: 0;
  transition: background 0.1s;
  cursor: pointer;
}

.btn:active {
  background: rgba(255, 255, 255, 0.25);
}

#leftBtn {
  border-right: 4px dashed rgba(255, 255, 255, 0.5);
}

#praise {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 70px;
  font-weight: bold;
  color: var(--accent-pink);
  text-shadow: 0 0 10px white, 0 6px 0 rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 6;
  transition: transform 0.4s cubic-bezier(.5, 1.8, .5, 1);
}

#praise.show {
  transform: translate(-50%, -50%) scale(1);
}

#title,
#pauseMenu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

#title {
  background: rgba(255, 235, 150, 0.95);
  z-index: 10;
}

#title h1 {
  font-size: 64px;
  color: var(--accent-pink);
  text-shadow: 0 6px 0 white, 0 8px 0 rgba(0, 0, 0, 0.15);
  margin-bottom: 20px;
}

#title p {
  font-size: 28px;
  color: #555;
  margin-bottom: 30px;
}

#playBtn,
.menuBtn {
  color: white;
  border: 6px solid white;
  border-radius: 30px;
  font-size: 40px;
  font-weight: bold;
  box-shadow: 0 8px 0 var(--shadow);
  cursor: pointer;
}

#playBtn {
  background: var(--button-green);
  padding: 20px 50px;
}

#playBtn:active,
.menuBtn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 var(--shadow);
}

#pauseMenu {
  display: none;
  gap: 18px;
  background: rgba(30, 40, 60, 0.55);
  z-index: 9;
}

#pauseMenu.show {
  display: flex;
}

#pauseMenu h2 {
  font-size: 60px;
  color: white;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

#pauseMenu p {
  font-size: 24px;
  color: #fef6d8;
}

.menuPanel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.menuPanel.show {
  display: flex;
}

.menuBtn {
  min-width: 220px;
  background: var(--button-orange);
  border-radius: 28px;
  padding: 16px 36px;
  font-size: 32px;
}

.settingsRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.settingsValue {
  min-width: 170px;
  font-size: 30px;
  font-weight: bold;
  color: white;
}

.stepBtn {
  min-width: 72px;
  padding: 14px 18px;
}

@media (max-width: 768px) {
  .pill {
    font-size: 22px;
  }

  #praise {
    font-size: 52px;
  }

  #title h1,
  #pauseMenu h2 {
    font-size: 48px;
  }

  #title p,
  #pauseMenu p {
    font-size: 22px;
  }

  #playBtn,
  .menuBtn {
    font-size: 30px;
  }

  .btn {
    font-size: 64px;
  }

  .settingsValue {
    font-size: 26px;
  }
}
