/* ======================================================
   FALLTEM — Completa Palabra
   Estilos específicos del juego
   Depende de: falltem-tokens.css
====================================================== */

/* ===== Layout global ===== */
.wrap {
  max-width: 860px;
  margin: 2.5rem auto;
  background: var(--card);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 18px 55px rgba(15,23,42,0.12);
}

.skip {
  position: absolute;
  top: -40px;
  left: 10px;
}
.skip:focus {
  top: 10px;
  background: #fff;
  padding: .5rem 1rem;
  border-radius: 8px;
  z-index: 200;
}

/* ===== Header ===== */
.header {
  max-width: 760px;
  margin: 0 auto var(--space);
}
.header-label {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--label-brand);
}
.header h1 {
  margin: .3rem 0 .5rem;
  font-size: clamp(2.1rem, 2.1vw + 1.3rem, 2.7rem);
  font-weight: 900;
}
.intro {
  max-width: 40rem;
  color: var(--muted);
}

/* ===== Controles ===== */
.controles {
  max-width: 480px;
  margin: 1.6rem auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.control {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.control label {
  font-weight: 900;
}
.control--actions {
  grid-column: 1 / -1;
}

/* Selects */
select {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: .8rem 1rem;
  border-radius: .8rem;
  font-size: 1.05rem;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='currentColor' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.5 7l4.5 5 4.5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.4rem;
}

/* ===== Zona del juego ===== */
.juego {
  display: grid;
  gap: 1.6rem;
  margin-top: 1rem;
}

/* Tarjeta */
.tarjeta {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: var(--space);
  box-shadow: 0 2px 10px rgba(15,23,42,0.08);
}

/* Pista */
.pista {
  background: rgba(95,203,224,.14);
  border: 1px solid rgba(95,203,224,.45);
  color: #05323a;
  padding: .7rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-weight: 700;
}

/* Hueco de la palabra */
.hueco {
  font-size: clamp(1.6rem, 1.4vw + 1rem, 2rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  margin-bottom: 1rem;
}

/* ===== Opciones ===== */
.opciones {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  .opciones { grid-template-columns: 1fr 1fr; }
}

.opciones button {
  width: 100%;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  justify-content: center;

  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 18px;

  font-size: clamp(1.1rem, .6vw + 1rem, 1.3rem);
  font-weight: 800;

  box-shadow: 0 3px 8px rgba(15,23,42,.08);
  cursor: pointer;
  transition: transform .12s ease, border-color .15s, box-shadow .15s;
}

.opciones button:hover,
.opciones button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--focus);
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Estado correcto */
.opciones button.correcta.marcada {
  background: #e8f5e9;
  border-color: var(--ok);
  box-shadow: 0 0 0 3px rgba(34,197,94,.35);
  color: var(--ok);
}

/* Estado incorrecto */
.opciones button.incorrecta.marcada {
  background: #ffebee;
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(249,115,115,.35);
  color: var(--bad);
}

/* ===== Acciones ===== */
.acciones {
  margin-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem;
}

.acciones button,
.acciones a {
  width: clamp(160px, 42%, 260px);
}

/* ===== Botones ===== */
.btn {
  border: none;
  border-radius: 16px;
  font-weight: 800;
  padding: .9rem 1.2rem;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn.principal {
  background: var(--accent);
  color: white;
}

.btn.secundario {
  background: var(--accent-2);
  color: #05323a;
}

.btn.info {
  background: #ffe48a;
  border: 2px solid #ffd769;
  color: #5b4600;
  font-weight: 800;
  border-radius: 16px;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.btn.info:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* ===== HUD ===== */
.estado {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}

/* ===== FAB ===== */
.fab-stack {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: .6rem;
  z-index: 40;
}
.fab {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: #111827;
  font-weight: 900;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15,23,42,.18);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  display: none;
  padding: 1rem;
  justify-content: center;
  align-items: center;
  z-index: 50;
}
.modal[aria-hidden="false"] { display: flex; }

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 20px 40px rgba(15,23,42,.32);
  position: relative;
}

.modal-title {
  font-weight: 900;
  margin-bottom: 1rem;
}

.modal-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1rem;
}

.modal-tab {
  flex: 1;
  padding: .6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.modal-tab[aria-selected="true"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.modal-panel {
  margin-bottom: 1.4rem;
}

.btn-x {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
}
/* Centrado del botón de pista */
.btn-pista-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

#btnPista {
  margin: 0 auto;
}
/* Estilo final del juego */
.final-card {
  text-align: center;
  padding: 1.2rem;
}

.final-card p {
  margin-bottom: .8rem;
  font-size: 1.15rem;
}

.final-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.final-actions .btn {
  min-width: 160px;
}


/* ===== ajustes ? ===== */
.refs {
  margin-left: 1.2rem;
}

.refs li {
  margin-bottom: .4rem;
}

.modal-panel h3 {
  margin-top: 1rem;
  font-weight: 800;
}


/* ===== Footer ===== */
.mini-credit {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
