/* #114 the pack-complete reward (reward.js). Under the Undo toast (.ap-toast is z 72) and over the desk; nothing here
   traps focus. Codex's art (assets/art/new/rewards/v1/web/): the radiant plate is the box's background, contained on
   wide screens (its dark centre holds the emblem and the live text), a centred crop on phones and tall windows; one
   transparent emblem per event stands above the headline (the laurel bust is the fallback for other events). */
/* the fade is on the scrim and the box, never on .pr itself: a parent mid-fade would cut the scrim's backdrop blur off
   from the desk behind it (it becomes the blur's backdrop root) */
.pr { position: fixed; inset: 0; z-index: 66; display: grid; place-items: center; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.pr-scrim { position: absolute; inset: 0; cursor: pointer; background: radial-gradient(70% 60% at 50% 45%, rgba(40, 7, 10, .78), rgba(4, 3, 4, .94));
  backdrop-filter: blur(12px) saturate(.8); -webkit-backdrop-filter: blur(12px) saturate(.8); opacity: 0; transition: opacity .32s cubic-bezier(.23, 1, .32, 1); }
.pr.on .pr-scrim { opacity: 1; }
.pr.off .pr-scrim, .pr.off .pr-box { opacity: 0; transition: opacity .2s ease-out; }
/* the stage: the radiant plate at 16:9, as wide as fits (never cropped here); the live column sits in its dark centre
   (Codex's safe area x600-1320 of 1920, so the column is ~37% of the stage) */
.pr-box { --plate: url("assets/art/new/rewards/v1/web/radiant-background-1280.webp");
  position: relative; width: min(1180px, 100%, calc((100vh - 32px) * 16 / 9)); aspect-ratio: 16 / 9; margin: auto; display: grid; place-items: center;
  padding: 18px 0; border-radius: 6px; text-align: center; overflow: hidden; background: #060405 var(--plate) center / contain no-repeat;
  box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .08), 0 30px 80px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .3s ease-out, transform .5s cubic-bezier(.2, 1.2, .35, 1); }
@media (min-resolution: 1.5dppx), (min-width: 1500px) { .pr-box { --plate: url("assets/art/new/rewards/v1/web/radiant-background-1920.webp"); } }
.pr.on .pr-box { opacity: 1; transform: none; }
.pr-col { position: relative; width: min(440px, 40%); display: grid; justify-items: center; gap: 10px; }
/* a soft shade under the live text so the plate's centre rays never fight it */
.pr-col::before { content: ""; position: absolute; inset: -6% -14%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(5, 3, 4, .72), rgba(5, 3, 4, .45) 60%, transparent); }
/* the emblem: transparent art, padded by Codex (its leaf tips need the room, so nothing clips it) */
.pr-art { position: relative; width: 196px; aspect-ratio: 1; margin: -6px 0 -10px; pointer-events: none; }
.pr-emb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .65));
  opacity: 0; transform: translateY(10px) scale(.86); transition: transform .9s cubic-bezier(.2, 1.15, .35, 1) .05s, opacity .5s ease-out .05s; }
.pr.on .pr-emb { opacity: 1; transform: none; }
/* tier up: the pack's emblem steps back and the tier-up emblem lands on the beat the bar crosses the line */
.pr:not(.pr-tierup) .pr-emb.pr-emb-up { opacity: 0; transform: scale(.7); transition: none; }
.pr.pr-tierup .pr-emb.pr-emb-was { opacity: 0; transform: scale(.92); transition: opacity .25s ease-out, transform .3s ease-out; }
.pr.pr-tierup .pr-emb.pr-emb-up { opacity: 1; transform: none; animation: prEmbUp .6s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes prEmbUp { 0% { opacity: 0; transform: scale(.7); } 55% { opacity: 1; transform: scale(1.07); } 100% { opacity: 1; transform: none; } }
.pr.pr-skipped .pr-emb.pr-emb-up { animation: none; }
.pr-kicker { position: relative; margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--t-titan, #f0c870); }
.pr-title { position: relative; margin: 0; font: 400 clamp(28px, 4vw, 38px)/1.1 var(--serif); color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.pr-xp { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 4px; }
.pr-num { font: 400 64px/1 var(--serif); color: var(--t-titan, #f0c870); font-variant-numeric: tabular-nums; min-width: 2.6ch; text-align: right; text-shadow: 0 0 26px rgba(240, 200, 112, .35); }
.pr-unit { font-size: 16px; font-weight: 600; letter-spacing: .14em; color: var(--bone, #ece4d8); }
/* the multiplier: hidden until it stamps in (a quick overshoot), then it stays */
.pr-mult { align-self: center; margin-left: 4px; padding: 6px 11px 5px; border-radius: 8px; font-size: 20px; font-weight: 700; letter-spacing: .02em; color: #1a1006;
  background: linear-gradient(160deg, #ffe4a3, #e0a94a 70%, #b97f2a); box-shadow: 0 0 0 1px rgba(255, 236, 190, .6), 0 6px 18px rgba(240, 180, 80, .35);
  opacity: 0; transform: scale(1.6) rotate(-8deg); }
.pr.pr-stamp .pr-mult { animation: prStamp .42s cubic-bezier(.2, 1.4, .4, 1) both; }
.pr.pr-skipped .pr-mult, .pr.pr-calm .pr-mult { animation: none; opacity: 1; transform: rotate(-4deg); }
@keyframes prStamp { 0% { opacity: 0; transform: scale(1.7) rotate(-10deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(-4deg); } }
.pr.pr-stamp .pr-num { animation: prPulse .5s cubic-bezier(.23, 1, .32, 1); }
@keyframes prPulse { 30% { text-shadow: 0 0 40px rgba(255, 220, 140, .8); } }
.pr-calc { position: relative; margin: 0; max-width: 34ch; font-size: 15.5px; line-height: 1.45; color: var(--bone-2, #b9b0a5); text-wrap: balance; }
.pr-pass { position: relative; width: 100%; margin-top: 8px; }
.pr-pass-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--bone-2, #b9b0a5); }
.pr-tier b { color: var(--bone, #ece4d8); font-size: 16px; }
.pr-up { color: var(--t-titan, #f0c870); font-weight: 700; animation: prUp .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes prUp { from { opacity: 0; transform: translateY(6px) scale(.9); } }
.pr-next { margin-left: auto; }
.pr-bar { height: 10px; border-radius: 99px; background: rgba(236, 228, 216, .08); box-shadow: inset 0 0 0 1px rgba(236, 228, 216, .1); }
.pr-bar { position: relative; }
/* where you were before this pack: the gain reads as the bright stretch after the tick */
.pr-was { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(255, 244, 222, .85); box-shadow: 0 0 6px rgba(255, 230, 180, .6); }
.pr-plus { font: 400 40px/1 var(--serif); color: var(--t-titan, #f0c870); opacity: .8; margin-right: -4px; }
.pr-bar i { display: block; height: 100%; transform-origin: 0 50%; border-radius: inherit;
  background: linear-gradient(90deg, #8f1a22, var(--red, #b3141d) 40%, #f0c870); box-shadow: 0 0 14px rgba(240, 160, 90, .45); }
.pr.pr-tierup .pr-bar { animation: prBarFlash .7s ease-out; }
@keyframes prBarFlash { 20% { box-shadow: inset 0 0 0 1px rgba(240, 200, 112, .8), 0 0 22px rgba(240, 200, 112, .55); } }
.pr-streak { position: relative; display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 15.5px; color: var(--bone, #ece4d8); opacity: 0; transform: translateY(6px);
  transition: opacity .3s ease-out, transform .3s cubic-bezier(.23, 1, .32, 1); }
.pr-streak-emb { flex: none; width: 46px; height: 46px; margin: -8px -2px -8px -6px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.pr-streak b { color: #f3b06a; font-weight: 600; }
.pr-acts { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; opacity: 0; transform: translateY(8px);
  transition: opacity .3s ease-out .08s, transform .35s cubic-bezier(.23, 1, .32, 1) .08s; }
.pr-note { position: relative; margin: 0; font-size: 14px; color: var(--bone-2, #b9b0a5); opacity: 0; transition: opacity .3s ease-out .16s; }
.pr.pr-done :is(.pr-streak, .pr-acts) { opacity: 1; transform: none; }
.pr.pr-done .pr-note { opacity: 1; }
.pr-acts .btn:active { transform: scale(.97); }
/* narrow or tall windows: a portrait panel with the plate as a centred crop (the arches fall away, the dark centre and
   its rays stay); a short window keeps the stage but lets it grow and scroll */
@media (max-width: 860px), (max-aspect-ratio: 5/4) {
  .pr-box { width: min(480px, 100%); aspect-ratio: auto; padding: 22px 28px 26px; background-size: cover; border-radius: 14px; }
  .pr-col { width: 100%; }
}
@media (max-height: 620px) and (min-width: 861px) and (min-aspect-ratio: 5/4) { .pr-box { aspect-ratio: auto; min-height: calc(100vh - 32px); } .pr-art { width: 150px; } }
/* phones: the box sits high enough that the Undo toast (bottom 16px) never covers its buttons */
@media (max-width: 520px) { .pr { padding-bottom: 104px; } .pr-box { padding: 16px 18px 20px; } .pr-art { width: 150px; } .pr-num { font-size: 54px; } .pr-acts { width: 100%; } .pr-acts .btn { flex: 1 1 0; padding: 0 14px; } }
/* reduced motion: a plain fade, everything already where it ends */
.pr.pr-calm .pr-box { transform: none; transition: opacity .2s ease-out; }
.pr.pr-calm .pr-scrim { transition: opacity .2s ease-out; }
.pr.pr-calm .pr-emb { transition: none; transform: none; opacity: 1; } /* (the tier-up pair's rules above still pick which one shows) */
.pr.pr-calm :is(.pr-streak, .pr-acts, .pr-note) { transition: none; }
@media (prefers-reduced-motion: reduce) { .pr, .pr * { animation: none !important; } }
