@import url('https://fonts.googleapis.com/css2?family=Bangers&display=swap');

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

body {
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Segoe UI', sans-serif;
}

#game-container {
  position: relative;
  width: 1280px;
  max-width: 100%;
}

#gameCanvas {
  display: block;
  background: linear-gradient(to bottom, #ffe8c2 0%, #ffd699 60%, #d4a86a 60%, #b8935a 100%);
  border: 4px solid #4a2c17;
  border-radius: 8px;
  cursor: crosshair;
  width: 100%;
}

#hud {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  color: white;
  font-family: 'Bangers', cursive;
  font-size: 30px;
  letter-spacing: 1px;
  font-weight: normal;
  text-shadow: 2px 2px 3px rgba(0,0,0,0.7);
  z-index: 10;
  pointer-events: none;
}

#instructions {
  text-align: center;
  color: #aaa;
  margin-top: 10px;
  font-size: 14px;
}

#level-complete {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  border-radius: 8px;
}

#level-complete.hidden {
  display: none;
}

#level-complete-img {
  max-width: 320px;
  width: 40%;
  height: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

#level-complete p {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  margin-bottom: 20px;
}

#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, #4a1505 0%, #1f0800 55%, #0a0300 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  border-radius: 8px;
}

#start-screen.hidden {
  display: none;
}

#start-screen-img {
  max-width: 96%;
  max-height: 82%;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(255,107,53,0.5);
}

#loading-container {
  width: 300px;
  text-align: center;
  margin-bottom: 20px;
}

#loading-bar {
  width: 100%;
  height: 18px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #ff6b35;
}

#loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff6b35, #ffd54f);
  transition: width 0.15s ease-out;
}

#loading-text {
  font-family: 'Bangers', cursive;
  color: #ffd54f;
  margin-top: 8px;
  letter-spacing: 1px;
}

#start-btn.hidden {
  display: none;
}

#start-btn {
  padding: 16px 50px;
  font-size: 26px;
  font-family: 'Bangers', cursive;
  letter-spacing: 2px;
  background: #ff6b35;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  animation: startPulse 1s ease-in-out infinite alternate;
}

#start-btn:hover {
  background: #ff8555;
}

@keyframes startPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

#game-over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 30px 20px;
  background: rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  border-radius: 8px 8px 0 0;
}

#game-over.hidden {
  display: none;
}

#game-over-img {
  max-width: 280px;
  width: 35%;
  height: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

#game-over p {
  font-size: 26px;
  margin-bottom: 20px;
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
  color: #fff;
}

#score-submit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

#username-input {
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 6px;
  border: 2px solid #ff6b35;
  text-align: center;
  width: 220px;
}

#submit-score-btn {
  padding: 8px 24px;
  font-size: 16px;
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#submit-score-btn:hover {
  background: #5fca63;
}

#submit-score-btn:disabled {
  background: #777;
  cursor: not-allowed;
}

#submit-status {
  font-size: 13px;
  color: #ffd54f;
  min-height: 16px;
}

#leaderboard-panel {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 20px;
  margin-bottom: 15px;
  max-width: 320px;
  max-height: 180px;
  overflow-y: auto;
}

#leaderboard-panel h3 {
  font-family: 'Bangers', cursive;
  color: #ffd54f;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: 1px;
}

#leaderboard-list {
  list-style: decimal;
  padding-left: 20px;
  font-size: 14px;
  text-align: left;
  color: #fff;
}

#leaderboard-list li {
  margin-bottom: 3px;
}

#restart-btn,
#restart-btn-2 {
  padding: 12px 30px;
  font-size: 22px;
  font-family: 'Bangers', cursive;
  letter-spacing: 1px;
  background: #ff6b35;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#restart-btn:hover,
#restart-btn-2:hover {
  background: #ff8555;
}
