/* Reward motion: full-screen white reward popups (streak, level unlock, league climb, Lesson completed).
 * Everything is prefixed .prm- so it never collides with player/step styles. Motion is driven from
 * js/player/reward-motion.js with the Web Animations API (transform/opacity only). */
.prm { position: fixed; inset: 0; z-index: 10060; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); background: #fff; color: var(--px-ink-900, #0f172a); text-align: center; overflow: hidden;
  contain: layout paint style; }   /* isolate from the player underneath */
.prm svg { display: block; }
.prm-close { position: absolute; top: 16px; right: 16px; z-index: 7; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: #65727c; box-shadow: 0 1px 3px rgba(15,23,42,.14); cursor: pointer; }
.prm-close:hover { color: #0f172a; }
.prm--auto { cursor: pointer; -webkit-tap-highlight-color: transparent; }   /* tap anywhere to skip */
.prm-close svg { width: 20px; height: 20px; }
.prm-close:focus-visible, .prm-cta:focus-visible { outline: 2px solid var(--px-action-focus, #324D74); outline-offset: 3px; }
.prm-art { position: relative; z-index: 2; width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent; }
.prm-title { position: relative; z-index: 2; margin: 22px 0 0; max-width: 22ch; font-size: 29px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.prm .prm-cta { position: relative; z-index: 2; width: 100%; max-width: 280px; margin-top: 20px; }
.prm-tw, .prm-bst, .prm-ember, .prm-spk, .prm-glint b, .prm-cam, .prm-lvl, .prm-row, .prm-flame, .prm-f-out, .prm-f-in,
.prm-odo-col, .prm-fc, .prm-dfill { will-change: transform, opacity; }

/* shared game-feel pieces */
.prm-glint { position: absolute; inset: 0; z-index: 3; border-radius: inherit; overflow: hidden; pointer-events: none; }
.prm-glint b { position: absolute; top: -30%; bottom: -30%; left: 0; width: 38%; transform: translateX(-150%) skewX(-18deg);
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.85) 50%, transparent); }
.prm-tw { position: absolute; z-index: 4; width: 18px; height: 18px; margin: -9px; pointer-events: none;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.prm-bst { position: absolute; z-index: 1; border-radius: 50%; pointer-events: none; }

/* streak */
.prm-glow { position: absolute; left: 50%; top: 36%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,116,0,.35), rgba(255,116,0,0) 65%); pointer-events: none; }
.prm-flame { position: relative; width: 128px; height: 137px; }
.prm-flame svg { position: absolute; left: 0; top: 0; width: 128px; height: 137px; overflow: visible; }
.prm-f-out { transform-origin: 50% 94%; } .prm-f-in { transform-origin: 48% 85%; }
.prm-ember { position: absolute; left: 50%; bottom: 30px; width: 7px; height: 7px; border-radius: 50%; background: #FFB100; opacity: 0; }  /* hidden until its rise starts */
.prm-odo { height: 54px; margin-top: 14px; overflow: hidden; font-size: 52px; line-height: 54px; font-weight: 600; color: #FF7400; }
.prm-odo-col div { height: 54px; }
.prm-odo-label { margin: 0; font-size: 22px; font-weight: 600; color: #B84F00; }
.prm-week { display: flex; gap: 10px; margin-top: 14px; }
.prm-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: #64748b; }
.prm-day.is-future { opacity: .55; }
.prm-dot { position: relative; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 2px solid #E5E7EB; box-shadow: 0 3px 0 #E5E7EB; background: #fff; color: #fff; }
.prm-dot.is-on { background: #FF7400; border-color: #FF7400; box-shadow: 0 3px 0 #B84F00; }
.prm-dot svg { position: relative; z-index: 1; width: 16px; height: 16px; }
.prm-dfill { position: absolute; inset: -2px; border-radius: 50%; background: #FF7400; box-shadow: 0 3px 0 #B84F00; }

/* level path */
.prm-trk { position: relative; width: 100%; height: 150px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.prm-cam { position: absolute; inset: 0; }
.prm-lvl { position: absolute; left: 50%; top: 50%; width: var(--prm-nd); height: var(--prm-nd); margin: calc(var(--prm-nd) / -2) 0 0 calc(var(--prm-nd) / -2); }
.prm-face { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: #FF7400; box-shadow: 0 8px 0 #B84F00; color: #fff; font-size: 32px; font-weight: 600; }
.prm-face::before { content: ""; position: absolute; z-index: 1; top: 9px; left: 15px; width: 24px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.35); transform: rotate(-22deg); }
.prm-face.is-locked { background: #E5E7EB; box-shadow: 0 7px 0 #C4C9D1; color: #9AA3AF; }
.prm-face.is-locked::before { background: rgba(255,255,255,.7); }
.prm-face b { position: relative; z-index: 2; font-weight: 600; }
.prm-face .prm-lock { position: absolute; z-index: 2; width: 32px; height: 32px; }
.prm-fc { position: absolute; inset: 0; z-index: 0; border-radius: 50%; opacity: 0; }
.prm-link { position: absolute; top: 50%; height: 12px; margin-top: -6px; border-radius: 9px; background: #E5E7EB; overflow: hidden; }
.prm-link i { position: absolute; inset: 0; border-radius: 9px; background: #FF7400; transform-origin: left; transform: scaleX(0); }
.prm-ring { position: absolute; inset: 0; border: 5px solid #F4BD37; border-radius: 50%; pointer-events: none; }
.prm-spk { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; background: #FFB743; pointer-events: none;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* league */
.prm-league { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 16px; font-weight: 500; color: #475569; }
.prm-league svg { width: 24px; height: 24px; }
.prm-rows { position: relative; width: min(320px, 100%); }
.prm-row { position: absolute; left: 0; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 2px solid #E5E7EB;
  border-radius: 14px; background: #fff; box-shadow: 0 4px 0 #E5E7EB; font-weight: 500; text-align: left; }
.prm-row b { width: 22px; font-weight: 600; color: #64748b; }
.prm-row .prm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prm-av { flex: none; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #F1F5F9; color: #475569; font-size: 13px; font-weight: 600; }
.prm-pts { flex: none; font-size: 14px; color: #64748b; }
.prm-row.is-me { z-index: 2; border-color: #FF7400; background: #FFF1E6; box-shadow: 0 4px 0 #B84F00; }
.prm-row.is-me .prm-av { background: #FF7400; color: #fff; }

/* final "Lesson completed" screen */
.prm-lc { gap: 18px; }
.prm-lc-title { position: relative; z-index: 2; margin: 0; max-width: 22ch; font-size: 29px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.prm-lc-stage { position: relative; z-index: 2; width: 176px; height: 235px; }
.prm-lc-lix { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 100%; }
.prm-lc-halo { position: absolute; left: 50%; top: 52%; z-index: 0; width: 280px; height: 280px; margin: -140px 0 0 -140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,116,0,.22), rgba(255,180,0,.08) 45%, rgba(255,116,0,0) 68%); }
.prm-lc-pill { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; padding: 8px 22px 8px 14px; border: 1px solid #e5e7eb; border-radius: 9999px; background: #fff; overflow: hidden; }
.prm-lc-pill img { width: 40px; height: 40px; object-fit: contain; }
.prm-lc-t { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.prm-lc-t span { font-size: 14px; color: #64748b; }
.prm-lc-t b { font-size: 21px; font-weight: 600; color: #0f172a; }
.prm-lc-icons { position: relative; z-index: 2; display: flex; gap: 12px; }
.prm-lc-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid #E5E7EB; border-radius: 50%; background: #fff; color: #3F3F46;
  box-shadow: 0 3px 0 #E5E7EB; cursor: pointer; transition: transform .1s, box-shadow .1s; }
.prm-lc-icon:active { transform: translateY(3px); box-shadow: none; }
.prm-lc-icon:focus-visible, .prm-lc-cta:focus-visible { outline: 2px solid var(--px-action-focus, #324D74); outline-offset: 3px; }
.prm-lc-icon svg { width: 20px; height: 20px; }
.prm .prm-lc-cta { position: relative; z-index: 2; width: 100%; max-width: 320px; margin-top: 6px; }
.prm-lc-cf { position: absolute; z-index: 1; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; }
.prm-lc-lix, .prm-lc-halo, .prm-lc-pill, .prm-lc-icon, .prm-lc-cf { will-change: transform, opacity; }
@media (max-width: 600px) { .prm-lc { gap: 14px; } .prm-lc-title { font-size: 24px; } .prm-lc-stage { width: 148px; height: 198px; } }

/* Layering: glow and burst rings sit BEHIND the hero; only the small sparkles sit in front. */
.prm-art > * { position: relative; z-index: 2; }
.prm-art > .prm-glow, .prm-art > .prm-bst { position: absolute; z-index: 0; }
.prm-art > .prm-tw { position: absolute; z-index: 3; }

@media (max-width: 600px) {
  .prm-title { font-size: 24px; }
  .prm-week { gap: 6px; }
  .prm-dot { width: 26px; height: 26px; }
  .prm-face { font-size: 26px; }
}
@media (max-height: 560px) { .prm-title { margin-top: 12px; } .prm .prm-cta { margin-top: 12px; } }
.prm-lc-message{position:relative;z-index:2;max-width:40ch;margin:0;font-size:16px;line-height:1.5;color:#475569;text-align:center}
@keyframes prm-lc-msg{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.prm-lc-message{animation:prm-lc-msg .45s ease-out 1.1s both}
@media (prefers-reduced-motion:reduce){.prm-lc-message{animation:none}}
