/* Daily challenges, streak and unlocks: the panels built by public/js/progress.js.
   Every class starts with pg-. The font is whatever the page uses (Fredoka).
   Colours come from four variables, with these fallbacks:
     --tp-navy #1d1b4f (panels)   --tp-yellow #ffc52e (accents)
     --tp-white #ffffff (text)    --tp-green #35d21f (done)                      */
.pg {
  --pg-navy: var(--tp-navy, #1d1b4f); --pg-yellow: var(--tp-yellow, #ffc52e); --pg-white: var(--tp-white, #ffffff); --pg-green: var(--tp-green, #35d21f);
  box-sizing: border-box; width: 100%; padding: 14px 16px 12px; border-radius: 22px; text-align: left;
  color: var(--pg-white); background: var(--pg-navy); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12), 0 5px 0 rgba(10, 14, 45, 0.35), 0 12px 26px rgba(10, 14, 45, 0.22);
  font-family: inherit; font-weight: 500; font-size: 16px; line-height: 1.25;
}
.pg *, .pg *::before, .pg *::after { box-sizing: border-box; }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pg-title { font-weight: 700; font-size: 19px; letter-spacing: 0.01em; color: var(--pg-yellow); }
.pg-owned { font-weight: 700; font-size: 14px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-variant-numeric: tabular-nums; }

/* the streak: a little calendar page with the number of days on it */
.pg-streak { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; white-space: nowrap; opacity: 0.7; }
.pg-streak-on { opacity: 1; }
.pg-cal { position: relative; display: grid; place-items: end center; width: 30px; height: 30px; padding-bottom: 2px; border-radius: 8px; color: var(--pg-navy); background: var(--pg-white); box-shadow: 0 2px 0 rgba(10, 14, 45, 0.4); overflow: hidden; }
.pg-cal::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 9px; background: rgba(29, 27, 79, 0.35); }
.pg-streak-on .pg-cal::before { background: var(--pg-yellow); }
.pg-cal::after { content: ''; position: absolute; top: 3px; left: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--pg-navy); box-shadow: 12px 0 0 var(--pg-navy); }   /* the two binder holes */
.pg-cal b { font-size: 15px; line-height: 1; font-variant-numeric: tabular-nums; }
.pg-streak-due .pg-cal { animation: pg-nudge 2.4s ease-in-out infinite; }

/* rows: a challenge, or a thing to unlock */
.pg-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pg-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 10px; padding: 9px 12px 10px; border-radius: 15px; background: rgba(255, 255, 255, 0.09); border: 2px solid transparent; }
.pg-tick { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.45); }
.pg-done .pg-tick { border-color: var(--pg-green); background: var(--pg-green); }
.pg-done .pg-tick::after { content: ''; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid var(--pg-navy); border-width: 0 3px 3px 0; border-radius: 1px; transform: rotate(40deg); }
.pg-text { min-width: 0; font-weight: 600; }
.pg-count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pg-yellow); white-space: nowrap; }
.pg-done .pg-count { color: var(--pg-green); }
.pg-done .pg-text { opacity: 0.85; }
.pg-bar { grid-column: 1 / -1; display: block; height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.pg-bar i { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--pg-yellow); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12); transition: width 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.pg-done .pg-bar i { background: var(--pg-green); }
/* what moved in the round just played, and what it finished */
.pg-adv { border-color: var(--pg-yellow); background: rgba(255, 210, 60, 0.14); animation: pg-pop 0.5s ease-out; }
.pg-just { border-color: var(--pg-green); background: rgba(61, 220, 106, 0.16); animation: pg-pop 0.6s ease-out; }

.pg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 10px; font-size: 13px; color: rgba(255, 255, 255, 0.78); }
.pg-keep { font-weight: 700; color: var(--pg-yellow); }
.pg-alldone .pg-reset { font-weight: 700; color: var(--pg-green); }

/* compact: one line per challenge (results screen) */
.pg-compact { padding: 10px 12px; border-radius: 18px; font-size: 14px; }
.pg-compact .pg-title { font-size: 15px; }
.pg-compact .pg-cal { width: 24px; height: 24px; border-radius: 7px; }
.pg-compact .pg-cal::before { height: 7px; }
.pg-compact .pg-cal::after { top: 2px; left: 5px; width: 3px; height: 3px; box-shadow: 10px 0 0 var(--pg-navy); }
.pg-compact .pg-cal b { font-size: 12px; }
.pg-compact .pg-list { margin-top: 7px; gap: 5px; }
.pg-compact .pg-row { position: relative; padding: 5px 10px 8px; border-radius: 11px; gap: 0 8px; overflow: hidden; }
.pg-compact .pg-tick { width: 16px; height: 16px; border-width: 2px; }
.pg-compact .pg-done .pg-tick::after { left: 3px; top: 0; width: 5px; height: 9px; border-width: 0 2px 2px 0; }
.pg-compact .pg-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-compact .pg-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0; }

/* next unlocks */
.pg-unlock { grid-template-columns: auto 1fr auto; }
.pg-unlock .pg-text { display: grid; gap: 1px; }
.pg-name { font-weight: 700; }
.pg-rule { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.78); }
.pg-swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); border: 3px solid var(--pg-white); }
.pg-swatch-skin::after { content: ''; position: absolute; inset: 4px 3px 3px; background: var(--pg-yellow); clip-path: polygon(0 18%, 30% 0, 40% 14%, 60% 14%, 70% 0, 100% 18%, 88% 44%, 76% 38%, 76% 100%, 24% 100%, 24% 38%, 12% 44%); }   /* a little shirt */
.pg-swatch-hat::before { content: ''; position: absolute; left: 6px; right: 6px; top: 5px; height: 11px; border-radius: 9px 9px 0 0; background: var(--pg-yellow); }   /* a little hat */
.pg-swatch-hat::after { content: ''; position: absolute; left: 2px; right: 2px; top: 15px; height: 4px; border-radius: 2px; background: var(--pg-yellow); }
.pg-swatch-trail::after { content: ''; position: absolute; left: 3px; top: 14px; width: 5px; height: 5px; border-radius: 50%; background: var(--pg-yellow); box-shadow: 7px -5px 0 0 var(--pg-white), 14px -1px 0 1px var(--pg-yellow); }   /* three specks */

@keyframes pg-pop { 0% { transform: scale(0.97); } 55% { transform: scale(1.025); } 100% { transform: scale(1); } }
@keyframes pg-nudge { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-9deg); } 95% { transform: rotate(7deg); } }
@media (prefers-reduced-motion: reduce) { .pg-adv, .pg-just, .pg-streak-due .pg-cal { animation: none; } .pg-bar i { transition: none; } }
