
#nameEntry:not(.hidden) {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#nameEntry:not(.hidden) button {
  margin-top: 12px;
  padding: 14px 20px;
  border-radius: 999px;
  font-size: 1.1rem;
  cursor: pointer;
  background: #ffffff;   /* white button */
  color: #1f1f2e;        /* dark text */
  font-weight: bold;
  border: 2px solid #ffcf56;
}

#instructionsCat {
  width: 120px;
  margin-bottom: 10px;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

#nameEntry:not(.hidden) input {
  width: 180px;
  background: #ffffff;
  color: #1f1f2e;
  caret-color: #1f1f2e;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 1.5rem;
  border: 3px solid #ffcf56;
}

#submitScoreDisplay {
  font-size: 1.6rem;
  font-weight: bold;
  color: #ffcf56;
  margin-bottom: 12px;
}

#nameEntry:not(.hidden) input:focus {
  outline: 3px solid #ffcf56;
  background: #fff8dc;
  color: #000000;
}

#nameEntry:not(.hidden) label {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

#nameEntry:not(.hidden) button {
  margin-top: 10px;
}


#instructionsPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#instructionsBox {
  width: min(90vw, 420px);
  background: #1f1f2e;
  color: white;
  padding: 22px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

#instructionsPopup.hidden {
  display: none;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}


* {
  box-sizing: border-box;
}

canvas {
  touch-action: none;
}

    body {
      margin: 0;
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #1f1f2e;
      font-family: Arial, sans-serif;
      color: white;
    }

    #gameWrapper {
      width: min(95vw, 760px);
      text-align: center;
    }

    h1 {
      margin: 8px 0;
      font-size: 2rem;
    }

    #hud {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      margin: 10px 0;
      font-size: 1.1rem;
    }

    canvas {
      width: 100%;
      aspect-ratio: 1 / 1;
      background: #f4d7a1;
      border: 8px solid #7a4a24;
      border-radius: 18px;
      box-shadow: 0 12px 30px rgba(0,0,0,0.35);
      display: block;
    }

    button {
      margin-top: 12px;
      padding: 12px 18px;
      border: none;
      border-radius: 999px;
      font-size: 1rem;
      cursor: pointer;
      background: #ffcf56;
      color: #2a1d00;
      font-weight: bold;
    }

    #instructions {
      opacity: 0.85;
      font-size: 0.95rem;
      margin-top: 8px;
      line-height: 1.4;
    }

    .hidden {
  display: none;
}

.challengeTag {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 207, 86, 0.18);
  border: 1px solid #ffcf56;
  color: #ffcf56;
  font-size: 0.45em;
  font-weight: bold;
  vertical-align: middle;
}

#leaderboardPanel {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
}

#leaderboardList {
  text-align: left;
  max-width: 280px;
  margin: 12px auto 0;
  padding-left: 28px;
}

#replacementCountdown {
  margin: 10px auto 14px;
  padding: 12px;
  max-width: 520px;
  background: rgba(255, 207, 86, 0.16);
  border: 2px solid #ffcf56;
  border-radius: 14px;
  font-weight: bold;
  line-height: 1.4;
}

#countdownTimer {
  color: #ffcf56;
  font-size: 1.2rem;
}

#leaderboardList li {
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.gold {
  background: rgba(255, 215, 0, 0.35);
}

.silver {
  background: rgba(192, 192, 192, 0.35);
}

.bronze {
  background: rgba(205, 127, 50, 0.35);
}

.playerScore {
  outline: 2px solid white;
}
