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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  font-family: Arial, Helvetica, sans-serif;
}

.game {
  width: min(95vw, 420px);
  aspect-ratio: 9 / 16;
  max-height: 90vh;
  position: relative;
  overflow: hidden;
  border: 4px solid #000;
  background: #87ceeb;
}

.background {
  position: absolute;
  inset: 0;
  background-image: url('assets/bg.webp'); 
  background-size: cover;
  background-position: center;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 14px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score {
  font-size: 24px;
  font-weight: bold;
}

.hint {
  font-size: 14px;
}

.bird {
  position: absolute;
  width: 56px;
  height: 40px;
  left: 90px;
  top: 260px;
  z-index: 15;
  background-image: url('assets/bird.png'); 
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  transform-origin: center;
}

.pipes {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.pipe-pair {
  position: absolute;
  top: 0;
  width: 72px;
  height: 100%;
}

.pipe {
  position: absolute;
  width: 100%;
  background: linear-gradient(90deg, #3cae22 0%, #78dd48 30%, #2b9b14 60%, #86ef5c 100%);
  border: 4px solid #1b6610;
}

.pipe::after {
  content: '';
  position: absolute;
  left: -8px;
  width: calc(100% + 16px);
  height: 24px;
  background: linear-gradient(90deg, #56c82e 0%, #9cf86d 45%, #46bb21 100%);
  border: 4px solid #1b6610;
}

.pipe.top {
  top: 0;
  border-top: none;
}

.pipe.top::after {
  bottom: -4px;
}

.pipe.bottom {
  bottom: 72px;
}

.pipe.bottom::after {
  top: -4px;
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  z-index: 12;
  background-image: url('assets/ground.png'); 
  background-repeat: repeat-x;
  background-size: auto 100%;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: white;
  text-shadow: 2px 2px 0 #000;
}

.overlay h1 {
  font-size: 34px;
}

.overlay p {
  font-size: 22px;
}

.overlay button {
  padding: 12px 20px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  border-radius: 10px;
}

.hidden {
  display: none;
}