
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: ivory;
  background-image: url('BG_25.png');
  background-size: cover;          /* Scales image to fill screen */
  background-position: center;    /* Centers the image */
  background-repeat: no-repeat;   
  /* background-attachment: scroll; */

  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
  overflow-y: scroll;
}

/* Menu Bar Styling */
#menuBar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(30, 30, 30, 0.9);
  color: white;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 0;
  z-index: 1000;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Button Styling */
.menuBtn {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: background 0.3s ease;
}

.menuBtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}


#gameContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
}


.flash-error {
  animation: flashRed 0.2s ease-in-out;
}

@keyframes flashRed {
  0%   { background-color: ivory; }   /* or your default bg */
  50%  { background-color: #ff4d4d; } /* bright red flash */
  100% { background-color: ivory; }
}

.stats-overlay {
  display: flex; /* default when not hidden */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.stats-overlay:not(.hidden) {
  display: flex;
}


.stats-box {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.stats-box h2 {
  font-size: 1.8em;
  margin-bottom: 20px;
  color: goldenrod;
}

.stats-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stats-box li {
  margin: 10px 0;
  font-size: 1.1em;
  font-weight: bold;
}

.stats-message {
  margin-top: 1rem;
  font-weight: bold;
  color: goldenrod;
}

.close-stats-btn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #444;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.close-stats-btn:hover {
  background-color: #1976d2;
}



.score-message {
  font-weight: bold;
  font-size: 1.2rem;
  margin-top: 1rem;
}

.star-display {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

.share-btn {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}


#confettiContainer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 2000;
}


.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f2c94c;
  animation-name: fall;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
  border-radius: 50%;
}


@keyframes fall {
  to {
    transform: translateY(100vh) translateX(var(--drift)) rotate(720deg);
    opacity: 0;
  }
}



@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


.overlay h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: gold;
}

.overlay p {
  margin: 10px 0;
}

.overlay button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 1em;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.overlay button:hover {
  background-color: #1976d2;
}

.help-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* 👈 This moves it to the top */
  padding-top: 2rem; /* Optional: adds spacing from the top */
  z-index: 9999;
}


.help-box {
  background: #fff;
  color: #333;
  max-width: 700px;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
  overflow-y: auto;
  max-height: 90vh;
}

.help-box h2, .help-box h3 {
  margin-top: 1rem;
}

.help-box ul {
  padding-left: 1.2rem;
}

.help-box li {
  margin-bottom: 0.5rem;
}

.highlight {
  background: #fff3cd;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: bold;
}

.close-help-btn {
  margin-top: 2rem;
  padding: 0.5rem 1rem;
  font-weight: bold;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

.hidden {
  display: none;
}

#foundWordsContainer {
  width: 320px;
  height: 280px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  display: block;
  visibility: visible;
  padding: 10px;
  overflow-y: auto;
  box-sizing: border-box;
  text-align: center;
  margin-top: 20px;
  font-family: sans-serif;
  backdrop-filter: blur(4px);
}
 

#foundWordsList {
  margin: 0;
  padding: 0;
  list-style: none;
}

#foundWordsContainer p {
  margin-top: 10px;
  font-weight: bold;
  text-align: center;
}

.found-title {
  font-size: 1.4em;
  font-weight: bold;
  color: #2c3e50; /* or darkgreen if preferred */
  text-align: center;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}


#foundWordsList li {
  font-weight: bold;
  color: forestgreen;
  margin: 5px 0;
}

#gamnum {
  font-size: 1.4em;
  margin-bottom: 2px;
  text-align: center;
}


#clue {
  font-size: 1.4em;
  margin-bottom: 2px;
  text-align: center;
  
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 60px);
  grid-template-rows: repeat(5, 60px);
  gap: 5px;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Soft shadow */
  border: 2px solid #ccc; /*  Light grey border */
  padding: 10px;
  background-color: #2196F3;
  border-radius: 8px;
}



.tile {
  font-size: 1.4em;
  font-weight: bold;
  background-color: orange;
  color: white;
  border: 2px solid #ccc;
  border-radius: 4px; /* Rounded corners */
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Soft shadow */
}

.tile.correct,
.tile.incorrect,
.tile.selected {
  border-radius: 4px;
}


.tile:hover {
  background-color: #ffb74d; /* slightly lighter orange */
}


/* Selected tile */
.tile.selected {
  background-color: green;
}

.tile.correct {
  background-color: gray;
  color: white;
  font-weight: bold;
}


/* Incorrect tile */
.tile.incorrect {
  background-color: orange;
}



.controls {
  margin-top: 1.5em;
  display: flex;
  justify-content: center;
  gap: 10px;
}




.game-button {
  padding: 10px 20px;
  font-size: 1em;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin: 5px 5px 5px 5px;
}

.game-button:disabled {
  background-color: #90caf9;
  cursor: not-allowed;
}

.game-button:hover:not(:disabled) {
  background-color: #1976d2;
}


#submit {
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 5px;
  transition: background-color 0.3s;
}

#submit:disabled {
  background-color: #90caf9;
  cursor: not-allowed;
}



#clearBtn {
 
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 5px;
  margin: 5px 5px 5px 5px;
  opacity: 0.6;
}

#clearBtn.enabled {
  opacity: 1;
  cursor: pointer;
}


button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


.found {
  color: green;
  font-weight: bold;
}

.unfound {
  color: red;
  font-weight: bold;
  text-decoration: line-through;
  opacity: 0.8;
}




.score-counter {
  padding: 10px;
  font-size: 1.2em;
  text-align: center;
  border-radius: 5px;
  color: white;
  font-weight: bold;
}

.score-25-20 {
  background-color: #2196f3; /* Light Blue */
}

.score-19-11 {
  background-color: #ff9800; /* Mid Orange */
}

.score-10-6 {
  background-color: #f57c00; /* Dark Orange */
}

.score-5-1 {
  background-color: #d32f2f; /* Red */
}

.score-0 {
  background-color: #616161; /* Grey for Game Over */
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.3s ease;
}



@media (max-width: 600px) {
  body {
    padding-top: 40px;

  }

#foundWordsContainer {
  width: 90%;
  height: 220px;
  padding: 8px;
}

  h1 {
    font-size: 1.5em;
    text-align: center;
  }

  .grid {
    grid-template-columns: repeat(5, 44px);
    grid-template-rows: repeat(5, 44px);
    gap: 4px;
    padding: 8px;
  }

  .tile {
    width: 44px;
    height: 44px;
    font-size: 1.1em;
  }

  .controls {
    flex-direction: column;
    gap: 8px;
    margin-top: 1em;
  }

  .game-button,
  #submit,
  #clearBtn {
    width: 100%;
    max-width: 240px;
    font-size: 1em;
    padding: 12px;
  }



  #score-counter {
    font-size: 1em;
    padding: 8px;
  }

  #foundWordsContainer h3 {
    font-size: 1.2em;
  }

  #foundWordsList li {
    font-size: 1em;
  }
}

#yesterdayModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#yesterdayModal .modal-box {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

#yesterdayWords div {
  font-weight: bold;
  margin: 6px 0;
  font-size: 1.1em;
  color: #2c3e50;
}