/* Progress «como un juego» (t239; rehecho en t244; en vivo desde t252,
 * 2026-11-20): `progress.html` carga esta hoja con `progress_game_on` y la raíz
 * lleva `.gp-pv`. Color por sección (rango, llama, misión del día y de la semana,
 * rareza), medallas con su anillo en un solo SVG (centradas por
 * construcción; aquí sólo se les da tamaño, nunca se recolocan por dentro),
 * el camino de los ocho rangos y una tira de cifras. Sólo tokens de la casa;
 * lo que se mueve, dentro de `prefers-reduced-motion: no-preference`; a 390 px,
 * sin scroll horizontal.
 */
.gp-pv { --rk: var(--rk-1); --pv-glow: color-mix(in srgb, var(--rk) 38%, transparent); }

/* --- Medallas (`medal()` en gam-progress-pv.js) ----------------------------- */
svg.pv-medal { display: block; flex: none; overflow: visible; }
svg.pv-medal .pv-rt { stroke: color-mix(in srgb, var(--text-faint) 22%, var(--surface-sunken)); }
svg.pv-medal.on.ra-rare, svg.pv-medal.on.ra-epic { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ra) 50%, transparent)); }
svg.pv-medal.on.ra-legendary { filter: drop-shadow(0 0 9px color-mix(in srgb, var(--ra-legendary) 65%, transparent)); }
.pv-ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.15em; flex: none; }

/* --- Cabecera: el jugador -------------------------------------------------- */
.gp-pv .gp-hero.pv-hero { grid-template-columns: 236px minmax(0, 1fr); gap: var(--s6); padding: var(--s6);
  background:
    radial-gradient(70% 120% at 0% 0%, color-mix(in srgb, var(--rk) 30%, transparent), transparent 62%),
    radial-gradient(60% 90% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(60% 90% at 90% 110%, color-mix(in srgb, var(--info) 14%, transparent), transparent 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--rk) 50%, var(--line)); box-shadow: 0 10px 40px -18px var(--pv-glow); }
.gp-pv .gp-hero.pv-hero::before { display: none; }
/* El emblema, su aura y el anillo de niveles: un cuadrado; los tres, centrados en él. */
.pv-emw { position: relative; width: 236px; height: 236px; display: grid; place-items: center; justify-self: center; }
.pv-emw > * { grid-area: 1 / 1; }
.pv-emw .gp-em { width: 168px; height: 168px; display: grid; place-items: center; position: relative; z-index: 1; }
.pv-emw .gp-em svg { width: 168px; height: 168px; }
.pv-aura { width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rk) 50%, transparent), transparent 70%); }
.pv-lvring { width: 236px; height: 236px; overflow: visible; }
.pv-lvring circle { fill: none; }
.pv-lvring .tr { stroke: color-mix(in srgb, var(--rk) 16%, var(--surface-sunken)); stroke-width: 3.2; }
.pv-lvring .pr { stroke: var(--rk); stroke-width: 3.2; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--pv-glow)); }
.pv-lvring .tk circle { fill: var(--surface); }
.pv-lv { position: absolute; z-index: 2; left: 50%; bottom: -4px; transform: translateX(-50%); min-width: 64px; padding: 4px 12px 5px; border-radius: 14px; text-align: center; line-height: 1;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rk) 35%, #fff), color-mix(in srgb, var(--rk) 70%, #fff)); color: color-mix(in srgb, var(--rk) 35%, #000);
  box-shadow: 0 4px 14px var(--pv-glow), inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent); border: 2px solid var(--surface); }
.pv-lv small { display: block; font-size: var(--size-2xs); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.pv-lv b { font-size: var(--size-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.gp-pv .pv-main .rk { font-size: var(--size-3xl); font-weight: 800; letter-spacing: -.025em; line-height: 1.05; margin: 2px 0 0;
  background: linear-gradient(95deg, var(--text) 10%, color-mix(in srgb, var(--rk) 85%, var(--text)) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pv-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--text-muted); font-size: var(--size-sm); margin-top: 6px; }
.pv-sub .pv-ic { color: var(--rk); font-size: 18px; }
.pv-sub b { color: var(--text); font-variant-numeric: tabular-nums; }
.pv-perk { padding: 2px 10px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--rk) 14%, transparent); border: 1px solid color-mix(in srgb, var(--rk) 40%, transparent); color: var(--text); font-size: var(--size-xs); }
.pv-xp { position: relative; height: 22px; margin: var(--s4) 0 var(--s2); border-radius: 999px; overflow: hidden;
  background: var(--surface-sunken); border: 1px solid var(--line); box-shadow: inset 0 2px 4px color-mix(in srgb, #000 25%, transparent); }
.pv-xp i { position: absolute; top: 0; bottom: 0; left: 0; display: block; }
.pv-xp i.fill { border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--rk) 60%, var(--accent)), var(--rk) 60%, color-mix(in srgb, var(--rk) 55%, #fff));
  box-shadow: 0 0 14px var(--pv-glow); overflow: hidden; }
.pv-xp i.fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, #fff 45%, transparent) 50%, transparent 70%); transform: translateX(-100%); }
.pv-xp i.today { background: repeating-linear-gradient(135deg, color-mix(in srgb, #fff 32%, transparent) 0 6px, transparent 6px 12px); }
.pv-xp > i:not(.fill):not(.today) { width: 1px; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.pv-xp .lab { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--size-xs); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text);
  text-shadow: 0 1px 2px color-mix(in srgb, var(--bg) 80%, transparent); }
.pv-today { color: var(--rk); }
.pv-near-line { display: flex; align-items: center; gap: 6px; margin: var(--s2) 0 0; font-size: var(--size-sm); font-weight: 600; color: var(--text); }
.pv-near-line .pv-ic { color: var(--flame-hot); font-size: 16px; }
.pv-next { --nx: var(--rk); display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3); font-size: var(--size-sm); color: var(--text-muted);
  padding: 8px 14px 8px 8px; border-radius: var(--radius); width: fit-content; max-width: 100%;
  background: linear-gradient(100deg, color-mix(in srgb, var(--nx) 16%, var(--surface)), var(--surface) 80%); border: 1px solid color-mix(in srgb, var(--nx) 40%, var(--line)); }
.pv-next .gp-em, .pv-next svg { width: 40px; height: 40px; flex: none; }
.pv-next b { color: var(--text); }
.pv-next small { display: block; font-size: var(--size-xs); color: var(--text-faint); }

/* --- El camino de los rangos ---------------------------------------------- */
.pv-road { margin-top: var(--s3); padding: var(--s4) var(--s5) var(--s5);
  background: linear-gradient(90deg, color-mix(in srgb, var(--rk-1) 8%, var(--surface)), color-mix(in srgb, var(--rk-5) 8%, var(--surface)) 55%, color-mix(in srgb, var(--rk-8) 12%, var(--surface))); }
.pv-road-hd { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--size-xs); }
.pv-track { position: relative; margin-top: var(--s3); }
.pv-track > i { position: absolute; top: 34px; left: 6.25%; height: 6px; border-radius: 3px; }
.pv-track > i.line { right: 6.25%; background: var(--surface-sunken); border: 1px solid var(--line); }
.pv-track > i.done { max-width: 87.5%; background: linear-gradient(90deg, var(--rk-1), var(--rk-2), var(--rk-3), var(--rk-4), var(--rk-5), var(--rk-6), var(--rk-7), var(--rk-8)); background-size: 114% 100%;
  box-shadow: 0 0 12px var(--pv-glow); }
.pv-track ol { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.pv-track li { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; padding: 0 2px 4px; border-radius: var(--radius-sm); position: relative; outline-offset: 2px; }
.pv-track li .gp-em { width: 72px; height: 72px; display: grid; place-items: center; }
.pv-track li svg { width: 48px; height: 48px; }
.pv-track li.cur svg { width: 64px; height: 64px; }
.pv-track li.cur .gp-em { border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rk) 35%, transparent), transparent 70%); }
.pv-track li b { font-size: var(--size-2xs); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pv-track li small { font-size: var(--size-2xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pv-track li.cur b { color: var(--rk); }
.pv-track li em { font-style: normal; font-size: var(--size-2xs); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: color-mix(in srgb, var(--rk) 35%, #000); background: color-mix(in srgb, var(--rk) 55%, #fff); border-radius: 999px; padding: 1px 8px; }

/* --- Tira de cifras ---------------------------------------------------------- */
.pv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.pv-stat { --c: var(--accent); display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s3); align-items: center; padding: var(--s3) var(--s4);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 20%, var(--surface)), var(--surface) 75%); border-color: color-mix(in srgb, var(--c) 42%, var(--line)); }
.pv-stat .eyebrow { margin: 0; color: var(--c); }
.pv-stat .n b { font-size: var(--size-xl); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pv-stat .n small { font-size: var(--size-xs); color: var(--text-muted); }
.pv-mini { display: block; height: 5px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; margin-top: 6px; }
.pv-mini i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 3px; }

/* --- Hoy y racha ------------------------------------------------------------ */
.gp-pv [data-gp="today"] { background: linear-gradient(160deg, color-mix(in srgb, var(--rk) 16%, var(--surface)), var(--surface) 60%); border-color: color-mix(in srgb, var(--rk) 40%, var(--line)); }
.pv-todayw { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s4); align-items: center; margin-top: var(--s2); }
svg.pv-medal.pv-big .pv-rp { filter: drop-shadow(0 0 2px var(--pv-glow)); }
.pv-tnum b { font-size: var(--size-xl); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.pv-tnum small { margin-left: 6px; font-size: var(--size-xs); color: var(--text-faint); }
.gp-pv .gp-streak { background: linear-gradient(160deg, color-mix(in srgb, var(--flame) 18%, var(--surface)), var(--surface) 60%); border-color: color-mix(in srgb, var(--flame) 42%, var(--line)); }
.gp-pv .gp-streak .top { gap: var(--s4); }
.gp-pv .gp-streak .top svg.pv-fl { width: 76px; height: 76px; color: inherit; }
.gp-pv .gp-streak .n { font-size: var(--size-3xl); font-weight: 800; }
.gp-pv .gp-days i.q { background: linear-gradient(180deg, var(--flame-hot), var(--flame)); box-shadow: 0 0 6px color-mix(in srgb, var(--flame) 45%, transparent); }
.gp-pv .gp-mult div.cur { background: linear-gradient(180deg, color-mix(in srgb, var(--flame-hot) 30%, var(--surface)), color-mix(in srgb, var(--flame) 26%, var(--surface))); }

/* --- Misiones como tarjetas -------------------------------------------------- */
.gp-pv [data-gp="daily"] { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface) 60%); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.gp-pv [data-gp="weekly"] { background: linear-gradient(160deg, color-mix(in srgb, var(--info) 16%, var(--surface)), var(--surface) 60%); border-color: color-mix(in srgb, var(--info) 40%, var(--line)); }
.pv-qhd { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: var(--size-xs); }
.pv-qhd .eyebrow { margin: 0; }
.pv-chest { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--size-xs); padding: 3px 10px 3px 8px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--flame-hot) 10%, transparent); border: 1px solid color-mix(in srgb, var(--flame-hot) 35%, transparent); }
.pv-chest .pv-ic { font-size: 18px; color: var(--flame-hot); }
.pv-chest .n { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--text); }
.pv-chest.open { color: var(--text); background: color-mix(in srgb, var(--flame-hot) 22%, transparent); }
.pv-qs { display: grid; gap: var(--s2); margin-top: var(--s3); }
.pv-q { --c: var(--accent); position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.pv-q[data-kind="weekly"], .pv-q[data-kind="fixed"] { --c: var(--info); }
.pv-q .t { font-size: var(--size-sm); font-weight: 650; }
.pv-q a.t.go { display: inline-flex; align-items: baseline; gap: 6px; color: var(--text); text-decoration: none; }
.pv-q a.t.go .ar { color: var(--c); }
.pv-q a.t.go:hover, .pv-q a.t.go:focus-visible { color: var(--c); text-decoration: underline; text-underline-offset: 3px; }
.pv-q .gp-hint { font-size: var(--size-xs); color: var(--text-faint); margin-top: 2px; }
.pv-qp { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: var(--size-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pv-qp .pips { display: inline-flex; gap: 3px; }
.pv-qp .pips i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-sunken); border: 1px solid var(--line); }
.pv-qp .pips i.on { background: var(--c); border-color: transparent; box-shadow: 0 0 6px color-mix(in srgb, var(--c) 50%, transparent); }
.pv-qp .pv-mini { width: 96px; margin: 0; --c: inherit; }
.pv-qp .pv-mini i { background: var(--c); }
.pv-rw { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 7px; border-radius: 999px; font-weight: 800; font-size: var(--size-sm); font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--text); background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.pv-rw small { font-size: var(--size-2xs); font-weight: 700; color: var(--text-muted); }
.pv-rw .pv-ic { color: var(--c); font-size: 16px; }
.pv-q.done { background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.pv-q.done .t { color: var(--text-muted); }
.pv-stamp { position: absolute; right: 110px; top: 50%; transform: translateY(-50%) rotate(-12deg); font-size: var(--size-2xs); font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c); border: 2px solid var(--c); border-radius: 6px; padding: 1px 6px; opacity: .55; pointer-events: none; }

/* --- Logros: «Closest to unlock» y la pared ------------------------------- */
.pv-close { margin-bottom: var(--s4); }
.pv-close-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s2); }
.pv-ca { --ra: var(--ra-common); display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s3); align-items: center; padding: var(--s3); border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--ra) 18%, var(--surface)), var(--surface) 75%); border: 1px solid color-mix(in srgb, var(--ra) 45%, var(--line)); }
.pv-ca b { display: block; font-size: var(--size-sm); }
.pv-ca small { display: block; font-size: var(--size-xs); color: var(--text-muted); line-height: 1.35; margin-top: 2px; }
.pv-cap { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: var(--size-2xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.pv-cap .rar { font-weight: 750; color: var(--ra); text-transform: uppercase; letter-spacing: .06em; }
.gp-pv .gp-a { grid-template-columns: 64px minmax(0, 1fr); align-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--ra) 7%, var(--surface)), var(--surface) 70%); }
.gp-pv .gp-a .disc.pv-disc { width: 64px; height: 64px; display: block; background: none; border: 0; box-shadow: none; border-radius: 0; filter: none; opacity: 1; }
.gp-pv .gp-a .disc.pv-disc > svg, .pv-ca > svg.pv-medal { width: 64px; height: 64px; }
.gp-pv .gp-a.on { background: linear-gradient(150deg, color-mix(in srgb, var(--ra) 18%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--ra) 50%, var(--line)); }
.gp-pv .gp-a.on[data-ra="legendary"] { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ra) 50%, transparent), 0 8px 26px -6px color-mix(in srgb, var(--ra) 40%, transparent); }
.gp-pv .gp-a.locked .n { color: var(--text-muted); }
.gp-pv .gp-filters button[aria-pressed="true"] { background: color-mix(in srgb, var(--rk) 20%, var(--surface)); border-color: var(--rk); }

/* --- Movimiento: sólo si se quiere ----------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .pv-aura { animation: pv-aura 3.6s ease-in-out infinite; }
  .pv-xp i.fill::after { animation: pv-shine 3.2s ease-in-out 1s infinite; }
  .pv-xp i.fill { transition: width .9s cubic-bezier(.2, .8, .2, 1); }
  .pv-lvring .pr, svg.pv-medal .pv-rp { transition: stroke-dashoffset .9s cubic-bezier(.2, .8, .2, 1); }
  .pv-track li { transition: transform .18s ease; }
  .pv-track li:hover, .pv-track li:focus-visible { transform: translateY(-3px); }
  .pv-track li.cur .gp-em svg { animation: pv-bob 2.8s ease-in-out infinite; }
  .pv-stat, .pv-ca { transition: transform .18s ease, box-shadow .18s ease; }
  .pv-stat:hover, .pv-ca:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--c, var(--ra)) 20%, transparent); }
  .pv-q { transition: transform .15s ease, border-color .15s ease; }
  .pv-q:hover { transform: translateX(2px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
  .pv-q.done .pv-stamp { animation: pv-stamp .5s cubic-bezier(.2, .9, .3, 1.4) both; }
  .gp-pv .gp-a { transition: transform .18s ease, box-shadow .18s ease; }
  .gp-pv .gp-a.on:hover { transform: translateY(-3px); }
  .gp-pv .gp-a.on:hover svg.pv-medal { animation: pv-pop .5s cubic-bezier(.2, .9, .3, 1.5); }
  svg.pv-medal.on.ra-legendary { animation: pv-leg 2.8s ease-in-out infinite; }
  .pv-chest.open .pv-ic { animation: pv-pop 1.6s ease-in-out infinite; }
  .gp-pv .gp-streak .top:not(.cold) svg.pv-fl { animation: pv-flame 2s ease-in-out infinite; }
}
@keyframes pv-aura { 50% { transform: scale(1.08); opacity: .8; } }
@keyframes pv-shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes pv-bob { 50% { transform: translateY(-4px); } }
@keyframes pv-pop { 50% { transform: scale(1.08); } }
@keyframes pv-stamp { from { transform: translateY(-50%) rotate(-12deg) scale(1.8); opacity: 0; } to { transform: translateY(-50%) rotate(-12deg) scale(1); opacity: .55; } }
@keyframes pv-leg { 50% { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--ra-legendary) 80%, transparent)); } }
@keyframes pv-flame { 50% { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--flame) 65%, transparent)); } }

/* --- Pantallas estrechas ------------------------------------------------- */
@media (max-width: 1100px) { .pv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pv-close-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .gp-pv .gp-hero.pv-hero { grid-template-columns: minmax(0, 1fr); padding: var(--s4); text-align: center; gap: var(--s4); }
  .pv-emw { width: 200px; height: 200px; }
  .pv-lvring { width: 200px; height: 200px; }
  .pv-emw .gp-em, .pv-emw .gp-em svg { width: 140px; height: 140px; }
  .pv-aura { width: 160px; height: 160px; }
  .gp-pv .pv-main .rk { font-size: var(--size-2xl); }
  .pv-sub, .pv-near-line { justify-content: center; }
  .pv-next { margin-left: auto; margin-right: auto; justify-content: center; text-align: left; }
  .gp-pv .gp-hero .gam-row { flex-direction: row; justify-content: space-between; }
  .pv-road { padding: var(--s3); }
  .pv-track > i { display: none; }
  .pv-track ol { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: var(--s3); }
  .pv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .pv-stat { grid-template-columns: minmax(0, 1fr); padding: var(--s3); }
  .pv-stat svg.pv-medal { width: 40px; height: 40px; }
  .pv-q { grid-template-columns: 52px minmax(0, 1fr); }
  .pv-q svg.pv-medal { width: 52px; height: 52px; }
  .pv-rw { grid-column: 2; justify-self: start; }
  .pv-stamp { right: 10px; top: 14px; transform: rotate(-12deg); }
  .gp-pv .gp-swap { min-height: 40px; }
  .pv-todayw { grid-template-columns: 96px minmax(0, 1fr); }
  .pv-todayw svg.pv-medal { width: 96px; height: 96px; }
}
@media (max-width: 720px) and (prefers-reduced-motion: no-preference) { .pv-q.done .pv-stamp { animation: none; } }
