/* Memoria · juego de parejas por equipos
   Estilo «álbum de fotos»: fondo papel claro, cartas tapadas azul noche y parejas como fotos
   instantáneas con el nombre de quien las hizo. Azul y amarillo identifican a cada grupo.
   Pensado para proyector 16:9. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/BricolageGrotesque-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("fonts/Caveat-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/Figtree-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/Figtree-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --papel: #f4f6ff;
  --blanco: #ffffff;
  --foto: #eef1fb;
  --linea: #dfe4fb;
  --tinta: #0a1130;
  --tinta-2: #1c2c72;
  --gris: #4a5378;
  --azul: #2f6bff;
  --amarillo: #ffd21f;

  --titular: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --mano: "Caveat", "Bradley Hand", cursive;
  --texto: "Figtree", system-ui, sans-serif;

  --sale: cubic-bezier(0.23, 1, 0.32, 1);
  --mueve: cubic-bezier(0.77, 0, 0.175, 1);
  --sombra-foto: 0 8px 18px rgb(10 17 48 / 0.18);

  --riel: clamp(120px, 9vw, 176px);
  --aire: clamp(12px, 1.3vw, 24px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: clamp(15px, 1.05vw, 20px);
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--amarillo); color: var(--tinta); }
:focus-visible { outline: 3px solid var(--tinta); outline-offset: 3px; }

h1, h2, p, figure { margin: 0; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Colores por grupo: campo lleno, texto sobre el campo */
[data-equipo="0"] { --campo: var(--azul); --sobre: var(--blanco); }
[data-equipo="1"] { --campo: var(--amarillo); --sobre: var(--tinta); }
.riel.es-activo[data-equipo="0"] :focus-visible,
.inicio__campo[data-equipo="0"] :focus-visible, .final[data-equipo="0"] :focus-visible,
.pareja[data-equipo="0"] :focus-visible { outline-color: var(--blanco); }

/* Una foto instantánea: marco blanco, sombra suave */
.polaroid {
  background: var(--blanco);
  padding: 6px 6px 18px;
  box-shadow: var(--sombra-foto);
}
.polaroid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--foto); }

/* ---------- Botones ---------- */

.boton {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 0.75em 1.3em;
  background: var(--tinta);
  color: var(--blanco);
  font-weight: 800;
  font-size: 1.05em;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 140ms var(--sale), background-color 160ms ease, color 160ms ease;
}
.boton:active { transform: scale(0.97); }
.boton--grande { font-size: 1.3em; padding: 0.8em 1.5em; }
.boton--linea { background: transparent; color: inherit; box-shadow: inset 0 0 0 3px currentColor; }
@media (hover: hover) {
  .boton:not(.boton--linea):hover { background: var(--tinta-2); }
}

/* ---------- Inicio ---------- */

.inicio { height: 100%; }
.inicio__forma {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(360px, 1.3fr) 1fr;
}
.inicio__campo {
  background: var(--campo);
  color: var(--sobre);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6em;
  padding: clamp(20px, 3vw, 56px);
}
.inicio__campo label { font-weight: 700; font-size: 1.05em; }
.inicio__campo input {
  width: 100%;
  border: 0;
  border-bottom: 4px solid currentColor;
  border-radius: 0;
  background: transparent;
  padding: 0.05em 0;
  font-family: var(--titular);
  font-weight: 800;
  font-size: clamp(30px, 3.6vw, 72px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  caret-color: currentColor;
}
.inicio__campo input:focus-visible { outline: none; border-bottom-width: 8px; }
.inicio__campo input::selection { background: var(--sobre); color: var(--campo); }

.inicio__centro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(14px, 2vw, 32px);
  padding: clamp(24px, 4vw, 72px);
}
.collage { display: flex; padding: 0 0 0.6em 0.4em; }
.collage .polaroid { width: clamp(110px, 9vw, 180px); }
.collage .polaroid:nth-child(1) { rotate: -7deg; }
.collage .polaroid:nth-child(2) { rotate: 4deg; margin-left: -1.6em; margin-top: 0.8em; }
.collage .polaroid:nth-child(3) { rotate: -2deg; margin-left: -1.4em; }
.inicio__centro h1 {
  font-family: var(--titular);
  font-weight: 800;
  font-size: clamp(52px, 6.4vw, 132px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.inicio__centro p { font-size: 1.25em; max-width: 28ch; text-wrap: balance; color: var(--gris); }
.inicio__acciones { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.inicio__acciones .boton--linea { font-size: 1.05em; }

/* Integrantes editables en la pantalla de inicio */
.integrantes--editable { gap: 0.35em 0.4em; font-size: clamp(20px, 1.7vw, 34px); }
.integrantes--editable li {
  display: inline-flex;
  align-items: center;
  gap: 0.1em;
  padding: 0.04em 0.12em 0.04em 0.55em;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px currentColor;
}
.quitar {
  appearance: none;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms var(--sale);
}
.quitar:active { transform: scale(0.9); }
.quitar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
@media (hover: hover) { .quitar:hover { background: var(--sobre); color: var(--campo); } }
.agregar { display: flex; align-items: center; gap: 10px; margin-top: 0.3em; max-width: 22em; }
.agregar input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-bottom: 2px solid currentColor;
  border-radius: 0;
  background: transparent;
  padding: 0.35em 0;
  font-weight: 700;
  font-size: 1.05em;
  caret-color: currentColor;
}
.agregar input::placeholder { color: inherit; opacity: 0.8; }
.agregar input:focus-visible { outline: none; border-bottom-width: 4px; }
.agregar__boton {
  appearance: none;
  border: 0;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  background: var(--sobre);
  color: var(--campo);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 140ms var(--sale);
}
.agregar__boton:active { transform: scale(0.94); }
.agregar__boton svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.inicio__aviso { min-height: 1.4em; font-weight: 800; }

.integrantes {
  list-style: none;
  margin: 0.3em 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.7em;
  font-family: var(--mano);
  font-weight: 700;
  font-size: clamp(22px, 2vw, 40px);
  line-height: 1.15;
}

/* ---------- Juego ---------- */

.juego {
  height: 100%;
  display: grid;
  grid-template-columns: var(--riel) minmax(0, 1fr) var(--riel);
}

/* Riel de cada grupo: angosto para que el tablero mande */
.riel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: var(--blanco);
  color: var(--tinta);
  border-top: 10px solid var(--campo);
  text-align: center;
  transition: background-color 320ms var(--sale), color 320ms var(--sale);
}
.riel.es-activo { background: var(--campo); color: var(--sobre); }

.riel__nombre {
  font-family: var(--titular);
  font-weight: 800;
  font-size: clamp(18px, 1.65vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.riel__puntos {
  font-family: var(--titular);
  font-weight: 800;
  font-size: clamp(64px, 6.4vw, 124px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.riel__puntos.sube { animation: sube 520ms var(--sale); }
@keyframes sube {
  0% { transform: translateY(0.12em) scale(0.9); }
  100% { transform: none; }
}
.riel__unidad { font-weight: 700; font-size: 0.85em; margin-top: -2px; }
.riel__rotulo { font-weight: 700; font-size: 0.8em; margin-top: 12px; }
.riel__persona {
  font-family: var(--mano);
  font-weight: 700;
  font-size: clamp(24px, 2.1vw, 40px);
  line-height: 1;
  padding: 2px 12px 5px;
  border-radius: 6px;
  max-width: 100%;
  overflow-wrap: anywhere;
  background: var(--campo);
  color: var(--sobre);
  rotate: 2deg;
}
.riel.es-activo .riel__persona { background: var(--sobre); color: var(--campo); rotate: -3deg; }
.riel__persona:empty { visibility: hidden; }

/* Fotos que no salieron en esta partida, apiladas como recuerdos sueltos */
.riel__fotos {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  margin: 14px 0 8px;
  overflow: hidden;
  overflow: clip;
  overflow-clip-margin: 8px;
}
.riel__fotos .polaroid {
  position: absolute;
  left: 50%;
  width: 82%;
  padding: 5px 5px 14px;
  translate: -50% 0;
  top: calc(var(--k) * 23%);
  rotate: var(--r);
}
.riel.es-activo .riel__fotos .polaroid { box-shadow: 0 6px 14px rgb(10 17 48 / 0.3); }

.boton--turno {
  width: 100%;
  min-height: 3.6em;
  flex: none;
  font-size: clamp(16px, 1.2vw, 22px);
  background: var(--blanco);
  color: var(--tinta);
}
.boton--turno[disabled] { cursor: default; background: transparent; color: inherit; box-shadow: inset 0 0 0 3px currentColor; }
.boton--turno[disabled]:active { transform: none; }
.riel:not(.es-activo) .boton--turno { visibility: hidden; }
@media (hover: hover) {
  .riel .boton--turno:not([disabled]):hover { background: var(--tinta); color: var(--blanco); }
}

.centro {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.barra {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 1.2vw, 20px);
  padding: clamp(10px, 1vw, 16px) clamp(16px, 1.5vw, 26px) clamp(8px, 0.8vw, 12px);
}

/* Reloj: un círculo amarillo con los segundos que quedan */
.reloj {
  width: clamp(54px, 4.4vw, 84px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amarillo);
  color: var(--tinta);
  transition: background-color 200ms ease, color 200ms ease;
}
.reloj__numero {
  font-family: var(--titular);
  font-weight: 800;
  font-size: clamp(28px, 2.3vw, 46px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.reloj.en-pausa { background: var(--linea); color: var(--gris); }
.reloj.apura { background: var(--tinta); color: var(--amarillo); }
.reloj__numero.late { animation: late 380ms var(--sale); }
@keyframes late {
  0% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.estado {
  font-family: var(--titular);
  font-weight: 600;
  font-size: clamp(17px, 1.55vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.controles { display: flex; align-items: center; gap: 2px; }
/* Anular turno: pasa al otro grupo sin sumar ni restar */
.boton--anular {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin-right: 8px;
  padding: 0.55em 1em;
  font-size: 0.9em;
  background: transparent;
  color: var(--tinta);
  box-shadow: inset 0 0 0 2px currentColor;
}
.boton--anular svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.boton--anular[disabled] { opacity: 0.35; cursor: default; }
.boton--anular[disabled]:active { transform: none; }
@media (hover: hover) { .boton.boton--anular:not([disabled]):hover { background: var(--tinta); color: var(--blanco); } }
.icono {
  appearance: none;
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: transparent;
  color: var(--tinta);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 140ms var(--sale), background-color 160ms ease;
}
.icono:active { transform: scale(0.94); }
.icono svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icono .mudo { display: none; }
.icono[aria-pressed="false"] .onda { display: none; }
.icono[aria-pressed="false"] .mudo { display: inline; }
@media (hover: hover) { .icono:hover { background: var(--linea); } }

/* La mecha: se consume durante el turno */
.mecha {
  height: 6px;
  margin: 0 clamp(16px, 1.5vw, 26px);
  border-radius: 3px;
  background: var(--linea);
  overflow: hidden;
}
.mecha i {
  display: block;
  height: 100%;
  background: var(--amarillo);
  transform-origin: left center;
  transform: scaleX(1);
}
.mecha.apura i { background: var(--tinta); }

/* ---------- Tablero ---------- */

.tablero {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 1vw, 18px);
  padding: clamp(12px, 1.1vw, 20px) clamp(16px, 1.5vw, 26px) clamp(16px, 1.4vw, 24px);
  min-height: 0;
}

.carta {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  position: relative;
  min-width: 0;
  min-height: 0;
  cursor: default;
  container-type: size;
  border-radius: 10px;
  perspective: 900px;
}
.tablero.reparte .carta {
  animation: reparte 420ms var(--sale) both;
  animation-delay: calc(var(--i) * 18ms);
}
@keyframes reparte {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.carta__giro {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 460ms var(--mueve);
}
.carta.vista .carta__giro { transform: rotateY(180deg); }

.carta__dorso, .carta__cara {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.carta__dorso {
  border-radius: 10px;
  background: var(--tinta);
  color: var(--blanco);
  display: grid;
  place-items: center;
  font-family: var(--titular);
  font-weight: 800;
  font-size: 44cqmin;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms ease, transform 160ms var(--sale);
}

/* La cara es una foto instantánea: imagen completa y, abajo, quién hizo la pareja */
.carta__cara {
  transform: rotateY(180deg);
  background: var(--blanco);
  padding: 4cqmin 4cqmin 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sombra-foto);
  outline: 0 solid var(--amarillo);
  transition: outline-width 200ms var(--sale);
}
.carta__foto { flex: 1; min-height: 0; display: block; background: var(--foto); }
.carta__foto img { display: block; width: 100%; height: 100%; object-fit: contain; }
.carta__pie {
  height: max(18px, 19cqh);
  flex: none;
  display: flex;
  align-items: center;
  gap: 4cqmin;
  padding: 0 1cqmin;
  font-family: var(--mano);
  font-weight: 700;
  font-size: clamp(14px, 15cqh, 32px);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  color: var(--tinta);
}
.carta__pie i {
  display: none;
  flex: none;
  width: min(12px, 8cqmin);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--tinta);
  background: var(--campo);
}
.carta.hecha .carta__pie i { display: block; }
.carta.vista:not(.hecha) .carta__cara { outline-width: 4px; }
.carta.hecha { rotate: var(--giro, 0deg); }

.tablero.se-juega .carta:not(.vista) { cursor: pointer; }
@media (hover: hover) {
  .tablero.se-juega .carta:not(.vista):hover .carta__dorso { background: var(--tinta-2); transform: scale(1.04); }
}
.tablero.se-juega .carta:not(.vista):active .carta__dorso { transform: scale(0.96); }

.carta.celebra { animation: celebra 520ms var(--sale); z-index: 2; }
@keyframes celebra {
  0% { transform: scale(1); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.carta.falla { animation: falla 420ms var(--sale); }
@keyframes falla {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}

/* ---------- Pareja a pantalla completa ---------- */

.pareja {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: var(--papel);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.pareja__foto {
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 48px);
  max-height: calc(100% - 40px);
  padding: clamp(10px, 1vw, 18px) clamp(10px, 1vw, 18px) 0;
  background: var(--blanco);
  box-shadow: 0 18px 40px rgb(10 17 48 / 0.22);
  rotate: -1.5deg;
  animation: crece 460ms var(--sale) both;
}
.pareja__foto img {
  display: block;
  min-height: 0;
  max-width: 100%;
  max-height: calc(100vh - 290px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--foto);
}
.pareja__autor {
  font-family: var(--mano);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 58px);
  line-height: 1;
  padding: 0.25em 0.1em 0.3em;
  color: var(--tinta);
}
@keyframes crece {
  from { opacity: 0; transform: translateY(18px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
.pareja__pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--aire);
  padding: clamp(14px, 1.5vw, 26px) clamp(18px, 2.4vw, 44px);
  background: var(--campo);
  color: var(--sobre);
}
.pareja__texto { font-size: clamp(18px, 1.9vw, 36px); font-weight: 700; line-height: 1.15; text-wrap: balance; }
.pareja__texto strong { font-family: var(--titular); font-weight: 800; font-size: 1.4em; letter-spacing: -0.02em; margin-right: 0.3em; }
.pareja .boton--grande { background: var(--blanco); color: var(--tinta); flex: none; font-size: clamp(20px, 1.8vw, 34px); }
@media (hover: hover) { .pareja .boton--grande:hover { background: var(--tinta); color: var(--blanco); } }

/* ---------- Final ---------- */

.final {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--campo, var(--azul));
  color: var(--sobre, var(--blanco));
  display: grid;
  place-items: center;
  animation: cae 620ms var(--sale) both;
}
@keyframes cae {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
.final__confeti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.final__contenido { position: relative; text-align: center; padding: var(--aire); max-width: 92vw; }
.final__gana { font-weight: 800; font-size: clamp(22px, 2.4vw, 46px); }
.final__nombre {
  font-family: var(--titular);
  font-weight: 800;
  font-size: clamp(56px, 10vw, 210px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  text-wrap: balance;
  margin: 0.05em 0 0.12em;
}
.final__integrantes { font-family: var(--mano); font-weight: 700; font-size: clamp(26px, 2.8vw, 54px); line-height: 1.1; text-wrap: balance; }
.final__marcador { font-weight: 700; font-size: clamp(18px, 1.8vw, 34px); margin-top: 0.5em; }
.final__fotos { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 4px; margin: clamp(18px, 2.4vw, 40px) auto 0; max-width: 1100px; }
.final__fotos .polaroid { width: clamp(72px, 6.2vw, 116px); padding: 4px 4px 12px; }
.final__acciones { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: clamp(22px, 3vw, 52px); }
.final .boton--grande { background: var(--blanco); color: var(--tinta); }
.final .boton--linea { font-size: 1.3em; padding: 0.8em 1.5em; }
@media (hover: hover) { .final .boton--grande:hover { background: var(--tinta); color: var(--blanco); } }

/* ---------- Diálogos ---------- */

.dialogo {
  border: 0;
  border-radius: 16px;
  padding: clamp(22px, 2.4vw, 40px);
  background: var(--blanco);
  color: var(--tinta);
  max-width: min(92vw, 520px);
  box-shadow: 0 24px 60px rgb(10 17 48 / 0.3);
}
.dialogo::backdrop { background: rgb(10 17 48 / 0.55); }
.dialogo h2 { font-family: var(--titular); font-weight: 800; font-size: 1.9em; line-height: 1.05; letter-spacing: -0.02em; }
.dialogo p { margin: 0.7em 0 1.4em; font-size: 1.1em; color: var(--gris); }
.dialogo form { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

#forma-tiempo { display: block; }
.paso { display: flex; align-items: center; justify-content: center; gap: 18px; }
.paso__boton {
  appearance: none;
  border: 0;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 14px;
  background: var(--azul);
  color: var(--blanco);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 140ms var(--sale);
}
.paso__boton:active { transform: scale(0.94); }
.paso__boton svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.paso__valor { display: flex; flex-direction: column; align-items: center; font-weight: 700; color: var(--gris); }
.paso__valor input {
  width: 2.4em;
  border: 0;
  background: transparent;
  color: var(--tinta);
  font-family: var(--titular);
  font-weight: 800;
  font-size: clamp(64px, 6vw, 110px);
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.paso__valor input::-webkit-outer-spin-button,
.paso__valor input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.atajos { display: flex; justify-content: center; gap: 8px; margin: 22px 0 26px; }
.atajos button {
  appearance: none;
  border: 0;
  min-width: 52px;
  padding: 0.5em 0.7em;
  border-radius: 999px;
  background: var(--papel);
  color: var(--tinta);
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms var(--sale), background-color 160ms ease;
}
.atajos button:active { transform: scale(0.95); }
.atajos button[aria-pressed="true"] { background: var(--amarillo); }
/* Guardar va primero en el HTML para que Enter guarde; visualmente queda a la derecha */
.dialogo__acciones { display: flex; flex-direction: row-reverse; gap: 12px; justify-content: flex-start; flex-wrap: wrap; }

/* ---------- Pantallas angostas (no es el uso principal) ---------- */

@media (max-width: 860px) {
  body { overflow: auto; }
  .inicio__forma { grid-template-columns: 1fr; grid-auto-rows: minmax(30vh, auto); }
  .inicio__centro { order: -1; }
  .juego { grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(70vh, 1fr); height: auto; min-height: 100%; }
  .centro { grid-column: 1 / -1; grid-row: 2; }
  .riel { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .riel__fotos, .riel__unidad, .riel__rotulo { display: none; }
  .riel__puntos { font-size: 52px; }
  .barra { grid-template-columns: auto 1fr; }
  .controles { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .tablero.reparte .carta, .carta.celebra, .carta.falla, .riel__puntos.sube, .reloj__numero.late, .final, .pareja__foto { animation: none; }
  .carta__giro { transition-duration: 1ms; }
}
