/* Cards, medals and reward animations */

/* ---------- medal ---------- */
.medal { display: inline-grid; place-items: center; flex: none; filter: drop-shadow(0 6px 10px rgba(60, 45, 20, .18)); }
.medal svg { display: block; }
.medal.locked { filter: grayscale(1); opacity: .32; }

/* ---------- collectible card ---------- */
.gcard {
  --c: #86b09b; --edge: rgba(255, 255, 255, .7); --gem: var(--ink-3);
  position: relative; width: 150px; height: 210px; border-radius: 16px; padding: 11px 12px 10px;
  display: grid; grid-template-rows: auto 1fr auto auto; gap: 6px; overflow: hidden; color: var(--ink);
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 45%, transparent), transparent 70%),
    linear-gradient(170deg, color-mix(in srgb, var(--c) 22%, var(--surface)), var(--surface) 75%);
  box-shadow: 0 1px 2px rgba(60, 45, 20, .1), 0 12px 26px -14px rgba(60, 45, 20, .45), inset 0 0 0 1px var(--edge);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.gcard:hover { transform: translateY(-3px) rotate(-.6deg); }
.gc-top { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; }
.gc-gems { color: var(--gem); letter-spacing: 1px; font-size: 10px; }
.gc-no { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.gc-art {
  display: grid; place-items: center; border-radius: 12px;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--surface) 70%, transparent), transparent 70%), color-mix(in srgb, var(--c) 30%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.gc-icon { font-size: 44px; line-height: 1; font-family: var(--serif); font-weight: 600; color: color-mix(in srgb, var(--c) 70%, var(--ink)); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .12)); }
.gc-title { font-family: var(--serif); font-weight: 600; font-size: 14.5px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.gc-foot { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); }
.gc-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%); background-size: 260% 100%; background-position: 120% 0; mix-blend-mode: soft-light; }

.gcard.sm { width: 112px; height: 158px; padding: 8px 9px; border-radius: 13px; gap: 4px; }
.gcard.sm .gc-icon { font-size: 32px; }
.gcard.sm .gc-title { font-size: 12px; }
.gcard.sm .gc-foot, .gcard.sm .gc-top { font-size: 9.5px; }
.gcard.lg { width: 220px; height: 308px; padding: 15px 16px 13px; border-radius: 22px; gap: 9px; }
.gcard.lg .gc-icon { font-size: 70px; }
.gcard.lg .gc-title { font-size: 20px; }
.gcard.lg .gc-top, .gcard.lg .gc-foot { font-size: 12px; }

/* rarity */
.gcard.r-rare { --edge: #9cc0e6; --gem: #4f8cc9; }
.gcard.r-rare:hover .gc-shine { animation: shine 1.6s var(--ease); }
.gcard.r-epic { --edge: #b9a2ea; --gem: #8a63d2; box-shadow: 0 1px 2px rgba(60, 45, 20, .1), 0 12px 30px -12px rgba(138, 99, 210, .55), inset 0 0 0 2px var(--edge); }
.gcard.r-epic .gc-shine { animation: shine 6s ease-in-out infinite; }
.gcard.r-legendary { --edge: #e8c15a; --gem: #c98f0c; box-shadow: 0 1px 2px rgba(60, 45, 20, .1), 0 14px 34px -10px rgba(212, 160, 24, .6), inset 0 0 0 2px var(--edge); }
.gcard.r-legendary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background: conic-gradient(from 0deg, #ff9a9e, #fad0c4, #fbc2eb, #a1c4fd, #c2e9fb, #d4fc79, #ff9a9e);
  animation: holo 8s linear infinite;
}
.gcard.r-legendary .gc-shine { animation: shine 3.2s ease-in-out infinite; }
.gcard.r-weekly { --edge: #e8c15a; --gem: #b37d06; background: radial-gradient(120% 70% at 50% 0%, #ffe7a6, transparent 70%), linear-gradient(170deg, #fff1c9, var(--surface) 80%); box-shadow: 0 14px 34px -10px rgba(212, 160, 24, .55), inset 0 0 0 2px var(--edge); }
.gcard.r-weekly .gc-art { background: radial-gradient(circle, #fff6d8, #f4d27a); }
.gcard.r-weekly .gc-shine { animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 0% { background-position: 120% 0; } 60%, 100% { background-position: -40% 0; } }
@keyframes holo { to { filter: hue-rotate(360deg); } }

/* card back */
.gcard.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .06) 1.5px, transparent 2px) 0 0 / 14px 14px,
    linear-gradient(160deg, #2f4a3f, #1e2622);
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(255, 255, 255, .12), inset 0 0 0 8px rgba(0, 0, 0, .12);
  display: grid; place-items: center;
}
.gc-back-art { display: grid; justify-items: center; gap: 10px; }
/* The NoRush ring on the back of a card. */
.gc-back-logo { width: 64px; height: 64px; border-radius: 99px; background: conic-gradient(#9cc4b0 0 70%, rgba(255, 255, 255, .16) 0); -webkit-mask: radial-gradient(circle, transparent 0 52%, #000 54%); mask: radial-gradient(circle, transparent 0 52%, #000 54%); }
.gc-back-word { font-family: var(--serif); font-size: 20px; font-weight: 600; color: #efe8dc; letter-spacing: .02em; }

/* ---------- overlays ---------- */
.rw-back {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--surface) 30%, transparent), var(--veil));
  -webkit-backdrop-filter: var(--veil-blur); backdrop-filter: var(--veil-blur);
  animation: fade var(--t-panel) var(--calm); cursor: pointer;
}
.rw-back.out { opacity: 0; transition: opacity var(--t-leave) var(--calm); }
.rw-box { display: grid; justify-items: center; gap: 16px; cursor: default; text-align: center; color: var(--ink); }
.rw-stage { position: relative; perspective: 1100px; animation: stageIn .5s var(--spring); }
@keyframes stageIn { from { transform: translateY(24px) scale(.85); opacity: 0; } }
.rw-glow { position: absolute; inset: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%); animation: glow 2.8s ease-in-out infinite; }
.r-rare .rw-glow { background: radial-gradient(circle, rgba(120, 170, 230, .5), transparent 65%); }
.r-epic .rw-glow { background: radial-gradient(circle, rgba(170, 130, 240, .55), transparent 65%); }
.r-legendary .rw-glow, .r-weekly .rw-glow { background: radial-gradient(circle, rgba(250, 205, 90, .65), transparent 65%); }
@keyframes glow { 50% { transform: scale(1.08); opacity: .8; } }
.flip { position: relative; width: 220px; height: 308px; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .85s cubic-bezier(.2, .8, .2, 1); }
.flip.flipped { transform: rotateY(0); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .face-back { transform: rotateY(180deg); }
.flip .gcard:hover { transform: none; }
.rw-title { margin: 4px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.rw-extra { font-family: var(--font); font-size: 15px; opacity: .7; font-weight: 500; }
.rw-progress { display: flex; align-items: center; gap: 12px; width: 320px; padding: 12px 14px; border-radius: 18px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow-lg); }
.rw-prog-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rw-prog-line { display: flex; justify-content: space-between; font-size: 13px; }
.rw-prog-line span { color: var(--ink-3); }
.rw-prog-sub { font-size: 13px; color: var(--ink-3); }
.rw-progress .progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rw-progress .progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 1.1s var(--ease); }
.rw-hint { margin: 0; font-size: 13px; opacity: .55; }

/* level up */
.lvl-stage { position: relative; width: 300px; height: 230px; display: grid; place-items: center; }
.lvl-stage .medal { position: relative; z-index: 2; animation: medalIn .9s var(--spring) both, medalFloat 4s ease-in-out 1s infinite; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
@keyframes medalIn { from { transform: scale(.2) rotate(-25deg); opacity: 0; } }
@keyframes medalFloat { 50% { transform: translateY(-6px); } }
.rays {
  position: absolute; width: 360px; height: 360px; border-radius: 50%; z-index: 0;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--r1) 55%, transparent) 0 8deg, transparent 8deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%);
  animation: spin 18s linear infinite, raysIn .8s var(--ease) both;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes raysIn { from { opacity: 0; scale: .4; } }
.sparks { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.sparks i { position: absolute; width: 8px; height: 8px; border-radius: 99px; background: #fff3c4; box-shadow: 0 0 12px #ffd76a; opacity: 0; animation: spark 1.3s var(--ease) forwards; animation-delay: calc(.35s + var(--d)); }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-150px) scale(.3); } }
.lvl-kicker { margin: 0; font-size: 13px; letter-spacing: .12em; opacity: .75; }
.lvl-name { margin: 0; font-family: var(--serif); font-size: 36px; font-weight: 600; letter-spacing: -.01em; }
.lvl-sub { margin: 0 0 8px; opacity: .8; max-width: 340px; }
.ms-medal { position: relative; z-index: 2; width: 150px; height: 150px; border-radius: 999px; display: grid; place-items: center; font-size: 72px;
  background: radial-gradient(circle at 35% 30%, #fff7d6, #f1cf72 60%, #d9a52a); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .6), 0 18px 30px rgba(0, 0, 0, .35);
  animation: medalIn .9s var(--spring) both, medalFloat 4s ease-in-out 1s infinite; }
.ms-body { max-width: 460px; font-size: 15.5px; line-height: 1.6; opacity: .92; }
.ms-offer { max-width: 440px; font-size: 13px; opacity: .7; }
.ms-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* achievement banner */
.ach-banner {
  position: fixed; left: 50%; z-index: 210; transform: translateX(-50%); display: flex; align-items: center; gap: 14px;
  padding: 12px 18px 12px 12px; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  min-width: 300px; max-width: calc(100vw - 24px); animation: bannerIn .5s var(--spring); transition: top .3s var(--ease);
}
.ach-banner.out { opacity: 0; transform: translate(-50%, -12px); transition: .35s var(--ease); }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -24px) scale(.95); } }
.ach-medal { width: 48px; height: 48px; border-radius: 99px; display: grid; place-items: center; font-size: 24px; background: radial-gradient(circle at 35% 30%, #fff7d6, #f1cf72 60%, #d9a52a); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6), 0 6px 14px -4px rgba(212, 160, 24, .6); flex: none; }
.ach-banner small { display: block; font-size: 12px; color: var(--warm); font-weight: 600; }
.ach-banner b { display: block; font-family: var(--serif); font-size: 17px; }
.ach-banner span { font-size: 13px; color: var(--ink-2); }

/* level chip (footer) */
.lvl-chip { flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; border: 0; background: var(--surface); box-shadow: var(--shadow); text-align: left; transition: transform .15s var(--ease); }
.lvl-chip:hover { transform: translateY(-1px); }
.lvl-chip b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.lvl-chip small { display: block; font-size: 13px; color: var(--ink-3); }
.lvl-chip-bar { display: block; height: 3px; margin-top: 4px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.lvl-chip-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.reduce-motion .rays, .reduce-motion .sparks, .reduce-motion .gcard::after, .reduce-motion .gc-shine { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .rays, .sparks, .gcard::after, .gc-shine { animation: none !important; } .flip { transition: none; } }

/* Calm + light on the CPU: small cards only shimmer while you hover them.
   The big card in the reveal keeps its full animation. */
.gcard:not(.lg):not(:hover) .gc-shine, .gcard:not(.lg):not(:hover)::after { animation: none; }
