/* =====================================================================
   Deletrea la palabra (se apoya en estilos.css, base.css y previa.css)
   Color del juego: naranja barro (texto blanco encima: 6.8:1).
   ===================================================================== */
.previa.deletrea { --color-juego: #9C3D0A; }

/* ---------- Pantalla previa: categorías con ícono ---------- */
.categorias { display: block; }
.lista-categorias { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.nivel.categoria span { flex-direction: row; align-items: center; gap: .6rem; }
.nivel.categoria img { width: 34px; height: 34px; flex: none; }
.nivel.categoria strong { font-size: 1.05rem; line-height: 1.2; }
.nivel input:disabled + span { opacity: .55; cursor: not-allowed; }
.creditos { text-align: center; font-size: .9rem; color: var(--tinta-2); padding: 0 1rem 2rem; }
.creditos a { color: inherit; }

/* Resultado: lista de palabras deletreadas */
.palabras-final { list-style: none; margin: 1.25rem auto 0; padding: 0; max-width: 520px; display: grid; gap: .5rem; text-align: left; }
.palabras-final li { display: flex; align-items: center; gap: .75rem; padding: .45rem .8rem; border: 3px solid var(--borde);
  border-radius: 12px; background: var(--cielo); }
.palabras-final img { width: 32px; height: 32px; flex: none; }
.palabras-final strong { font-size: 1.15rem; letter-spacing: .06em; }
.palabras-final span { margin-left: auto; font-weight: 700; color: var(--tinta-2); }

/* ---------- Durante el juego ---------- */
#hud .chip { background: #1E2B45; }
#hud .boton-chip { background: #3A4350; }
.barra-superior { position: absolute; top: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0 12px; }

/* Tablero: ícono + fichas de la palabra */
.tablero { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-radius: 20px;
  background: rgba(16, 20, 24, .9); border: 3px solid #fff; box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.icono-palabra { width: 84px; height: 84px; flex: none; background: #fff; border-radius: 16px; padding: 8px; }
.fichas { --tam: clamp(34px, calc((100vw - 220px) / var(--n, 6) - 8px), 64px); display: flex; gap: 8px; flex-wrap: nowrap; }
.ficha { position: relative; display: grid; place-items: center; width: var(--tam); height: calc(var(--tam) * 1.15);
  border-radius: 12px; border: 3px solid #8A94A3; background: #2A313B; color: #C9D1DB;
  font: 800 calc(var(--tam) * .6) "Atkinson Hyperlegible", system-ui, sans-serif; }
.ficha.actual { background: #FFD43B; border-color: #fff; color: #14213D; transform: translateY(-4px);
  box-shadow: 0 0 0 4px rgba(255, 212, 59, .45); }
.ficha.hecha { background: #12805C; border-color: #fff; color: #fff; }
.ficha.hecha::after { content: "✓"; position: absolute; top: -10px; right: -10px; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: #fff; color: #0E6E5A; font-size: 15px; border: 2px solid #0E6E5A; }
.ficha.hecha[data-saltada="1"] { background: #4B5563; }
.ficha.hecha[data-saltada="1"]::after { content: "–"; color: #4B5563; border-color: #4B5563; }
.tablero.completa { border-color: #7CFFB2; }

/* Letra que sigue (a la izquierda, con la imagen de su seña) */
.sigue { position: absolute; top: 200px; left: 12px; width: 190px; padding: 10px 12px 12px; text-align: center; border-radius: 16px;
  background: var(--panel); border: 3px solid #FFD43B; color: #fff; }
.sigue .indicacion { display: block; font-size: 15px; font-weight: 700; }
.sigue strong { display: block; font-size: 72px; line-height: 1; color: #FFD43B; }
.sigue.acerto strong { color: #7CFFB2; }
.sena-sigue:empty { display: none; }
.sena-sigue img { display: block; width: 100%; max-height: 150px; object-fit: contain; background: #fff; border-radius: 10px; margin-top: 6px; }
.sigue.sin-sena .sena-sigue { display: none; }
.tipo-letra { display: block; font-size: 14px; margin-top: 6px; opacity: .95; }
.tipo-letra:empty { display: none; }
.barrita { height: 10px; margin-top: 8px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.barrita div { height: 100%; width: 0; background: #7CFFB2; }

.estado-mano { position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 8px 14px; border-radius: 12px; font-weight: 700; font-size: 17px;
  background: #1E2B45; color: #fff; }
.estado-mano.falta { background: #FFD43B; color: #14213D; }
.botones-hud { position: absolute; bottom: 12px; right: 12px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
#depuracion { background: rgba(0,0,0,.75); font-family: ui-monospace, monospace; font-size: 15px; }
.boton-chip { min-height: 44px; font-size: 17px; }
.boton-chip:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px #FFD43B; }
.anuncio { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); margin: 0; max-width: 90vw; padding: 16px 28px;
  border-radius: 20px; border: 4px solid #fff; font-size: clamp(26px, 4.5vw, 48px); font-weight: 800; text-align: center; color: #fff;
  background: #12805C; box-shadow: 0 10px 40px rgba(0,0,0,.5); }

@media (max-width: 700px) {
  .tablero { top: 112px; left: 12px; right: 12px; transform: none; max-width: none; justify-content: center; gap: 10px; padding: 8px 10px; }
  .icono-palabra { width: 52px; height: 52px; padding: 5px; }
  /* En celular las palabras largas se acomodan en dos renglones para que las fichas no queden diminutas */
  .fichas { --tam: clamp(34px, calc((100vw - 110px) / var(--n, 6) - 6px), 48px); gap: 6px 5px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 110px); }
  .estado-mano { bottom: 66px; font-size: 15px; }
  .ficha { border-width: 2px; border-radius: 8px; }
  .ficha.hecha::after { width: 18px; height: 18px; font-size: 12px; top: -8px; right: -8px; }
  .sigue { top: auto; bottom: 112px; width: 130px; }
  .sigue strong { font-size: 52px; }
  .sena-sigue img { max-height: 100px; }
}
