/* Progression (js/progression.js): Adventure panel (daily missions, login calendar, Pokédex rewards, area progress, medals),
   catch-chain HUD chip, progress pills / banners and the reward pop. Load after panels.css and social.css, before mobile.css. */

/* ---------------------------------------------------------------- shared bits */
.pg { display: flex; flex-direction: column; }
.pg-tabs .tab { min-height: 42px; }
.pg-tabs .tab em.pg-dot { background: var(--danger); color: #fff; min-width: 18px; text-align: center; }
.pg-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.pg-page > .pg-sec:first-child, .pg-col > .pg-sec:first-child { margin-top: 4px; }
.pg-page { container-type: inline-size; }
/* wide panels (desktop, landscape): missions beside chest + calendar */
@container (min-width: 640px) {
  .pg-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .pg-col > .pg-chest:first-child { margin-top: 30px; }
  .pg-col-area > .pg-sec:first-child { margin-top: 0; }
}
.pg-sec .muted { text-transform: none; letter-spacing: 0; font-weight: 800; }
.pg-reset, .pg-streak { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.pg-reset .ic, .pg-streak .ic { width: 16px; height: 16px; }
.pg-reset b { color: #fff; font-variant-numeric: tabular-nums; }
.pg-streak b { color: var(--gold); font-size: 15px; }
.pg-note { padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 700; line-height: 1.45; }

.pg-bar { position: relative; display: block; flex: 1; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .4); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
.pg-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4fc3ff, #7aa8ff); transition: width .45s var(--ease); }
.pg-bar.lg { height: 12px; }
.pg-prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pg-prog small { flex: none; min-width: 38px; text-align: right; font-size: 12px; font-weight: 900; color: #dfe7ff; font-variant-numeric: tabular-nums; }

/* reward chips */
.pg-rws { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pg-rw { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 8px 0 3px; border-radius: 999px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); white-space: nowrap; }
.pg-rw b { font-size: 12px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.pg-rw .item-art.xs, .pg-rw .pg-gem, .pg-rw .pg-coin { width: 20px; height: 20px; flex: none; }
.pg-rws.stack { flex-direction: column; align-items: flex-end; }
.pg-rws.in-btn .pg-rw { background: rgba(255, 255, 255, .35); border-color: rgba(255, 255, 255, .5); height: 24px; }
.pg-rws.in-btn .pg-rw b { color: #3a2400; }
.pg-gem { display: inline-block; width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.pg-coin { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 900; color: #5a3a00;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffcf4a 55%, #d99410); box-shadow: inset 0 -1px 0 rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.3); }

/* ---------------------------------------------------------------- daily missions */
.pg-missions { display: flex; flex-direction: column; gap: 8px; }
.pg-mis { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 72px; padding: 10px 10px 10px 12px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: background var(--t), border-color var(--t); }
.pg-mis-ic .ic-tile { width: 44px; height: 44px; display: block; }
.pg-mis-main { min-width: 0; }
.pg-mis-main > b { display: block; font-size: 14.5px; line-height: 1.25; }
.pg-mis-act { display: flex; justify-content: flex-end; }
.pg-mis.ready { background: linear-gradient(100deg, rgba(255, 207, 74, .16), rgba(255, 207, 74, .05)); border-color: rgba(255, 207, 74, .55);
  box-shadow: 0 0 0 1px rgba(255, 207, 74, .15), 0 6px 18px rgba(255, 180, 40, .12); }
.pg-mis.ready .pg-bar > i, .pg-ms.ready .pg-bar > i { background: linear-gradient(90deg, #ffcf4a, #ffe58a); }
.pg-mis.claimed { opacity: .62; }
.pg-mis.claimed .pg-bar > i { background: var(--ok); }
.pg-mis.claimed .pg-mis-ic { filter: saturate(.4); }
.pg-claim { min-height: 44px; padding: 6px 12px 6px 8px; gap: 8px; font-size: 14.5px; font-weight: 900; border-radius: 13px; animation: pg-glow 1.6s ease-in-out infinite; }
.pg-claim:not(:has(.pg-rws)) { padding: 6px 16px; }
.pg-done { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; height: 34px; border-radius: 999px; background: rgba(62, 224, 122, .14); color: #8ff0b4; font-weight: 900; font-size: 13px; }
.pg-done .ic { width: 18px; height: 18px; }
.pg-swap-b { min-height: 44px; }
.pg-swapline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 4px 0; min-height: 36px; }
.pg-swapline small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.pg-swap-t { min-height: 36px; font-size: 13.5px; }
@keyframes pg-glow { 50% { box-shadow: 0 0 0 4px rgba(255, 207, 74, .28), 0 4px 16px rgba(255, 190, 40, .35); } }

/* bonus chest */
.pg-chest { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 16px;
  background: linear-gradient(120deg, rgba(160, 110, 255, .14), rgba(255, 255, 255, .04)); border: 1px dashed rgba(170, 195, 255, .3); }
.pg-chest-art svg { width: 64px; height: 56px; display: block; }
.pg-chest-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pg-chest-main > b { font-size: 15px; }
.pg-chest-main > small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.pg-pips { display: flex; gap: 5px; }
.pg-pips i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.pg-pips i.on { background: var(--gold); }
.pg-chest.ready { border-style: solid; border-color: rgba(255, 207, 74, .6); background: linear-gradient(120deg, rgba(255, 207, 74, .2), rgba(160, 110, 255, .12)); }
.pg-chest.ready .pg-chest-art { animation: pg-wiggle 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.pg-chest.opened { opacity: .7; border-style: solid; }
.pg-open { min-height: 44px; min-width: 76px; font-size: 15px; font-weight: 900; animation: pg-glow 1.6s ease-in-out infinite; }
@keyframes pg-wiggle { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(-6deg) translateY(-2px); } 74% { transform: rotate(6deg) translateY(-2px); } 82% { transform: rotate(-3deg); } 90% { transform: rotate(2deg); } }

/* login calendar */
.pg-cal { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 1.35fr); gap: 5px; }
.pg-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px; min-height: 84px; padding: 6px 2px 6px;
  border-radius: 13px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: default; font: inherit; }
.pg-day-n { font-size: 10.5px; font-weight: 900; letter-spacing: .3px; text-transform: uppercase; }
.pg-day-art { display: grid; place-items: center; width: 34px; height: 34px; }
.pg-day-art .item-art.sm, .pg-day-art .pg-gem, .pg-day-art .pg-coin { width: 32px; height: 32px; }
.pg-day-art .pg-coin { font-size: 16px; }
.pg-day-q { font-size: 11.5px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pg-day.got { background: rgba(62, 224, 122, .08); border-color: rgba(62, 224, 122, .3); }
.pg-day.got .pg-day-art { opacity: .45; }
.pg-day-ok { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #06321a; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pg-day-ok .ic { width: 18px; height: 18px; }
.pg-day.today { box-shadow: 0 0 0 2px rgba(62, 224, 122, .5); }
.pg-day.now { cursor: pointer; color: #3a2400; background: linear-gradient(var(--gold), var(--gold-2)); border-color: rgba(255, 233, 168, .9); animation: pg-glow 1.6s ease-in-out infinite; }
.pg-day.now .pg-day-q { color: #3a2400; }
.pg-day.now .pg-day-art { animation: pg-bob 1.6s ease-in-out infinite; }
.pg-day.d7:not(.now) { background: linear-gradient(160deg, rgba(168, 116, 255, .32), rgba(255, 116, 200, .14)); border-color: rgba(208, 140, 255, .55); color: #f0d8ff; }
.pg-day.d7 .pg-day-art { width: 42px; height: 42px; }
.pg-day.d7 .pg-day-art .item-art.sm { width: 40px; height: 40px; }
.pg-day.d7.got { background: rgba(62, 224, 122, .08); border-color: rgba(62, 224, 122, .3); }
@keyframes pg-bob { 50% { transform: translateY(-3px) scale(1.06); } }
.pg-cal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.pg-cal-foot small { flex: 1 1 200px; color: var(--muted); font-weight: 700; font-size: 12.5px; line-height: 1.4; }
.pg-cal-b { min-height: 46px; flex: 1 1 100%; font-size: 15.5px; font-weight: 900; }
.pg-cal-b .item-art.xs, .pg-cal-b .pg-gem, .pg-cal-b .pg-coin { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- Pokédex tab */
.pg-hero { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 95, 107, .28), rgba(76, 141, 255, .1) 60%), var(--surface); border: 1px solid var(--line-2); }
.pg-hero-n { display: flex; align-items: baseline; gap: 6px; flex: none; }
.pg-hero-n b { font-size: 40px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pg-hero-n small { font-size: 11.5px; font-weight: 900; line-height: 1.15; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.pg-hero-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 800; color: #dfe7ff; }
.pg-hero-main b { color: var(--gold); }
.pg-mss { display: flex; flex-direction: column; gap: 6px; }
.pg-ms { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); }
.pg-ms-n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-weight: 900; font-size: 15px; color: #dfe7ff;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.18), rgba(0,0,0,.25)); border: 2px solid var(--line-2); }
.pg-ms-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pg-ms-main > b { font-size: 14px; }
.pg-ms.ready { border-color: rgba(255, 207, 74, .55); background: linear-gradient(100deg, rgba(255, 207, 74, .14), rgba(255, 207, 74, .03)); }
.pg-ms.ready .pg-ms-n { color: #3a2400; background: linear-gradient(var(--gold), var(--gold-2)); border-color: #ffe9a8; }
.pg-ms.big .pg-ms-n { border-color: rgba(208, 140, 255, .7); }
.pg-ms.locked { opacity: .7; }
.pg-lock { display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); }
.pg-lock .ic { width: 20px; height: 20px; }
.pg-count { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 900; color: #fff; }
.pg-count.ok { color: var(--ok); }
.pg-area { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pg-area.complete { border-color: rgba(62, 224, 122, .45); }
.pg-area.complete .pg-bar > i { background: var(--ok); }
.pg-sps { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.pg-sp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.pg-sp small { max-width: 100%; font-size: 11.5px; font-weight: 800; color: #dfe7ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-sp.unk small, .pg-sp.seen small { color: var(--muted); }
.pg-pic { position: relative; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.14), rgba(0,0,0,.25)); }
.pg-pic > .ic { width: 48%; height: 48%; color: rgba(170, 195, 255, .22); transition: opacity 200ms; }
.pg-pic.ready > .ic { opacity: 0; }
.pg-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 200ms; }
.pg-pic.ready img { opacity: 1; }
.pg-sp:not(.got) .pg-pic img { filter: brightness(0) invert(.35) sepia(.4) hue-rotate(190deg); }
.pg-sp.unk .pg-pic.ready img { opacity: .55; }
.pg-sp.got .pg-pic { background: radial-gradient(circle at 50% 35%, rgba(62, 224, 122, .2), rgba(0,0,0,.2)); box-shadow: inset 0 0 0 1.5px rgba(62, 224, 122, .45); }
.pg-sp-ok { position: absolute; top: -3px; right: calc(50% - 34px); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #06321a; }
.pg-sp-ok .ic { width: 14px; height: 14px; }
.pg-area-rw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.pg-area.complete .pg-area-rw { color: var(--ok); font-size: 14px; }
.pg-area-rw .ic { width: 18px; height: 18px; }
.pg-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-area-chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px 0 6px; border-radius: 999px; font-size: 12.5px; font-weight: 800;
  background: rgba(62, 224, 122, .1); border: 1px solid rgba(62, 224, 122, .3); color: #c9f7da; }
.pg-area-chip .ic { width: 16px; height: 16px; color: var(--ok); }

/* ---------------------------------------------------------------- medals */
.pg-md-sum { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pg-md-sum b { display: block; font-size: 20px; font-weight: 900; }
.pg-md-sum small { color: var(--muted); font-weight: 800; font-size: 12.5px; }
.pg-medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 8px; }
.pg-medal-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); }
.pg-medal-card.tier-gold { border-color: rgba(255, 207, 74, .45); background: linear-gradient(110deg, rgba(255, 207, 74, .12), var(--surface) 60%); }
.pg-md-main { min-width: 0; }
.pg-md-main > b { font-size: 14.5px; }
.pg-md-main > small { display: block; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.pg-md-main .pg-prog { margin-top: 4px; }
.pg-md-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pg-tiers { display: flex; gap: 4px; flex: none; }
.pg-tiers i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.pg-tiers i.bronze { background: linear-gradient(135deg, #f0a870, #8a4a22); }
.pg-tiers i.silver { background: linear-gradient(135deg, #ffffff, #8e9bb0); }
.pg-tiers i.gold { background: linear-gradient(135deg, #ffe07a, #d98a0c); }

/* medal disc (also used in banners) */
.pg-medal { --m1: #5a6684; --m2: #2c3554; --r1: #4b5675; --r2: #39425f; position: relative; display: inline-block; width: 44px; height: 50px; flex: none; }
.pg-ribbon { position: absolute; left: 50%; top: 0; width: 22px; height: 18px; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--r1) 0 50%, var(--r2) 50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%); }
.pg-disc { position: absolute; left: 3px; right: 3px; bottom: 0; height: 38px; display: grid; place-items: center; border-radius: 50%; color: rgba(255, 255, 255, .55);
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--m1) 60%, #fff), var(--m1) 45%, var(--m2));
  box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, .28), inset 0 -3px 0 rgba(0,0,0,.18), 0 3px 8px rgba(0,0,0,.35); }
.pg-disc .ic { width: 22px; height: 22px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.pg-medal.bronze { --m1: #e09a62; --m2: #8a4a22; --r1: #d0483a; --r2: #a8352a; }
.pg-medal.silver { --m1: #e8eef8; --m2: #8090a8; --r1: #3d7be0; --r2: #2a5cb0; }
.pg-medal.gold { --m1: #ffd34a; --m2: #c27a08; --r1: #e2373b; --r2: #3d7be0; }
.pg-medal:not(.none) .pg-disc { color: #fff; }
.pg-medal.silver .pg-disc { color: #3a4560; }
.pg-medal.gold .pg-disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%);
  background-size: 250% 100%; animation: pg-shine 3.2s ease-in-out infinite; }
@keyframes pg-shine { 0%, 60% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* ---------------------------------------------------------------- feedback lane: progress pills + banners */
#pg-fx { position: fixed; z-index: 7; left: 50%; top: 76px; transform: translateX(-50%); width: min(400px, calc(100vw - 24px)); display: flex; flex-direction: column; align-items: center;
  gap: 6px; pointer-events: none; }
#pg-fx > * { pointer-events: auto; font: inherit; color: #fff; text-align: left; opacity: 0; transform: translateY(-10px) scale(.96); transition: opacity .22s, transform .3s var(--ease); }
#pg-fx > .in { opacity: 1; transform: none; }
#pg-fx > .out { opacity: 0; transform: translateY(-8px) scale(.98); }
.pg-fx-mini { display: flex; align-items: center; gap: 10px; min-height: 44px; max-width: 100%; padding: 6px 14px 6px 8px; border-radius: 999px; cursor: pointer;
  background: rgba(13, 21, 44, .94); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.pg-fx-mini .pg-fx-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; background: rgba(122, 168, 255, .2); color: #bcd4ff; }
.pg-fx-mini .pg-fx-ic .ic, .pg-fx-mini .pg-fx-ic .pg-link { width: 19px; height: 19px; }
.pg-fx-t { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.pg-fx-mini .pg-fx-t { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.pg-fx-mini .pg-fx-t b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-fx-mini .pg-fx-t small { font-size: 12.5px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pg-fx-mini .pg-bar { grid-column: 1 / -1; height: 4px; margin-top: 3px; min-width: 160px; }
.pg-fx-big { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px 10px 10px; border-radius: 18px; cursor: pointer;
  background: linear-gradient(110deg, rgba(40, 52, 110, .97), rgba(16, 24, 58, .97)); border: 1px solid rgba(255, 207, 74, .6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 207, 74, .15), inset 0 1px 0 rgba(255,255,255,.12); }
.pg-fx-big .pg-fx-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; }
.pg-fx-big .pg-fx-ic .ic-tile { width: 44px; height: 44px; }
.pg-fx-big .pg-fx-ic .pg-link { width: 30px; height: 30px; color: #e0c4ff; }
.pg-fx-big .pg-fx-t b { font-size: 16px; font-weight: 900; color: var(--gold); }
.pg-fx-big .pg-fx-t small { font-size: 12.5px; font-weight: 800; color: #dfe7ff; line-height: 1.35; }
#pg-fx > .pg-fx-big.in { animation: pg-banner .5s var(--ease); }
.pg-fx-big.area, .pg-fx-big.dex { border-color: rgba(62, 224, 122, .7); background: linear-gradient(110deg, rgba(24, 92, 70, .97), rgba(16, 30, 58, .97)); }
.pg-fx-big.area .pg-fx-t b, .pg-fx-big.dex .pg-fx-t b { color: #9ff0c0; }
.pg-fx-big.chain { border-color: rgba(208, 140, 255, .75); background: linear-gradient(110deg, rgba(92, 44, 150, .97), rgba(22, 24, 62, .97)); }
.pg-fx-big.chain .pg-fx-t b { color: #f0d8ff; }
.pg-fx-big.medal .pg-medal { transform-origin: 50% 0; animation: pg-swing 1s var(--ease); }
@keyframes pg-banner { 0% { transform: translateY(-16px) scale(.9); } 55% { transform: translateY(2px) scale(1.03); } 100% { transform: none; } }
@keyframes pg-swing { 0% { transform: rotate(-25deg) scale(.6); } 50% { transform: rotate(12deg) scale(1.1); } 75% { transform: rotate(-5deg); } 100% { transform: none; } }

/* ---------------------------------------------------------------- catch-chain chip */
.pg-chain { position: fixed; z-index: 3; left: 50%; bottom: 74px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; height: 36px; max-width: min(320px, calc(100vw - 24px));
  padding: 0 10px 0 3px; border-radius: 999px; font: inherit; color: #fff; cursor: pointer;
  background: rgba(14, 20, 50, .82); border: 1px solid rgba(208, 140, 255, .5); box-shadow: var(--shadow-sm); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pg-chain[hidden] { display: none; }
.pg-chain::before { content: ''; position: absolute; inset: -5px; }   /* bigger touch target */
.pg-chain-pic { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; color: #e0c4ff;
  background: radial-gradient(circle at 50% 35%, rgba(208, 140, 255, .35), rgba(0,0,0,.3)); }
.pg-chain-pic img { width: 100%; height: 100%; object-fit: contain; }
.pg-chain-pic .pg-link { width: 18px; height: 18px; }
.pg-chain-name { min-width: 0; font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-chain-x { flex: none; font-size: 15px; font-weight: 900; color: #e0c4ff; font-variant-numeric: tabular-nums; }
.pg-chain-sh { flex: none; display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 7px 0 4px; border-radius: 999px; font-size: 12px; font-weight: 900;
  color: #3a2400; background: linear-gradient(var(--gold), var(--gold-2)); }
.pg-chain-sh[hidden] { display: none; }
.pg-chain-sh .ic { width: 15px; height: 15px; }
.pg-chain.hot { border-color: rgba(255, 207, 74, .7); box-shadow: var(--shadow-sm), 0 0 12px rgba(255, 207, 74, .3); }
.pg-chain.grow { animation: pg-chain-grow .55s var(--ease); }
.pg-chain.grow .pg-chain-x { animation: pg-num .55s var(--ease); }
@keyframes pg-chain-grow { 30% { box-shadow: 0 0 0 6px rgba(208, 140, 255, .35), var(--shadow-sm); } }
@keyframes pg-num { 30% { transform: scale(1.45); color: #fff; } }
.pg-link { display: block; }
body.battle-active .pg-chain, body.battle-active #pg-fx { display: none; }

/* ---------------------------------------------------------------- reward pop */
.pg-pop { position: fixed; z-index: 20; width: 0; height: 0; pointer-events: none; }
.pg-burst { position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 233, 150, .85), rgba(255, 207, 74, .3) 45%, transparent 70%); animation: pg-burst .6s ease-out forwards; }
.pg-pop.big .pg-burst { left: -70px; top: -70px; width: 140px; height: 140px; }
.pg-spark { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: #ffe58a; box-shadow: 0 0 6px #ffcf4a;
  animation: pg-spark .65s cubic-bezier(.2, .7, .3, 1) forwards; }
.pg-pop-items { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: flex; gap: 6px; }
.pg-pop-it { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px; white-space: nowrap;
  background: rgba(13, 21, 44, .95); border: 1px solid rgba(255, 207, 74, .7); box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  animation: pg-rise 1.3s cubic-bezier(.2, .8, .2, 1) calc(var(--i) * 70ms) both; }
.pg-pop.big .pg-pop-it { animation-duration: 1.7s; }
.pg-pop-it .item-art.sm, .pg-pop-it .pg-gem, .pg-pop-it .pg-coin { width: 28px; height: 28px; }
.pg-pop-it b { font-size: 15px; font-weight: 900; color: var(--gold); }
@keyframes pg-burst { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes pg-spark { from { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(.3); opacity: 0; } }
@keyframes pg-rise { 0% { transform: translateY(10px) scale(.5); opacity: 0; } 18% { transform: translateY(-14px) scale(1.12); opacity: 1; } 30% { transform: translateY(-18px) scale(1); }
  75% { opacity: 1; } 100% { transform: translateY(-70px) scale(.9); opacity: 0; } }

/* ---------------------------------------------------------------- touch layouts */
html.touch .pg-tabs .tab { min-height: 44px; }
html.touch.portrait .tabs.swipe.pg-tabs .tab { flex: 1 1 auto; justify-content: center; padding: 6px 10px; }
html.touch .pg-claim, html.touch .pg-open { min-height: 46px; }
/* portrait: the chip sits right of the chat / party round buttons, above the stick, clear of the A button */
html.touch.portrait .pg-chain { left: calc(var(--sal, 0px) + 120px); bottom: calc(var(--sab, 0px) + 158px); transform: none;
  max-width: calc(100vw - 120px - 92px - var(--sal, 0px) - var(--sar, 0px)); }
html.touch.portrait .pg-chain-name { font-size: 12px; }
/* portrait: pills under the minimap column, clear of the party column on the left */
html.touch.portrait #pg-fx { top: calc(var(--sat, 0px) + 222px); left: calc(var(--sal, 0px) + 62px); right: calc(var(--sar, 0px) + 10px); width: auto; transform: none; }
/* landscape: chip right of the round buttons, bottom-left; pills under the quest chip */
html.touch.landscape .pg-chain { left: calc(var(--sal, 0px) + 228px); bottom: calc(var(--sab, 0px) + 14px); transform: none; max-width: min(320px, calc(100vw - 228px - 260px)); }
html.touch.landscape #pg-fx { top: calc(var(--sat, 0px) + 60px); width: min(380px, calc(100vw - 420px)); }
html.touch.moving .pg-chain { opacity: .75; }

/* phones: tighter cards */
@media (max-width: 420px) {
  .pg-mis { gap: 10px; padding: 10px 8px 10px 10px; grid-template-columns: 40px minmax(0, 1fr) auto; }
  .pg-mis-ic .ic-tile { width: 40px; height: 40px; }
  .pg-mis-main > b { font-size: 14px; }
  .pg-claim { padding: 6px 10px 6px 6px; gap: 6px; }
  .pg-claim .pg-rws.in-btn { display: none; }        /* the reward is listed on the pop; keep the button big */
  .pg-claim { padding: 6px 16px; }
  .pg-day { min-height: 80px; border-radius: 11px; }
  .pg-day-n { font-size: 9.5px; }
  .pg-day-q { font-size: 10.5px; }
  .pg-hero-n b { font-size: 34px; }
  .pg-sps { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .pg-pic { width: 54px; height: 54px; }
}

/* ---------------------------------------------------------------- reduced motion */
html.reduce-motion .pg-chain, html.reduce-motion .pg-chain *, html.reduce-motion #pg-fx > *, html.reduce-motion .pg-pop *, html.reduce-motion .pg * { animation: none !important; transition: none !important; }
html.reduce-motion .pg-pop-it { animation: pg-fade 1.2s linear both !important; }
@media (prefers-reduced-motion: reduce) {
  .pg-chain, .pg-chain *, #pg-fx > *, .pg-pop *, .pg * { animation: none !important; transition: none !important; }
  .pg-pop-it { animation: pg-fade 1.2s linear both !important; }
}
@keyframes pg-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
