*,
*::before,
*::after {
  box-sizing: border-box;
  user-select: none;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Press Start 2P', cursive, Arial, sans-serif;
  background-color: #f7f7f7;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(to bottom, #f7f7f7, #e0e0e0);
  overflow-x: hidden;
  touch-action: manipulation;
}

.game-container {
  width: 100%;
  max-width: 800px;
  padding: 10px;
  box-sizing: border-box;
  position: relative;
}

.header {
  text-align: center;
  margin-bottom: 10px;
  width: 100%;
}

.header h1 {
  font-size: 1.5rem;
  color: #ff5722;
  text-shadow: 2px 2px 0 #333;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-display {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
}

.score,
.high-score {
  font-size: 1rem;
  color: #333;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  border-radius: 5px;
  white-space: nowrap;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
  width: 100%;
}

.control-btn {
  background-color: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.7rem;
  border: 2px solid #333;
  min-width: 80px;
  flex: 1;
  max-width: 120px;
  text-align: center;
  cursor: pointer;
}

.game-box {
  position: relative;
  width: 100%;
  border: 3px solid #333;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
  box-sizing: border-box;
}

.world {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 300px;
  background-color: #f0f8ff;
  overflow: hidden;
}

.ground {
  --left: 0;
  position: absolute;
  width: 300%;
  bottom: 0;
  left: calc(var(--left) * 1%);
  height: 30px;
  background-color: #4a8c4a;
}

.dino {
  --bottom: 0;
  position: absolute;
  left: 2%;
  height: 18%;
  bottom: calc(var(--bottom) * 1%);
  z-index: 2;
  image-rendering: pixelated;
}

.cactus {
  position: absolute;
  left: calc(var(--left) * 1%);
  height: 15%;
  bottom: 0;
  z-index: 1;
  image-rendering: pixelated;
}

.mobile-jump-btn {
  position: fixed;
  top: 560px;
  right: 180px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: rgba(255, 87, 34, 0.7);
  border: 3px solid #333;
  color: white;
  font-family: inherit;
  font-size: 0.9rem;
  z-index: 10;
  display: none;
  cursor: pointer;
}

.developer-credit {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.7rem;
  color: #666;
}

.developer-credit a {
  color: #ff5722;
  text-decoration: none;
}

.game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  display: none;
}

.game-over-text {
  color: #ff5722;
  font-size: 2rem;
  margin-bottom: 20px;
  text-shadow: 3px 3px 0 #000;
}

.final-score {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.restart-btn {
  background-color: #ff5722;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  margin-top: 20px;
}

.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.dark-mode .game-box {
  background-color: #1e1e1e;
  border-color: #ff5722;
}

.dark-mode .world {
  background-color: #1a2a3a;
}

.dark-mode .ground {
  background-color: #2a4a3a;
}

.dark-mode .developer-credit {
  color: #aaa;
}

.dark-mode .game-over {
  background-color: rgba(0, 0, 0, 0.9);
}

@media (max-width: 768px) {
  body {
    padding: 5px;
    align-items: flex-start;
  }

  .game-container {
    padding: 5px;
    max-width: 100%;
  }

  .header h1 {
    font-size: 1.2rem;
  }

  .score,
  .high-score {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .control-btn {
    padding: 6px 8px;
    font-size: 0.6rem;
    min-width: 70px;
  }

  .world {
    height: 70vh;
    min-height: 350px;
  }

  .mobile-jump-btn {
    display: block;
    bottom: 100px;
  }

  .game-over-text {
    font-size: 1.5rem;
  }

  .final-score {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 2rem;
    margin-top: 30px;
    margin-bottom: 50px;
  }

  .world {
    height: 65vh;
    min-height: 300px;
  }

  .mobile-jump-btn {
    width: 60px;
    height: 60px;
    font-size: 0.8rem;
    bottom: 90px;
  }

  .developer-credit {
    font-size: 0.6rem;
  }

  .game-over-text {
    font-size: 1.2rem;
  }

  .final-score {
    font-size: 0.9rem;
  }
}

.world {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 300px;
  overflow: hidden;
  background: linear-gradient(to bottom, #87CEEB, #E0F7FA);
}

/* New background elements */
.sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.clouds {
  position: absolute;
  top: 20%;
  left: 0;
  width: 300%;
  height: 20%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 40"><path fill="%23FFFFFF" fill-opacity="0.8" d="M20,30 Q30,20 40,30 Q50,10 60,30 Q70,20 80,30 Q90,10 100,30 Q110,20 120,30 Q130,10 140,30 Q150,20 160,30 Q170,10 180,30"/></svg>') repeat-x;
  background-size: auto 100%;
  z-index: 1;
  animation: cloudMove 60s linear infinite;
}

.mountains {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 300%;
  height: 30%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 60"><path fill="%233a6a3a" d="M0,60 L20,40 L40,50 L60,30 L80,40 L100,20 L120,30 L140,10 L160,30 L180,20 L200,40 L200,60 Z"/></svg>') repeat-x;
  background-size: auto 100%;
  z-index: 1;
  animation: mountainMove 30s linear infinite;
}

@keyframes cloudMove {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes mountainMove {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Adjust z-index of existing elements */
.ground {
  z-index: 3;
}

.dino {
  z-index: 4;
}

.cactus {
  z-index: 3;
}

/* Dark mode adjustments */
.dark-mode .world {
  background: linear-gradient(to bottom, #0a1120, #1a2a3a);
}

.dark-mode .mountains {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 60"><path fill="%232a4a3a" d="M0,60 L20,40 L40,50 L60,30 L80,40 L100,20 L120,30 L140,10 L160,30 L180,20 L200,40 L200,60 Z"/></svg>') repeat-x;
}


/* Add to styles.css */
.start-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 1.2rem;
  z-index: 10;
  display: none;
  animation: fadeOut 1.5s ease-out forwards;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    display: none;
  }
}