/* ============================================================================
   Progression (plan 2026-10-16, M3) — the home card, the profile tile and the
   after-match toast; rendered by /shared/js/progression.js. The home shelf's
   look (home-shelf.css, profile-dashboard.css): dark tiles with a hard
   bottom shadow, gold for progress, Baloo Bhaijaan 2 where the page loads it.
   Logical properties only (RTL and LTR). Load with ?v=N, bumped on change.
   ========================================================================== */
.pg-card, .pg-tile, .pg-toast {
    --pg-font: var(--gt-font, 'Baloo Bhaijaan 2', 'Tajawal', system-ui, sans-serif);
    --pg-tile: #17181D; --pg-line: rgba(255, 255, 255, .06); --pg-track: #2A2B33;
    --pg-gold: #F5C518; --pg-gold2: #FFE066; --pg-ink: #2A1F00; --pg-lip: #B38600;
    --pg-fire: #FF8A3D; --pg-ok: #6BE07A; --pg-mute: rgba(255, 255, 255, .62);
    font-family: var(--pg-font); color: #fff;
}
.pg-card[hidden], .pg-tile[hidden] { display: none; }

.pg-card { display: grid; gap: 12px; margin: 4px 0 18px; padding: 14px; border-radius: 22px;
    background: var(--pg-tile); border: 1px solid var(--pg-line); box-shadow: 0 5px 0 #050506; }
.pg-mute { color: var(--pg-mute); font-size: .78rem; font-weight: 700; }

/* ── Level, XP, Stars ─────────────────────────────────────────────────── */
.pg-top { display: flex; align-items: center; gap: 12px; }
.pg-lvl { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1;
    background: linear-gradient(180deg, var(--pg-gold2), var(--pg-gold)); color: var(--pg-ink); box-shadow: 0 4px 0 var(--pg-lip); }
.pg-lvl small { font-size: .62rem; font-weight: 800; opacity: .8; }
.pg-lvl b { font-size: 1.35rem; font-weight: 800; }
.pg-xp { flex: 1; min-width: 0; display: grid; gap: 6px; }
.pg-xp-row { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; font-size: .92rem; }
.pg-bar, .pg-qbar { display: block; height: 10px; border-radius: 99px; background: var(--pg-track); overflow: hidden; }
.pg-bar > i, .pg-qbar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pg-gold), var(--pg-gold2)); }
[dir="rtl"] .pg-bar > i, [dir="rtl"] .pg-qbar > i { background: linear-gradient(270deg, var(--pg-gold), var(--pg-gold2)); }
.pg-stars { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 99px; background: rgba(245, 197, 24, .12); font-size: 1.1rem; }
.pg-stars b { font-weight: 800; color: var(--pg-gold2); }

/* ── Streak ───────────────────────────────────────────────────────────── */
.pg-streak { display: grid; gap: 10px; padding: 12px; border-radius: 18px; background: rgba(255, 138, 61, .09); border: 1px solid rgba(255, 138, 61, .22); }
.pg-streak-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pg-flame { display: flex; align-items: baseline; gap: 6px; }
.pg-flame > span { font-size: 1.5rem; }
.pg-flame b { font-size: 1.6rem; font-weight: 800; color: var(--pg-fire); }
.pg-flame small { font-weight: 700; color: var(--pg-mute); }
.pg-note { font-size: .8rem; font-weight: 700; color: #FFC9A3; }
.pg-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.pg-days li { display: grid; place-items: center; aspect-ratio: 1; max-height: 40px; border-radius: 50%; background: var(--pg-track); color: var(--pg-mute); font-weight: 800; font-size: .85rem; }
.pg-days li.is-done { background: linear-gradient(180deg, #FFB067, var(--pg-fire)); color: #3A1500; }
.pg-days li.is-today { box-shadow: inset 0 0 0 2px var(--pg-fire); color: #fff; animation: pg-pulse 1.6s ease-in-out infinite; }
.pg-days li.is-big:not(.is-done) { background: rgba(245, 197, 24, .16); }
.pg-days li.has-av { overflow: hidden; }
.pg-days li.has-av img { width: min(100%, 40px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.pg-days li.has-av.is-done img { opacity: .5; }
.pg-days-r { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: -4px 0 0; padding: 0; list-style: none; }
.pg-days-r li { display: grid; justify-items: center; align-content: start; gap: 1px; font-size: .62rem; font-weight: 700; line-height: 1.2; color: var(--pg-mute); white-space: nowrap; }
@keyframes pg-pulse { 50% { box-shadow: inset 0 0 0 2px var(--pg-fire), 0 0 0 4px rgba(255, 138, 61, .25); } }

.pg-claim { min-height: 46px; width: 100%; padding: 0 12px; border: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
    background: linear-gradient(180deg, var(--pg-gold2), var(--pg-gold)); color: var(--pg-ink); box-shadow: 0 4px 0 var(--pg-lip);
    font: 800 1rem/1.15 var(--pg-font); cursor: pointer; transition: transform .08s, box-shadow .08s; }
.pg-claim span { font-size: .85rem; opacity: .85; }
.pg-claim:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--pg-lip); }
.pg-claim:disabled { cursor: default; }
.pg-claim.is-done { background: var(--pg-track); color: var(--pg-ok); box-shadow: none; }
.pg-claim:focus-visible, .pg-feat:focus-visible, .pg-pop-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ── Quests ───────────────────────────────────────────────────────────── */
.pg-quests { border-radius: 16px; background: rgba(255, 255, 255, .03); }
.pg-quests > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 0 12px;
    list-style: none; cursor: pointer; font-weight: 800; border-radius: 16px; }
.pg-quests > summary::-webkit-details-marker { display: none; }
.pg-quests > summary::after { content: '▾'; color: var(--pg-mute); transition: transform .2s; }
.pg-quests[open] > summary::after { transform: rotate(180deg); }
.pg-quests > summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.pg-quests > summary .pg-mute { margin-inline-start: auto; }
.pg-quests[open] > summary .pg-mute { display: none; }
.pg-sum-t b { color: var(--pg-gold2); }
.pg-qbody { display: grid; gap: 12px; padding: 0 10px 12px; }
.pg-feat { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 14px; text-decoration: none; color: #fff;
    background: rgba(92, 200, 255, .1); border: 1px solid rgba(92, 200, 255, .25); font-weight: 700; }
.pg-feat b { color: #9FDCFF; }
.pg-qhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pg-qhead h3 { margin: 0; font: 800 1rem/1.2 var(--pg-font); }
.pg-qlist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pg-qi { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.pg-qcheck { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--pg-track); font-weight: 800; font-size: .85rem; }
.pg-qt { flex: 1; min-width: 0; display: grid; gap: 6px; }
.pg-qt b { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.pg-qbar { height: 6px; }
.pg-qr { flex: none; display: grid; justify-items: end; gap: 2px; }
.pg-qr small { color: var(--pg-mute); font-weight: 700; }
.pg-qr em { font-style: normal; font-weight: 800; color: var(--pg-gold2); white-space: nowrap; }
.pg-qi.is-done .pg-qcheck { background: var(--pg-ok); border-color: var(--pg-ok); color: #0B2A10; }
.pg-qi.is-done .pg-qt b { color: var(--pg-mute); }
.pg-qi.is-done .pg-qbar > i { background: var(--pg-ok); }

/* ── Guest ────────────────────────────────────────────────────────────── */
.pg-guest { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 12px; }
.pg-guest-ico { font-size: 2rem; }
.pg-guest-t { display: grid; gap: 2px; }
.pg-guest-t small { color: var(--pg-mute); font-weight: 600; }
.pg-guest .pg-claim { grid-column: 1 / -1; }

/* ── Profile tile (inside .pd-bento) ──────────────────────────────────── */
.pg-tile { grid-column: span 2; display: grid; gap: 10px; padding: 14px; border-radius: 22px; background: var(--pg-tile); border: 1px solid var(--pg-line); box-shadow: 0 5px 0 #050506; }

/* ── The daily streak popup (home, first open of the day) ─────────────── */
.pg-pop { position: fixed; z-index: 10040; inset: 0; display: grid; place-items: center; padding: 16px;
    background: rgba(5, 5, 6, .72); opacity: 0; transition: opacity .2s ease-out; }
.pg-pop.is-on { opacity: 1; }
.pg-pop-box { width: 100%; max-width: 400px; margin: 0; transform: translateY(12px) scale(.98); transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.pg-pop.is-on .pg-pop-box { transform: none; }
.pg-pop-title { margin: 0; text-align: center; font: 800 1.35rem/1.2 var(--pg-font); color: #fff; }
.pg-pop-close { min-height: 44px; border: 0; border-radius: 14px; background: none; color: var(--pg-mute); font: 800 .95rem/1 var(--pg-font); cursor: pointer; }
.pg-pop-close:hover { color: #fff; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.pg-toast { position: fixed; z-index: 10050; inset-inline: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 420px;
    display: grid; gap: 4px; padding: 12px 16px; border-radius: 18px; background: #17181D; border: 2px solid var(--pg-gold); box-shadow: 0 6px 0 #050506, 0 12px 30px rgba(0, 0, 0, .5);
    transform: translateY(140%); opacity: 0; transition: transform .35s cubic-bezier(.22, 1, .36, 1), opacity .2s; pointer-events: none; text-align: center; }
.pg-toast.is-on { transform: none; opacity: 1; pointer-events: auto; }
.pg-toast b { font-size: 1.15rem; font-weight: 800; color: var(--pg-gold2); }
.pg-toast span { font-weight: 700; font-size: .92rem; }

@media (prefers-reduced-motion: reduce) {
    .pg-days li.is-today { animation: none; }
    .pg-pop, .pg-pop-box { transition: none; }
    .pg-toast { transition: opacity .2s; transform: none; }
}
@media (min-width: 900px) {
    .pg-card { grid-template-columns: 1fr 1fr; align-items: start; }
    .pg-card > .pg-top { grid-column: 1 / -1; }
}

/* The challenges page (/challenges.html, [data-progression-page]). */
.pg-page { gap: 18px; margin: 0; padding: 16px; background: var(--pg-tile); border: 1px solid var(--pg-line); box-shadow: 0 5px 0 #050506; }
.pg-page[aria-busy] { min-height: 160px; place-content: center; color: var(--pg-mute); font-weight: 700; text-align: center; }
.pg-sec { display: grid; gap: 10px; }
.pg-sec > h2 { margin: 0; font: 800 1.1rem/1.2 var(--pg-font); color: #fff; }
.pg-page .pg-qbody { padding: 0; }
.pg-page a.pg-claim { text-decoration: none; }
.nav-dropdown .menu-item[aria-current="page"] { color: var(--accent-gold, #f7c948); }

/* ── Silver (game points; 2026-10-24) ─────────────────────────────────────
   The points' icon on every page that loads this file (all pages with a
   balance, the home header, the profile, every game): a CSS-only silver coin
   sized by the font, so it works in text, buttons and the 3rem modal icon.
   <span class="qd-silver" aria-hidden="true"></span> next to the number; the
   name is فضة / Silver. Stars keep 🌟, coins keep 🪙. */
.qd-silver { display: inline-block; flex: none; width: 1em; height: 1em; border-radius: 50%; vertical-align: -.14em;
    background: radial-gradient(circle at 34% 30%, #fff 0 9%, #eceff2 24%, #bcc3cb 56%, #8d959e 82%, #6c747d 100%);
    box-shadow: inset 0 0 0 .07em #dde1e6, inset 0 0 0 .14em #8f979f, 0 .04em .1em rgba(0, 0, 0, .35); }
