/* Override Reown's @font-face declarations to use our proxy */
@font-face {
  font-family: 'KHTeka';
  src: url('/fonts/KHTeka-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'KHTeka';
  src: url('/fonts/KHTeka-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'KHTeka';
  src: url('/fonts/KHTeka-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Creepster', cursive;
  overflow-x: hidden;
  background: url('./assets/images/startmenu.jpg') no-repeat center/cover;
}
a { text-decoration: none; color: black; }

canvas#canvas1 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
}

.wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100vh;
}

/* Start menu container */
.start-menu {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: url("./assets/images/startmenu.jpg") no-repeat center / cover;
  user-select: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Center vertically */
  gap: 50px; /* space between button row and optional heading if any */
}

/* Button row: three buttons side by side */
.start-menu .button-row {
  display: flex;
  justify-content: center;  /* center horizontally */
  align-items: center;      /* center vertically */
  gap: 30px;                /* space between buttons */
  flex-wrap: wrap;          /* wrap to next line if screen too small */
}

/* 🔥 All buttons unified styling */
.start-menu__btn,
.connect-btn,
.leaderboard-btn,
.set-username-btn {
  position: relative;
  width: 280px;   /* larger width */
  height: 100px;  /* larger height */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: transform 300ms ease;
  z-index: 2;
}

/* Button images fill the button */
.start-menu__btn .start-menu__img,
.connect-btn .start-menu__img,
.leaderboard-btn .start-menu__img,
.set-username-btn .start-menu__img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* ensures image covers entire button */
  border-radius: 12px;
}

/* Button text centered */
.start-menu__btn .start-menu__text,
.connect-btn .start-menu__text,
.leaderboard-btn .start-menu__text,
.set-username-btn .start-menu__text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 34px; /* larger font */
  text-align: center;
  color: black;
  white-space: nowrap;
  pointer-events: none;
}

/* Hover effect for all buttons */
.start-menu__btn:hover,
.connect-btn:hover,
.leaderboard-btn:hover,
.set-username-btn:hover {
  transform: scale(1.1);
}


.hide {
  display: none !important;
  pointer-events: none !important;
}

.leaderboard-wrapper {
  max-width: 900px;
  margin: 50px auto;
  padding: 40px 20px;
  background: transparent;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 1;
  position: relative;
}

.leaderboard-title {
  font-size: 64px;
  margin-bottom: 40px;
  text-shadow: 2px 2px white;
}

.leaderboard-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 900px;
  margin-top: 20px;
  background: transparent;
  border: 2px solid #ffe9ac;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #ffe9ac;
  color: #fff;
}

.leaderboard-table th {
  background: transparent;
  color: #ff9900;
  font-size: 1.5rem;
}

.back-btn {
  width: 220px;
  height: 80px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 300ms ease;
}

.back-btn:hover {
  transform: scale(1.1);
}

.game-over-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  border: 3px solid #ffe9ac;
  border-radius: 10px;
  padding: 40px 60px;
  text-align: center;
  color: #ffe9ac;
  font-family: 'Creepster', cursive;
  z-index: 9999;
}

.game-over-overlay h1 {
  font-size: 50px;
  margin-bottom: 20px;
}

.game-over-overlay p {
  font-size: 25px;
  margin-bottom: 30px;
}

.game-over-buttons button {
  font-family: 'Creepster', cursive;
  font-size: 20px;
  margin: 0 10px;
  padding: 10px 20px;
  background-color: #ff7f50;
  border: 2px solid #ffe9ac;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
}

.game-over-buttons button:hover {
  background-color: #ffa07a;
}

/* Username modal styles */
/* ================== Username Modal ================== */
/* Username modal styles */
.username-modal {
  position: fixed;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  display: flex; 
  justify-content: center; 
  align-items: center;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
}

w3m-modal {
 z-index: 10;
}

.username-modal__content {
  background: #222;
  padding: 50px 60px;
  border-radius: 15px;
  text-align: center;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 0 30px rgba(255, 233, 172, 0.8);
  border: 3px solid #ffe9ac;
}

.username-modal__content h2 {
  font-size: 36px;
  margin-bottom: 25px;
  color: #ffe9ac;
}

.username-modal__content input {
  width: 100%;
  padding: 20px;
  font-size: 26px;
  border-radius: 10px;
  border: 2px solid #ffe9ac;
  text-align: center;
  background: #fff;
  outline: none;
  margin-bottom: 30px;
}

.username-modal__content .modal-buttons button {
  padding: 18px 45px;
  font-size: 24px;
  margin: 0 15px;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid #ffe9ac;
  background-color: #ff7f50;
  color: #fff;
  transition: transform 0.2s, background-color 0.2s;
}

.username-modal__content .modal-buttons button:hover {
  background-color: #ffa07a;
  transform: scale(1.05);
}

/* Responsive: make modal smaller on narrow screens */
@media (max-width: 480px) {
  .username-modal__content {
    padding: 30px 20px;
    width: 95%;
  }
  
  .username-modal__content h2 {
    font-size: 28px;
  }
  
  .username-modal__content input {
    font-size: 20px;
    padding: 15px;
  }

  .username-modal__content .modal-buttons button {
    font-size: 20px;
    padding: 15px 30px;
    margin: 10px 5px;
  }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hide {
  display: none;
}

.modal-content {
  background-color: #222;
  padding: 20px;
  border: 2px solid #ffe9ac;
  border-radius: 10px;
  text-align: center;
  color: #ffe9ac;
  font-family: "Creepster", sans-serif;
}

.modal-buttons {
  margin-top: 10px;
}

.modal-buttons button {
  margin: 0 10px;
  padding: 5px 15px;
  font-size: 16px;
  cursor: pointer;
}

/* Loading spinner */
.loading {
  font-size: 90px;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading.hide {
  display: none !important;
  pointer-events: none !important;
}

.hollowLoader {
  top: 65%;
  width: 60px;
  height: 60px;
  animation: loaderAnim 2s infinite ease-in-out;
  outline: 1px solid transparent;
}

.hollowLoader .largeBox {
  height: 60px;
  width: 60px;
  background: rgba(0, 0, 0, 0.39);
  outline: 1px solid transparent;
  animation: largeBoxAnim 2s alternate infinite ease-in-out;
}

.hollowLoader .smallBox {
  height: 60px;
  width: 60px;
  background-color: black;
  z-index: 1;
  outline: 1px solid transparent;
  animation: smallBoxAnim 2s alternate infinite ease-in-out;
}

@keyframes largeBoxAnim { 0% { transform: scale(1) } 50% { background-color: rgba(0,0,0,.8); transform: scale(.7) } 100% { transform: scale(1) } }
@keyframes smallBoxAnim { 0% { transform: scale(.2) } 50% { background-color: rgba(0,0,0,.8); transform: scale(1) } 100% { transform: scale(.2) } }
@keyframes loaderAnim { 0% { transform: rotate(0deg) } 50% { transform: rotate(145deg) } 100% { transform: rotate(0deg) } }


