/* ============================================================
   ZONA GAMER 2026 — Logros y Gamer Card
   ------------------------------------------------------------
   pf-*  vitrina de logros (resumen, filtros, insignias)
   gc-*  Gamer Card pública (tarjeta para compartir)
   Usa los tokens de zg.css.
   ============================================================ */

.pf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Resumen de logros ───────── */
.pf-sum {
    display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 24px; margin-bottom: 12px;
    border: 1px solid rgba(255, 201, 60, .28);
    background: radial-gradient(280px 150px at 0% 0%, rgba(255, 201, 60, .16), transparent 70%), var(--zg-card);
}
.pf-ring {
    --p: 0;
    position: relative; flex: 0 0 88px; width: 88px; height: 88px; border-radius: 50%;
    display: grid; place-content: center; text-align: center; line-height: 1;
    background: conic-gradient(var(--zg-sun) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0);
}
.pf-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--zg-card); }
.pf-ring b, .pf-ring small { position: relative; }
.pf-ring b { font-family: var(--zg-display); font-weight: 800; font-size: 1.9rem; letter-spacing: -.03em; }
.pf-ring small { margin-top: 3px; font-size: .7rem; color: var(--zg-muted); }
.pf-sum-copy { min-width: 0; display: grid; gap: 3px; }
.pf-sum-copy strong { font-family: var(--zg-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; line-height: 1.15; }
.pf-sum-copy small { color: var(--zg-dim); font-size: .88rem; }
.pf-stats { margin-bottom: 18px; }

.pf-nudge {
    display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; margin-bottom: 18px; padding: 16px;
    border-radius: 22px; border: 1px solid rgba(185, 244, 60, .3);
    background: radial-gradient(260px 140px at 0% 0%, rgba(185, 244, 60, .14), transparent 70%), var(--zg-card);
}
.pf-nudge .zg-b { grid-column: 1 / -1; }
.pf-nudge strong { display: block; font-family: var(--zg-display); font-weight: 800; font-size: 1.08rem; }
.pf-nudge small { display: block; color: var(--zg-dim); font-size: .86rem; margin-top: 2px; }
.pf-nudge-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: rgba(185, 244, 60, .15); color: var(--zg-lime); font-size: 1.2rem; }

/* ───────── Filtros ───────── */
.pf-filters { margin-bottom: 14px; }
.pf-filters .zg-chip { height: 44px; }
.pf-chip-n {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); font-size: .72rem; font-variant-numeric: tabular-nums;
}
.pf-filters .zg-chip.is-on .pf-chip-n { background: var(--zg-bg); color: var(--zg-text); }

/* ───────── Insignias ───────── */
.pf-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pf-badge {
    display: grid; justify-items: center; align-content: start; gap: 5px; padding: 14px 10px 12px; border-radius: 20px; text-align: center;
    background: var(--zg-card); border: 1px solid var(--zg-line); min-width: 0;
}
.pf-badge[hidden] { display: none; }
.pf-badge-ico {
    --p: 0;
    position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; margin-bottom: 2px;
    background: conic-gradient(var(--zg-sky) calc(var(--p) * 1%), rgba(255, 255, 255, .07) 0);
    font-size: 1.4rem; color: var(--zg-muted);
}
.pf-badge-ico::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--zg-bg-2); }
.pf-badge-ico > i { position: relative; }
.pf-badge.is-on .pf-badge-ico {
    background: radial-gradient(circle at 50% 35%, #ffe08a, var(--zg-sun) 55%, var(--zg-sun-d));
    color: #3a2500; box-shadow: 0 6px 22px -8px rgba(255, 201, 60, .8);
}
.pf-badge.is-on .pf-badge-ico::before { inset: 5px; background: radial-gradient(circle at 50% 30%, #fff1c2, #ffcf4d 70%); }
.pf-badge-check {
    position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    background: var(--zg-mint); color: #04261a; font-size: .66rem; box-shadow: 0 0 0 3px var(--zg-card);
}
.pf-badge strong { font-family: var(--zg-display); font-weight: 700; font-size: .95rem; line-height: 1.15; letter-spacing: -.01em; }
.pf-badge-desc { color: var(--zg-dim); font-size: .78rem; line-height: 1.3; }
.pf-badge.is-on { border-color: rgba(255, 201, 60, .3); background: radial-gradient(160px 90px at 50% 0%, rgba(255, 201, 60, .1), transparent 70%), var(--zg-card); }
.pf-bar { display: block; width: 100%; height: 6px; margin-top: 4px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.pf-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--zg-sky); }
.pf-badge-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; font-size: .74rem; color: var(--zg-muted); font-variant-numeric: tabular-nums; }
.pf-badge-foot.is-done { justify-content: center; color: var(--zg-mint); font-weight: 600; }
.pf-prize { display: inline-flex; align-items: center; gap: 3px; color: var(--zg-sun); font-weight: 700; }
.pf-prize .zg-ico-coin { width: 16px; height: 16px; }
.pf-cta { margin-top: 22px; }

/* ============================================================
   GAMER CARD
   ============================================================ */
.gc {
    --lc: var(--zg-lime);
    position: relative; margin: 4px 0 0; border-radius: 28px; overflow: hidden;
    background: var(--zg-card); border: 1px solid var(--zg-line-2);
    box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .9);
}
.gc-banner {
    position: relative; height: 112px; overflow: hidden;
    background:
        radial-gradient(240px 140px at 15% 120%, rgba(185, 244, 60, .35), transparent 70%),
        radial-gradient(260px 160px at 90% -20%, rgba(76, 195, 255, .45), transparent 70%),
        linear-gradient(135deg, #2a1f7a, #123a6b);
}
.gc-banner::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 14px); }
.gc-banner-mark { position: absolute; right: 14px; top: 12px; width: 30px; height: 30px; opacity: .85; z-index: 1; }
.gc-body { position: relative; display: grid; justify-items: center; text-align: center; padding: 0 16px 18px; margin-top: -60px; }

.gc-avatar { position: relative; width: 120px; height: 120px; }
.gc-avatar img { position: relative; z-index: 1; display: block; width: 108px; height: 108px; margin: 6px; border-radius: 50%; background: var(--zg-card-2); }
.gc-avatar-ring { position: absolute; inset: 0; border-radius: 50%; background: var(--zg-card); border: 4px solid var(--zg-lime); }
.gc-lv {
    position: absolute; z-index: 2; left: 50%; bottom: -8px; transform: translateX(-50%);
    min-width: 36px; height: 28px; padding: 0 9px; border-radius: 999px; display: grid; place-items: center;
    background: var(--zg-lime); color: var(--zg-lime-ink); font-family: var(--zg-display); font-weight: 800; font-size: .95rem;
    box-shadow: 0 0 0 3px var(--zg-card);
}
.gc-acc {
    position: absolute; z-index: 2; right: 0; top: 2px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
    background: var(--zg-card-2); color: var(--zg-sun); box-shadow: 0 0 0 3px var(--zg-card); font-size: .9rem;
}
/* Marcos (cosméticos de la tienda): mismo efecto que en el resto de la zona. */
.gc-avatar[data-frame="frame-bronze"] .gc-avatar-ring { border-color: #b45309; }
.gc-avatar[data-frame="frame-silver"] .gc-avatar-ring { border-color: transparent; background: linear-gradient(135deg, #e5e7eb, #6b7280); }
.gc-avatar[data-frame="frame-gold"] .gc-avatar-ring { border-color: transparent; background: linear-gradient(135deg, #fde68a, #d97706); box-shadow: 0 0 26px -6px rgba(245, 158, 11, .9); }
.gc-avatar[data-frame="frame-neon"] .gc-avatar-ring { border-color: #22d3ee; box-shadow: 0 0 18px 2px rgba(34, 211, 238, .55), inset 0 0 12px rgba(34, 211, 238, .4); }
.gc-avatar[data-frame="frame-holo"] .gc-avatar-ring { border-color: transparent; background: conic-gradient(from 0deg, #f472b6, #22d3ee, #a3e635, #facc15, #f472b6); animation: gc-spin 6s linear infinite; }
.gc-avatar[data-frame="frame-fuego"] .gc-avatar-ring { border-color: transparent; background: radial-gradient(circle, #fbbf24 30%, #ef4444 70%, #7f1d1d); box-shadow: 0 0 22px 4px rgba(249, 115, 22, .55); }
.gc-avatar[data-frame="frame-nivel-10"] .gc-avatar-ring { border-color: #3b82f6; }
.gc-avatar[data-frame="frame-nivel-25"] .gc-avatar-ring { border-color: transparent; background: linear-gradient(135deg, #e9d5ff, #7c3aed); }
.gc-avatar[data-frame="frame-plus"] .gc-avatar-ring { border-color: transparent; background: conic-gradient(from 90deg, #7c3aed, #0891b2, #7c3aed); }
.gc-avatar[data-frame="frame-pase"] .gc-avatar-ring { border-color: transparent; background: linear-gradient(135deg, #22d3ee, #1d4ed8); }
@keyframes gc-spin { to { transform: rotate(360deg); } }

.gc-name { margin: 18px 0 0; font-family: var(--zg-display); font-weight: 800; font-size: clamp(1.6rem, 7vw, 2.2rem); letter-spacing: -.035em; line-height: 1.05; overflow-wrap: anywhere; }
.gc-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.gc-tag {
    --tc: var(--zg-dim);
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: .8rem; font-weight: 600;
    color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent);
}
.gc-tag.is-league { --tc: var(--lc); }
.gc-tag.is-plus { --tc: var(--zg-gem); }
.gc-tag .zg-ico-gem { width: 16px; height: 16px; }

.gc-xp { width: 100%; max-width: 420px; margin-top: 16px; text-align: left; }
.gc-xp-top { display: flex; align-items: baseline; gap: 8px; font-size: .86rem; color: var(--zg-dim); }
.gc-xp-top b { font-family: var(--zg-display); font-weight: 800; font-size: 1rem; color: var(--zg-text); }
.gc-xp .zg-xp { margin-top: 7px; }
.gc-xp small { display: block; margin-top: 6px; font-size: .76rem; color: var(--zg-muted); font-variant-numeric: tabular-nums; }

.gc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; max-width: 520px; margin: 16px 0 0; }
.gc-stats div { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; background: rgba(255, 255, 255, .04); }
.gc-stats dt { order: 2; font-size: .68rem; color: var(--zg-muted); }
.gc-stats dd { order: 1; margin: 0; font-family: var(--zg-display); font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.gc-stats dd small { font-family: var(--zg-font); font-weight: 400; font-size: .7rem; color: var(--zg-muted); }
.gc-since { margin: 14px 0 0; font-size: .78rem; color: var(--zg-muted); }
.gc-since i { margin-right: 4px; }

/* Acciones del dueño */
.gc-actions { display: grid; gap: 12px; margin-top: 16px; }
.gc-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gc-tagform { display: grid; gap: 6px; margin-top: 18px; padding: 16px; border-radius: 20px; background: var(--zg-card); border: 1px solid var(--zg-line); }
.gc-tagform small { color: var(--zg-dim); font-size: .84rem; }
.gc-tagform-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }
.gc-tagform input {
    width: 100%; min-width: 0; height: 48px; margin: 0; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--zg-line-2);
    background: var(--zg-bg-2); color: var(--zg-text); font-size: 1rem; outline: none;
}
.gc-tagform input:focus { border-color: var(--zg-sky); }
.gc-tagform input[aria-invalid="true"] { border-color: var(--zg-coral); }
.gc-err { color: #ffb3b3 !important; }

/* Visitante */
.gc-join {
    display: grid; gap: 12px; margin-top: 16px; padding: 16px; border-radius: 22px; border: 1px solid rgba(185, 244, 60, .3);
    background: radial-gradient(260px 140px at 0% 0%, rgba(185, 244, 60, .14), transparent 70%), var(--zg-card);
}
.gc-join strong { display: block; font-family: var(--zg-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.gc-join small { display: block; color: var(--zg-dim); font-size: .88rem; margin-top: 2px; }

/* Juegos favoritos */
.gc-games { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; border-radius: var(--zg-r); background: var(--zg-card); border: 1px solid var(--zg-line); counter-reset: gc; }
.gc-games a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 8px; border-radius: 14px; }
.gc-games a:hover { background: rgba(255, 255, 255, .04); }
.gc-game-shot {
    display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; overflow: hidden;
    background: color-mix(in srgb, var(--c) 22%, var(--zg-card-2)); color: var(--c); font-size: 1.2rem;
}
.gc-game-shot img { width: 100%; height: 100%; object-fit: cover; }
.gc-game-copy { flex: 1; min-width: 0; display: grid; }
.gc-game-copy strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-game-copy small { font-size: .76rem; color: var(--zg-muted); }
.gc-game-best { display: inline-flex; align-items: center; gap: 5px; font-family: var(--zg-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.gc-game-best i { color: var(--zg-sun); font-size: .8rem; }

/* Insignias */
.gc-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gc-badges li { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; background: var(--zg-card); border: 1px solid var(--zg-line); text-align: center; }
.gc-badge-ico {
    display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-size: 1.05rem;
    background: radial-gradient(circle at 50% 35%, #ffe08a, var(--zg-sun) 60%, var(--zg-sun-d)); color: #3a2500;
}
.gc-badges small { font-size: .68rem; line-height: 1.2; color: var(--zg-dim); overflow-wrap: anywhere; }
.gc-empty { display: flex; align-items: center; gap: 10px; margin: 0; padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1px dashed var(--zg-line-2); color: var(--zg-muted); }

/* ───────── Pantallas grandes ───────── */
@media (min-width: 600px) {
    .pf-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
    .pf-sum, .pf-nudge, .pf-stats { max-width: 720px; }
    .pf-nudge { grid-template-columns: auto 1fr auto; }
    .pf-nudge .zg-b { grid-column: auto; }
    .pf-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
    .pf-cta { max-width: 320px; }

    /* Gamer Card: la tarjeta a la izquierda, lo demás al lado. */
    .zg-main:has(> .gc) { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 0 32px; align-items: start; }
    .zg-main:has(> .gc) > .gc { grid-column: 1; grid-row: 1 / span 6; position: sticky; top: calc(var(--zg-top-h) + 20px); }
    .zg-main:has(> .gc) > :not(.gc) { grid-column: 2; }
    .zg-main:has(> .gc) > .gc-actions, .zg-main:has(> .gc) > .gc-join { margin-top: 4px; }
    .zg-main:has(> .gc) > .zg-sec:first-of-type { margin-top: 24px; }
    .gc-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1150px) {
    .pf-badges { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .gc-avatar-ring { animation: none !important; }
}
