/* Juego de formar palabras arrastrando letras (ver assets/js/juego-palabras.js) */
.instrucciones { text-align: center; color: var(--suave); }

.fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 16px;
  background: #fff;
  border: 3px solid var(--borde);
  border-radius: 20px;
}
.fila.completa { border-color: var(--acento); background: #ecf8f1; }

.palabra { flex: 1 1 360px; min-width: 0; }
.fichas, .huecos {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 1vw, 8px);
}
.fichas { margin-bottom: 14px; }

/* Las casillas encogen si la palabra es larga, para que quepan en una línea */
.ficha, .hueco {
  flex: 0 1 50px;
  min-width: 0;
  height: clamp(40px, 10vw, 58px);
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: clamp(1.1rem, 4vw, 1.9rem);
  font-weight: bold;
}
.ficha {
  background: var(--acento);
  color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .2);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.ficha.usada { visibility: hidden; }
.ficha.fantasma {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  cursor: grabbing;
  transform: scale(1.12);
}
.ficha.volviendo { transition: left .25s, top .25s, transform .25s; transform: none; }

.hueco { background: #fff; border: 3px dashed var(--suave); }
.hueco.lleno { border-style: solid; border-color: var(--acento); color: var(--acento); }
.hueco.error { border-color: #d9443b; background: #fde2df; animation: temblar .35s; }

.ok { text-align: center; margin: 12px 0 0; font-weight: bold; color: var(--acento); }

.imagen {
  flex: 0 0 240px;
  height: 170px;
  margin: 0 auto;
  display: grid;
  gap: 3px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--borde);
}
.imagen.varias { grid-template: repeat(2, 1fr) / repeat(3, 1fr); }
.imagen img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
}

.creditos { text-align: center; color: var(--suave); font-size: .8rem; margin-top: 32px; }

.final { text-align: center; font-size: 1.4rem; }

@keyframes temblar {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
