/* ============================
   Base Layout
============================ */
body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background: #f7f9fc;
}

h1 {
  text-align: center;
}

.game-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  text-align: center;
}

.score-timer {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 20px;
  font-size: 1.1rem;
  font-weight: bold;
}

/* ============================
   Grid
============================ */
.crossword-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr); /* Desktop */
  gap: 2px;
  justify-content: center;
  margin: 20px auto;
  max-width: 95vw;
}

.crossword-grid .cell {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  border: 1px solid #ddd;
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: background 0.2s, color 0.2s;
}

.crossword-grid .cell.selected {
  background: #007bff;
  color: #fff;
}

.crossword-grid .cell.found {
  background: #28a745;
  color: #fff;
}

/* ============================
   Word List
============================ */
.word-list-container h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #2a2a99;
}

#word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0;
}

#word-list li {
  list-style: none;
  background: #f4f4f4;
  border: 1px solid #ccc;
  padding: 4px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: default;
  user-select: none;
  transition: background 0.3s;
}

#word-list li.found {
  text-decoration: line-through;
  color: #666;
  background: #d4edda;
  border-color: #b2dfb8;
}

/* ============================
   Controls & Feedback
============================ */
.controls {
  margin-top: 15px;
}

.controls button {
  margin: 5px;
  padding: 8px 14px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

#check-btn {
  background: #007bff;
  color: white;
}

#next-btn {
  background: #28a745;
  color: white;
}

#restart-btn {
  background: #ffc107;
  color: black;
}

#feedback {
  margin-top: 10px;
  font-weight: bold;
  min-height: 24px;
}

/* ============================
   Responsive
============================ */
@media (max-width: 768px) {
  .crossword-grid {
    grid-template-columns: repeat(10, 1fr); /* Mobile */
    gap: 1px;
  }

  .crossword-grid .cell {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  #word-list li {
    font-size: 0.85rem;
    padding: 5px 8px;
  }
}