/* ========================================
   Profile — HUD Comando (show) + boletería form (edit)
   Show usa .profile-hud (sistema HUD táctico).
   Edit sigue usando .profile-grid + .profile-aside legacy.
   ======================================== */


/* ─────────────────────────────────────────────
   HUD COMANDO — perfil del usuario (show)
   ───────────────────────────────────────────── */

.profile-hud {
  position: relative;
  background: transparent; /* deja ver el fondo de la página */
  padding: 20px 16px;
}
@media (min-width: 720px)  { .profile-hud { padding: 28px; } }
@media (min-width: 1024px) { .profile-hud { padding: 36px 40px; } }

/* premium variant — glow dorado sutil alrededor del banner. */
.profile-hud.-premium {
  box-shadow: 0 0 60px -20px var(--gold-glow);
}


/* ─────────────────────────────────────────────
   BANNER HEADER + PESTAÑAS (.profile-hud.-banner)
   Portada arriba con el avatar montado, acciones (Fichines/Editar/Duelo)
   sobre la banda, meta en chips y el contenido repartido en pestañas.
   ───────────────────────────────────────────── */
.profile-hud.-banner {
  /* padding-top deja sitio a la portada, que va detrás del header (bar +
     identidad + chips) como capa de fondo y se desvanece cerca de las pestañas. */
  padding: 132px 16px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
@media (min-width: 720px) {
  .profile-hud.-banner { padding: 168px 24px 26px; }
}

/* Portada — capa de fondo del header (gradient por defecto, imagen si hay cover
   equipado). Absolute desde arriba; el contenido va por encima vía z-index. */
.profile-hud__cover {
  display: block;
  position: absolute; top: 0; left: 0; right: 0; z-index: 0;
  height: 232px;
}
@media (min-width: 720px) {
  .profile-hud__cover { height: 276px; }
}
/* Sin foto equipada: trama de gradientes por defecto. Se aísla con
   :not(.-has-image) para no competir con la imagen (que va inline). */
.profile-hud__cover:not(.-has-image) {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 24%, transparent),
      color-mix(in srgb, var(--sky) 14%, transparent)),
    var(--card-2);
}
/* Con foto: una sola vez, centrada y cubriendo (no se repite ni se corta raro). */
.profile-hud__cover.-has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Foto visible arriba; recién en el último tramo se funde con la card (para que
   el contenido montado siga legible) + un scrim sutil donde va el texto. */
.profile-hud__cover::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      transparent 0%,
      transparent 48%,
      color-mix(in srgb, var(--bg) 30%, transparent) 70%,
      var(--card) 100%);
}
.profile-hud.-premium .profile-hud__cover:not(.-has-image) {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--gold) 28%, transparent),
      color-mix(in srgb, var(--gold) 8%, transparent)),
    var(--card-2);
}
.profile-hud[data-accent]:not([data-accent=""]) .profile-hud__cover:not(.-has-image) {
  background:
    linear-gradient(135deg, var(--p-accent-dim), transparent),
    var(--card-2);
}

/* Acciones sobre la banda (esquina superior derecha) */
.profile-hud__bar {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 8;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.profile-hud__bar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.profile-hud__bar-btn.-edit {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 14px -4px var(--green-glow);
}
.profile-hud.-premium .profile-hud__bar-btn.-edit {
  background: var(--gold); color: var(--amarilla-ink);
  box-shadow: 0 4px 14px -4px var(--gold-glow);
}
.profile-hud__bar-btn.-fichines {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--gold);
  border-color: rgba(255, 210, 63, 0.4);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.profile-hud__bar-btn.-fichines b { font-family: var(--font-scoreboard); font-size: 16px; line-height: 1; }
/* El menú ⓘ sobre la banda: fondo translúcido para legibilidad */
.profile-hud__bar .profile-hud__info > summary {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* Identidad sobre la parte baja de la portada (el padding-top del header la
   posiciona; la portada va detrás vía z-index). */
.profile-hud.-banner .profile-hud__identity {
  position: relative; z-index: 2;
  flex-direction: row; align-items: flex-end; text-align: left;
  gap: 14px;
}
@media (min-width: 720px) {
  .profile-hud.-banner .profile-hud__identity { gap: 18px; }
}

/* Fila de chips de meta (socio · rol · antigüedad · equipo) */
.profile-hud__chips {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px;
}
.profile-hud__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.profile-hud__chip.-socio b { color: var(--accent); font-weight: 500; }
.profile-hud.-premium .profile-hud__chip.-socio b { color: var(--gold); }
.profile-hud__chip.-socio i { font-style: normal; color: var(--fg-3); }
.profile-hud__chip.-team { text-transform: none; letter-spacing: 0.02em; font-family: var(--font); font-size: 12px; }
.profile-hud__chip.-team strong { color: var(--fg); font-weight: 600; }

/* Pestañas */
.profile-tabs {
  position: relative; z-index: 1;
  display: flex; gap: 4px;
  margin: 18px 0 16px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.profile-tabs__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--fg-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms, color 150ms, flex 150ms;
}
.profile-tabs__btn .ico { display: inline-flex; align-items: center; }
.profile-tabs__btn .ico svg { width: 18px; height: 18px; display: block; }
.profile-tabs__btn .txt { overflow: hidden; text-overflow: ellipsis; }

/* Mobile: ícono arriba + etiqueta abajo, SIEMPRE visible en las 4 (mismo
   patrón que .tnav). Antes solo la activa mostraba texto y las demás quedaban
   como íconos ambiguos. Las 4 entran a lo ancho sin scroll. */
@media (max-width: 539px) {
  .profile-tabs__btn {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 7px 4px;
  }
  .profile-tabs__btn .txt { font-size: 9.5px; line-height: 1.1; }
}
/* Desktop: solo texto, ancho repartido en partes iguales. */
@media (min-width: 540px) {
  .profile-tabs__btn { flex: 1 1 0; min-width: 0; padding: 8px 16px; }
  .profile-tabs__btn .ico { display: none; }
}
.profile-tabs__btn:hover { color: var(--fg); }
.profile-tabs__btn.-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.profile-hud.-premium .profile-tabs__btn.-active { background: var(--gold); color: var(--amarilla-ink); }
.profile-hud[data-accent]:not([data-accent=""]) .profile-tabs__btn.-active {
  background: var(--p-accent); color: var(--accent-ink);
}

.profile-tab { position: relative; z-index: 1; }
.profile-tab.-hidden { display: none; }
/* Dentro de pestañas el primer bloque no necesita el margin-top de “sección” */
.profile-tab > .profile-hud__modules,
.profile-tab > .profile-hud__achievements,
.profile-tab > .profile-hud__tournaments,
.profile-tab > .profile-hud__palpitos-wrap { margin-top: 0; }
.profile-hud.-banner .profile-hud__h2h { position: relative; z-index: 2; margin-top: 12px; }


/* Role pill — vive en la fila de chips de meta (.profile-hud__chips) */
.profile-hud__role {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.profile-hud__role.-admin {
  color: var(--accent);
  border-color: rgba(10, 219, 198, 0.45);
  background: rgba(10, 219, 198, 0.06);
}
.profile-hud__role.-premium {
  color: var(--gold);
  border-color: rgba(255, 210, 63, 0.45);
  background: rgba(255, 210, 63, 0.06);
}
/* Cobro en proceso: mismo dorado que premium pero con el dot pulsando para
   leerse como "en curso", no "activo". */
.profile-hud__role.-pending {
  color: var(--gold);
  border-color: rgba(255, 210, 63, 0.30);
  background: rgba(255, 210, 63, 0.04);
}
.profile-hud__role.-pending .dot {
  animation: profile-hud-pulse 1.2s ease-in-out infinite;
}
@keyframes profile-hud-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
.profile-hud__role .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Info dropdown (native <details>) — replaces the old "Atajos" aside */
/* .profile-hud__info se deja sin position para que el menú se ancle al head
   (no al botón) y no se salga por la izquierda en mobile cuando la fila envuelve. */
.profile-hud__info > summary {
  list-style: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg-2);
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}
.profile-hud__info > summary::-webkit-details-marker { display: none; }
.profile-hud__info > summary::marker { content: ""; }
.profile-hud__info > summary:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}
.profile-hud__info[open] > summary {
  color: var(--accent);
  border-color: var(--accent);
}

.profile-hud__info-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(260px, calc(100vw - 48px));
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  padding: 6px;
  z-index: 30;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.profile-hud__info-menu > a,
.profile-hud__info-menu > button {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
}
.profile-hud__info-menu > a + a,
.profile-hud__info-menu > a + button,
.profile-hud__info-menu > button + a,
.profile-hud__info-menu > button + button {
  border-top: 1px dashed var(--line);
}
.profile-hud__info-menu > a:hover,
.profile-hud__info-menu > button:hover {
  background: var(--card-2);
}
.profile-hud__info-menu .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.profile-hud.-premium .profile-hud__info-menu .lbl { color: var(--gold); }
.profile-hud__info-menu .desc {
  font-size: 13px;
  color: var(--fg-2);
}


/* Identity: avatar + username/email/since */
.profile-hud__identity {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  text-align: center;
}
@media (min-width: 540px) {
  .profile-hud__identity {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 18px;
  }
}

.profile-hud__avatar {
  position: relative;
  width: 86px; height: 86px; flex: none;
  border-radius: 50%;
  font-family: var(--font-scoreboard);
  font-size: 50px;
  line-height: 1;
}
@media (min-width: 720px) {
  .profile-hud__avatar { width: 110px; height: 110px; font-size: 62px; }
}
/* La foto vive en un .avatar interno (mismo componente que el resto de la app):
   posicionado absoluto para llenar el wrapper con tamaño DEFINIDO — así el
   recorte queda en círculo limpio (no óvalo) y, si hay marco equipado, su aro
   y badge (player-theme) se dibujan por fuera. Sin overflow:hidden en el
   wrapper, justamente para no recortar ese marco. */
.profile-hud__avatar > .avatar {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  font-size: inherit;
}
/* Disco tematizado del HUD (acento + glow): solo SIN marco — con marco manda
   el aro del propio marco. */
.profile-hud__avatar > .avatar:not([class*="-frame-"]):not(.-framed) {
  border-color: var(--accent);
  color: var(--accent);
  background:
    radial-gradient(closest-side, rgba(10, 219, 198, 0.25), transparent 70%),
    var(--bg-2);
  box-shadow:
    inset 0 0 0 4px var(--bg-2),
    0 0 30px -8px var(--green-glow);
}
.profile-hud.-premium .profile-hud__avatar > .avatar:not([class*="-frame-"]):not(.-framed) {
  border-color: var(--gold);
  color: var(--gold);
  background:
    radial-gradient(closest-side, rgba(255, 210, 63, 0.30), transparent 70%),
    var(--bg-2);
  box-shadow:
    inset 0 0 0 4px var(--bg-2),
    0 0 35px -6px var(--gold-glow);
}
/* orbital dashed ring — se oculta cuando hay marco (su aro lo reemplaza) */
.profile-hud__avatar::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(10, 219, 198, 0.35);
  animation: profile-hud-orbit 14s linear infinite;
  pointer-events: none;
}
.profile-hud.-premium .profile-hud__avatar::after {
  border-color: rgba(255, 210, 63, 0.4);
}
.profile-hud__avatar:has(> .avatar[class*="-frame-"])::after,
.profile-hud__avatar:has(> .avatar.-framed)::after { display: none; }
@keyframes profile-hud-orbit {
  to { transform: rotate(360deg); }
}

.profile-hud__name {
  font-family: var(--font-scoreboard);
  font-size: 36px;
  line-height: 0.9;
  word-break: break-word;
}
@media (min-width: 720px) {
  .profile-hud__name { font-size: 48px; }
}
.profile-hud__handle {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  word-break: break-all;
}
.profile-hud.-premium .profile-hud__handle { color: var(--gold); }
.profile-hud__since {
  display: block;
  margin-top: 4px;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-hud__team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.profile-hud__team strong {
  color: var(--fg);
  font-weight: 600;
  font-family: var(--font);
}
.profile-hud__team .cl-logo { flex: none; }


/* Modules: stats grid (Fichines destacado primero) */
.profile-hud__modules {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-top: 22px;
}
@media (min-width: 720px) {
  .profile-hud__modules { grid-template-columns: repeat(4, 1fr); }
}

.profile-hud__module {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none;
  color: inherit;
}
.profile-hud__module::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 14px; height: 1px;
  background: var(--accent);
}
.profile-hud.-premium .profile-hud__module::before { background: var(--gold); }
.profile-hud__module .lbl {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.profile-hud__module .val {
  font-family: var(--font-scoreboard);
  font-size: 28px;
  color: var(--fg);
  line-height: 1;
}
.profile-hud__module .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}
.profile-hud__module.-fichines .val { color: var(--accent); }
.profile-hud__module.-fichines::before { background: var(--accent); }
a.profile-hud__module:hover { border-color: var(--line-strong); }


/* Achievements (logros como Steam) */
.profile-hud__achievements {
  position: relative; z-index: 1;
  margin-top: 26px;
}
.profile-hud__section-cap {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.profile-hud__section-cap::before,
.profile-hud__section-cap::after {
  content: ""; height: 1px; flex: 1;
  background: var(--line-strong);
}
.profile-hud__section-cap b { color: var(--fg-2); font-weight: 500; }

.profile-hud__ach-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (min-width: 540px) {
  .profile-hud__ach-grid { grid-template-columns: repeat(6, 1fr); }
}

.profile-hud__ach {
  position: relative;
  aspect-ratio: 1;
  display: grid; place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--accent);
  cursor: help;
  padding: 0;
}
.profile-hud__ach {
  aspect-ratio: 1.4 / 1; /* más bajo, menos pesado */
  max-height: 88px;
}
.profile-hud__ach > .icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
}
@media (min-width: 540px) {
  .profile-hud__ach { aspect-ratio: 1; max-height: 96px; }
  .profile-hud__ach > .icon { width: 26px; height: 26px; }
}
.profile-hud__ach > .icon > svg { width: 100%; height: 100%; }

.profile-hud__ach.-rare {
  border-color: rgba(10, 219, 198, 0.4);
  box-shadow: inset 0 0 0 1px rgba(10, 219, 198, 0.15);
}
.profile-hud__ach.-legend {
  color: var(--accent);
  border-color: rgba(10, 219, 198, 0.55);
  box-shadow:
    0 0 18px -6px var(--green-glow),
    inset 0 0 0 1px rgba(10, 219, 198, 0.18);
}

.profile-hud__ach.-locked {
  color: var(--fg-3);
}
.profile-hud__ach.-locked > .icon { opacity: 0.35; filter: grayscale(1); }
.profile-hud__ach.-locked::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg,
    transparent 0 8px, rgba(0, 0, 0, 0.25) 8px 10px);
}

/* Tooltip nativo del logro (tap-friendly via :focus-within) */
.profile-hud__ach > .tip {
  position: absolute;
  left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  width: 170px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  pointer-events: none;
  opacity: 0; transition: 0.15s;
  z-index: 30; text-align: left;
}
/* Flip tooltip alignment on edge columns to avoid viewport overflow.
   Mobile: 3 columns → flip 3n right, 3n+1 left. Desktop: 6 columns. */
.profile-hud__ach:nth-child(3n) > .tip {
  left: auto; right: -6px; transform: translateY(4px);
}
.profile-hud__ach:nth-child(3n+1) > .tip {
  left: -6px; right: auto; transform: translateY(4px);
}
@media (min-width: 540px) {
  .profile-hud__ach:nth-child(3n) > .tip,
  .profile-hud__ach:nth-child(3n+1) > .tip {
    left: 50%; right: auto; transform: translateX(-50%) translateY(4px);
  }
  .profile-hud__ach:nth-child(6n) > .tip {
    left: auto; right: -6px; transform: translateY(4px);
  }
  .profile-hud__ach:nth-child(6n+1) > .tip {
    left: -6px; right: auto; transform: translateY(4px);
  }
}
.profile-hud__ach > .tip b {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg);
}
.profile-hud__ach > .tip span {
  font-size: 11px; color: var(--fg-3);
}
.profile-hud__ach:hover > .tip,
.profile-hud__ach:focus-visible > .tip,
.profile-hud__ach:focus-within > .tip {
  opacity: 1;
  translate: 0 -4px; /* slide up; horizontal alignment preserved by per-column transform */
}
.profile-hud__ach-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--fg-3);
  padding: 18px 0;
}


/* Upsell premium (free only) */
.profile-hud__upsell {
  position: relative; z-index: 1;
  margin-top: 22px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(10, 219, 198, 0.06), transparent);
  border: 1px dashed rgba(10, 219, 198, 0.4);
  display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 540px) {
  .profile-hud__upsell {
    flex-direction: row; align-items: center; justify-content: space-between;
  }
}
.profile-hud__upsell .txt {
  font-size: 13px;
  color: var(--fg-2);
}
.profile-hud__upsell .txt b {
  color: var(--accent);
  font-weight: 600;
}
.profile-hud__upsell a {
  align-self: stretch;
  padding: 8px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
@media (min-width: 540px) {
  .profile-hud__upsell a { align-self: auto; }
}


/* Stats avanzadas (premium) */
.profile-hud__advanced {
  position: relative; z-index: 1;
  margin-top: 22px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(10, 219, 198, 0.05), transparent);
  border: 1px solid rgba(10, 219, 198, 0.25);
}
.profile-hud__advanced .grid {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin-top: 12px;
}
@media (min-width: 540px) {
  .profile-hud__advanced .grid { grid-template-columns: repeat(3, 1fr); }
}
.profile-hud__advanced .stat { display: flex; flex-direction: column; }
.profile-hud__advanced .stat .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.profile-hud__advanced .stat .val {
  font-family: var(--font-scoreboard);
  font-size: 30px;
  color: var(--accent);
}


/* Botón pill reusable (lo usa "← Volver al perfil" en el historial de XP) */
.profile-hud__btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.profile-hud__btn:hover { border-color: var(--accent); }
.profile-hud__btn.-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.profile-hud__btn.-gold {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}



/* ─────────────────────────────────────────────
   Legacy: edit form usa esto todavía
   ───────────────────────────────────────────── */


/* ─── Two-column grid (credencial / form on left, aside on right) ─── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  /* default align-items=stretch so both columns share the row's
     height when displayed side by side. */
}
@media (min-width: 880px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); }
}
/* Both grid items become column-flex so their action rows can dock
   to the bottom (margin-top:auto) when the row stretches. */
.profile-grid > .profile-credencial,
.profile-grid > .boleteria-form-card,
.profile-grid > .profile-aside {
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* belt-and-braces against any inner element forcing
                       a horizontal scroll on the page */
}
.profile-grid > .profile-credencial > .profile-credencial__actions,
.profile-grid > .boleteria-form-card > .boleteria-form > .boleteria-form__actions {
  margin-top: auto;
}
.profile-grid > .boleteria-form-card > .boleteria-form { flex: 1; }

/* El combobox de equipos (team-search) es compartido con el alta de cuenta y
   se estiliza en auth-form.css contra tokens --auth-*. Acá lo reusamos dentro
   del boleteria-form mapeando esos tokens a la paleta global. */
.boleteria-form__field > .team-combo {
  --auth-form-bg-2: var(--card);
  --auth-line: var(--line);
  --auth-line-strong: var(--line-strong);
  --auth-ink: var(--ink);
  --auth-muted: var(--muted);
  --auth-green: var(--accent);
}


/* ─── Credencial card (show) ─── */
.profile-credencial {
  position: relative;
  padding: 22px 26px 24px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}

.profile-credencial__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--line-strong);
}
.profile-credencial__eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-credencial .role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}
.profile-credencial .role-badge.-admin {
  background: rgba(10, 219, 198, 0.14);
  color: var(--accent);
  border-color: rgba(10, 219, 198, 0.32);
}


/* Identity row: avatar + username/email/since */
.profile-credencial__main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.profile-credencial__avatar {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(10, 219, 198, 0.32), rgba(10, 219, 198, 0.1));
  border: 2px solid rgba(10, 219, 198, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-scoreboard);
  font-size: 36px;
  color: var(--green);
  box-shadow: 0 4px 18px rgba(10, 219, 198, 0.18);
}
.profile-credencial__avatar > .img,
.profile-credencial__avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-credencial__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-credencial__username {
  font-family: var(--font-scoreboard);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--ink);
  margin: 0;
}
.profile-credencial__email {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.profile-credencial__since {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}


/* Stats grid */
.profile-credencial__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  margin-bottom: 18px;
}
.profile-credencial__stat {
  padding: 14px 12px;
  text-align: center;
  border-right: 1px dashed var(--line);
}
.profile-credencial__stat:last-child { border-right: 0; }
.profile-credencial__stat > .num {
  font-family: var(--font-scoreboard);
  font-size: 30px;
  line-height: 0.9;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.profile-credencial__stat:first-child > .num { color: var(--accent); }
.profile-credencial__stat > .lbl {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 559px) {
  .profile-credencial__main { flex-direction: column; align-items: flex-start; }
  .profile-credencial__stat > .num { font-size: 22px; }
}


/* Action row */
.profile-credencial__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}


/* ─── Generic ghost / primary pill buttons used in profile ─── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }

.btn-primary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--green-glow);
  transition: transform 150ms, box-shadow 200ms;
}
.btn-primary-pill:hover { transform: translateY(-1px); box-shadow: 0 10px 24px var(--green-glow); }


/* ─── Edit form — avatar upload row ─── */
.profile-avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}
.profile-avatar-preview {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 219, 198, 0.32), rgba(10, 219, 198, 0.1));
  border: 2px solid rgba(10, 219, 198, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-scoreboard);
  font-size: 30px;
  color: var(--green);
}
.profile-avatar-preview .img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-preview .placeholder { font-size: inherit; }
.profile-avatar-preview .-hidden { display: none; }

.profile-avatar-controls { flex: 1; min-width: 0; }
/* Subida de archivo: input nativo oculto + label-botón estilado (el texto
   "Browse… / No file selected" del control nativo no se puede cambiar por CSS,
   así que lo reemplazamos por un botón propio). Usado por foto y portada. */
.file-upload {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  cursor: pointer;
}
.file-upload__input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.file-upload__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 150ms, border-color 150ms;
}
.file-upload:hover .file-upload__btn { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.file-upload__input:focus-visible + .file-upload__btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-avatar-hint {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}


/* Divider inside boletería-form (e.g. "— Cambiar contraseña") */
.boleteria-form__divider {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 16px 0 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.boleteria-form__divider .muted {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
}


/* Collapsible sub-section inside a boletería form (e.g. cambiar
   contraseña). Native <details>/<summary>, no JS. */
.boleteria-form__collapsible {
  margin: 8px 0 4px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
}
.boleteria-form__collapsible > summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  cursor: pointer;
  list-style: none; /* hide default disclosure marker */
  padding: 4px 0;
}
.boleteria-form__collapsible > summary::-webkit-details-marker { display: none; }
.boleteria-form__collapsible > summary::marker { content: ""; }

.boleteria-form__collapsible-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.boleteria-form__collapsible-hint {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}
.boleteria-form__collapsible-chevron {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.boleteria-form__collapsible[open] > summary .boleteria-form__collapsible-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}
.boleteria-form__collapsible[open] > summary .boleteria-form__collapsible-label {
  color: var(--accent);
}
.boleteria-form__collapsible-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}


/* Action row (Cancelar + submit) */
.boleteria-form__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.btn-ghost-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms;
}
.btn-ghost-link:hover { color: var(--ink); }


/* ─── Aside panel — atajos / buenas prácticas ─── */
.profile-aside {
  position: relative;
  padding: 24px 26px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(10, 219, 198, 0.04) 0%, transparent 60%),
    var(--bg-2);
}
.profile-aside__eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.profile-aside__title {
  font-family: var(--font-scoreboard);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 18px;
}

/* Linked shortcuts (show) */
.profile-aside__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.profile-aside__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
  text-decoration: none;
  transition: background 150ms;
}
.profile-aside__links > li:first-child .profile-aside__link { border-top: 0; padding-top: 0; }
.profile-aside__link-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.profile-aside__link-meta {
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: color 150ms;
}
.profile-aside__link:hover .profile-aside__link-meta { color: var(--ink); }

.profile-aside__logout {
  width: 100%;
  margin-top: 18px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.profile-aside__logout:hover { border-color: var(--coral); color: var(--coral); }
.profile-aside__logout form { width: 100%; }


/* Steps list (edit) */
.profile-aside__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-aside__steps > li {
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.profile-aside__steps > li:first-child {
  padding-top: 0;
  border-top: 0;
}
.profile-aside__step-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.profile-aside__steps > li > p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ─── Zona de riesgo (baja de cuenta) ─── */
.profile-aside__danger {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--red-dim);
}
.profile-aside__danger > .profile-aside__step-label { color: var(--coral); }
.profile-aside__danger > p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.profile-aside__danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--red-dim);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--coral);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 150ms, background 150ms, color 150ms;
}
.profile-aside__danger-btn:hover {
  border-color: var(--coral);
  background: var(--red-dim);
  color: #fff;
}

/* Submit destructivo — rojo en vez del dorado del CTA positivo. */
.boleteria-form__submit.-danger {
  background: linear-gradient(135deg, var(--roja), #c62836);
  color: #fff;
  box-shadow: 0 6px 18px var(--red-dim);
}
.boleteria-form__submit.-danger:hover {
  box-shadow: 0 10px 24px rgba(230, 57, 70, 0.35);
}

/* ---------- Insignias ---------- */
.profile-badges {
  padding: 16px 0;
  border-top: 1px dashed var(--line-strong);
}
.profile-badges__label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.profile-badges__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--card-2);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.profile-badge > span { color: var(--ink-soft); }
.profile-badges__empty {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ---------- Premium: marco dorado + stats avanzadas ---------- */
.profile-credencial.-premium {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 8px 30px -12px rgba(255, 210, 63, 0.35);
}

.profile-advanced {
  padding: 16px 0 4px;
  border-top: 1px dashed var(--line-strong);
}
.profile-advanced__label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.profile-advanced__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.profile-advanced__stat {
  text-align: center;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 6px;
}
.profile-advanced__stat > .num {
  display: block;
  font-family: var(--font-scoreboard);
  font-size: 1.5rem;
  color: var(--accent);
}
.profile-advanced__stat > .lbl {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}


/* === Nombres de jugador clickeables === */
.player-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.player-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* === Perfil público: torneos pronosticados === */
.profile-hud__tournaments {
  position: relative; z-index: 1;
  margin-top: 26px;
}
.profile-hud__trn-grid {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
@media (min-width: 560px) {
  .profile-hud__trn-grid { grid-template-columns: repeat(2, 1fr); }
}
.profile-hud__trn {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 10px 12px;
  min-width: 0;
}
.profile-hud__trn .ico {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.profile-hud__trn .ico img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
.profile-hud__trn .ico:empty { display: none; }
.profile-hud__trn .body {
  min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.profile-hud__trn .name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
}
.profile-hud__trn .meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}


/* === Perfil público: últimos palpitos coloreados === */
.profile-hud__palpitos-wrap {
  position: relative; z-index: 1;
  margin-top: 26px;
}
/* Mobile-first: lista vertical, cada palpito a lo ancho con el marcador
   alineado a la derecha. En desktop (abajo) vuelve a chips que envuelven. */
.profile-hud__palpitos {
  display: flex; flex-direction: column; gap: 6px;
}
.palpito-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--bg-2);
}
.palpito-chip .teams {
  min-width: 0;
  font-size: 13px;
  color: var(--fg-2);
}
.palpito-chip .score {
  flex: 0 0 auto;
  font-family: var(--font-scoreboard);
  font-size: 20px;
  line-height: 1;
}
@media (min-width: 720px) {
  .profile-hud__palpitos { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .palpito-chip {
    flex-direction: column; align-items: flex-start; justify-content: flex-start;
    width: auto; gap: 2px; padding: 8px 12px;
  }
  .palpito-chip .teams { white-space: nowrap; font-size: 12px; }
  .palpito-chip .score { font-size: 18px; }
}
.palpito-chip.-green {
  border-left-color: var(--green);
  background: var(--green-dim);
}
.palpito-chip.-green .score { color: var(--green); }
.palpito-chip.-yellow {
  border-left-color: var(--gold);
  background: var(--gold-dim);
}
.palpito-chip.-yellow .score { color: var(--gold); }
.palpito-chip.-red {
  border-left-color: var(--red);
  background: var(--red-dim);
}
.palpito-chip.-red .score { color: var(--red); }

.profile-hud__palpitos-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-3);
}
.profile-hud__palpitos-legend span {
  display: inline-flex; align-items: center; gap: 6px;
}
.profile-hud__palpitos-legend .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.profile-hud__palpitos-legend .dot.-green { background: var(--green); }
.profile-hud__palpitos-legend .dot.-yellow { background: var(--gold); }
.profile-hud__palpitos-legend .dot.-red { background: var(--red); }

.profile-hud__empty {
  font-size: 13px;
  color: var(--fg-3);
  margin: 8px 0 0;
}

/* Link "Ver historial completo" dentro de la sección de palpitos */
.profile-hud__historial-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  transition: gap 150ms;
}
.profile-hud__historial-link:hover { gap: 8px; }
.profile-hud__historial-link .arr { transition: transform 150ms; }
.profile-hud__historial-link:hover .arr { transform: translateX(2px); }
.profile-hud.-premium .profile-hud__historial-link { color: var(--gold); }


/* ─────────────────────────────────────────────
   HISTORIAL DE PALPITOS — página /profile/historial
   ───────────────────────────────────────────── */

.historial-wrap {
  position: relative;
}

/* Lista de entradas */
.historial-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Card de historial (.hist-card) ──────────────────────────────────────
   Mobile: el partido arriba (full-width) y abajo el duelo (izq) + veredicto
   (der). Desktop: una sola fila — partido | duelo | veredicto. */
.hist-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main main"
    "duel verdict";
  gap: 12px 16px;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px 16px 13px 20px;
  overflow: hidden;
  transition: border-color 150ms, background 150ms;
}
.hist-card:hover { border-color: var(--line-strong); background: var(--card-2); }

@media (min-width: 640px) {
  .hist-card {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "main duel verdict";
    gap: 22px;
    padding: 14px 20px 14px 24px;
  }
}

/* Barra de estado lateral */
.hist-card__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--line-strong);
}
.hist-card.-exact  .hist-card__bar { background: var(--green); }
.hist-card.-result .hist-card__bar { background: var(--gold); }
.hist-card.-miss   .hist-card__bar { background: var(--red); }

/* ── Partido: equipos (2 líneas) + meta ── */
.hist-card__main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.hist-card__teams {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hist-team {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.hist-team .nm {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.hist-card__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--fg-3);
  line-height: 1.2;
}
.hist-card__meta .ico {
  width: 14px; height: 14px;
  object-fit: contain;
  border-radius: 3px;
  flex: none;
}
.hist-card__meta .trn { color: var(--fg-2); font-weight: 500; }
.hist-card__meta .dot { color: var(--line-strong); }

/* ── Duelo: pálpito → real, cada uno con su caption ── */
.hist-card__duel {
  grid-area: duel;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}
@media (min-width: 640px) {
  .hist-card__duel {
    justify-content: center;
    padding: 0 22px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}
.duel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.duel-col .cap {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.duel-col .score {
  font-family: var(--font-scoreboard);
  font-size: 27px;
  line-height: 1;
  color: var(--fg);
  display: inline-flex;
  align-items: baseline;
}
.duel-col .score i {
  font-style: normal;
  color: var(--fg-3);
  font-size: 0.62em;
  margin: 0 2px;
}
.duel-col .score.-pred.-exact  { color: var(--green); }
.duel-col .score.-pred.-result { color: var(--gold); }
.duel-col .score.-pred.-miss   { color: var(--red); }
.duel-arrow {
  display: inline-flex;
  align-items: center;
  color: var(--fg-3);
  margin-top: 14px;
}

/* ── Veredicto: puntos + badge + fichines ── */
.hist-card__verdict {
  grid-area: verdict;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
@media (min-width: 640px) {
  .hist-card__verdict {
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    min-width: 62px;
  }
}
.verdict-pts {
  font-family: var(--font-scoreboard);
  font-size: 30px;
  line-height: 0.9;
  color: var(--fg-2);
  white-space: nowrap;
}
.verdict-pts i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-left: 3px;
}
.verdict-pts.-pos  { color: var(--green); }
.verdict-pts.-neg  { color: var(--red); }
.verdict-pts.-zero { color: var(--fg-3); }

.verdict-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.hist-card.-exact  .verdict-badge { color: var(--green); background: var(--green-dim); }
.hist-card.-result .verdict-badge { color: var(--gold);  background: var(--gold-dim); }
.hist-card.-miss   .verdict-badge { color: var(--fg-3);  background: rgba(236, 232, 220, 0.06); }

/* Estados extra usados por "Mis pálpitos" del torneo (tournaments/_palpito_card):
   partidos que el historial del perfil no muestra. En vivo = parcial provisorio
   (coral); por jugarse = pálpito cargado, sin resultado todavía (muted). */
.hist-card.-live    .hist-card__bar { background: var(--coral); }
.hist-card.-pending .hist-card__bar { background: var(--line-strong); }
.duel-col .score.-pred.-live { color: var(--coral); }
.duel-col .score.-real.-live { color: var(--coral); }
.duel-col .score.-real.-pending { color: var(--fg-3); }
.verdict-pts.-live { color: var(--coral); }
.hist-card.-live .verdict-badge {
  color: var(--coral);
  background: rgba(255, 120, 102, 0.12);
}
.hist-card.-pending .verdict-badge {
  color: var(--fg-3);
  background: rgba(236, 232, 220, 0.06);
}
/* Indicador "En vivo" en la meta de la card */
.hist-card__meta .trn.-live {
  color: var(--coral);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.verdict-fichines { display: inline-flex; gap: 4px; }
.verdict-fichines .fichin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  flex: none;
}

/* Empty state del historial */
.historial-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--fg-3);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.historial-empty a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.historial-empty a:hover { text-decoration: underline; }

/* Botón / trigger de infinite scroll */
.historial-load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

/* Spinner puntito giratorio */
.historial-load-more-btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: historial-spin 0.7s linear infinite;
  flex: none;
}
@keyframes historial-spin {
  to { transform: rotate(360deg); }
}
