/* Partida y resultado. La barra, las vidas, la puntuación y las opciones son las
   de Glotpanic (css/game.css); la bandera es nueva. */

.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 pregunta --- */

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

/* La bandera: un SVG 4:3 de flag-icons en <img>, con un marco fino porque
   hay banderas con mucho blanco (Japón, Chipre). */
.flag {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: var(--sp-lg);
  background: var(--surface);
  border-radius: var(--r-card);
}

.flag__img {
  display: block;
  width: min(100%, 280px);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}

/* La silueta: un SVG en línea, sola (en el acento) o en el mapa de su zona,
   con el mar, el resto de países en gris y ella resaltada. Los trazos no
   crecen con el zoom del encuadre. */
.shape {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: var(--sp-lg);
  background: var(--surface);
  border-radius: var(--r-card);
}
.shape--context { padding: 0; overflow: hidden; background: var(--sea); }
.shape__svg { display: block; width: min(100%, 280px); aspect-ratio: 1; }
.shape--context .shape__svg { width: 100%; max-height: 360px; }
.shape__on { fill: var(--accent); }
.shape__land { fill: var(--land); stroke: var(--land-line); stroke-width: 0.75; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.shape__land--other { fill: var(--land-other); }
.shape__on--context { stroke: var(--bg); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
/* Tras responder, el mapa con la capital marcada: más bajo, para que quepa el panel. */
.shape--reveal .shape__svg { max-height: 260px; }
.shape__capital { fill: var(--bg); stroke: var(--fg); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* La capital o el país que se pregunta en los modos de capitales: el nombre
   grande, con el icono del modo o la bandera del país al lado. */
.word {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-sm) var(--sp-md);
  padding: var(--sp-lg);
  background: var(--surface);
  border-radius: var(--r-card);
  color: var(--accent);
  text-align: center;
}
.word__text { color: var(--fg); font-size: clamp(24px, 7vw, 34px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.word__flag { width: 56px; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }

/* Selector de modo de la portada (copiado de Glotpanic): un botón por modo,
   en dos filas de dos, porque en una no caben «Capital → país» y «País → capital». */
.modes {
  display: grid;
  grid-template-columns: repeat(2, 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; }
.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); }

/* --- 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; }
.reveal__note { margin: 0; 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; }

/* --- Selector de pack --- */

.packs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }
.btn--pack { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; }
.btn--pack .btn__sub { color: var(--fg-muted); }
.btn--pack.btn--on .btn__sub { color: #fff; }

/* --- Fallos de la partida --- */

.misses { width: 100%; display: flex; flex-direction: column; gap: var(--sp-sm); }
.miss { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-sm); border: 1px solid var(--line); border-radius: var(--r-tile); }
.miss__flag { width: 56px; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 4px; flex: none; }
.miss__shape { width: 56px; aspect-ratio: 1; flex: none; display: flex; padding: 4px; background: var(--surface); border-radius: 4px; }
.miss__shape .shape__svg { width: 100%; }
.miss__text { display: flex; flex-direction: column; line-height: 1.4; }
.miss__answer { font-weight: 600; }
.miss__choice { color: var(--danger); font-size: 13px; }

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