/* === Layout and Font === */
#marathi-word-game {
  max-width: 950px;
  margin: 0 auto;
  padding: 10px;
  font-family: 'Noto Sans Devanagari', sans-serif;
  text-align: center;
}

/* Title */
#gameTitle {
  font-size: 26px;
  margin-bottom: 10px;
}

/* TopBar (Timer + Button + Rev Timer) */
#topBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

#topBar > * {
  flex: 1;
  min-width: 80px;
}

#timer, #revTimer {
  font-size: 18px;
  font-weight: bold;
  color: #444;
}

#startBtn {
  padding: 8px 20px;
  background-color: #008cba;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}

#startBtn:hover {
  background-color: #005f6b;
}

/* Game Layout */
#gameContainer {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

#wordList {
  width: 200px;
  text-align: left;
}

#wordList div {
  font-size: 18px;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 4px;
}

#wordList .found {
  background-color: #c8e6c9;
  font-weight: bold;
}

#boardWrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
}

#gridWrapper {
  position: relative;
  width: 100%;
}

/* Grid */
#grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}

#grid div {
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 18px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background-color: #fff;
  transition: background-color 0.3s ease;
}

#grid div.selected {
  background-color: #bbdefb;
}

#grid div.foundCell {
  background-color: #a5d6a7;
  color: #000;
  font-weight: bold;
}

/* Drag Box */
#drag-box {
  position: absolute;
  border: 2px dashed #2196f3;
  background-color: rgba(33, 150, 243, 0.1);
  display: none;
  z-index: 10;
  pointer-events: none;
}

/* Navigation */
#navigationButtons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
}

#navigationButtons button {
  padding: 6px 12px;
  font-size: 14px;
  background-color: #673ab7;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  min-width: 80px;
}

#navigationButtons button:hover {
  background-color: #512da8;
}

/* Popup */
#popup {
  display: none;
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff8e1;
  padding: 20px 30px;
  border: 2px solid #ffa000;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  z-index: 999;
  text-align: center;
}

#popup button {
  margin-top: 10px;
  padding: 6px 12px;
  background-color: #ffa000;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

#popup button:hover {
  background-color: #ff6f00;
}

/* Responsive */
@media screen and (max-width: 768px) {
  #gameContainer {
    flex-direction: column;
    align-items: center;
  }

  #wordList, #boardWrapper {
    width: 100%;
    text-align: center;
  }

  #topBar {
    flex-direction: column;
  }

  #grid div {
    padding: 6px;
    font-size: 16px;
  }
}