/* GENERAL STYLING */
body {
  font-family: sans-serif;
  background: #1e1e1e;
  color: #f0f0f0;
  text-align: center;
  margin: 0;
  padding: 20px;
}

header.navbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

header.navbar .back-link {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  position: absolute;
  left: 20px;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

/* SETTINGS PANEL */
.settings-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin: 0 auto 30px;
  padding: 20px;
  max-width: 400px;
  background: #2a2a2a;
  border-radius: 12px;
  border: 1px solid #444;
  text-align: left;
}

.settings-panel label {
  font-size: 1rem;
  margin-bottom: 4px;
}

.settings-panel input,
.settings-panel select {
  font-size: 1rem;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: #3a3a3a;
  color: #fff;
}

.settings-panel button {
  font-size: 1rem;
  padding: 10px;
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.settings-panel button:hover {
  background: #45a049;
}

.flex {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* GRID LAYOUT */
#gridContainer {
  flex-grow: 1;
  display: block;
  justify-content: center;
  overflow-x: auto;
  min-width: 0;
}

#grid {
  display: grid;
  gap: 2px;
  width: max-content;
}

.cell {
  background: #2d2d2d;
  border: 1px solid #444;
  padding: 10px;
  font-size: 1.2em;
  user-select: none;
  touch-action: none;
  color: #eee;
}

/* WORD LIST PANELS */
#gameWrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  margin-top: 20px;
  padding: 0 10px;
  flex-wrap: nowrap;
}

.side-list {
  min-width: 140px;
  max-width: 220px;
  flex: 0 0 160px;
  text-align: center;
  word-break: break-word;
}

.side-list h3 {
  text-align: center;
}

#wordListToFind,
#wordListFound {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* STATE CLASSES */
.highlight {
  background: #66bb6a;
  color: #fff;
}

.hinted {
  background: #ffa726 !important;
  color: #fff;
}

.found {
  position: relative;
  color: #999;
  text-decoration: none;
  display: inline-block;
  transition: color 0.3s ease;
}

.found::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 50%;
  height: 2px;
  width: 100%;
  background: #66bb6a;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.found.animated::after {
  transform: scaleX(1);
}

.found-cell {
  background: #1976d2;
  color: #fff;
}

.found-cell.animated {
  animation: foundFlash 0.5s ease;
}

@keyframes foundFlash {
  0% { background-color: #1976d2; }
  50% { background-color: #42a5f5; }
  100% { background-color: #1976d2; }
}

.word-entry {
  display: block;
  margin-bottom: 5px;
  transition: text-decoration 0.3s ease, color 0.3s ease;
}

.word-entry.found {
  color: #999;
  text-decoration: line-through;
}

/* BUTTONS */
button {
  margin: 10px 5px;
  padding: 10px 20px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background: #555;
}

#advancedSettings {
  display: grid;
  gap: 10px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

#advancedSettings.show {
  max-height: 200px;
  opacity: 1;
}

