/* Global base styles */
body {
  background: #0b0c0f;
  color: #00ff00;
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
  user-select: none;
  overflow-x: hidden;
  overflow-y: hidden; /* prevent vertical scroll */
  margin: 0;
  padding: 0 1rem; /* horizontal padding */
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Responsive font sizes using clamp(min, preferred, max) */
h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-top: 1.5rem;
  text-shadow: 0 0 1.5px #00ff00;
}

#game {
  /*margin-top: 1.5rem;*/
  max-width: 600px;
  width: 100%;
}

/* Combo */
#combo {
  font-size: clamp(2.5rem, 7vw, 4rem);
  /*margin-top: 1.5rem;*/
  font-weight: bold;
  text-shadow: 0 0 1.5px #00ff00;
  transition: transform 0.2s ease;
}

.shake {
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* Timer */
#timer {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-top: 0.75rem;
  text-shadow: 0 0 1.5px #00ff00;
}

/* Message */
#message {
  margin-top: 1.5rem;
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  min-height: 40px;
  font-weight: 600;
  text-shadow: 0 0 1.5px #00ff00;
  padding: 0 0.5rem;
  word-wrap: break-word;
}

/* Best Combo */
#bestCombo {
  margin-top: 1rem;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: #00ff00;
  text-shadow: 0 0 1.5px #00ff00;
}

/* Start Button */
#startBtn {
  margin-top: 2rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  padding: 12px 28px;
  border: none;
  border-radius: 50px;
  background: #003300;
  color: #00ff00;
  font-weight: bold;
  cursor: pointer;
  box-shadow:
    0 0 3px #00ff00,
    inset 0 0 2px #007700;
  transition: background 0.3s ease;
  z-index: 20;
}

#startBtn:hover {
  background: #005500;
  box-shadow:
    0 0 6px #00ff00,
    inset 0 0 4px #00ff00;
}

/* End Image */
#endImage {
  display: none; /* hide by default */
  max-width: 300px;       /* max width on large screens */
  width: 50vw;      /* max width: 90% of viewport width */
  max-height: 50vh;     /* max height: 70% of viewport height */
  /* width: auto; */
  height: auto;
  margin: 1.5rem auto 0 auto;
  border: 3px solid #00ff00;
  border-radius: 10px;
  object-fit: scale-down;  /* keep aspect ratio */
}
/* Clear High Score Button */
#clearHighScoreBtn {
  position: fixed;
  bottom: 60px; /* moved up to avoid overlap */
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  padding: 5px 10px;
  border: none;
  border-radius: 20px;
  background: #002200;
  color: #00ff00;
  font-weight: bold;
  cursor: pointer;
  box-shadow:
    0 0 1.5px #00ff00,
    inset 0 0 1px #007700;
  transition: background 0.3s ease;
  z-index: 1000;
}

#clearHighScoreBtn:hover {
  background: #004400;
  box-shadow:
    0 0 3px #00ff00,
    inset 0 0 2px #00ff00;
}

/* Tap Zones */
.tap-zone {
  position: absolute;
  width: 80px;
  height: 80px;
  background: #ff6f61;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  user-select: none;
  cursor: pointer;
  box-shadow: 0 0 10px #ff6f61aa;
  transition: background-color 0.2s ease;
}

.tap-zone:active {
  background-color: #ff3b2f;
  box-shadow: 0 0 15px #ff3b2fcc;
}

/* Tap Zones Container Full Screen */
#tapZonesContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  border: none;
  border-radius: 0;
  z-index: 10;
  pointer-events: none;
  background: transparent;
}

#tapZonesContainer.active {
  pointer-events: auto;
}

/* Responsive fixes for very small screens */
@media (max-width: 400px) {
  h1 {
    font-size: 2.2rem;
    margin-top: 1rem;
  }

  #combo {
    font-size: 2rem;
    margin-top: 1rem;
  }

  #timer {
    font-size: 1.3rem;
    margin-top: 0.5rem;
  }

  #message {
    font-size: 1rem;
    margin-top: 1rem;
  }

  #bestCombo {
    font-size: 1rem;
    margin-top: 0.5rem;
  }

  #startBtn {
    font-size: 1.2rem;
    margin-top: 1rem;
    padding: 10px 20px;
  }

  #clearHighScoreBtn {
    bottom: 15px;
    font-size: 10px;
    padding: 4px 8px;
  }
}

#copyChallengeBtn {
  display: none;
  background: #222;
  color: white;
  font-size: 18px;
  padding: 6px 10px;
  border: 2px solid #00ff00;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}

#copyChallengeBtn:hover {
  background: #333;
}

.challenge-message {
  font-size: 0.8em;
  display: block;
  margin-top: 0.3em;
}

/* For your tap zones container or the whole body */
#tapZonesContainer, body {
  touch-action: manipulation;
}
