.site-wrapper main>.Challenge-section,
main>.Challenge-section,
.Challenge-section {
  margin-top: 10px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Neon Flyer - Scoped Styles Only */

/* Remove unused styles and update layout */
/* Center the overlay and style it like other Challenges */

/* Overlay only covers the canvas-wrap, not the whole page */
.canvas-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.canvas-wrap .ptb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* background: transparent; */
  /* backdrop-filter: blur(8px); */
  z-index: 30;
}

.ptb-overlay-card {
  width: min(440px, calc(100% - 48px));
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 22px 22px 20px;
  text-align: center;
  /* box-shadow: 0 28px 70px rgba(0,0,0,0.35); */
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ptb-overlay-title {
  font-size: 2.1rem;
  font-weight: 900;
  color: #0d1020;
  letter-spacing: 0.01em;
}

.ptb-score-label {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(13, 16, 32, 0.55);
}

.ptb-score {
  margin-top: 6px;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: #ff3c3c;
}

.ptb-overlay-btn {
  margin-top: 18px;
  padding: 12px 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  background: linear-gradient(90deg, #111 0%, #2a2f4a 100%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  transition: background 0.18s, color 0.18s;
}

.ptb-overlay-btn:hover {
  background: #ff3c3c;
  color: #fff;
}

#ChallengeContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
  margin-top: 0;
  width: 100%;
}

#ChallengeContainer canvas,
.canvas-wrap canvas {
  background: #FAE9D5;
  border-radius: 14px;
  max-width: 95vw;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
}

#canvasControls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#canvasControls button {
  background: #fff;
  border: 2px solid #222;
  color: #222;
  font-size: 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
}

#canvasControls button:hover {
  background: #f0f0f0;
  color: #ff0303;
}

.Challenge-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.canvas-wrap {
  display: flex;
  flex-direction: column;
}

.canvas-wrap canvas {
  background: #FAE9D5;
  border: 6px solid #22222200;
}

#canvasControls {
  display: flex;
  gap: 10px;
}

#canvasControls button {
  background: #fff;
  border: 2px solid #222;
}

.ptb-overlay {
  /* keep scoped .canvas-wrap .ptb-overlay for overlay positioning */
}

#ChallengeContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
  margin-top: 100px;
  width: 100%;
}

#ChallengeContainer canvas {
  background: #eeeeee;
  border: 4px solid #222;
  border-radius: 14px;
  max-width: 95vw;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
}

#canvasControls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#canvasControls button {
  background: #fff;
  border: 2px solid #222;
  color: #222;
  font-size: 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
}

#canvasControls button:hover {
  background: #f0f0f0;
  color: #ff0303;
}

/* How-to-play section (inherits from .how-to-play in style.css) */
.how-to-play.playful-instructions {
  margin-top: 32px;
}

/* Challenge-specific icons */
.how-to-play .fa-solid {
  margin-right: 6px;
}

/* Heart icon color override */
.how-to-play .heart {
  color: #ff0000 !important;
}

/* Responsive tweaks for Challenge canvas */
@media (max-width: 600px) {
  #ChallengeContainer canvas {
    border-width: 2px;
    border-radius: 8px;
  }

  #canvasControls button {
    font-size: 1rem;
    padding: 6px 10px;
  }

  /* Pause/Resume button responsive adjustments */
  #canvasControls {
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
  }

  #canvasPauseBtn {
    font-size: 0.95rem;
    padding: 6px 12px;
    min-width: 72px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #canvasControls button {
    flex: 0 0 auto;
  }

  .ptb-overlay-card {
    width: 40px;
    border-radius: 12px;
    padding: 2px 2px 2px;
  }

  .ptb-overlay-title {
    font-size: 0.6rem;
    font-weight: 700;
  }

  .ptb-score-label {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
  }

  .ptb-score {
    margin-top: 3px;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    color: #ff3c3c;
  }

  .ptb-overlay-btn {
    margin-top: 8px;
    padding: 2px 2px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
  }
}

.modal,
.modal-dialog,
.modal-content,
.modal-body,
.btn-close,
#retryScreen,
#leaderboard,
#leaderboardList {
  display: none !important;
}

/* === LAYOUT: Challenge CONTAINER & CANVAS === */

#ChallengeContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
  width: 100%;
}

canvas {
  background: rgb(255, 255, 255);
  border: 5px solid #000000;
  border-radius: 12px;
  /* box-shadow: 0 0 5px #00fff0; */
  max-width: 95vw;
  max-height: auto;
}

/* === CANVAS CONTROLS === */

#canvasControls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#canvasControls button {
  background: transparent;
  border: none;
  color: #0c0d14;
  font-size: 24px;
  cursor: pointer;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

/* #canvasControls button:hover {
  transform: scale(1.1);
} */

#closeStartModal :hover {
  cursor: pointer;
}

/* === LEADERBOARD SECTION === */

#leaderboard {
  font-family: "Baloo 2", cursive;
  color: #0c0d14;
  text-align: center;
  margin-top: 2rem;
  max-width: 1000px;
  width: 100%;
}

#leaderboard h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

#leaderboard h3 i {
  margin-right: 8px;
}

#leaderboardList {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

#leaderboardList>.no-scores {
  background: transparent;
  padding: 10px 15px;
  min-width: 180px;
  text-align: center;
}

.leaderboard-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 1rem;
}



.score {
  color: #0c0d14;
  font-weight: bold;
}

.leaderboard-entry:nth-child(1) .score {
  color: #ff0000;
}

.leaderboard-entry:nth-child(2) .score {
  color: #00a2ff;
}

.leaderboard-entry:nth-child(3) .score {
  color: #ffa600;
}


/* === MODALS === */

#retryScreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: monospace;
  color: white;
  z-index: 1000;
}

.modal-backdrop.show {
  opacity: 0;
  pointer-events: none;
}


.retry-text {
  font-size: 48px;
  margin-bottom: 16px;
}

#retryButton {
  font-size: 18px;
  padding: 8px 20px;
  cursor: pointer;
}


.modal {
  position: absolute !important;
}

.modal-dialog {
  position: absolute !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  width: 100%;
  max-width: 420px;
}

/* Keep your existing modal style and glow look */
.modal-content {
  background: radial-gradient(circle at top, #000000, #000000);
  /* border: 2px solid #00fff0;
  box-shadow: 0 0 5px #00fff0; */
  border-radius: 1.2rem;
  width: 100%;
  max-width: 400px;
  margin: auto;
  text-align: center;
}

/* Modal body tweaks */

.modal-body {
  padding: 1rem !important;
}

.modal-body h3 {
  font-size: 1.5rem !important;
  margin-bottom: 1rem !important;
  /* text-shadow: 0 0 10px #00fff0; */
}

.modal-body p {
  font-size: 1.1rem !important;
  margin-bottom: 0rem !important;
  color: #ffffff;
}

.modal-body button {
  background: transparent;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  text-align: center !important;
  justify-content: center !important;
  letter-spacing: 0.5px;
  padding: 0rem 1rem !important;
}

.btn-close {
  position: absolute;
  top: 5px;
  left: 5px;
  color: #fff;
  opacity: 1;
  z-index: 10;
  pointer-events: auto;
}

#playerNameInput {
  background: #000;
  color: rgb(255, 255, 255);
  border: 2px solid rgb(255, 255, 255);
  border-radius: 8px;
  text-align: center;
  width: 70%;
  padding: 0.2rem 0.75rem;
  margin: 0 auto 0rem auto;
  /* <-- center horizontally */
  font-size: 1rem;
  outline: none;
  display: block;
  /* ensures margin auto works */
}

#playerNameInput::placeholder {
  color: #a3a3a3;
}

#playerNameInput:focus {
  box-shadow: 0 0 2px rgb(255, 255, 255);
}

#nameConfirmBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === NAVIGATION & FOOTER === */

#footer {
  text-align: center;
  padding: 12px 0;
  background: transparent !important;
  color: #0c0d14;
  font-size: 1rem;
  position: relative;
  bottom: 0;
  width: 100%;
  z-index: 999;
}

#footer a {
  color: #0c0d14;
  text-decoration: none;
}

#footer a:hover {
  text-decoration: underline;
}

/* === RESPONSIVE DESIGN === */

@media (max-width: 1000px) {
  header {
    padding: 25px 15px;
  }

  header h1 {
    font-size: 2.2rem;
  }

  main {
    /* margin: 30px auto; */
  }

  #leaderboard {
    margin-top: 2rem;
    max-width: 800px;
    width: 90%;
  }

  #leaderboard h3 {
    font-size: 1rem;
  }

  #leaderboard h3 i {
    margin-right: 5px;
  }

  #leaderboardList {
    gap: 10px;
  }

  #leaderboardList div {
    /* padding: 8px 10px; */
    min-width: 120px;
    font-size: 1rem;
  }

  .leaderboard-entry {
    /* padding: 5px 10px; */
    min-width: 80px;
    max-width: 180px;
    font-size: 0.7rem;
  }

  #canvasControls button {
    font-size: 24px;
    padding: 6px 10px;
  }

  #canvasControls {
    gap: 8px;
    margin-top: 10px;
  }

  .rank {
    margin-right: 2px;
  }

  .score {
    margin-left: 2px;
  }

  .modal-content {
    max-width: 80vw;
  }

  #footer {
    padding: 12px 0;
    font-size: 0.7rem;
  }
}

/* ---------- Tablets (≤800px) ---------- */

@media (max-width: 800px) {
  header {
    padding: 20px 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  main {
    /* margin: 20px auto; */
  }

  main h2 {
    font-size: 1.4rem;
  }

  #leaderboard {
    margin-top: 2rem;
    max-width: 800px;
    width: 90%;
  }

  #leaderboard h3 {
    font-size: 1rem;
  }

  #leaderboard h3 i {
    margin-right: 3px;
  }

  #leaderboardList {
    gap: 8px;
  }

  #leaderboardList div {
    /* padding: 6px 8px; */
    min-width: 100px;
    font-size: 0.8rem;
  }

  .leaderboard-entry {
    /* padding: 5px 10px; */
    min-width: 100px;
    max-width: 180px;
    min-height: 40px;
    font-size: 0.6rem;
  }

  #canvasControls button {
    font-size: 1rem;
    padding: 6px 10px;
  }

  #canvasControls {
    gap: 5px;
    margin-top: 10px;
  }

  .rank {
    margin-right: 2px;
  }

  .score {
    margin-left: 2px;
  }

  .modal-body h3 {
    font-size: 1.2rem !important;
  }

  .modal-body p {
    margin-bottom: 0rem !important;
    padding-bottom: 0rem !important;
  }

  .modal-body button {
    padding: 0rem 1rem !important;
    margin-top: 0.5rem !important;
  }

  #footer {
    padding: 12px 0;
    font-size: 0.8rem;
  }
}

/* ---------- Mobile (≤600px) ---------- */

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  canvas {
    border-width: 2px;
  }

  header {
    padding: 15px 5px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  main {
    /* margin: 15px auto; */
  }

  main h2 {
    font-size: 1.2rem;
  }

  main p,
  main li {
    font-size: 0.95rem;
  }

  #leaderboard {
    margin-top: 1rem;
    max-width: 600px;
    width: 95%;
  }

  #leaderboard h3 {
    font-size: 0.8rem;
  }

  #leaderboard h3 i {
    margin-right: 2px;
  }

  #leaderboardList {
    gap: 5px;
  }

  #leaderboardList div {
    /* padding: 4px 6px; */
    min-width: 20px;
    font-size: 0.5rem;
  }

  .leaderboard-entry {
    /* padding: 5px 5px; */
    min-width: 100px;
    min-height: 30px;
    /* max-width: 180px; */
    max-height: 10px;
    font-size: 0.6rem;
  }

  #canvasControls button {
    font-size: 1rem;
    padding: 6px 10px;
  }

  #canvasControls {
    gap: 5px;
    margin-top: 10px;
  }

  .rank {
    margin-right: 1px;
  }

  .score {
    margin-left: 1px;
  }

  .modal-content {
    border-radius: 1rem;
    max-width: 50vw !important;
    max-height: 80vw !important;
  }

  .modal-content button {
    margin-bottom: 0rem;
  }

  .modal-body {
    padding: 0.5rem !important;
  }

  .modal-body h3 {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
  }

  .modal-body p {
    font-size: 0.8rem !important;
    margin-bottom: 0rem !important;
  }

  .modal-body button {
    font-size: 0.8rem !important;
    margin-top: 0.3rem !important;
    padding: 0rem 0.8rem !important;
  }

  .modal-body i {
    font-size: 0.8rem !important;
  }

  .btn-close {
    top: 5px;
    right: -5px;
    font-size: 0.6rem;
  }

  #playerNameInput {
    padding: 0.5rem 0.5rem;
    margin-bottom: 5px;
    margin-top: 5px;
    font-size: 0.8rem;
    max-height: 25px !important;
  }

  #footer {
    padding: 12px 0;
    font-size: 0.6rem;
  }

  .canvas-wrap .ptb-overlay {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 40;
  }

  .canvas-wrap .ptb-overlay .ptb-overlay-card {
    width: calc(100% - 28px) !important;
    max-width: 420px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: none !important;
  }

  .canvas-wrap .ptb-overlay .ptb-overlay-title {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    line-height: 1.1 !important;
  }

  .canvas-wrap .ptb-overlay .ptb-score-label {
    font-size: 0.85rem !important;
    margin-top: 8px !important;
    font-weight: 700 !important;
  }

  .canvas-wrap .ptb-overlay .ptb-score {
    font-size: 1.6rem !important;
    margin-top: 6px !important;
  }

  .canvas-wrap .ptb-overlay .ptb-overlay-btn {
    padding: 10px 14px !important;
    font-size: 1rem !important;
    margin-top: 12px !important;
    border-radius: 8px !important;
  }
}