.game-container {
  width: 100%;
  max-width: 800px;
  height: 300px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid #14b8a6;
  background: linear-gradient(to bottom, #0b1f1f, #0f2a2a);
  flex-shrink: 0; /* Prevent shrinking */
  margin-top: 20px; /* Add some top margin */
}

#game {
  width: 100%;
  height: 100%;
  position: relative;
}

#dino {
  width: 50px;
  height: 50px;
  position: absolute;
  bottom: 0;
  left: 50px;
  /* 預設方塊，若有 GIF 會被取代 */
  /* background-color: #f43f5e; Removed red background */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.cactus {
  width: 30px;
  height: 50px;
  position: absolute;
  bottom: 0;
  background-color: #14b8a6;
  border-radius: 4px;
}

#score {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  z-index: 10;
}

#start-screen, #game-over-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 20;
  background: rgba(9, 26, 26, 0.8);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #14b8a6;
}

button {
  background: #0f766e;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}

button:hover {
  background: #14b8a6;
}

/* 讓 GIF 能夠正確顯示 */
.dino-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ADs Styles */
.ads-block {
  width: 100%;
  max-width: 800px;
  margin: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding: 0 12px;
  box-sizing: border-box;
}

.ads-title {
  width: 100%;
  max-width: 300px;
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #9fb3b1;
  font-weight: 700;
  text-align: left;
}

.ad-slot {
  width: 100%;
  max-width: 300px;
  min-width: 300px; /* Ensure minimum width to avoid 0 width issues */
  height: 250px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #2f4f4f;
  font-weight: bold;
  font-size: 18px;
  position: relative;
  overflow: hidden; /* Prevent overflow */
}

/* Leaderboard Styles */
.leaderboard-container {
  width: 100%;
  max-width: 800px;
  margin-top: 20px;
  padding: 10px;
  background: rgba(9, 26, 26, 0.5);
  border-radius: 8px;
  max-height: 30vh;
  overflow-y: auto;
  border: 1px solid #333;
}

.leaderboard-container h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #14b8a6;
  text-align: center;
}

#leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#leaderboard-list li {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  border-bottom: 1px solid #333;
  font-size: 14px;
}

#leaderboard-list li:last-child {
  border-bottom: none;
}

/* Input Form Styles */
#submit-score-section {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#player-name {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #14b8a6;
  background: #0f2a2a;
  color: white;
  text-align: center;
}

#submit-btn {
  background: #059669;
  margin-top: 0;
}

#submit-btn:hover {
  background: #10b981;
}

#restart-btn {
  width: 100%;
}
