body { gap: 16px; }

/* scoreboard chips */
#score {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* difficulty button group (always visible) */
#difficulty {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.diff-btn {
  padding: 8px 18px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
.diff-btn:hover { opacity: 1; background: var(--surface-3); }
.diff-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}
#difficulty[hidden] { display: none; }

/* ---- the letter grid ---- */
#grid {
  display: grid;
  gap: 3px;
  background: var(--surface-2);
  padding: 10px;
  border-radius: 14px;
  box-shadow: 0 10px 40px var(--shadow);
  touch-action: none;            /* let us own drag gestures on touch */
  user-select: none;
  -webkit-user-select: none;
}
.gcell {
  /* --cell is set inline from game.js so the board scales with grid size */
  width: var(--cell, 38px);
  height: var(--cell, 38px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: calc(var(--cell, 38px) * 0.5);
  text-transform: uppercase;
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, transform 0.1s;
}
/* live drag highlight */
.gcell.sel {
  background: var(--accent);
  color: var(--accent-text);
  transform: scale(1.04);
}
/* permanently found cells */
.gcell.found {
  background: var(--green);
  color: #fff;
}
/* a found cell that also lies under the current drag */
.gcell.found.sel {
  background: var(--accent);
  color: var(--accent-text);
}

/* ---- the words list ---- */
#words {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  max-width: min(560px, 92vw);
  padding: 0;
}
#words li {
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--text);
  transition: color 0.2s, opacity 0.2s;
}
#words li.done {
  text-decoration: line-through;
  text-decoration-color: var(--green);
  text-decoration-thickness: 2px;
  color: var(--muted);
  opacity: 0.7;
}

#grid.won { box-shadow: 0 0 0 3px var(--green), 0 10px 40px var(--shadow); }
