/**
 * smgr/css/pages/j340_ranking.css — clasificacion de '34-0' (chrome 'Foco').
 * NOTA: '.pg-toast' se crea por JS y se anexa a document.body -> SIN scope.
 */
:root { --j-navy:#1e3a5f; --j-navy2:#2c5282; --j-orange:#ed8936; --j-border:#e2e8f0; --j-muted:#64748b; --j-ink:#0f172a; }

/* ===== Reset de aislamiento (contrarresta rincon.css dentro del juego) ===== */
.game-scope img { max-width: none; }
.game-scope button { font: inherit; }

    .game-scope { background: #f0f4f9; }
    
    .game-scope .ranking-page { max-width: 760px; margin: 20px auto; padding: 0 12px; font-family: Roboto, sans-serif; }
    .game-scope .ranking-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 10px 0 18px; }
    .game-scope .ranking-header-text { flex: 1; min-width: 0; }
    .game-scope .ranking-page h1 { font-size: 24px; color: var(--j-navy2); margin: 0 0 4px; font-weight: 700; display:flex; align-items:center; gap:10px; }
    .game-scope .ranking-page h1 img { height: 30px; }
    .game-scope .ranking-page .intro { color: var(--j-muted); font-size: 14px; margin: 0; }
    .game-scope .btn-play-top {
        flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
        background: linear-gradient(135deg,var(--j-orange),#dd6b20); color: white; padding: 11px 20px; border-radius: 9px;
        font-weight: 600; font-size: 15px; text-decoration: none; box-shadow: 0 4px 12px rgba(237,137,54,.3); transition: all .15s;
    }
    .game-scope .btn-play-top:hover { color: white; text-decoration: none; transform: translateY(-1px); filter:brightness(1.04); }

    .game-scope .ranking-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
    .game-scope .filter-group { display: inline-flex; background: #e7edf5; border-radius: 8px; padding: 3px; }
    .game-scope .filter-group a { padding: 7px 16px; font-size: 13px; font-weight: 500; color: #64748b; text-decoration: none; border-radius: 6px; transition: all .15s; }
    .game-scope .filter-group a:hover:not(.active) { color: var(--j-navy2); }
    .game-scope .filter-group a.active { background: white; color: var(--j-navy2); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
    .game-scope .filter-group.mode a[href*="m=memoria"].active { color: #c2410c; }

    .game-scope .ranking-table { width: 100%; background: white; border-collapse: collapse; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(15,23,42,.06); }
    .game-scope .ranking-table th { background: var(--j-navy2); color: white; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; text-align: left; font-weight: 500; }
    .game-scope .ranking-table td { font-size: 15px; padding: 10px 14px; border-bottom: 1px solid #edf2f7; color: var(--j-ink); }
    .game-scope .ranking-table tr:last-child td { border-bottom: none; }
    .game-scope .ranking-table .rank { width: 48px; color: #a0aec0; font-weight: 500; }
    .game-scope .ranking-table .rank.top1 { color: #dd6b20; font-weight: 700; }
    .game-scope .ranking-table .rank.top2 { color: #a0aec0; font-weight: 700; }
    .game-scope .ranking-table .rank.top3 { color: #b7791f; font-weight: 700; }
    .game-scope .ranking-table .rec { text-align: right; font-weight: 700; color: var(--j-navy2); font-size: 17px; font-family:'Space Grotesk',sans-serif; font-variant-numeric: tabular-nums; }
    .game-scope .ranking-table .rec .l { color:#cbd5e1; }
    .game-scope .ranking-table .games { text-align: right; color: #718096; font-size: 13px; font-variant-numeric: tabular-nums; }
    .game-scope .ranking-table .pct { text-align: right; color: #718096; font-size: 13px; font-variant-numeric: tabular-nums; }
    .game-scope .ranking-table tr.me td { background: #fff7ed; font-weight: 500; }
    .game-scope .ranking-table tbody tr { cursor: pointer; transition: background-color .12s; }
    .game-scope .ranking-table tbody tr:hover td { background: #f7fafc; }
    .game-scope .ranking-table tbody tr.me:hover td { background: #ffedd5; }
    .game-scope .guest-pill { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.3px; background: #fef3c7; color: #854d0e; vertical-align: 2px; }
    .game-scope .ranking-empty { text-align: center; padding: 40px 20px; color: #a0aec0; background: white; border-radius: 10px; }
    .game-scope .my-rank-card { background: #fff7ed; border:1px solid #fed7aa; border-radius: 10px; padding: 14px 18px; margin-top: 16px; font-size: 14px; color: #9a3412; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; transition: background .12s, box-shadow .12s; }
    .game-scope .my-rank-card:hover { background: #ffedd5; box-shadow: 0 2px 8px rgba(154,52,18,.12); }
    .game-scope .my-rank-card .mrc-cta { font-weight: 600; color: #c2410c; white-space: nowrap; }
    .game-scope .my-rank-card .mrc-cta .fa { font-size: 12px; margin-left: 4px; }
    .game-scope .btn-back { display: inline-block; color: #718096; padding: 10px 0; font-size: 13px; text-decoration: none; margin-top: 14px; }
    .game-scope .btn-back:hover { color: var(--j-navy2); text-decoration: none; }

    /* ---- player games modal ---- */
    .game-scope .pg-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none; z-index: 9999; }
    .game-scope .pg-backdrop.show { display: block; }
    .game-scope .pg-modal {
        position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
        background: white; border-radius: 14px; width: min(620px, calc(100vw - 28px));
        max-height: 92vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
        font-family: Roboto, sans-serif; z-index: 10000; animation: pgIn .18s ease-out;
    }
    @keyframes pgIn { from { transform: translate(-50%, calc(-50% + 8px)); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
    .game-scope .pg-head { padding: 18px 20px 14px; border-bottom: 1px solid #edf2f7; position: sticky; top: 0; background: #fff; z-index: 2; }
    .game-scope .pg-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .game-scope .pg-head h3 { margin: 0; color: var(--j-navy2); font-size: 18px; font-weight: 700; word-break: break-word; }
    .game-scope .pg-mode-toggle { display: inline-flex; margin-top: 10px; background: #eef2f7; border-radius: 8px; padding: 3px; }
    .game-scope .pg-mode-toggle a { padding: 5px 12px; font-size: 12px; font-weight: 500; color: #64748b; text-decoration: none; border-radius: 6px; cursor: pointer; transition: all .15s; }
    .game-scope .pg-mode-toggle a:hover:not(.active) { color: var(--j-navy2); }
    .game-scope .pg-mode-toggle a.active { background: white; color: var(--j-navy2); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
    .game-scope .pg-mode-toggle a[data-mode="memoria"].active { color: #c2410c; }
    .game-scope .pg-close { background: none; border: none; font-size: 22px; line-height: 1; color: #a0aec0; cursor: pointer; padding: 0 4px; flex-shrink: 0; }
    .game-scope .pg-close:hover { color: var(--j-ink); }
    .game-scope .pg-body { padding: 16px 20px 20px; }
    .game-scope .pg-loading, .game-scope .pg-empty { text-align: center; color: #a0aec0; padding: 26px 0; font-size: 14px; }
    .game-scope .pg-error { color: #b91c1c; background: #fee2e2; border-radius: 8px; padding: 12px 14px; font-size: 13px; }

    .game-scope .pg-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
    .game-scope .pg-cell { background: #f4f7fb; border-radius: 9px; padding: 10px 8px; text-align: center; }
    .game-scope .pg-cell .v { font-size: 18px; font-weight: 700; color: var(--j-navy2); font-family:'Space Grotesk',sans-serif; font-variant-numeric: tabular-nums; }
    .game-scope .pg-cell .l { font-size: 11px; color: #718096; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

    .game-scope .pg-sec-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #718096; font-weight: 600; margin: 4px 0 10px; }

    .game-scope .g-card { border: 1px solid var(--j-border); border-radius: 11px; margin-bottom: 10px; overflow: hidden; background: #fff; }
    .game-scope .g-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: #f8fafc; border: none; cursor: pointer; text-align: left; font-family: inherit; }
    .game-scope .g-head:hover { background: #f1f5f9; }
    .game-scope .g-head .g-rec { font-family:'Space Grotesk',sans-serif; font-weight: 700; font-size: 19px; color: var(--j-navy2); font-variant-numeric: tabular-nums; min-width: 64px; }
    .game-scope .g-head .g-rec .l { color: #cbd5e1; }
    .game-scope .g-head .g-grade { font-size: 12px; font-weight: 700; letter-spacing: .3px; }
    .game-scope .g-head .g-when { margin-left: auto; font-size: 12px; color: #a0aec0; white-space: nowrap; }
    .game-scope .g-head .g-chev { color: #cbd5e1; transition: transform .18s; font-size: 13px; }
    .game-scope .g-card.open .g-head .g-chev { transform: rotate(180deg); }
    .game-scope .grade-S { color:#7c3aed; } .game-scope .grade-A { color:#16a34a; } .game-scope .grade-B { color:#2563eb; } .game-scope .grade-C { color:#0891b2; } .game-scope .grade-D { color:#d97706; } .game-scope .grade-F { color:#dc2626; }

    .game-scope .g-body { display: none; padding: 12px 14px 14px; border-top: 1px solid #edf2f7; }
    .game-scope .g-card.open .g-body { display: block; }
    .game-scope .g-pct { font-size: 13px; color: var(--j-ink); margin: 0 0 12px; }
    .game-scope .g-pct b { color: var(--j-navy2); }

    .game-scope .g-roster { display: flex; flex-direction: column; gap: 7px; }
    .game-scope .g-rrow { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; background: #f8fafc; border-left: 4px solid var(--j-navy2); }
    .game-scope .g-rrow .av { width: 32px; height: 32px; border-radius: 8px; background: var(--j-navy); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .game-scope .g-rrow .who { flex: 1 1 auto; min-width: 0; }
    .game-scope .g-rrow .nm { font-weight: 700; color: var(--j-ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .game-scope .g-rrow .mt { font-size: 11.5px; color: var(--j-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .game-scope .g-rrow .rst { margin-left: auto; flex-shrink: 0; display: flex; gap: 11px; text-align: center; }
    .game-scope .g-rrow .rst .st b { display: block; font-size: 13px; color: var(--j-ink); font-variant-numeric: tabular-nums; }
    .game-scope .g-rrow .rst .st span { font-size: 9px; color: #94a3b8; }
    .game-scope .pos-B { color:#2563eb; } .game-scope .pos-E { color:#0891b2; } .game-scope .pos-A { color:#16a34a; } .game-scope .pos-AP { color:#d97706; } .game-scope .pos-P { color:#dc2626; }

    .game-scope .g-totals { display: flex; justify-content: space-around; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--j-border); text-align: center; }
    .game-scope .g-totals .tt { flex: 1; min-width: 0; }
    .game-scope .g-totals .tt b { display: block; font-family:'Space Grotesk',sans-serif; font-size: 19px; color: var(--j-ink); font-variant-numeric: tabular-nums; }
    .game-scope .g-totals .tt span { font-size: 10px; color: #94a3b8; letter-spacing: .5px; }
    .game-scope .g-totals .tt .tbar { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin: 5px 4px 0; }
    .game-scope .g-totals .tt .tbar i { display: block; height: 100%; background: linear-gradient(90deg,var(--j-navy2),var(--j-orange)); }

    .game-scope .g-actions { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
    .game-scope .g-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 9px; cursor: pointer; border: 1px solid var(--j-border); background: #fff; color: var(--j-navy2); text-decoration: none; }
    .game-scope .g-btn:hover { background: #f1f5f9; color: var(--j-navy2); text-decoration: none; }
    .game-scope .g-btn.primary { background: linear-gradient(135deg,var(--j-orange),#dd6b20); color: #fff; border: none; }
    .game-scope .g-btn.primary:hover { color: #fff; filter: brightness(1.04); }

    .pg-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--j-ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; z-index: 11000; pointer-events: none; }
    .pg-toast.show { opacity: 1; }

    @media (max-width: 640px) {
        .game-scope .ranking-table .pct { display: none; }
        .game-scope .ranking-header { flex-direction: column; align-items: stretch; }
        .game-scope .btn-play-top { justify-content: center; }
        .game-scope .pg-summary { grid-template-columns: repeat(2, 1fr); }
        .game-scope .g-rrow .st-x { display: none; }   /* ROB/TAP per-player: wider screens only */
        .game-scope .g-rrow .rst { gap: 9px; }
    }
