/* Rejilla, lista de palabras, mensajes, overlay de encontradas */
.game-info { text-align: center; margin-bottom: 12px; }
.game-date { font-size: .8rem; color: var(--muted); text-transform: capitalize; }
.game-theme { font-size: 1.5rem; font-weight: 800; }
.game-sub { font-size: .9rem; color: var(--muted); }

.grid-container { display: flex; justify-content: center; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.cell {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: all 0.12s;
}
.cell.selected { background: #F5C842; border-color: #E8B800; transform: scale(0.95); }
.cell.found { background: #6AAA64; color: #fff; border-color: #5a9a54; }
.cell.revealed { background: #B7E4B0; }
.cell.found.revealed { background: #6AAA64; }
.cell.hint-char { animation: pulse-red 1.5s infinite; }
.cell.wrong { background: #ff6b6b; animation: shake 0.3s; }

@keyframes pulse-red {
  0%, 100% { border-color: red; }
  50% { border-color: transparent; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.message {
  min-height: 1.6em;
  margin: 12px 0 8px;
  text-align: center;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
}
.message.ok { color: #2e7d32; }
.message.err { color: #c62828; }

.score-bar { display: flex; justify-content: center; gap: 12px; margin-bottom: 8px; }
.score-box {
  min-width: 84px;
  padding: 8px 10px;
  text-align: center;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
}
.score-num { font-size: 1.4rem; font-weight: 800; }
.score-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.words-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 380px;
  margin: 12px auto;
}
.words-list li {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 600;
}
.words-list li.found { text-decoration: line-through; opacity: .5; }

/* Overlay de fin */
.end-stats { list-style: none; margin: 0 0 12px; display: grid; gap: 4px; }
.end-stats li { display: flex; justify-content: space-between; border-bottom: 1px dashed #e0e0e0; padding: 3px 0; }
.end-ach { margin-bottom: 14px; font-weight: 700; color: #b8860b; }
.end-ach span { display: inline-block; margin: 2px 6px 2px 0; padding: 2px 8px; background: #fff7d6; border-radius: 10px; }

/* Escritorio: rejilla más grande para jugar cómodo */
@media (min-width: 720px) {
  .grid { max-width: 600px; gap: 3px; }
  .cell { font-size: 1.5rem; }
  .words-list { max-width: 600px; }
}

@media (max-width: 480px) {
  .cell { font-size: .95rem; border-width: 1.5px; border-radius: 4px; }
  .words-list { max-width: 95vw; }
  .score-box { min-width: 72px; }
}
