/* =========================================================
   RatoLibre — Stop (estilos propios del juego)
   ========================================================= */

.stop-area {
  padding: 12px;
}

.stop-titulo {
  margin: 0 0 12px;
  font-size: 1.3rem;
  text-align: center;
}

/* ---------- Paneles ---------- */

.stop-panel {
  margin: 0 0 16px;
  padding: 18px 16px;
  border: 2px solid var(--accent-2);
  border-radius: var(--radius);
  background: var(--accent-2-soft);
  text-align: center;
  animation: stop-entrar 0.35s ease-out;
}

.stop-panel[hidden],
.stop-ajustes[hidden],
.stop-partida[hidden],
.stop-sacar[hidden],
.stop-hoja[hidden],
.stop-resultado[hidden],
.stop-totales[hidden] {
  display: none;
}

.stop-panel:focus,
.stop-ajustes:focus,
.stop-resultado:focus {
  outline: none;
}

.stop-panel .titulo {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--accent-2);
}

.stop-panel p {
  margin: 0 0 0.6rem;
}

.stop-panel .botones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.stop-panel .botones .btn {
  flex: 1 1 200px;
  max-width: 320px;
  padding-left: 1rem;
  padding-right: 1rem;
}

.stop-confirmar,
.stop-incompleto {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.stop-confirmar .titulo,
.stop-incompleto .titulo {
  color: var(--accent-dark);
}

/* ---------- Ajustes de la partida ---------- */

.stop-ajustes {
  max-width: 760px;
  margin: 0 auto;
}

.stop-grupo {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.stop-grupo legend {
  margin: 0 0 8px;
  padding: 0;
  font-weight: 800;
}

.stop-pastillas,
.stop-casillas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stop-tiempos {
  display: grid;
  gap: 10px;
}

.stop-pastilla,
.stop-casilla,
.stop-opcion {
  position: relative;
  display: flex;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stop-pastilla {
  flex: 1 1 0;
  min-width: 72px;
}

.stop-casilla {
  flex: 1 1 200px;
}

/* El círculo o la casilla de verdad queda escondido; se ve la etiqueta grande. */
.stop-pastilla input,
.stop-casilla input,
.stop-opcion input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.stop-pastilla span,
.stop-casilla span,
.stop-opcion > span {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 700;
  line-height: 1.3;
}

.stop-pastilla span {
  justify-content: center;
  text-align: center;
}

/* Marca a la izquierda: círculo (una opción) o casilla (varias). */
.stop-casilla span::before,
.stop-opcion > span::before {
  content: "";
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-right: 12px;
  border: 2px solid var(--muted);
  border-radius: 6px;
  background: var(--surface) no-repeat center / 18px 18px;
}

.stop-opcion > span::before {
  border-radius: 50%;
  align-self: flex-start;
  margin-top: 2px;
}

.stop-opcion > span {
  display: block;
  position: relative;
  padding-left: 52px;
  font-weight: 400;
}

.stop-opcion > span::before {
  position: absolute;
  left: 14px;
  top: 12px;
  margin: 0;
}

.stop-opcion strong {
  display: block;
  font-weight: 800;
}

.stop-pastilla input:checked + span,
.stop-casilla input:checked + span,
.stop-opcion input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.stop-casilla input:checked + span::before {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 10.5l4 4 8-9'/%3E%3C/svg%3E");
}

.stop-opcion input:checked + span::before {
  border-color: var(--accent);
  background-image: radial-gradient(circle, var(--accent) 0 6px, transparent 7px);
  background-size: auto;
}

.stop-pastilla:hover span,
.stop-casilla:hover span,
.stop-opcion:hover > span {
  border-color: var(--accent);
}

.stop-pastilla input:focus-visible + span,
.stop-casilla input:focus-visible + span,
.stop-opcion input:focus-visible + span {
  outline: var(--focus);
  outline-offset: 3px;
}

.stop-aviso {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.stop-aviso[hidden] {
  display: none;
}

/* ---------- Barra de la ronda: letra, ronda y reloj ---------- */

.stop-barra {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -12px -12px 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  box-shadow: 0 4px 10px rgba(31, 42, 55, 0.06);
}

.stop-barra[hidden] {
  display: none;
}

.stop-letra {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
}

.stop-letra.es-vacia {
  background: var(--bg);
  border: 2px dashed var(--border);
  color: var(--muted);
}

.stop-letra.es-sorteo {
  background: var(--text);
  border: 0;
  color: #ffffff;
}

.stop-letra.es-nueva {
  animation: stop-letra 0.6s ease-out;
}

.stop-barra-texto p {
  margin: 0;
}

.stop-ronda {
  font-weight: 800;
}

.stop-reloj {
  color: var(--muted);
  font-weight: 700;
}

.stop-reloj[hidden] {
  display: none;
}

.stop-reloj strong {
  color: var(--text);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.stop-reloj.es-urgente strong {
  color: var(--accent);
}

/* ---------- Sacar la letra ---------- */

.stop-sacar {
  padding: 8px 0 4px;
  text-align: center;
}

.stop-sacar-texto {
  max-width: 34rem;
  margin: 0 auto 14px;
}

.stop-sacar .btn {
  width: 100%;
  max-width: 360px;
}

/* ---------- La hoja: un campo por categoría ---------- */

.stop-campos {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 18px;
}

.stop-campo label {
  display: block;
  margin: 0 0 4px;
  font-weight: 800;
}

.stop-campo input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  scroll-margin-top: 110px;
  scroll-margin-bottom: 24px;
}

.stop-campo input::placeholder {
  color: #8a8f98;
  font-weight: 400;
}

.stop-campo input:focus {
  border-color: var(--accent-2);
  outline: 3px solid var(--accent-2);
  outline-offset: 1px;
  background: #ffffff;
}

.stop-campo input.es-otra-letra {
  border-color: var(--accent);
}

.stop-campo input[readonly] {
  background: var(--bg);
  color: var(--muted);
}

.stop-campo-nota {
  min-height: 0;
  margin: 2px 0 0;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.stop-campo-nota:empty {
  display: none;
}

.stop-rivales {
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stop-rivales[hidden] {
  display: none;
}

.stop-boton-stop {
  min-height: 60px;
  margin-top: 4px;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.stop-boton-stop[hidden] {
  display: none;
}

.stop-incompleto {
  margin: 0 0 12px;
}

/* ---------- ¿La cuentas? ---------- */

.stop-duda-contador {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.stop-duda-contador[hidden] {
  display: none;
}

.stop-duda-palabra {
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.stop-duda-palabra strong {
  font-size: 1.3rem;
}

/* ---------- Puntos de la ronda ---------- */

.stop-resultado-texto {
  text-align: center;
}

.stop-tarjetas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 16px;
}

.stop-tarjeta {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stop-tarjeta.es-tuya {
  border-color: var(--accent-2);
}

.stop-tarjeta h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 1.2rem;
}

.stop-tarjeta-suma {
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.stop-tarjeta ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stop-tarjeta li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.stop-tarjeta li:last-child {
  border-bottom: 0;
}

.stop-cat {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.stop-palabra {
  grid-column: 1;
  font-weight: 700;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.stop-palabra.es-vacia {
  color: var(--muted);
}

.stop-motivo {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.stop-pts {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-width: 3.2em;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stop-pts.es-100 {
  background: var(--accent-2);
  color: #ffffff;
}

.stop-pts.es-50 {
  background: #f6dfb0;
  color: #5a3d00;
}

.stop-pts.es-0 {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.stop-tarjeta-total {
  margin: 8px 0 0;
  font-weight: 800;
  text-align: right;
}

/* ---------- Fin de la partida ---------- */

.stop-podio {
  max-width: 420px;
  margin: 0 auto 12px;
  padding: 0;
  list-style: none;
  counter-reset: puesto;
  text-align: left;
}

.stop-podio li {
  counter-increment: puesto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stop-podio li::before {
  content: counter(puesto) ".";
  min-width: 1.6em;
  font-weight: 800;
  color: var(--muted);
}

.stop-podio li span {
  flex: 1 1 auto;
  font-weight: 700;
}

/* Si los puntos no caben junto al nombre, bajan a otra línea, a la derecha. */
.stop-podio li strong {
  margin-left: auto;
  white-space: nowrap;
}

.stop-podio li.es-tuyo {
  border: 2px solid var(--accent-2);
}

/* ---------- Puntos de la partida y marcador ---------- */

.stop-totales {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.stop-totales li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.stop-totales li.es-tuyo {
  border: 2px solid var(--accent-2);
}

.stop-totales strong {
  font-variant-numeric: tabular-nums;
}

.stop-estado {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 16px 0;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stop-estado .dato {
  display: flex;
  flex-direction: column;
  min-width: 6ch;
}

.stop-estado .etiqueta {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stop-estado strong {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Pantallas grandes ---------- */

@media (min-width: 720px) {
  .stop-area {
    padding: 20px;
  }

  .stop-barra {
    margin: -20px -20px 18px;
    padding: 12px 20px;
  }

  .stop-campos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stop-tarjetas {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }

  .stop-tiempos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stop-boton-stop,
  .stop-resultado > .btn {
    display: flex;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .stop-ajustes > .btn {
    display: flex;
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (min-width: 1000px) {
  .stop-campos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Animaciones ---------- */

@keyframes stop-entrar {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes stop-letra {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .stop-panel,
  .stop-letra.es-nueva {
    animation: none;
  }
}
