/* Game page specific styles */

.container {
  max-width: 1200px;
  padding: 40px 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

.game-container {
  width: 100%;
  height: 500px;
  background: linear-gradient(180deg, #87ceeb 0%, #e0f6ff 100%);
  border: 3px solid #2d2d2d;
  border-radius: 20px;
  box-shadow: 8px 8px 0 #2d2d2d;
  overflow: hidden;
  position: relative;
  margin: 30px 0;
}

.game-world {
  width: 3200px;
  height: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  transition: transform 0.05s linear;
}

.sky {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #87ceeb 0%, #e0f6ff 70%);
}

.ground {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 80px;
  background: #8b4513;
  border-top: 4px solid #654321;
  z-index: 1;
}

.grass {
  position: absolute;
  bottom: 80px;
  width: 100%;
  height: 20px;
  background: #228b22;
  z-index: 2;
  background-image:
    linear-gradient(90deg, transparent 0%, #1a6b1a 50%, transparent 100%),
    repeating-linear-gradient(
      90deg,
      #228b22 0px,
      #1e7a1e 2px,
      #228b22 4px,
      #2a9d2a 6px,
      #228b22 8px
    );
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.building {
  position: absolute;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

.building img {
  max-height: 220px;
  image-rendering: pixelated;
}

.building-label {
  margin-top: 10px;
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #2d2d2d;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 4px 4px 0 rgba(45, 45, 45, 0.3);
}

/* Character */
.character {
  width: 40px;
  height: 80px;
  position: absolute;
  bottom: 100px;
  left: 100px;
  z-index: 10;
}

.character::before {
  content: "😊";
  position: absolute;
  width: 32px;
  height: 32px;
  background: #ffdbac;
  border: 3px solid #2d2d2d;
  border-radius: 50%;
  top: 0;
  left: 4px;
  box-shadow: 2px 2px 0 rgba(45, 45, 45, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  line-height: 1;
}

.character::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 35px;
  background: #4a90e2;
  border: 3px solid #2d2d2d;
  border-radius: 8px 8px 4px 4px;
  top: 34px;
  left: 6px;
  box-shadow: 2px 2px 0 rgba(45, 45, 45, 0.2);
}

.character-arm-left,
.character-arm-right {
  position: absolute;
  width: 8px;
  height: 25px;
  background: #ffdbac;
  border: 2px solid #2d2d2d;
  border-radius: 4px;
  top: 38px;
  transform-origin: top center;
}

.character-arm-left {
  left: 0;
}

.character-arm-right {
  right: 0;
}

.character-leg-left,
.character-leg-right {
  position: absolute;
  width: 10px;
  height: 28px;
  background: #333;
  border: 2px solid #2d2d2d;
  border-radius: 5px;
  bottom: -28px;
  transform-origin: top center;
}

.character-leg-left {
  left: 8px;
}

.character-leg-right {
  right: 8px;
}

/* Animations */
.character.walking .character-leg-left {
  animation: leg-walk-left 0.4s infinite;
}

.character.walking .character-leg-right {
  animation: leg-walk-right 0.4s infinite;
}

.character.walking .character-arm-left {
  animation: arm-walk-left 0.4s infinite;
}

.character.walking .character-arm-right {
  animation: arm-walk-right 0.4s infinite;
}

@keyframes leg-walk-left {
  0%,
  100% {
    transform: rotate(-25deg);
  }
  50% {
    transform: rotate(25deg);
  }
}

@keyframes leg-walk-right {
  0%,
  100% {
    transform: rotate(25deg);
  }
  50% {
    transform: rotate(-25deg);
  }
}

@keyframes arm-walk-left {
  0%,
  100% {
    transform: rotate(20deg);
  }
  50% {
    transform: rotate(-20deg);
  }
}

@keyframes arm-walk-right {
  0%,
  100% {
    transform: rotate(-20deg);
  }
  50% {
    transform: rotate(20deg);
  }
}

.character.jumping .character-leg-left,
.character.jumping .character-leg-right {
  animation: leg-jump 0.3s ease-out;
}

@keyframes leg-jump {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.character.flipped {
  transform: scaleX(-1);
}

/* Info box */
.info-box {
  background: #f7f7f7;
  border-left: 4px solid #4ecdc4;
  padding: 25px;
  margin: 30px 0;
  border-radius: 10px;
}

.info-box h3 {
  font-family: "Permanent Marker", cursive;
  font-size: 22px;
  margin-bottom: 15px;
  color: #2d2d2d;
}

.info-box ol {
  margin-left: 25px;
}

.info-box li {
  margin-bottom: 10px;
}

.info-box ul {
  margin-left: 20px;
  margin-top: 8px;
}

.info-box code {
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 13px;
}

footer {
  border-top: 3px solid #e0e0e0;
}

@media (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  .game-container {
    height: 400px;
  }

  .back-link {
    position: static;
    display: inline-block;
    margin-bottom: 20px;
  }

  header {
    text-align: center;
  }
}
