/* Expeditions reward pop-up. Load AFTER harks-original.css.
   Only .xr-* classes plus two expedition-only helpers, so other pages don't change. */

/* Clickable pet + "Ready / Reward" badge on the map */
button.ex-pin-tag.xr-claim { padding: 6px; background: none; border: 0; cursor: pointer; pointer-events: auto; line-height: 1.2; }
button.ex-pin-tag.xr-claim > img { flex: none; width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); animation: xr-bob 1.6s ease-in-out infinite; }
button.ex-pin-tag.xr-claim:hover { filter: brightness(1.08); }
button.ex-pin-tag.xr-claim:focus-visible { outline: 3px solid #fff; border-radius: 14px; }
.xr-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.xr-ready > button.xr-face { padding: 0; background: none; border: 0; cursor: pointer; }
.xr-ready img { width: 110px; height: 110px; object-fit: contain; }
.xr-ready p { margin: 0 0 8px; font: 800 18px var(--font-body); color: var(--ink); }

/* Pop-up shell */
dialog.xr { box-sizing: border-box; position: fixed; inset: 0; margin: auto; width: min(440px, calc(100vw - 24px)); height: fit-content; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: hidden auto; padding: 0 0 18px; text-align: center; color: var(--ink); background: #fff; border: 4px solid #1b5aa8; border-radius: 24px; box-shadow: 0 24px 60px rgba(9, 36, 68, .45); font-family: var(--font-body); }
dialog.xr::backdrop { background: rgba(11, 40, 74, .72); }
.xr-title { margin: 0; padding: 14px 48px 15px; font: 400 27px/1.1 var(--font-display); letter-spacing: .5px; color: #fff; -webkit-text-stroke: 4px #1b5aa8; paint-order: stroke fill; background: linear-gradient(#48afee 0 60%, #2f93e2 60%); }
.xr-x { position: absolute; top: 6px; right: 6px; z-index: 3; width: 44px; height: 44px; padding: 0; font: 800 28px/1 var(--font-body); color: #fff; background: none; border: 0; cursor: pointer; }
.xr-body { display: grid; justify-items: center; gap: 12px; padding: 16px 18px 0; }
.xr-big { min-width: 200px; }
.xr-error { margin: 0; padding: 8px 12px; font: 800 13.5px/1.4 var(--font-body); color: #8f2018; background: #ffe3de; border: 2px solid #e8452f; border-radius: 10px; }

/* Tap-to-open orb with sound rings (Harks love noise) */
.xr-orb { position: relative; display: grid; place-items: center; width: 100%; height: 305px; padding: 0; overflow: hidden; cursor: pointer; border: 0; border-radius: 18px; background: radial-gradient(circle at 50% 45%, #fff 0 18%, #c9edff 48%, #74c8f5 100%); }
.xr-orb:disabled { cursor: default; }
/* Keyboard focus in the pop-up: no dashed outlines. A focused control brightens and lifts a little
   instead (the orb lights up its label pill), so Tab users still see where they are. */
dialog.xr :is(.xr-orb, .btn, .xr-x, .xr-skip):focus-visible { outline: none; }
.xr-orb:focus-visible .xr-orb-label { background: #fff1dc; border-color: #f58a12; box-shadow: 0 0 0 3px rgba(245, 138, 18, .35); }
dialog.xr .btn:focus-visible { filter: brightness(1.1) saturate(1.1); transform: translateY(-2px); }
dialog.xr .xr-x:focus-visible { background: rgba(255, 255, 255, .28); border-radius: 50%; }
dialog.xr .xr-skip:focus-visible { text-decoration: underline; }
.xr-pet { position: relative; z-index: 1; width: 209px; height: 209px; object-fit: contain; }
.xr-orb .xr-pet { animation: xr-bob 1.5s ease-in-out infinite; margin-bottom: 30px; }
.xr-orb-label { position: absolute; z-index: 2; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 7px 18px; white-space: nowrap; font: 800 15px var(--font-body); color: #164a7c; background: #fff; border: 2px solid #1b5aa8; border-radius: 99px; }
.xr-rings i { position: absolute; left: 50%; top: 45%; width: 120px; height: 120px; margin: -60px; border: 4px solid #fff; border-radius: 50%; opacity: 0; animation: xr-ring 2.4s ease-out infinite; }
.xr-rings i:nth-child(2) { animation-delay: .8s; }
.xr-rings i:nth-child(3) { animation-delay: 1.6s; }

/* Loot cards */
.xr-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; }
.xr-card { box-sizing: border-box; display: grid; justify-items: center; align-content: center; gap: 4px; width: 118px; min-height: 128px; padding: 10px 6px; background: #eef8ff; border: 3px solid #9fd0f7; border-radius: 16px; animation: xr-pop .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.xr-card b { font: 800 14px/1.25 var(--font-body); overflow-wrap: anywhere; }
.xr-card small { font: 800 12px var(--font-body); color: #4a6581; text-transform: capitalize; }
.xr-item { width: 52px; height: 52px; object-fit: contain; }
.xr-card.rarity-uncommon { background: #eefbe6; border-color: #6fbf45; }
.xr-card.rarity-rare, .xr-card.rarity-epic { background: #f5ecff; border-color: #9a63d0; }
.xr-card.rarity-legendary { background: #fff5cf; border-color: #e0a512; }
.xr-double { margin: 0; padding: 4px 16px; font: 400 20px var(--font-display); color: #174d12; background: #d9f6c4; border-radius: 99px; animation: xr-pop .5s .5s both; }

/* Mystery friend */
.xr-secret { background: radial-gradient(circle at 50% 45%, #8fdcff 0 12%, #2467ad 55%, #102c54 100%); }
.xr-shadow { filter: brightness(0) drop-shadow(0 0 12px #bfeaff); }
.glow-gold .xr-secret { background: radial-gradient(circle at 50% 45%, #fff6c2 0 14%, #d18b0c 55%, #5a3200 100%); }
.glow-gold .xr-shadow { filter: brightness(0) drop-shadow(0 0 16px #ffe46b); }
.glow-diamond .xr-secret { background: conic-gradient(from 0deg at 50% 45%, #ff9bd2, #ffe27a, #8ff0b0, #7fd4ff, #c7a2ff, #ff9bd2); }
.glow-diamond .xr-shadow { filter: brightness(0) drop-shadow(0 0 18px #fff); }
.xr-yip { position: absolute; z-index: 2; top: 22px; right: 28px; padding: 6px 16px; font: 400 24px var(--font-display); color: #164a7c; background: #fff; border-radius: 20px 20px 20px 4px; animation: xr-yip 1.8s ease-in-out infinite; }
.is-opening .xr-secret .xr-pet { animation: xr-shake .22s linear infinite; }
.is-opening .xr-rings i { animation-duration: .9s; }
.is-opening .xr-rings i:nth-child(2) { animation-delay: .3s; }
.is-opening .xr-rings i:nth-child(3) { animation-delay: .6s; }
.is-opening .xr-orb::after { content: ""; position: absolute; inset: 0; z-index: 3; background: #fff; opacity: 0; animation: xr-flash 1.8s ease-in forwards; }
.xr-skip { padding: 8px 14px; font: 800 13px var(--font-body); color: #165a96; text-decoration: underline; background: none; border: 0; cursor: pointer; }

/* The reveal */
.xr-stage { position: relative; display: grid; place-items: center; width: 100%; height: 220px; overflow: hidden; border-radius: 18px; background: radial-gradient(circle, #fff 0 20%, #d5f0ff 55%, #a5dbf7 100%); }
.glow-gold .xr-stage { background: radial-gradient(circle, #fff 0 20%, #ffeb94 55%, #ffc640 100%); }
.glow-diamond .xr-stage { background: linear-gradient(135deg, #ffd6ee, #fff3b8, #c7f8d8, #c3eaff, #e3d2ff); }
.xr-friend { width: 198px; height: 198px; animation: xr-arrive .7s cubic-bezier(.2, 1.5, .4, 1) both; }
.is-leave .xr-friend { animation: none; }
.xr-burst i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 3px; background: #ffa927; opacity: 0; animation: xr-burst 1s ease-out forwards; }
.xr-burst i:nth-child(3n) { background: #1fa8f0; }
.xr-burst i:nth-child(3n+1) { background: #fff; }
.xr-name { margin: 0; font: 400 30px/1 var(--font-display); color: #17599a; }
.xr-wow { margin: 0; padding: 3px 14px; font: 800 14px var(--font-body); color: #5a3200; background: #ffe98a; border-radius: 99px; }
.xr-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; margin: 0; padding: 0 0 4px; list-style: none; }
.xr-stats li { animation: xr-pop .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.xr-stats li, .xr-stats .pt-p { min-width: 0; }
.xr-stats .pt-tier b { font-size: 28px; }
@media (max-width: 360px) { .xr-body { padding-inline: 12px; } .xr-stats { gap: 5px; } .xr-stats .pt-tier b { font-size: 22px; } }
.is-leave .xr-stats li { animation: none; }
.xr-nostats { margin: 0; font: 800 13.5px/1.4 var(--font-body); color: #4a6581; }
.xr-ask { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.xr-ask .btn { min-width: 130px; min-height: 44px; }
@media (max-height: 700px) { .xr-orb { height: 255px; } .xr-stage { height: 165px; } .xr-friend { width: 154px; height: 154px; } }

@keyframes xr-bob { 50% { translate: 0 -6px; } }
@keyframes xr-ring { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(3); opacity: 0; } }
@keyframes xr-pop { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes xr-yip { 0%, 55%, 100% { transform: scale(0); opacity: 0; } 65%, 90% { transform: scale(1); opacity: 1; } }
@keyframes xr-shake { 25% { transform: translateX(-5px) rotate(-3deg); } 75% { transform: translateX(5px) rotate(3deg); } }
@keyframes xr-flash { 0%, 70% { opacity: 0; } 100% { opacity: 1; } }
@keyframes xr-arrive { from { transform: scale(.4); filter: brightness(3); } to { transform: none; filter: none; } }
@keyframes xr-burst { 0% { opacity: 1; transform: rotate(calc(var(--i) * 25.7deg)) translateY(-20px); } 100% { opacity: 0; transform: rotate(calc(var(--i) * 25.7deg)) translateY(-150px) scale(.4); } }
@media (prefers-reduced-motion: reduce) {
  dialog.xr *, dialog.xr *::after, button.ex-pin-tag.xr-claim > img { animation: none !important; }
  .xr-rings, .xr-burst, .xr-yip { display: none; }
}
