* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #1a1a2e;
  color: #fff;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ─── СТАРТОВЫЙ ЭКРАН ─── */
#startScreen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2d5a27 0%, #4a8c3f 30%, #87CEEB 60%, #b0e0b0 100%);
  z-index: 100;
}
.start-content { text-align: center; }
.game-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  text-shadow: 3px 3px 6px rgba(0,0,0,.4);
  margin-bottom: .3rem;
  animation: bounce 2s ease infinite;
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.game-subtitle {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #ffffcc;
  margin-bottom: 1.2rem;
}
.characters-preview {
  display: flex; gap: 1.5rem; justify-content: center;
  margin-bottom: 1.2rem;
}
.char-preview {
  font-size: 3rem;
  animation: charBounce 1.5s ease infinite;
}
.char-preview:nth-child(2) { animation-delay: .3s; }
.char-preview:nth-child(3) { animation-delay: .6s; }
@keyframes charBounce {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.1); }
}
.controls-info {
  background: rgba(0,0,0,.3);
  border-radius: 12px;
  padding: .8rem 1.5rem;
  margin: 0 auto 1.2rem;
  display: inline-block;
}
.controls-info p { font-size: 1rem; margin: .2rem 0; }
.start-btn {
  font-size: 1.3rem;
  padding: .8rem 2.5rem;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #ff6b35, #ff9a3c);
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 15px rgba(255,107,53,.4);
}
.start-btn:hover { transform: scale(1.08); box-shadow: 0 6px 25px rgba(255,107,53,.6); }
.hint {
  color: #ccffcc;
  font-size: .9rem;
  margin-top: .5rem;
}

/* ─── ИГРОВОЙ ЭКРАН ─── */
#gameScreen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
}
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 1.2rem;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  font-size: 1.1rem;
  font-weight: bold;
  z-index: 10;
  min-height: 44px;
}
#gameCanvas {
  flex: 1;
  display: block;
  image-rendering: pixelated;
  background: #87CEEB;
}

/* ─── ТАЧ-УПРАВЛЕНИЕ ─── */
#touchControls {
  display: none;
  justify-content: center;
  gap: 1rem;
  padding: .6rem;
  background: rgba(0,0,0,.5);
}
.touch-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.touch-btn:active { background: rgba(255,255,255,.35); }
.touch-jump { background: rgba(255,107,53,.3); border-color: rgba(255,107,53,.6); }

@media (hover: none) and (pointer: coarse) {
  #touchControls { display: flex; }
}

/* ─── GAME OVER / WIN ─── */
#gameOverScreen, #winScreen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
#gameOverScreen { background: rgba(30,0,0,.85); }
#winScreen { background: rgba(0,30,0,.85); }
.gameover-content { text-align: center; }
.gameover-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: .8rem;
}
.final-score {
  font-size: 1.5rem;
  color: #ffdd57;
  margin-bottom: .5rem;
}
.final-message {
  color: #ccc;
  font-size: 1rem;
  margin: .3rem 0;
}
