body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-width: 100vw;
  width: 100vw;
  height: 100vh;
  font-family: "Impact", sans-serif;
  font-weight: normal;
  overflow: hidden;
  background-color: #d3d8cc;
  /* Make background image fit the screen */
  /* background: url("./assets/background.png") no-repeat center center fixed;
  background-size: cover; */
}

@keyframes rotate-block {
  to {
    transform: rotate(90deg);
  }
}

.animate-rotate {
  animation: rotate-block 0.3s ease-in-out forwards;
}

@keyframes rotate-block-ccw {
  to {
    transform: rotate(-90deg);
  }
}

.animate-rotate-ccw {
  animation: rotate-block-ccw 0.3s ease-in-out forwards;
}

.nav-buttons {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none; /* Allow clicks to pass through the container */
}

.nav-buttons > * {
  pointer-events: auto; /* Re-enable clicks on the buttons themselves */
}

.back-button {
  position: relative; /* Changed from absolute */
  /* background: #522fa3; */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
  flex-shrink: 0; /* Prevent shrinking */
}

.volume-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  background: #4b8d7a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.volume-wrapper:hover {
  /* background: #5f3abc; */
  background: #498b78;
  transform: translateY(-1px);
}

.volume-wrapper:active {
  transform: translateY(0);
}

.volume-wrapper .volume-button {
  width: 42px; /* Much larger icon like Image 1 */
  height: 42px;
  object-fit: contain;
}

.volume-wrapper.muted {
  /* background: #5b31ba; */
  background: #498b78;
}

.volume-wrapper.muted .volume-button {
  opacity: 1;
}

.volume-wrapper.muted::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 20%;
  width: 60%;
  height: 2px;
  background-color: #fff;
  transform: translateY(-50%) rotate(-45deg);
  pointer-events: none;
}

.game-container {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  box-sizing: border-box;
  /* width: 100vw; */
  height: 100vh;
  margin: 0 auto; /* Center the container */
  gap: 6vw;
}

.grid-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.level-display,
.moves-display {
  /* background: rgb(106, 61, 197, 0.8); */
  background: #facc60;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px 2vw;
}

.grid-panel {
  margin-top: 6vh;
  position: relative;
  padding: 16px;
  border-radius: 32px;
}

.grid-panel::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  /* background: rgb(149, 68, 212, 0.5); */
  background: #facc60;
  border-radius: 48px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  z-index: -1;
}

.grid-panel.target {
  background: #facc60;
}

.grid-panel.current {
  background: #facc60;
}

#targetGridContainer {
  display: grid;
  gap: 2vw; /* Smaller gap for the target grid */
}

#currentGridContainer {
  display: grid;
  gap: 4vw; /* Increase gap for the current grid */
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 500;
  user-select: none;
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 500;
  user-select: none;
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

#targetGridContainer .tile.target {
  width: 10vh; /* Smaller size for target tiles */
  height: 10vh;
  font-size: 2.25rem; /* Smaller font size */
  /* background: linear-gradient(to bottom, #e1cfea, #e5dce8, #e1dedc); */
  background: #009bd4;
  color: white; /* #5b5b5b; */
}

#currentGridContainer .tile.target {
  width: 14vh; /* Smaller size for target tiles */
  height: 14vh;
  font-size: 2.65rem; /* Smaller font size */
  /* background: #312cfe;
    color: #ffffff; */
  background: #009bd4;
  color: white; /* #5b5b5b; */
}

.highlight {
  background: #a5ca7b !important;
  color: #5b5b5b !important;
}

.word-clone-logo {
  width: 35vw;
  height: auto;
}

.how-to-play-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-to-play-content-wrapper {
  max-height: 95vh;
  width: 60vw;
  padding: 12px;
  /* background: rgba(126, 70, 200, 0.8); */
  background: none;
  border-radius: 28px;
}

.how-to-play-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* background: #4831a5; */
  background: #facc60;
  padding: 24px;
  border-radius: 32px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.how-to-play-content img {
  width: 36vw;
  border-radius: 32px;
  margin: 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.game-title-text {
  /* color: #fff; */
  color: #5b5b5b;
  margin-top: 24px;
  margin-bottom: 24px;
  font-size: 3.5rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: -3px 4px 6px rgba(0, 0, 0, 0.2);
}

.game-title-text-sm {
  font-size: 2.25rem;
  margin-top: 3px;
  margin-bottom: 3px;
}

.game-subtitle-text {
  /* color: #fff; */
  color: #5b5b5b;
  font-weight: 400;
  font-size: 1.45rem;
  text-align: center;
  margin: 6px;
}

.game-subtitle-text-htp {
  margin: 0 !important;
}

.game-btn {
  min-width: 28vw;
  /* background: #373f89; */
  background: #009bd4;
  /* color: #fff; */
  color: #fcefc9;
  font-size: 2.5rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 42px;
  /* border: 6px solid #5b40b0; */
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  outline: none;
  margin-top: 24px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
}

/* Start of Selection */
.btn-4x4 {
  background: #a5ca7b;
}

.btn-4x4:hover {
  background: #a5ca7b !important;
}

.btn-6x4 {
  background: #e66568;
}

.btn-6x4:hover {
  background: #e66568 !important;
}
/* End of Selection */

.game-btn-sm {
  min-width: auto;
  padding: 10px 5vw;
}

.game-btn-level {
  min-width: auto;
  padding: 10px;
  margin: 4px;
  font-size: 2.5rem;
}

.game-btn-level-modal {
  min-width: auto;
  padding: 10px;
  margin: 4px;
  font-size: 1.75rem;
  /* background: #714cca; */
  background: #009bd4;
  border: 4px solid #009bd4;
  text-transform: uppercase;
  letter-spacing: 110%;
  text-shadow: -3px 4px 6px rgba(0, 0, 0, 0.2);
  color: #fff;
  border-radius: 2.5rem;
  min-width: 15vw;
  margin-top: 0.5rem;
}

.game-btn:hover {
  /* background: #373f89; */
  background: #009bd4;
  color: #fcefc9;
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  /* background-color: #4831a5; */
  background-color: #facc60;
  border: 10px solid #facc60;
  border-radius: 28px;
  padding: 32px 48px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
  max-width: 90vw;
  width: 50vw;
  text-align: center;
}

.modal-title {
  margin: 0 0 16px;
  font-size: 3rem;
  color: #5b5b5b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: -3px 4px 6px rgba(0, 0, 0, 0.2);
}

.modal-subtext {
  margin: 0 0 8px;
  font-size: 1.75rem;
  color: #5b5b5b;
  padding-top: 1rem;
}

.modal-value {
  margin: 0 auto 24px;
  font-size: 3rem;
  color: #fff;
  font-weight: bold;
  background-color: #009bd4;
  border-radius: 1rem;
  width: 150px;
  text-align: center;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.inline-grid {
  touch-action: none;
}

/* ─────────────────────────────────────────
   Media Queries for Responsiveness
   ───────────────────────────────────────── */

/* Tablet Layout */
/* Mobile Layout */
@media screen and (max-width: 1024px) {
  #landingScreen {
    height: 90%;
  }

  #sizeSelectionScreen {
    height: 90%;
  }

  #levelSelectionScreen {
    height: 90%;
  }

  #gameScreen {
    height: 100%;
  }

  .back-button,
  .volume-wrapper {
    width: 42px;
    height: 42px;
  }

  .volume-wrapper .volume-button {
    width: 35px;
    height: 35px;
  }

  .word-clone-logo {
    width: 40vw;
  }

  .game-container {
    margin-top: 0.5rem;
    height: 95%;
    gap: 4vw;
    padding-top: 0;
    overflow: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  .game-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }

  .grid-section {
    margin-top: 0;
    margin-bottom: 2vw;
  }

  .game-btn {
    min-width: 35vw;
    font-size: 1.25rem;
    margin-top: 12px !important;
  }

  .game-btn-sm {
    min-width: auto;
    padding: 10px 5vw;
  }

  .game-title-text {
    font-size: 1.5rem;
    margin: 0.2rem;
  }

  .game-subtitle-text {
    font-size: 0.9rem;
    font-weight: 500;
  }

  .how-to-play-content-wrapper {
    width: 75vw;
  }

  .how-to-play-content {
    height: 100%;
  }

  .how-to-play-content img {
    width: 30vw;
    border-radius: 12px;
  }

  .text-sm-play {
    font-size: 1.5rem !important;
    margin: 0 !important;
  }

  .modal-title {
    margin: 0 0 16px;
    font-size: 2rem;
  }

  .modal-subtext {
    font-size: 1rem;
  }

  .modal-title {
    margin: 0 0 16px;
    font-size: 2rem;
  }

  #levelButtons {
    gap: 6px;
    margin: 0;
  }

  .game-btn-level {
    font-size: 1.5rem;
    padding: 10px 14px;
    min-width: auto;
  }

  .grid-panel {
    margin-top: 8vh;
    border-radius: 12px;
    padding: 9px;
  }

  .grid-panel::before {
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 16px;
  }

  #targetGridContainer {
    gap: 0.9vw; /* Smaller gap for the target grid */
  }

  #currentGridContainer {
    gap: 1.25vw; /* Increase gap for the current grid */
  }

  .tile {
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  }

  #targetGridContainer .tile.target {
    width: 10vh; /* Smaller size for target tiles */
    height: 10vh;
    font-size: 1.65rem; /* Smaller font size */
  }

  #currentGridContainer .tile.target {
    width: 15vh; /* Smaller size for target tiles */
    height: 15vh;
    font-size: 2rem; /* Smaller font size */
  }
}

/* Mobile Fullscreen Prompt */
.mobile-fullscreen-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  margin-top: 0 !important;
}

.mobile-fullscreen-prompt.hidden {
  display: none;
}

.mobile-fullscreen-content {
  /* background: linear-gradient(135deg, #522fa3, #6a3dc5); */
  background: #facc60;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 3px solid #facc60;
}

.mobile-fullscreen-content h3 {
  color: #5b5b5b;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.mobile-fullscreen-content p {
  color: #5b5b5b;
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.mobile-fullscreen-btn {
  display: flex;
  justify-content: center;
}

.mobile-fullscreen-content .game-btn {
  background: #009bd4;
  color: #5b5b5b;
  font-weight: bold;
  border: 2px solid #009bd4;
  text-shadow: none;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
}

.mobile-fullscreen-content .game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
}
