body {
  font-family: Arial, sans-serif;
  background-color: #fefefe;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: scroll;
  margin: 0;
}

h1 {
  margin-bottom: 0;
}

.how-to-play {
  margin-bottom: 2rem;
  text-align: left;
}

.how-to-play h2 {
  font-size: 18px;
  margin-bottom: 0.5rem;
  text-align: center;
  font-family: Monospace, monospace;
}

.how-to-play ul {
  padding-left: 1.2rem;
  margin: 0;
  column-count: 2;
  column-gap: 2rem;
}

.how-to-play li {
  margin: 0.3rem 0;
  font-size: 16px;
}

.container {
  margin-top: 2rem;
  display: flex;
  gap: 6rem;
  align-items: flex-start;
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--rows, 10), 30px);
  grid-template-rows: repeat(var(--cols, 10), 30px);
  gap: 4px;
  margin-bottom: 1rem;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e3e3e3;
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  user-select: none;
}

.cell:hover {
  background-color: #d0eaff;
}

.cell.selected, .cell.selected.found {
  background-color: #ffcc80;
}

.cell.found {
  background-color: #d6f5d6;
  font-weight: bold;
}


.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#check-btn {
  background-color: #1976d2;
  color: white;
  font-size: 16px;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#check-btn:hover {
  background-color: #145a96;
}

.result-box {
  padding: 0.5rem 1rem;
  min-height: 24px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  display: none; 
}

.result-box.success {
  background-color: #d4edda;
  color: #256029;
  border: 1px solid #c3e6cb;
}

.result-box.error {
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

.word-list {
  margin-top: -1.5rem;
  min-width: 250px;
  font-family: 'Proxima Nova', sans-serif;
  height: 77vh;
  overflow-y: scroll;
}

.word-list h2 {
  display: none;
  margin: 0 0.5rem;
  font-size: 20px;
  text-align: center;
}

.word-list h5 {
  display: none;
  margin: 0.5rem 0 0.5rem;
  font-size: 14px;
  text-align: center;
}

.word-list ul {
  column-count: 3;
  column-gap: 1rem;
  list-style: none;
  padding: 0;
}

.word-list li {
  font-size: 16px;
  padding: 2px 0;
  text-align: center;
  transition: all 0.3s ease;
}

.highlight-temp {
  animation: flash 0.6s ease;
}

@keyframes flash {
  0% { background-color: #c2f0c2; }
  100% { background-color: #d6f5d6; }
}

.hover-highlight {
  background-color: #fff3cd !important;
  transition: background-color 0.3s;
}

.word-list li.found {
  text-decoration: line-through;
  color: #aaa;
  font-style: italic;
}

@keyframes bounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
  60% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

.cell.bounce {
  animation: bounce 0.4s ease;
}