* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #333;
}

.game-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  width: 100%;
}

.game-header {
  text-align: center;
  margin-bottom: 30px;
}

.game-header h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #ff9a9e, #fecfef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-info {
  display: flex;
  justify-content: space-around;
  font-size: 1.2em;
  font-weight: bold;
}

.score,
.high-score {
  padding: 10px 20px;
  background: linear-gradient(45deg, #ff9a9e, #fecfef);
  color: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.lives {
  padding: 10px 20px;
  background: linear-gradient(45deg, #a1c4fd, #c2e9fb);
  color: #ff7675;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  font-weight: bold;
}

.game-area {
  position: relative;
  height: 400px;
  background: linear-gradient(to bottom, #87ceeb 0%, #98d8e8 50%, #8fbc8f 100%);
  border-radius: 15px;
  overflow: hidden;
  border: 3px solid #ff9a9e;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

.parallax-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background-repeat: repeat-x;
  background-size: auto 100%;
}

.bg-far {
  background-image: radial-gradient(
      circle at 20% 80%,
      rgba(255, 255, 255, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 255, 255, 0.3) 0%,
      transparent 50%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 60%,
      rgba(139, 69, 19, 0.1) 100%
    );
  z-index: 1;
}

.bg-mid {
  background-image: linear-gradient(
      45deg,
      transparent 40%,
      rgba(255, 255, 255, 0.2) 50%,
      transparent 60%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 70%,
      rgba(160, 82, 45, 0.2) 100%
    );
  z-index: 2;
}

.bg-near {
  background-image: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 50px,
      rgba(255, 255, 255, 0.1) 50px,
      rgba(255, 255, 255, 0.1) 100px
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 80%,
      rgba(139, 69, 19, 0.3) 100%
    );
  z-index: 3;
}

.player {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background: linear-gradient(45deg, #ffb347, #ffcc5c);
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease;
  animation: run 0.3s infinite alternate;
  z-index: 20;
}

.player::before {
  content: "🦖";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30px;
}

.obstacle {
  position: absolute;
  bottom: 0;
  width: 30px;
  height: 60px;
  background: linear-gradient(45deg, #ff9a9e, #fecfef);
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 15;
  opacity: 1;
  transition: opacity 0.1s ease;
}

.obstacle::before {
  content: "🏢";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
}

.game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.game-over h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #ff4757;
}

.game-over p {
  font-size: 1.2em;
  margin-bottom: 30px;
}

.restart-btn {
  background: linear-gradient(45deg, #ff9a9e, #fecfef);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 1.1em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}

.game-controls {
  margin-top: 20px;
  text-align: center;
  color: #666;
}

.game-controls p {
  margin: 5px 0;
  font-size: 1em;
}

.control-buttons {
  margin-bottom: 15px;
  text-align: center;
}

.control-btn {
  background: linear-gradient(45deg, #4caf50, #45a049);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  margin: 0 5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.control-btn:disabled {
  background: linear-gradient(45deg, #cccccc, #bbbbbb);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* アニメーション */
@keyframes run {
  0% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.05);
  }
  100% {
    transform: translateY(0px) scale(1);
  }
}

@keyframes jump {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-250px);
  }
}

.jumping {
  animation: jump 0.8s ease-out;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .game-container {
    margin: 20px;
    padding: 20px;
  }

  .game-header h1 {
    font-size: 2em;
  }

  .game-area {
    height: 300px;
  }

  .player {
    width: 40px;
    height: 40px;
  }

  .player::before {
    font-size: 24px;
  }
}
