body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #222;
  font-family: Arial, Helvetica, sans-serif;
  color: #fff;
}

#game-container {
  text-align: center;
}

#hud {
  display: flex;
  justify-content: space-around;
  margin-top: 0; /* move HUD up */
  font-size: 1.2em;
}

h1 {
  margin: 0 0 5px 0; /* tighter spacing above HUD */
}

#enemy-area {
  width: 200px;
  height: 200px;
  margin: 60px auto 0 auto; /* remove bottom margin to bring character closer */
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.enemy {
  width: 100%;
  height: 100%;
}

#instructions {
  margin-top: 10px;
  font-size: 1em;
  opacity: 0.8;
}

.hidden {
  display: none !important;
}

#game-over {
  margin-top: 20px;
}

#restart-btn {
  padding: 8px 16px;
  font-size: 1em;
  cursor: pointer;
}

/* Character styling */
#character {
  width: 140px;
  height: 140px;
  margin: -70px auto 0 auto; /* overlap half of enemy area (200px/2 = 100px, but character is 140px, so -70px is about half) */
  border-radius: 8px;
  background: none;
  z-index: 20;
  position: relative;
}

@keyframes punchLeft {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-60px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes punchRight {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(60px);
  }
  100% {
    transform: translateX(0);
  }
}

.punch-left {
  animation: punchLeft 0.3s ease-out;
}

.punch-right {
  animation: punchRight 0.3s ease-out;
}

/* Preview styling */
#preview-wrapper {
  display: none; /* hide old side previews */
}

#preview-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.preview {
  width: 50px;
  height: 50px;
  border: 3px solid #fff;
}

/* Stacked enemy layers */
.enemy-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#mute-btn {
  position: relative;
  top: 0;
  left: 0;
  margin-bottom: 8px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1.5em;
  cursor: pointer;
  padding: 4px 12px;
  transition: background 0.2s;
}
#mute-btn:hover {
  background: #444;
}
#start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

#start-screen-container {
  max-width: 1200px;
  width: 100%;
}

#game-image-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#start-img {
  max-width: 90vw;
  max-height: 60vh;
  margin-bottom: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 32px #000a;
}
#start-message {
  color: #fff;
  font-size: 2em;
  text-align: center;
  margin-top: 12px;
  text-shadow: 0 2px 8px #000a;
} 

/* Leaderboard Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  margin-bottom: 1rem;
  color: #333;
}

.modal-content p {
  margin-bottom: 1.5rem;
  color: #666;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
}

.form-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.form-buttons button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

#submit-score-btn {
  background-color: #28a745;
  color: white;
}

#submit-score-btn:hover {
  background-color: #218838;
}

#submit-score-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

#skip-leaderboard-btn {
  background-color: #6c757d;
  color: white;
}

#skip-leaderboard-btn:hover {
  background-color: #5a6268;
}

#submission-success {
  color: #28a745;
  font-weight: bold;
  margin-top: 1rem;
}

#leaderboard-modal {
  user-select: auto !important;
}
#leaderboard-modal * {
  user-select: auto !important;
}

#leaderboard-modal input,
#leaderboard-modal input:focus,
#leaderboard-modal input:active,
#leaderboard-modal textarea,
#leaderboard-modal textarea:focus,
#leaderboard-modal textarea:active {
  user-select: auto !important;
  pointer-events: auto !important;
  -webkit-user-select: auto !important;
  -webkit-touch-callout: auto !important;
  touch-action: manipulation !important;
  background: #fff !important;
  color: #000 !important;
}

/* Mobile-specific modal adjustments */
@media (max-width: 768px) {
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .form-buttons {
    flex-direction: column;
  }
  
  .form-buttons button {
    width: 100%;
  }
  
  /* Start screen responsive layout */
  #start-screen-container {
    flex-direction: column !important;
    gap: 20px !important;
  }
  
  #game-image-section {
    min-width: auto !important;
  }
  
  #web3-gaming-ui {
    flex: none !important;
    max-width: 350px !important;
  }
  
  #start-img {
    max-width: 80vw !important;
    max-height: 40vh !important;
  }
}

/* Web3 Gaming UI Styles */
.web3-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 5px;
}

.web3-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.web3-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.web3-btn.primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.web3-btn.success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.web3-btn.danger {
  background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

/* Reward tiers styles moved to popup modal (removed from main UI) */

#web3-gaming-ui {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Messages and notifications */
.web3-message {
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
  text-align: center;
}

.web3-message.success {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid #28a745;
}

.web3-message.error {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border: 1px solid #dc3545;
}

.web3-message.info {
  background: rgba(23, 162, 184, 0.2);
  color: #17a2b8;
  border: 1px solid #17a2b8;
} 