@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #fef6ff, #e4f1ff);
  margin: 0;
  padding: 20px;
  text-align: center;
  color: #333;
}

h1 {
  font-size: 2rem;
  color: #5d1c91;
  margin-bottom: 20px;
}

#grid {
  display: grid;
  grid-template-columns: repeat(20, 30px);
  gap: 4px;
  justify-content: center;
  margin-bottom: 20px;
}

.cell {
  width: 30px;
  height: 30px;
  border: 1px solid #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  user-select: none;
  font-weight: bold;
  font-size: 16px;
  color: #222;
}

.cell:hover {
  background-color: #f0e6ff;
  transform: scale(1.1);
}

.cell.selected {
  background-color: #d0b3ff;
}

.cell.highlighted {
  background-color: #90ee90;
  color: #064406;
}

#wordList {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 20px auto;
  max-width: 90%;
  gap: 10px;
}

#wordList li {
  background-color: #fff;
  border: 2px solid #b18cd9;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  color: #5c379c;
  transition: background 0.3s;
}

#wordList li.found {
  background-color: #d1ffd6;
  color: #186a2c;
  text-decoration: line-through;
}

.controls {
  margin-bottom: 15px;
}

button {
  padding: 10px 20px;
  background-color: #7a48c8;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background-color: #5e30a1;
}

#timer {
  font-size: 1.2rem;
  font-weight: bold;
  color: #1c2959;
  margin-top: 10px;
}

#result {
  margin-top: 20px;
  font-size: 1.3rem;
  color: #234f1e;
  font-weight: bold;
}

#ranking {
  margin-top: 30px;
  text-align: center;
}

#ranking table {
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 1rem;
  color: #333;
  width: 90%;
  max-width: 500px;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#ranking th, #ranking td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}

#ranking th {
  background-color: #7a48c8;
  color: white;
}

#ranking tr:nth-child(even) {
  background-color: #f9f9f9;
}
