/* Partida y resultado. La barra, las vidas, la puntuación y las opciones son las
   de Phabetia (css/game.css); la frase y la pantalla tras la ronda son nuevas. */

.screen--round, .screen--end { gap: var(--sp-lg); }

/* --- Cabecera de la partida: progreso por tramos, vidas y puntos --- */

.hud {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.gauge {
  flex: 1;
  display: flex;
  gap: 4px;
}

.gauge__step { flex: 1; min-width: 4px; height: 6px; background: var(--surface-2); border-radius: 3px; }
.gauge__step--ok { background: var(--success); }
.gauge__step--ko { background: var(--danger); }
.gauge__step--now { background: var(--accent); }

.status { display: inline-flex; align-items: center; gap: var(--sp-sm); }
.lives { display: inline-flex; gap: 2px; color: var(--danger); }
.lives__heart--off { color: var(--fg-subtle); }

.score {
  min-width: 3ch;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- La frase --- */

.question { margin: 0; color: var(--fg-muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.sentence {
  width: 100%;
  margin: 0;
  padding: var(--sp-lg);
  background: var(--surface);
  border-radius: var(--r-card);
  font-family: var(--font-text);
  font-size: 22px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Modo escritura: más grande, que se trata de mirar las letras, y con más
   interlineado para las que apilan signos (birmana, tibetana, jemer). La fuente
   de cada escritura la pone css/scripts.css (generado por pipeline/fonts.py). */
.sentence[data-script] { font-size: 26px; line-height: 1.8; }

/* --- Opciones --- */

.options {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
}

.btn--option {
  min-height: 56px;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 8px;
}

.btn--option.is-correct {
  background: var(--success-dim);
  border-color: var(--success-line);
  color: var(--success);
}

.btn--option.is-wrong {
  background: var(--danger-dim);
  border-color: var(--danger-line);
  color: var(--danger);
}

.btn--option:disabled { opacity: 1; }

@media (pointer: fine) {
  .btn--option[data-hotkey] { position: relative; }
  .btn--option[data-hotkey]::before {
    content: attr(data-hotkey);
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 10px;
    font-weight: 500;
    color: var(--fg-subtle);
  }
  .btn--option[data-hotkey]:disabled::before { content: none; }
}

/* --- Tras la ronda --- */

.reveal {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-md);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.reveal__verdict { margin: 0; font-size: 16px; font-weight: 700; }
.reveal__verdict--ok { color: var(--success); }
.reveal__verdict--ko { color: var(--danger); }
.reveal__translation { margin: 0; font-style: italic; }
.reveal__credit { margin: 0; color: var(--fg-muted); font-size: 12px; }
.reveal__credit a, .reveal__learn { color: var(--accent); }
.reveal__learn { font-weight: 600; text-decoration: none; }
.reveal__where { margin: 0; color: var(--fg-muted); font-size: 14px; }

/* Reportar: discreto hasta que se pulsa; los motivos, en fila si caben. */
.report { display: flex; flex-direction: column; gap: var(--sp-sm); align-items: flex-start; }
.report__open { padding: 4px 0; font-size: 12px; }
.report__ask, .report__done { margin: 0; color: var(--fg-muted); font-size: 13px; }
.report__reasons { display: flex; flex-wrap: wrap; gap: var(--sp-sm); }

/* --- Resultado --- */

.final__score { margin: 0; font-size: 48px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.squares { display: flex; gap: 6px; }
.squares__one { width: 20px; height: 20px; border-radius: 5px; background: var(--surface-2); }
.squares__one--ok { background: var(--success); }
.squares__one--ko { background: var(--danger); }

.actions { width: 100%; display: flex; flex-direction: column; gap: var(--sp-sm); }

/* --- Reto diario --- */

.streak { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--tone-4); }
.streak span { color: var(--fg); font-weight: 600; }

.share__feedback { min-height: 1.4em; text-align: center; }
.share__feedback:empty { display: none; }

.stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.stats__figures { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-sm); }
.stats__figure { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.stats__value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats__label { color: var(--fg-muted); font-size: 12px; }
.stats__caption { margin: var(--sp-sm) 0 0; color: var(--fg-muted); font-size: 12px; }

/* Distribución de aciertos: una columna por número de aciertos, de 0 a 10. */
.dist { width: 100%; display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.dist__col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dist__track { width: 100%; height: 72px; display: flex; align-items: flex-end; }
.dist__bar { width: 100%; min-height: 2px; background: var(--surface-2); border-radius: 3px; }
.dist__col--now .dist__bar { background: var(--success); }
.dist__count, .dist__n { font-size: 11px; color: var(--fg-muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.dist__col--now .dist__n { color: var(--fg); font-weight: 700; }

.countdown { font-variant-numeric: tabular-nums; }

/* --- Modo audio --- */

/* Selector de modo de la portada: un botón por modo, como un interruptor. */
.modes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--sp-xs);
  width: 100%;
  padding: var(--sp-xs);
  background: var(--surface);
  border-radius: var(--r-btn);
}
.btn--mode { border-color: transparent; background: transparent; min-width: 0; padding-inline: 6px; gap: 6px; }
/* Con tres modos no caben icono y nombre en fila en un móvil estrecho: el icono, encima. */
@media (max-width: 420px) {
  .btn--mode { flex-direction: column; gap: 2px; padding-block: 8px; font-size: 13px; }
}
.btn--mode.btn--on { background: var(--bg); color: var(--fg); border-color: var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.btn--mode.btn--on:hover:not(:disabled) { background: var(--bg); }

/* Camino de niveles (1.9.0): como el selector de modo; los cerrados, con candado y apagados. */
.levels .btn--mode { font-size: 13px; padding-block: 8px; gap: 4px; }
.levels__locked:not(.btn--on) { color: var(--fg-muted); }
@media (max-width: 420px) {
  .levels .btn--mode { font-size: 12px; }
}

/* Temas: tarjetas como las de los packs, con la dificultad en estrellas. */
.theme__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm); }
.theme__stars { display: inline-flex; gap: 2px; color: var(--accent); flex-shrink: 0; }
.theme--off { opacity: 0.6; }
.end__level { align-self: center; }

/* Lo que ocupa el sitio de la frase: el botón de escuchar y su progreso. */
.listen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-lg);
  background: var(--surface);
  border-radius: var(--r-card);
}

.btn--listen {
  width: 88px;
  height: 88px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.btn--listen:hover:not(:disabled) { background: #4460ef; }

.listen__track {
  width: 100%;
  max-width: 240px;
  height: 4px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 2px;
}
.listen__bar { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.25s linear; }

.listen--error .btn--listen { background: var(--danger); }

.end__title { display: inline-flex; align-items: center; gap: var(--sp-sm); }

/* --- Cuenta y rankings (1.6.0, formularios copiados de Phabetia) --- */

.home__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-sm); }

.screen--account, .screen--rankings { gap: var(--sp-lg); }
.screen--account > .hint, .screen--rankings > .hint { text-align: center; }

.auth__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth__form { width: 100%; display: flex; flex-direction: column; gap: var(--sp-md); }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }

.field__label {
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field__input {
  font-family: var(--font);
  font-size: 16px;
  padding: 13px 14px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-tile);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.field__input:focus { outline: none; background: var(--bg); border-color: var(--accent-line); }
.field__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.form__notice:empty { display: none; }
.hint--error { color: var(--danger); }
.hint--ok { color: var(--success); }

.account__who { display: flex; flex-direction: column; align-items: center; gap: var(--sp-xs); }
.account__email { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.account__verify, .account__alias { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--sp-sm); text-align: center; }
.account__sync { text-align: center; font-size: 14px; }

.boards { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-xs); }

.ranking { width: 100%; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-xs); }
.ranking:empty { display: none; }

.ranking__row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--r-tile);
}

.ranking__rank { min-width: 2ch; color: var(--fg-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ranking__alias { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.ranking__score { font-variant-numeric: tabular-nums; }
.ranking__row--me { background: var(--accent-dim); }
.ranking__row--me .ranking__alias { color: var(--accent); }
.ranking__status:empty { display: none; }
.ranking__me { display: flex; flex-direction: column; align-items: center; gap: var(--sp-xs); text-align: center; }
.ranking__me:empty { display: none; }
.account__who .label { text-align: center; }
