* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  flex-direction: column;
  background: #0c0d14 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow: auto !important;
  padding: 0 !important;
  font-family: "Baloo 2", cursive !important;
  color: #fff;
  user-select: none !important;
}
header {
  background: linear-gradient(90deg, #ff00ff, #00ffff);
  text-align: center;
  padding: 30px 20px;
  margin-top: 100px;
}
header h1 {
  margin: 0;
  font-size: 2.5rem;
  text-shadow: 0 0 10px #ff00ff, 0 0 10px #00ffff;
}
main {
  max-width: 900px;
  margin: 90px auto;
  padding: 20px;
  line-height: 1.6;
}
main h2 {
  color: #ff00ff;
  margin-top: 30px;
}
main a {
  color: #00ffff;
  text-decoration: none;
}
main a:hover {
  text-decoration: underline;
}
#gameContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 50px;
  width: 100%;
}
canvas {
  background: #0c0d14;
  border: 3px solid #00fff0;
  border-radius: 12px;
  box-shadow: 0 0 5px #00fff0;
  max-width: 95vw;
  height: auto;
}
.fullscreen-canvas {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999;
  background: #0c0d14;
  border: none !important;
  box-shadow: none !important;
}
html:fullscreen,
html:-webkit-full-screen,
html:-moz-full-screen,
html:-ms-fullscreen,
html.fullscreen-active {
  overflow: hidden !important;
  width: 100% !important;
  height: 100% !important;
  position: fixed !important;
}
body:fullscreen,
body:-webkit-full-screen,
body:-moz-full-screen,
body:-ms-fullscreen,
body.fullscreen-active {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
  top: 0 !important;
  left: 0 !important;
}
#canvasControls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}
#canvasControls button {
  background: transparent;
  border: none;
  color: white;
  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;
  color: #0ff;
}
#leaderboard {
  font-family: "Baloo 2", cursive;
  color: white;
  text-align: center;
  margin-top: 2rem;
  max-width: 1000px;
  width: 90%;
}
#leaderboard h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  letter-spacing: 1px;
}
#leaderboard h3 i {
  margin-right: 8px;
}
#leaderboardList {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
#leaderboardList div {
  background: transparent;
  border: 2px solid #00fff0;
  border-radius: 10px;
  padding: 10px 15px;
  min-width: 180px;
  text-align: center;
}
.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 255, 240, 0.05);
  border: 2px solid #00fff0;
  border-radius: 10px;
  padding: 8px 16px;
  min-width: 180px;
  max-width: 240px;
  color: #fff;
  font-size: 1rem;
  text-align: center;
}
.rank {
  color: #48e200;
  margin-right: 5px;
}
.player-name {
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.score {
  color: #00fff0;
  margin-left: 5px;
}
.leaderboard-entry:nth-child(1) .rank {
  color: gold;
}
.leaderboard-entry:nth-child(2) .rank {
  color: #C0C0C0;
}
.leaderboard-entry:nth-child(3) .rank {
  color: #cd7f32;
}
.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;
}
.modal-content {
  background: radial-gradient(circle at top, #0e0f16, #05060a);
  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 {
  padding: 1rem 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: 1.25rem !important;
  color: #ccc;
}
.modal-body button {
  background: transparent;
  border: 2px solid #00ccc0 !important;
  color: #ffffff !important;
  text-align: center !important;
  justify-content: center !important;
  letter-spacing: 0.5px;
  padding: 0.2rem 1.5rem !important;
  border-radius: 9999px;
}
.btn-close {
  position: absolute;
  top: 10px;
  left: 15px;
  color: #fff;
  opacity: 1;
  z-index: 10;
  pointer-events: auto;
}
.btn-close:hover {
  color: #00fff0;
  transform: scale(1.1);
  transition: all 0.2s ease;
}
#playerNameInput {
  background: #000;
  color: #0ff;
  border: 1px solid #0ff;
  border-radius: 8px;
  text-align: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  outline: none;
}
#playerNameInput::placeholder {
  color: #555;
}
#playerNameInput:focus {
  box-shadow: 0 0 10px #0ff;
}
#nameConfirmBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#navLogo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #0c0d14 !important;
  color: #fff;
  padding: 10px 20px;
  font-family: "Baloo 2", cursive;
  font-size: 20px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
#logo {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
#footer {
  text-align: center;
  padding: 12px 0;
  background: transparent !important;
  color: #fff;
  font-size: 1rem;
  position: relative;
  bottom: 0;
  width: 100%;
  z-index: 999;
}
#footer a {
  color: #00fff0;
  text-decoration: none;
}
@media (max-width: 992px) {
  header {
    padding: 25px 15px;
  }  
  header h1 {
    font-size: 2.2rem;
  }  
  main {
    margin: 30px auto;
    padding: 15px;
  }
  #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;
  }
}
@media (max-width: 768px) {
  header {
    padding: 20px 10px;
  }
  header h1 {
    font-size: 2rem;
  }
  main {
    margin: 20px auto;
    padding: 10px;
  }
  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;
    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: 0.5rem 1.2rem !important;
    margin-top: 0.1rem !important;
  }
  #footer {
    padding: 12px 0;
    font-size: 0.8rem;
  }
}
@media (max-width: 576px) {
  body {
    padding: 1rem;
  }
  canvas {
    border-width: 2px;
  }
  header {
    padding: 15px 5px;
  }
  header h1 {
    font-size: 1.6rem;
  }
  main {
    margin: 15px auto;
    padding: 8px;
  }
  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 10px;
    min-width: 100px;
    max-width: 180px;
    font-size: 0.3rem;
  }
  #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: 0.5rem;
  }
  .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: 0.5rem !important;
  }
  .modal-body button {
    font-size: 0.8rem !important;
    margin-top: 0.3rem !important;
    padding: 0.2rem 0.8rem !important;
  }
  .modal-body i {
    font-size: 0.8rem !important;
  }
  .btn-close{
    top: 10px;
    right: -10px;
    font-size: 0.8rem;
  }
  #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;
  }
}
