/* El Futbolista del Día — mobile first */
:root {
  --bg: #0b1016;
  --bg-2: #121a23;
  --bg-3: #1a2430;
  --line: #2a3644;
  --text: #eef2f6;
  --muted: #a9b6c4;
  --accent: #36d399;
  --accent-ink: #062016;
  /* Okabe–Ito (apto para daltonismo) + iconos */
  --ok: #009E73;
  --near: #E69F00;
  --no: #3a4350;
  --ok-ink: #04130d;
  --near-ink: #1d1400;
  --no-ink: #eef2f6;
  --radius: 12px;
  --stage-h: clamp(220px, 44svh, 400px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.45; overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
a { color: #8fd3ff; }
:focus-visible { outline: 3px solid #ffd166; outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 50; background: #ffd166; color: #000; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }

/* ------------------------------- Escena ------------------------------- */
.app { display: flex; flex-direction: column; min-height: 100svh; }
.stage {
  position: sticky; top: 0; z-index: 5; height: var(--stage-h); background: #05080c;
  overflow: hidden; transition: height .2s ease; touch-action: manipulation;
}
body.is-typing .stage { height: clamp(150px, 26svh, 240px); }
.stage-media { position: absolute; inset: 0; z-index: 0; }
.clip {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%;
  display: block; background: #05080c;
}
.clip.is-hidden { visibility: hidden; }
.clip-poster { z-index: 1; }                 /* por encima del vídeo hasta que haya frame */
.clip-poster.is-hidden { visibility: hidden; }
.freeze-tint {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .12s linear;
  background: radial-gradient(ellipse at 50% 45%, rgba(120,190,255,0) 55%, rgba(40,90,150,.35) 100%);
  mix-blend-mode: screen;
}
.stage[data-state="frozen"] .freeze-tint { opacity: 1; }
.stage[data-state="frozen"] .clip { filter: saturate(.8) contrast(1.03); }
.stage .clip { transition: filter .12s linear; }
.ball-marker {
  position: absolute; left: 0; top: 0; z-index: 3; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(160, 220, 255, .95); box-shadow: 0 0 0 3px rgba(20,60,110,.35), 0 0 14px rgba(140,210,255,.7);
  opacity: 0; transition: opacity .15s linear; pointer-events: none; will-change: transform;
}
.ball-marker.is-on { opacity: 1; animation: pulse 1.8s ease-in-out infinite; }
.ball-marker.is-gone { transition: opacity .35s ease-out; }   /* gol: se desvanece mientras el balón entra */
.stage[data-state="moving"] .ball-marker.is-on { opacity: .55; animation: none; }   /* sigue al balón en vuelo */
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(20,60,110,.15), 0 0 20px rgba(140,210,255,.9); } }
/* Bullet time: capas sobre el vídeo congelado (game.js · BT) */
.stage-media { transition: none; }                        /* al reanudarse, vuelve al instante (no mueve el aro) */
.stage.is-bullet .stage-media { transform: scale(1.035); transition: transform 2.8s cubic-bezier(.16, .7, .2, 1); }
.bt-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .12s linear; }
.stage.is-bullet .bt-layer { opacity: 1; transition: opacity .45s ease-out .05s; }
.bt-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.bt-ball {
  position: absolute; left: 0; top: 0; background: url("assets/football/ball-spin.webp") 0 0 / 600% 400% no-repeat;
  will-change: transform, opacity;
}
.bt-trail {
  position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: 999px;
  background: linear-gradient(90deg, rgba(190, 225, 255, .34), rgba(190, 225, 255, 0));
  filter: blur(2px);
}
.bt-ring {
  position: absolute; left: calc(var(--bx) - var(--br)); top: calc(var(--by) - var(--br));
  width: calc(var(--br) * 2); height: calc(var(--br) * 2); border-radius: 50%;
  border: 1.5px solid rgba(200, 232, 255, .55); opacity: 0;
}
.stage.is-bullet .bt-ring { animation: bt-ripple 2.6s cubic-bezier(.2, .6, .3, 1) infinite; }
.stage.is-bullet .bt-ring--2 { animation-delay: 1.3s; }
@keyframes bt-ripple { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(3.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bt-layer { display: none; } .stage.is-bullet .stage-media { transform: none; } }
.hud { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.hud-chip {
  margin: 0; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: rgba(5, 10, 16, .72); color: #e8f4ff; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.hud-freeze { opacity: 0; transition: opacity .12s linear; }
.stage[data-state="frozen"] .hud-freeze { opacity: 1; }
.hud-distance { margin-left: auto; text-align: right; }
.stage-result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; padding: 10px 22px; border-radius: 14px; font-weight: 900; letter-spacing: .02em;
  font-size: clamp(30px, 9vw, 64px); text-shadow: 0 3px 12px rgba(0,0,0,.6); animation: pop .35s ease-out;
  white-space: nowrap; pointer-events: none;
}
.stage-result.is-goal { color: #fff; background: rgba(0, 158, 115, .82); }
.stage-result.is-save { color: #fff; background: rgba(30, 36, 46, .85); font-size: clamp(22px, 6vw, 40px); }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }
.btn-kick {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 6;   /* césped libre entre portería y balón */
  min-height: 56px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-size: 20px; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 0 4px rgba(54,211,153,.25);
  animation: kickPulse 1.6s ease-in-out infinite;
}
.btn-kick:hover { filter: brightness(1.08); }
@keyframes kickPulse { 50% { box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 0 10px rgba(54,211,153,.12); } }
.stage[data-state="ready"] .freeze-tint, .stage[data-state="ready"] .hud-freeze { opacity: 0; }
.stage-hint { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); margin: 0; font-size: 12px; color: #cfe2f3; background: rgba(0,0,0,.5); padding: 3px 10px; border-radius: 999px; }

/* ------------------------------- Panel -------------------------------- */
.panel { padding: 12px 16px 28px; max-width: 720px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: .03em; line-height: 1.15; }
@media (max-width: 400px) {
  .brand-ball { font-size: 15px; }
  .brand { font-size: 13.5px; }
  .btn-chip { padding: 0 9px; font-size: 13px; }
  .top-actions { gap: 4px; }
}
.brand { min-width: 0; white-space: nowrap; flex-shrink: 0; }
.brand-ball { font-size: 18px; }
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-chip, .btn-icon {
  min-height: 44px; min-width: 44px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-2); cursor: pointer; padding: 0 12px; font-size: 14px; font-weight: 600;
}
.btn-icon { padding: 0; font-size: 17px; }
/* Iconos de colección y estadísticas: SVG propios (trazo claro + acento verde), en el mismo chip que «?» */
.btn-svg { display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.btn-svg svg { display: block; transition: transform .15s; }
.btn-svg:hover svg { transform: translateY(-1px); }
.btn-chip:hover, .btn-icon:hover { background: var(--bg-3); }
.diff-menu { position: relative; }
.diff-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.diff-opt {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 48px;
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer;
}
.diff-opt:hover, .diff-opt:focus-visible { background: var(--bg-3); }
.diff-opt.is-current { background: rgba(54, 211, 153, .14); }
.diff-opt-l { font-weight: 700; }
.diff-opt-s { font-size: 13px; color: var(--muted); }
.meta { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.hint { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(230,159,0,.12); border: 1px solid rgba(230,159,0,.35); font-size: 14px; }

.guess { margin-top: 12px; }
.guess-label { display: block; font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.combo { position: relative; display: flex; gap: 8px; }
#guess-input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; color: #0b1016; font-size: 17px;
}
#guess-input::placeholder { color: #5b6674; }
#guess-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(54,211,153,.35); }
#guess-input:disabled { background: #d9dee4; }
.btn-shoot, .btn-primary {
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; cursor: pointer;
}
.btn-shoot:disabled { background: #2b3a36; color: #8fa39b; cursor: not-allowed; }
/* «Chutar» debajo del buscador, centrado y un 25 % más grande */
.shoot-row { display: flex; justify-content: center; margin-top: 10px; }
.shoot-row .btn-shoot { min-height: 60px; padding: 0 28px; font-size: 20px; border-radius: 15px; min-width: 150px; }
.btn-secondary { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); font-weight: 700; cursor: pointer; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; margin: 0; padding: 4px; list-style: none;
  background: #fff; color: #0b1016; border-radius: 12px; box-shadow: 0 14px 30px rgba(0,0,0,.45);
  max-height: min(50svh, 360px); overflow-y: auto;
}
.sugg, .sugg-none { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.sugg[aria-selected="true"], .sugg:hover { background: #dff5ec; }
.sugg-name { font-weight: 700; }
.sugg-sub { font-size: 12px; color: #4a5563; }
.sugg-none { color: #4a5563; cursor: default; }
.attempts { margin: 6px 0 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }

/* Pistas progresivas */
.hints { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.hints-title { margin: 0 0 6px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hints-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hint-item {
  position: relative; padding: 6px 10px 6px 26px; border-radius: 8px; background: var(--bg-3); font-size: 15px;
  font-weight: 600; overflow-wrap: anywhere; border: 1px solid transparent;
}
.hint-item::before { content: "💡"; content: "💡" / ""; position: absolute; left: 6px; top: 6px; font-size: 13px; }
.hint-item.is-new { border-color: var(--near); background: rgba(230,159,0,.12); animation: hint-in .5s ease-out both; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-4px); } }
.hints-next { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.hints-list:not([hidden]) + .hints-next { margin-top: 8px; }

/* Último intento: 10 opciones */
.final { margin-top: 12px; padding: 12px; border-radius: var(--radius); background: rgba(230,159,0,.10); border: 1px solid rgba(230,159,0,.4); }
.final-title { margin: 0 0 8px; font-size: 15px; }
.final-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.final-opt { min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); font-weight: 700; font-size: 14px; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.final-opt:hover, .final-opt:focus-visible { border-color: var(--near); background: var(--bg-3); }

/* Colección (el efecto visual de las cartas se aplicará con la referencia de Sushi 12) */
/* ================= Colección: carrusel de cartas (comportamiento de Sushi 12, estilo propio) =================
   El comportamiento y el efecto (inclinación, brillo lenticular, arrastre, clic ≠ arrastre, móvil) son los del
   carrusel y la ficha de sushi12.com, con sus mismos valores (carousel.js). El aspecto es el del juego:
   fondo oscuro, acento verde y cartas con la proporción de un cromo real (63 × 88 mm).
   Tamaños: data-size="a" | "b" | "c" en #coleccion-carousel (b = tamaño real en pantalla: 63 mm ≈ 238 px CSS). */
.product-carousel { min-width: 0; --size-w: 238px; }
.product-carousel[data-size="a"] { --size-w: 190px; }
.product-carousel[data-size="c"] { --size-w: 286px; }
.fd-coleccion .product-carousel { margin-inline: -18px; }                 /* a sangre: se ven las cartas vecinas */
@media (min-width: 900px) { .modal-card.fd-coleccion { max-width: min(1100px, 92vw); } }

:root .product-carousel [data-carousel-rail] {
  --card-width: var(--size-w);
  overscroll-behavior-x: contain;
  padding: 24px max(0px, calc((100% - var(--card-width)) / 2));
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
  gap: 24px;
  scroll-padding: 0;
  display: flex;
  overflow-x: auto;
}
.product-carousel [data-carousel-rail]::-webkit-scrollbar { display: none; }
/* carta (valores de transición, escala y opacidad de Sushi 12; colores y forma propios) */
:root .product-carousel [data-carousel-rail] > .menu-card {
  flex: 0 0 var(--card-width);
  scroll-snap-align: center;
  opacity: 0.6;
  transform: scale(0.9);
  transition: transform 0.45s, opacity 0.45s;
  position: relative;
  display: grid;
  min-width: 0;
  padding: 7px;
  border-radius: calc(var(--card-width) * 0.048);                          /* esquina de un cromo real (3 mm / 63 mm) */
  border: 1px solid rgba(54, 211, 153, .38);
  background: linear-gradient(160deg, #213040 0%, #121b25 55%, #0b1016 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: #fff;
  overflow: hidden;
}
:root .product-carousel [data-carousel-rail] > .menu-card.is-active { opacity: 1; transform: scale(1); }
.product-carousel__controls { justify-content: center; align-items: center; gap: 20px; margin: 0 0 16px; display: flex; }
.product-carousel__controls[hidden] { display: none; }
.product-carousel__controls > button {
  width: 44px; height: 44px; color: var(--text); cursor: pointer; background: var(--bg-3); border: 1px solid var(--line); border-radius: 50%;
  font-size: 18px; font-weight: 700;
}
.product-carousel__controls > button:hover:not(:disabled) { border-color: var(--accent); }
.product-carousel__controls > button:disabled { opacity: 0.3; cursor: default; }
[data-carousel-dots] { flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 65%; display: flex; }
[data-carousel-dots] button { cursor: pointer; background: 0 0; border: 0; width: 20px; min-height: 32px; padding: 12px 0; }
[data-carousel-dots] button:after { content: ""; background: var(--line); height: 3px; border-radius: 2px; display: block; }
[data-carousel-dots] button[aria-current="true"]:after { background: var(--accent); }
.product-carousel [data-carousel-rail].dragging { cursor: grabbing; user-select: none; }
.product-carousel .carousel-sheen { display: none; }
@media (min-width: 768px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :root .product-carousel [data-carousel-rail] > .menu-card.is-active:hover {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.015);
    transition: transform 0.12s ease-out, opacity 0.45s;
  }
  .product-carousel .carousel-sheen {
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    background:
      repeating-linear-gradient(90deg, #0000 0 3px, #ffffff38 3px 4px, #00000029 4px 5px) 0 0/100% 100%,
      linear-gradient(115deg, #0000 15%, #67e6ff66 30%, #a8ff8366 40%, #ffec8766 50%, #ff78ce66 60%, #0000 75%) 0 0/230% 230%;
    background-position: center, var(--shine, 50%) 50%;
    transition: opacity 0.3s;
    display: block;
    position: absolute;
    inset: 0;
  }
  .product-carousel .menu-card.is-active:hover .carousel-sheen { opacity: 0.65; }
}
@media (max-width: 767px) {
  :root .product-carousel [data-carousel-rail] { --card-width: min(72vw, var(--size-w)); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .product-carousel [data-carousel-rail] > .menu-card { transition: none; }
}

/* Cara de la carta: solo el nombre */
.menu-card__media.fd-card__face { border: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.fd-card__face {
  display: grid; place-items: center; width: 100%; aspect-ratio: 63 / 88; padding: 12%;
  border-radius: calc(var(--card-width, 238px) * 0.03); border: 1px solid rgba(255, 255, 255, .09);
  background: radial-gradient(120% 70% at 50% 0%, rgba(54, 211, 153, .16), rgba(54, 211, 153, 0) 60%), transparent;
  text-align: center;
}
.fd-card__name {
  margin: 0; color: #fff; font-weight: 900; line-height: 1.12; overflow-wrap: anywhere; text-wrap: balance;
  font-size: calc(var(--card-width, 238px) * 0.1); letter-spacing: .01em; text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

/* Ficha: efecto image-effect de Sushi 12 (mismos valores), con la carta de nuestro estilo */
.image-effect {
  position: relative; padding: 7px; border-radius: 16px; border: 1px solid rgba(54, 211, 153, .38);
  background: linear-gradient(160deg, #213040 0%, #121b25 55%, #0b1016 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  width: min(100%, 320px); margin-inline: auto; --card-width: 320px;
}
.image-effect__sheen { display: none; }
@media (min-width: 768px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .image-effect { transition: transform 0.45s; }
  .image-effect:hover {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.015);
    transition: transform 0.12s ease-out;
  }
  .image-effect__sheen {
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    background:
      repeating-linear-gradient(90deg, #0000 0 3px, #ffffff38 3px 4px, #00000029 4px 5px) 0 0/100% 100%,
      linear-gradient(115deg, #0000 15%, #67e6ff66 30%, #a8ff8366 40%, #ffec8766 50%, #ff78ce66 60%, #0000 75%) 0 0/230% 230%;
    background-position: center, var(--shine, 50%) 50%;
    transition: opacity 0.3s;
    display: block;
    position: absolute;
    inset: 0;
  }
  .image-effect:hover .image-effect__sheen { opacity: 0.65; }
}
.fd-ficha__back {
  display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 12px; padding: 0; border: 0; background: none;
  color: var(--accent); font-weight: 700; cursor: pointer;
}
.fd-ficha__back::before { content: "←"; margin-right: 6px; }
.fd-ficha .fd-ficha__title { margin: 16px 0 0; font-size: 21px; text-align: center; }
.fd-ficha__layout { display: grid; gap: 1.5rem; margin-top: 1rem; }
@media (min-width: 64rem) {
  .fd-ficha__layout { align-items: center; gap: 3rem; grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.85fr); }
  .fd-ficha .fd-ficha__title { margin: 0; font-size: 30px; text-align: left; }
}

/* Resultado */
.result { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.result h2 { margin: 0 0 6px; font-size: 20px; }
.result h2:focus { outline: none; }
.result p { margin: 0 0 10px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tablero */
.board { margin-top: 16px; }
.board-head { display: none; }
.guesses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.row { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.row-name { display: block; font-weight: 800; margin: 0 2px 6px; }
.row-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.guesses[data-cols="4"] .row-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cell {
  position: relative; min-height: 58px; border-radius: 9px; padding: 5px 7px; display: flex; flex-direction: column;
  justify-content: center; overflow: hidden;
}
.cell-correct { background: var(--ok); color: var(--ok-ink); }
.cell-close { background: var(--near); color: var(--near-ink); }
.cell-wrong { background: var(--no); color: var(--no-ink); }
.cell-k { font-size: 11px; font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .04em; min-height: 17px; }
.cell-v { font-size: 12.5px; font-weight: 700; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.cell-top { position: absolute; top: 4px; right: 6px; display: flex; gap: 2px; font-weight: 900; font-size: 15px; line-height: 1; }
.cell-arrow { font-size: 17px; }
.row.is-new .cell { animation: flip .32s ease-out both; animation-delay: calc(var(--i) * 28ms); }
@keyframes flip { from { transform: rotateX(80deg); opacity: 0; } }
.empty { color: var(--muted); font-size: 14px; }

.foot { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.small { font-size: 13px; color: var(--muted); }

/* ------------------------------ Modales ------------------------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(2,5,9,.72); padding: 12px; }
.modal-card {
  position: relative; width: 100%; max-width: 460px; max-height: 92svh; overflow-y: auto; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 18px; padding: 22px 18px 18px;
}
.modal-card h2 { margin: 0 0 8px; font-size: 21px; padding-right: 40px; }
.modal-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.modal-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.diff-cards { display: grid; gap: 10px; margin-top: 14px; }
.diff-card {
  display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 10px; padding: 12px 14px; min-height: 64px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--bg-3); cursor: pointer;
}
.diff-card:hover, .diff-card:focus-visible { border-color: var(--accent); }
.diff-card-l { font-weight: 800; font-size: 17px; }
.diff-card-m { grid-row: span 2; align-self: center; font-weight: 900; font-size: 22px; color: var(--accent); }
.diff-card-s { font-size: 13px; color: var(--muted); }
.tut-step { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.tut-art { margin-top: 14px; padding: 16px; border-radius: 12px; background: var(--bg-3); text-align: center; font-size: 20px; letter-spacing: .06em; }
.tut-svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; color: #e8eef5; }
/* Colección (entra por la izquierda) y estadísticas (por la derecha) como páginas */
.modal--page .modal-card { animation: page-in .28s cubic-bezier(.22,1,.36,1) both; }
.modal--from-left .modal-card { --from: -100%; }
.modal--from-right .modal-card { --from: 100%; }
@keyframes page-in { from { transform: translateX(var(--from)); opacity: .4; } }
@media (max-width: 899px) {
  .modal--page { padding: 0; align-items: stretch; }
  .modal--page .modal-card { max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0;
    padding-top: calc(22px + env(safe-area-inset-top, 0px)); padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  .modal--page .modal-close { top: calc(8px + env(safe-area-inset-top, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .modal--page .modal-card { animation: none; } }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 8px 0 14px; }
.stat-n { display: block; font-size: 26px; font-weight: 900; }
.stat-l { font-size: 12px; color: var(--muted); }
.modal h3 { font-size: 15px; margin: 8px 0; }
.dist-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.dist-k { width: 16px; text-align: right; font-weight: 700; }
.dist-bar { background: var(--ok); color: var(--ok-ink); font-weight: 800; font-size: 13px; padding: 2px 6px; border-radius: 4px; text-align: right; min-width: 22px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 80; padding: 10px 16px;
  border-radius: 14px; background: #fff; color: #000; font-weight: 700; opacity: 0; pointer-events: none; transition: all .2s;
  width: max-content; max-width: calc(100vw - 32px); text-align: center; line-height: 1.3;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.noscript { padding: 16px; }
body.is-loading .panel { opacity: .85; }

/* ------------------------------- Escritorio ---------------------------- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: minmax(0, 65fr) minmax(360px, 35fr); height: 100svh; min-height: 0; }
  .stage, body.is-typing .stage { position: relative; height: 100svh; }
  .panel { height: 100svh; overflow-y: auto; max-width: none; padding: 18px 22px 30px; border-left: 1px solid var(--line); }
  .modal { align-items: center; }
  .hud-chip { font-size: 14px; }
  .brand { font-size: 19px; }
  /* tablero en formato tabla */
  .board-head { display: grid; grid-template-columns: repeat(var(--c, 6), minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
  .board-head[data-cols="4"] { --c: 4; }
  .bh-name { display: none; }
  .row-cells { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .guesses[data-cols="4"] .row-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cell { min-height: 54px; padding: 5px 6px; }
  .cell-k { display: none; }
  .cell-v { font-size: 12.5px; padding-top: 14px; }
}

/* ------------------------- Movimiento reducido ------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------ Páginas de contenido ------------------------ */
.page { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.page-top a.home { font-weight: 900; letter-spacing: .04em; text-decoration: none; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
.page-top .play { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; text-decoration: none; }
.page h1 { font-size: 28px; line-height: 1.2; margin: 22px 0 10px; }
.page h2 { font-size: 20px; margin: 26px 0 8px; }
.page p, .page li { color: #dbe4ec; }
.page dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.page dt { font-weight: 700; }
.page dd { margin: 0; }
.archive-list { list-style: none; padding: 0; }
.archive-list li { border-bottom: 1px solid var(--line); }
.archive-list a { display: flex; justify-content: space-between; gap: 12px; min-height: 48px; align-items: center; text-decoration: none; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-top: 12px; }
.breadcrumb a { display: inline-flex; min-height: 44px; align-items: center; }

/* Cabecera «⚽ EL FUTBOLISTA» en una línea también en móviles estrechos (al final: gana a las reglas base) */
@media (max-width: 520px) {
  .topbar { gap: 6px; }
  .top-actions { gap: 4px; }
  .brand { font-size: 13px; letter-spacing: .01em; }
  .brand-ball { font-size: 14px; }
}
@media (max-width: 400px) {
  .brand { font-size: 12px; letter-spacing: 0; }
  .brand-ball { font-size: 13px; }
  /* zona táctil de 44 px, pero ocupan 38 px en la fila (se solapan 3 px por lado, solo el área invisible) */
  .btn-icon { min-width: 44px; margin-inline: -3px; }
}
@media (max-width: 370px) { .brand { font-size: 11.5px; } }
@media (max-width: 340px) {
  .brand-ball { display: none; }
  .btn-icon { margin-inline: -4px; }
  .btn-chip { padding: 0 7px; }
}
