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

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5e6d3;
  font-family: system-ui, sans-serif;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.game-container {
  position: relative;
  width: min(600px, 100vw);
  height: min(800px, 100vh);
  height: min(800px, 100dvh);
  border: 5px solid black;
  overflow: hidden;
}

/* Hearts display */
.hearts {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  z-index: 100;
}

/* DDR Lanes */
.ddr-lanes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 1;
}

.lane {
  flex: 1;
  height: 100%;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

.lane-label {
  display: none;
}

/* Hit zone */
.hit-zone {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: rgba(76, 175, 80, 0.3);
  border-top: 3px solid rgba(76, 175, 80, 0.6);
  z-index: 20;
  display: flex;
  pointer-events: none;
}

.hit-zone-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.4);
}

/* Falling bars */
.bar {
  position: absolute;
  width: calc(100% - 20px);
  height: 30px;
  background: linear-gradient(180deg, #ff9800, #f57c00);
  border-radius: 4px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bar.hit {
  background: linear-gradient(180deg, #4caf50, #388e3c);
  opacity: 0.5;
}

/* Turkey container - foreground */
.turkey-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.3s ease;
  transform-origin: bottom center;
}

.turkey-container.playing {
  transform: translateX(-50%) scale(0.5);
}

.sprite {
  background-image: url("sprite-sheet.png");
  background-repeat: no-repeat;
  image-rendering: auto;
}

.feet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.hand {
  position: absolute;
  z-index: 2;
}

.face {
  position: absolute;
  z-index: 3;
}

.hat {
  position: absolute;
  z-index: 1;
  display: none;
}

.hat.visible {
  display: block;
}

/* Hit zone label feedback states */
.hit-zone-label.perfect {
  color: #ff9800;
}

.hit-zone-label.nice {
  color: #4caf50;
}

.hit-zone-label.miss {
  color: #f44336;
}

/* Bar explosion animation */
@keyframes explode {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) scale(1.5);
    opacity: 0.8;
    filter: brightness(1.5);
  }
  100% {
    transform: translateX(-50%) scale(2);
    opacity: 0;
  }
}

.bar.exploding {
  animation: explode 0.3s ease-out forwards;
  background: linear-gradient(180deg, #ffeb3b, #ff9800);
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.8);
}

/* Start dialog */
.start-dialog {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 30px 40px;
  border-radius: 16px;
  border: 3px solid black;
  z-index: 100;
  text-align: center;
  opacity: 0;
  visibility: hidden;
}

.start-dialog.ready {
  animation: fadeInUp 0.4s ease-out forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
  }
}

/* Speech bubble tail */
.start-dialog::after {
  content: "";
  position: absolute;
  bottom: -20px;
  right: 25%;
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 20px solid black;
}

.start-dialog::before {
  content: "";
  position: absolute;
  bottom: -14px;
  right: calc(25% + 3px);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid white;
  z-index: 1;
}

.start-dialog.hidden {
  display: none;
}

.start-dialog h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: #333;
}

.start-dialog p {
  margin: 0;
  font-size: 18px;
  color: #666;
}

.start-dialog .keys {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.start-dialog .key {
  width: 44px;
  height: 44px;
  background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
  border: 2px solid #999;
  border-bottom-width: 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: #333;
  box-shadow:
    0 2px 0 #888,
    0 3px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.1s;
}

.start-dialog .key.active {
  background: linear-gradient(to bottom, #5cb85c, #4caf50);
  border-color: #388e3c;
  border-bottom-width: 2px;
  color: white;
  box-shadow:
    0 1px 0 #2d6a2d,
    0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(2px);
}

.game-over-stats {
  margin-bottom: 20px;
}

.final-score {
  font-size: 64px;
  font-weight: bold;
  color: black;
}

/* Touch feedback for lanes */
.hit-zone-label.touched {
  background: rgba(76, 175, 80, 0.5);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
  .game-container {
    border: none;
    height: 100vh;
    height: 100dvh;
  }

  .hearts {
    font-size: 24px;
    top: 10px;
    right: 10px;
  }

  .hit-zone-label {
    font-size: 20px;
  }

  .start-dialog {
    padding: 20px 25px;
  }

  .start-dialog h2 {
    font-size: 22px;
  }

  .final-score {
    font-size: 48px;
  }

  .turkey-container {
    bottom: 80px;
  }
}
