/* ─── LOOTBOX SYSTEM ──────────────────────────────────────────────────────────── */

/* Re-roll cash splash: big "-$N" that pops in, hovers, fades out. */
.lootbox-cash-splash {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 140px;
  font-weight: 900;
  color: #ff3040;
  text-shadow: 0 4px 18px rgba(0,0,0,0.75), 0 0 24px rgba(255,48,64,0.55);
  font-family: inherit;
  pointer-events: none;
  z-index: 9999999;
  animation: lootboxCashSplash 1.2s ease-out forwards;
  letter-spacing: 0.02em;
}
@keyframes lootboxCashSplash {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  40%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(0.95); }
}

/* ── Main modal ─────────────────────────────────────────────────────────────── */
.lootbox-modal {
  background: linear-gradient(155deg, rgba(20,8,32,0.8) 0%, rgba(34,15,53,0.8) 45%, rgba(20,8,32,0.8) 100%);
  border: 2px solid #7a3090;
  border-radius: 18px;
  padding: 34px 34px 24px;
  width: 624px;
  max-width: 96vw;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  color: #f0d0ff;
  box-shadow: 0 10px 50px rgba(140,50,200,0.35), inset 0 0 40px rgba(100,30,160,0.1);
  scrollbar-width: thin;
  scrollbar-color: #6a3080 #1a0830;
}

.lootbox-close-x {
  position: absolute;
  top: 17px;
  right: 22px;
  background:#3a0808;
  border:1px solid #7a1010;
  border-radius:6px;
  color:#ff6060;
  font-size:17px;
  font-weight:700;
  padding:3.6px 11px;
  line-height:1;
  transition:background 0.12s,border-color 0.12s;
}
.lootbox-close-x:hover{background:#5a0c0c;border-color:#cc2020;}

/* ── Header ──────────────────────────────────────────────────────────────────── */
.lootbox-header {
  text-align: center;
  margin-bottom: 31px;
}

.lootbox-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.lootbox-title {
  font-size: 36px;
  font-weight: bold;
  background: linear-gradient(90deg, #ffd700, #ffaa00, #ffd700);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: lootbox-title-shine 3s linear infinite;
  letter-spacing: 3.6px;
  text-shadow: none;
}

/* ── Inline Help (?) Button ─────────────────────────────────────────────────── */
.lootbox-help-btn {
  width: 29px;
  height: 29px;
  padding: 0;
  border-radius: 50%;
  background: #1a0a24;
  border: 1px solid #5a3080;
  color: #c0a0e0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
  vertical-align: middle;
}
.lootbox-help-btn:hover {
  background: #2a1040;
  border-color: #8060c0;
  color: #e0c0ff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(128, 96, 192, 0.4);
}

/* ── Lootbox Guide Modal ───────────────────────────────────────────────────── */
.lootbox-help-modal {
  max-width: 600px;
  width: 94vw;
  max-height: 86vh;
  overflow-y: auto;
  text-align: left;
}
/* Guide text sized 20% larger than the base modal/help styles. */
.lootbox-help-modal .modal-title { font-size: 20.4px; }
.lootbox-help-modal .modal-close { font-size: 14.4px; }

.lootbox-help-intro {
  font-size: 14.4px;
  color: #a090c0;
  text-align: center;
  margin: 6px 0 14px;
  padding: 8px 12px;
  background: #100818;
  border: 1px solid #2a1040;
  border-radius: 6px;
  line-height: 1.5;
}
.lootbox-help-category {
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #160a1e;
  border-radius: 6px;
  border-left: 3px solid #3a1a50;
}
.lootbox-help-cat-title {
  font-size: 15.6px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lootbox-help-desc {
  font-size: 13.2px;
  color: #c0a0d8;
  line-height: 1.5;
}

@keyframes lootbox-title-shine {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.lootbox-subtitle {
  font-size: 14px;
  color: #c090d8;
  margin-top: 6px;
}

/* ── Box option cards ─────────────────────────────────────────────────────────── */
.lootbox-boxes-area {
  display: flex;
  gap: 19px;
  justify-content: center;
  margin-bottom: 29px;
}

.lootbox-box-option {
  background: linear-gradient(145deg, #200d38, #2e1248);
  border: 2px solid #6a3580;
  border-radius: 14px;
  padding: 24px 22px 19px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  flex: 1;
  max-width: 240px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.lootbox-box-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(180,100,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.lootbox-box-option:hover {
  border-color: #bb77ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(160,80,255,0.35);
}

.lootbox-box-option:active {
  transform: translateY(-1px);
}

.lootbox-box-multi {
  border-color: #c8a000;
  background: linear-gradient(145deg, #1e1400, #2e1f00);
}

.lootbox-box-multi::before {
  background: linear-gradient(135deg, rgba(255,200,50,0.08) 0%, transparent 60%);
}

.lootbox-box-multi:hover {
  border-color: #ffdd44;
  box-shadow: 0 6px 24px rgba(255,210,0,0.4);
}

.lootbox-box-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #cc9900, #ffcc00);
  color: #1a0e00;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.96px;
  padding: 5px 12px;
  border-radius: 0 14px 0 10px;
}

.lootbox-box-icon {
  font-size: 53px;
  margin-bottom: 10px;
  display: block;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.5));
  animation: lootbox-icon-float 3s ease-in-out infinite;
}

.lootbox-box-multi .lootbox-box-icon {
  animation-delay: -1.5s;
}

@keyframes lootbox-icon-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

.lootbox-box-name {
  font-size: 17px;
  font-weight: bold;
  color: #e8c0ff;
  margin-bottom: 7px;
}

.lootbox-box-multi .lootbox-box-name {
  color: #ffe080;
}

.lootbox-box-price {
  font-size: 24px;
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 14px;
}

.lootbox-box-multi .lootbox-box-price {
  color: #ffcc00;
}

.lootbox-old-price {
  font-size: 16px;
  color: #806060;
  text-decoration: line-through;
  margin-right: 5px;
}

.lootbox-free-tag {
  color: #5aff7a;
  text-shadow: 0 0 8px rgba(90,255,122,0.7), 0 0 14px rgba(90,255,122,0.35);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.lootbox-free-banner {
  margin: 18px auto 0;
  display: block;
  width: fit-content;
  padding: 5px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a3a1a, #0d1f0d);
  border: 1px solid #5aff7a;
  color: #aaffbb;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(90,255,122,0.35), inset 0 0 6px rgba(90,255,122,0.2);
}

.lootbox-box-free {
  box-shadow: 0 0 18px 2px rgba(90,255,122,0.45), inset 0 0 12px rgba(90,255,122,0.25);
  border-color: #5aff7a !important;
}

.lootbox-box-cta {
  background: linear-gradient(135deg, #7733bb, #aa44dd);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1.8px;
  padding: 8px 22px;
  border-radius: 20px;
  transition: background 0.15s;
  display: inline-block;
}

.lootbox-box-option:hover .lootbox-box-cta {
  background: linear-gradient(135deg, #9944dd, #cc55ff);
}

.lootbox-box-multi .lootbox-box-cta {
  background: linear-gradient(135deg, #bb8800, #ddaa00);
}

.lootbox-box-multi:hover .lootbox-box-cta {
  background: linear-gradient(135deg, #ddaa00, #ffcc00);
}

/* ── Drop rates ──────────────────────────────────────────────────────────────── */
.lootbox-rates-section {
  background: rgba(0,0,0,0.35);
  border: 1px solid #3a1560;
  border-radius: 12px;
  padding: 17px 22px 14px;
  margin-bottom: 19px;
}

.lootbox-rates-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  color: #806090;
  margin-bottom: 12px;
}

.lootbox-rates-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lootbox-rate-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lootbox-rate-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lootbox-rate-label {
  font-size: 14px;
  font-weight: bold;
  flex: 1;
}

.lootbox-rate-pct {
  font-size: 14px;
  color: #706080;
}

.lootbox-disclaimer {
  font-size: 12px;
  color: #453555;
  text-align: center;
}

/* ── Box waiting / reveal screen ─────────────────────────────────────────────── */
.lootbox-reveal-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 44px 32px 36px;
  background: radial-gradient(ellipse at center, #1e0a30 0%, #0e0518 70%);
  border-radius: 18px;
  border: 2px solid #5a1a80;
  width: 860px;
  max-width: 96vw;
  min-height: 700px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(120,40,200,0.3);
}

/* Starfield shimmer */
.lootbox-reveal-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 70%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.3) 0%, transparent 100%);
  pointer-events: none;
  animation: lootbox-stars-twinkle 4s ease-in-out infinite alternate;
}

@keyframes lootbox-stars-twinkle {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}

.lootbox-reveal-msg {
  font-size: 15px;
  color: #c8a0e8;
  margin-bottom: 32px;
  text-align: center;
  transition: opacity 0.3s;
  position: relative;
  z-index: 2;
}

/* ── Scene wrapper (main box + background boxes) ─────────────────────────────── */
.lb-scene {
  display: flex;
  align-items: flex-end;
  position: relative;
  z-index: 2;
  margin: 20px 0;
}

/* Two smaller static square boxes behind the main box */
.lb-bg-box {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(0,0,0,0.04) 20px),
    linear-gradient(150deg, #e8b820 0%, #c49518 50%, #daa520 100%);
  border-radius: 4px;
  border: 2px solid #a07810;
  box-shadow:
    inset -8px 0 18px rgba(0,0,0,0.25),
    inset 4px 0 8px rgba(255,220,80,0.12),
    0 10px 28px rgba(0,0,0,0.5),
    0 0 16px rgba(255,200,50,0.2);
}

/* Horizontal tape band across the top seam of each bg box */
.lb-bg-box::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 30px;
  height: 20px;
  background: rgba(255, 230, 120, 0.45);
  border-top: 1px solid rgba(255, 215, 0, 0.35);
  border-bottom: 1px solid rgba(255, 215, 0, 0.35);
  opacity: 0.5;
}

/* Side depth shadow on each bg box */
.lb-bg-box::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 12px;
  background: linear-gradient(-90deg, rgba(0,0,0,0.2), transparent);
  border-radius: 0 4px 4px 0;
}

/* Overlap the main box over each bg box by ~28px */
.lb-bg-box:first-child { margin-right: -28px; }
.lb-bg-box:last-child  { margin-left:  -28px; }

/* Fade & shrink side boxes as player drags open */
.lb-scene .lb-bg-box {
  opacity: calc(1 - var(--lb-prog, 0) * 0.9);
  scale: calc(1 - var(--lb-prog, 0) * 0.15);
  transition: opacity 0.15s, scale 0.15s;
}

/* ── Loot box (drag-to-open) ─────────────────────────────────────────────────── */
.lootbox-box-wrap {
  cursor: default;
  position: relative;
  z-index: 2;
  animation: lootbox-drop-in 0.65s cubic-bezier(0.22, 1.6, 0.36, 1) forwards;
}

@keyframes lootbox-drop-in {
  0%   { transform: translateY(-240px) scale(0.4); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Tall golden box */
.lootbox-tall-box {
  width: 170px;
  height: 310px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 29px, rgba(0,0,0,0.04) 30px),
    linear-gradient(160deg, #f0c830 0%, #c8a018 35%, #e0b828 65%, #d4a820 100%);
  border-radius: 5px 5px 4px 4px;
  position: relative;
  box-shadow:
    inset -14px 0 28px rgba(0,0,0,0.22),
    inset 6px 0 14px rgba(255,230,100,0.12),
    0 14px 44px rgba(0,0,0,0.55),
    0 0 24px rgba(255,200,50,0.4);
  border: 2px solid #b08818;
  cursor: grab;
  user-select: none;
  animation: lb-box-pulse 2s ease-in-out infinite;
  overflow: hidden;
}

@keyframes lb-box-pulse {
  0%,100% { box-shadow: inset -14px 0 28px rgba(0,0,0,0.22), inset 6px 0 14px rgba(255,230,100,0.12), 0 14px 44px rgba(0,0,0,0.55), 0 0 24px rgba(255,200,50,0.4); }
  50%      { box-shadow: inset -14px 0 28px rgba(0,0,0,0.22), inset 6px 0 14px rgba(255,230,100,0.12), 0 14px 44px rgba(0,0,0,0.55), 0 0 50px rgba(255,210,50,0.7), 0 0 90px rgba(255,180,0,0.35); }
}

.lootbox-box-wrap.lb-dragging .lootbox-tall-box {
  cursor: grabbing;
  animation: lb-drag-shake calc(0.3s - var(--lb-prog, 0) * 0.22s) linear infinite !important;
  box-shadow:
    inset -14px 0 28px rgba(0,0,0,0.22),
    inset 6px 0 14px rgba(255,230,100,0.12),
    0 14px 44px rgba(0,0,0,0.55),
    0 0 calc(24px + var(--lb-prog, 0) * 60px) rgba(255,215,0, calc(0.4 + var(--lb-prog, 0) * 0.6)),
    0 0 calc(40px + var(--lb-prog, 0) * 100px) rgba(255,180,0, calc(0.1 + var(--lb-prog, 0) * 0.5));
  transform: scale(calc(1 + var(--lb-prog, 0) * 0.06));
}

@keyframes lb-drag-shake {
  0%   { translate: 0 0; }
  25%  { translate: calc(var(--lb-prog, 0) * 4px) calc(var(--lb-prog, 0) * -1px); }
  50%  { translate: calc(var(--lb-prog, 0) * -3px) calc(var(--lb-prog, 0) * 2px); }
  75%  { translate: calc(var(--lb-prog, 0) * 3px) calc(var(--lb-prog, 0) * 1px); }
  100% { translate: 0 0; }
}

/* Tape strip running full height of the box */
.lb-tape {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 26px;
  height: 100%;
  background: rgba(255, 230, 120, 0.5);
  border-left: 1px solid rgba(255, 215, 0, 0.35);
  border-right: 1px solid rgba(255, 215, 0, 0.35);
  z-index: 2;
  pointer-events: none;
}

/* Peeled portion grows downward from top as player drags */
.lb-tape-peel {
  position: absolute;
  top: 0;
  left: -1px;
  right: -1px;
  height: 0%;
  background: linear-gradient(0deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(245, 228, 160, 0.85) 12%,
    rgba(230, 212, 140, 0.7) 100%
  );
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(255, 240, 180, 0.45);
}

.lb-edge-left {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, rgba(0,0,0,0.18), transparent);
  pointer-events: none;
  z-index: 1;
}

.lb-edge-right {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 14px;
  background: linear-gradient(-90deg, rgba(0,0,0,0.18), transparent);
  pointer-events: none;
  z-index: 1;
}

.lootbox-box-wrap:hover .lootbox-tall-box {
  box-shadow:
    inset -14px 0 28px rgba(0,0,0,0.22),
    inset 6px 0 14px rgba(255,230,100,0.12),
    0 14px 44px rgba(0,0,0,0.55),
    0 0 50px rgba(255,215,0,1), 0 0 90px rgba(255,180,0,0.6);
  animation-play-state: paused;
}

/* Opening animation */
.lootbox-box-wrap.lootbox-opening .lootbox-tall-box {
  animation: lootbox-box-open 1.25s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  cursor: default;
}

@keyframes lootbox-box-open {
  0%   { transform: scale(1)    rotate(0deg);   opacity: 1; }
  15%  { transform: scale(0.9)  rotate(-8deg);  filter: drop-shadow(0 0 24px rgba(255,160,60,0.8)); }
  30%  { transform: scale(1.15) rotate(6deg);   filter: drop-shadow(0 0 50px rgba(255,240,100,1)); }
  50%  { transform: scale(1.0)  rotate(-4deg);  filter: drop-shadow(0 0 70px rgba(255,255,200,1)) drop-shadow(0 0 120px rgba(255,200,80,0.8)); }
  70%  { transform: scale(1.5)  rotate(2deg);   filter: drop-shadow(0 0 100px rgba(255,255,255,1)) drop-shadow(0 0 160px rgba(220,180,255,0.9)); opacity: 1; }
  90%  { transform: scale(2.4)  rotate(-1deg);  filter: drop-shadow(0 0 120px rgba(255,255,255,0.8)); opacity: 0.6; }
  100% { transform: scale(3.2)  rotate(0deg);   filter: drop-shadow(0 0 80px rgba(255,255,255,0.4)); opacity: 0; }
}

/* Light burst */
.lootbox-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,230,120,0.7) 25%, rgba(200,120,255,0.4) 55%, transparent 75%);
  animation: lootbox-burst-expand 0.8s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
  pointer-events: none;
  z-index: 10;
}

@keyframes lootbox-burst-expand {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  60%  { opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

.lootbox-click-hint {
  font-size: 18px;
  color: #b080d0;
  margin-top: 20px;
  position: relative;
  z-index: 2;
  animation: lootbox-hint-blink 1.6s ease-in-out infinite;
  transition: opacity 0.3s;
}

@keyframes lootbox-hint-blink {
  0%,100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

/* ── Results screen ──────────────────────────────────────────────────────────── */
.lootbox-results-wrap {
  background: radial-gradient(ellipse at top, #1a0a2a 0%, #0e0518 80%);
  border: 2px solid #7a3090;
  border-radius: 18px;
  padding: 24px 20px 20px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  color: #f0d0ff;
  box-shadow: 0 10px 50px rgba(140,50,200,0.35);
  scrollbar-width: thin;
  scrollbar-color: #6a3080 #1a0830;
  /* 10% larger results window — scales window, text, cards, emojis & buttons. */
  position: relative;
  transform: scale(1.1);
}

.lootbox-results-single {
  width: 460px;
}

.lootbox-results-multi {
  width: 820px;
}

.lootbox-results-title {
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  color: #ffd700;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
  letter-spacing: 1px;
}

/* ── Results grid ─────────────────────────────────────────────────────────────── */
.lootbox-results-single .lootbox-results-grid {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.lootbox-results-multi .lootbox-results-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

/* ── Result card ──────────────────────────────────────────────────────────────── */
.lootbox-result-card {
  background: linear-gradient(155deg, #180c28, #240e38);
  border: 2px solid var(--rc, #888);
  border-radius: 14px;
  padding: 12px 10px 10px;
  text-align: center;
  box-shadow: 0 0 14px var(--rg, rgba(136,136,136,0.3)), inset 0 0 10px rgba(0,0,0,0.4);
  animation: lootbox-card-appear 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both;
  position: relative;
  overflow: hidden;
}

.lootbox-result-card::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -30%;
  width: 60%;
  height: 80%;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

@keyframes lootbox-card-appear {
  0%   { opacity: 0; transform: scale(0.55) translateY(18px); }
  65%  { opacity: 1; transform: scale(1.06) translateY(-3px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Per-rarity glow animations */
.lootbox-rarity-legendary {
  background: linear-gradient(155deg, #1e0e04, #2c1a0a);
  animation: lootbox-card-appear 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both,
             lootbox-glow-legendary 2.2s ease-in-out infinite !important;
}

@keyframes lootbox-glow-legendary {
  0%,100% { box-shadow: 0 0 14px rgba(216,122,60,0.55), inset 0 0 10px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 35px rgba(232,150,80,0.9), 0 0 70px rgba(180,100,40,0.5), inset 0 0 10px rgba(0,0,0,0.4); }
}

.lootbox-rarity-transcendent {
  background: linear-gradient(155deg, #150820, #1f0e30);
  animation: lootbox-card-appear 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both,
             lootbox-glow-transcendent 1.8s linear infinite !important;
}

/* Transcendent card glow cycles through the same rainbow as the achievement
 * popup border (see css/panels.css → @keyframes achRainbow). */
@keyframes lootbox-glow-transcendent {
  0%,100% { box-shadow: 0 0 18px rgba(255,0,96,0.55),  0 0 40px rgba(255,0,96,0.3),  inset 0 0 10px rgba(0,0,0,0.4); }
  14%      { box-shadow: 0 0 18px rgba(255,102,0,0.55), 0 0 40px rgba(255,102,0,0.3), inset 0 0 10px rgba(0,0,0,0.4); }
  28%      { box-shadow: 0 0 18px rgba(255,224,0,0.55), 0 0 40px rgba(255,224,0,0.3), inset 0 0 10px rgba(0,0,0,0.4); }
  42%      { box-shadow: 0 0 18px rgba(0,221,0,0.55),   0 0 40px rgba(0,221,0,0.3),   inset 0 0 10px rgba(0,0,0,0.4); }
  57%      { box-shadow: 0 0 18px rgba(0,170,255,0.55), 0 0 40px rgba(0,170,255,0.3), inset 0 0 10px rgba(0,0,0,0.4); }
  71%      { box-shadow: 0 0 18px rgba(136,0,255,0.55), 0 0 40px rgba(136,0,255,0.3), inset 0 0 10px rgba(0,0,0,0.4); }
  85%      { box-shadow: 0 0 18px rgba(255,0,204,0.55), 0 0 40px rgba(255,0,204,0.3), inset 0 0 10px rgba(0,0,0,0.4); }
}

/* Rainbow-cycling dot — matches .rarity-text-transcendent cadence. */
.rarity-dot-transcendent {
  animation: rarityDotTranscendent 1.8s linear infinite;
}
@keyframes rarityDotTranscendent {
  0%,100% { background: #ff4080; box-shadow: 0 0 6px rgba(255,0,96,0.75); }
  14%      { background: #ff8040; box-shadow: 0 0 6px rgba(255,102,0,0.75); }
  28%      { background: #ffe060; box-shadow: 0 0 6px rgba(255,224,0,0.75); }
  42%      { background: #60e070; box-shadow: 0 0 6px rgba(0,221,0,0.75); }
  57%      { background: #40a0ff; box-shadow: 0 0 6px rgba(0,170,255,0.75); }
  71%      { background: #b060ff; box-shadow: 0 0 6px rgba(136,0,255,0.75); }
  85%      { background: #ff60d0; box-shadow: 0 0 6px rgba(255,0,204,0.75); }
}

/* Rainbow-cycling text — apply to any "Transcendent" label on screen. */
.rarity-text-transcendent {
  animation: rarityTextTranscendent 1.8s linear infinite;
  font-weight: 700;
}
@keyframes rarityTextTranscendent {
  0%,100% { color: #ff4080;  text-shadow: 0 0 6px rgba(255,0,96,0.55); }
  14%      { color: #ff8040;  text-shadow: 0 0 6px rgba(255,102,0,0.55); }
  28%      { color: #ffe060;  text-shadow: 0 0 6px rgba(255,224,0,0.55); }
  42%      { color: #60e070;  text-shadow: 0 0 6px rgba(0,221,0,0.55); }
  57%      { color: #40a0ff;  text-shadow: 0 0 6px rgba(0,170,255,0.55); }
  71%      { color: #b060ff;  text-shadow: 0 0 6px rgba(136,0,255,0.55); }
  85%      { color: #ff60d0;  text-shadow: 0 0 6px rgba(255,0,204,0.55); }
}

.lootbox-rarity-epic {
  animation: lootbox-card-appear 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both,
             lootbox-glow-epic 2.8s ease-in-out infinite !important;
}

@keyframes lootbox-glow-epic {
  0%,100% { box-shadow: 0 0 12px rgba(204,85,255,0.5), inset 0 0 10px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 28px rgba(204,85,255,0.85), 0 0 55px rgba(150,50,220,0.35), inset 0 0 10px rgba(0,0,0,0.4); }
}

.lootbox-rarity-rare {
  animation: lootbox-card-appear 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both,
             lootbox-glow-rare 3.4s ease-in-out infinite !important;
}

@keyframes lootbox-glow-rare {
  0%,100% { box-shadow: 0 0 10px rgba(74,158,255,0.45), inset 0 0 10px rgba(0,0,0,0.4); }
  50%      { box-shadow: 0 0 22px rgba(74,158,255,0.75), 0 0 45px rgba(50,120,220,0.3), inset 0 0 10px rgba(0,0,0,0.4); }
}

.lootbox-card-badge {
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

/* Skin preview */
.lootbox-card-skin-preview {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border-width: 2px;
  border-style: solid;
  margin: 0 auto 8px;
}

.lootbox-results-single .lootbox-card-skin-preview {
  width: 130px;
  height: 130px;
  border-radius: 18px;
  margin-bottom: 12px;
}

/* Sticker preview */
.lootbox-card-sticker-preview {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}

.lootbox-results-single .lootbox-card-sticker-preview {
  font-size: 82px;
  margin-bottom: 12px;
}

.lootbox-card-name {
  font-size: 11px;
  font-weight: bold;
  color: #f0e4ff;
  margin-bottom: 3px;
  line-height: 1.3;
}

.lootbox-results-single .lootbox-card-name {
  font-size: 18px;
  margin-bottom: 5px;
}

.lootbox-card-type {
  font-size: 10px;
  color: #7060a0;
  margin-bottom: 5px;
}

.lootbox-results-single .lootbox-card-type {
  font-size: 13px;
}

/* Notes */
.lootbox-card-note {
  font-size: 10px;
  border-radius: 6px;
  padding: 3px 6px;
  display: inline-block;
  margin-top: 3px;
}

.lootbox-dupe {
  background: rgba(150, 110, 40, 0.25);
  color: #c8a060;
  border: 1px solid rgba(150,110,40,0.35);
}

.lootbox-bucks {
  background: rgba(80, 140, 60, 0.25);
  color: #80c060;
  border: 1px solid rgba(80,140,60,0.35);
}

.lootbox-new {
  background: rgba(80, 160, 220, 0.2);
  color: #80c8ff;
  border: 1px solid rgba(80,160,220,0.3);
  font-weight: bold;
  letter-spacing: 1px;
}

.lootbox-place-sticker-btn {
  margin-top: 5px;
  background: linear-gradient(135deg, #2a6030, #3a8040);
  color: #a0f0a0;
  border: 1px solid rgba(80,180,80,0.4);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.lootbox-place-sticker-btn:hover {
  background: linear-gradient(135deg, #3a8040, #50aa50);
  color: #c0ffc0;
}

.lootbox-equip-btn {
  margin-top: 5px;
  background: linear-gradient(135deg, #2a4570, #3a60a0);
  color: #b0d8ff;
  border: 1px solid rgba(100,160,220,0.4);
  border-radius: 10px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.lootbox-equip-btn:hover {
  background: linear-gradient(135deg, #3a60a0, #5080c8);
  color: #e0f0ff;
}

.lootbox-equip-btn.lootbox-equipped,
.lootbox-equip-btn:disabled {
  background: linear-gradient(135deg, #2a5a35, #3a7840);
  color: #c0ffc0;
  border-color: rgba(100,200,100,0.5);
  cursor: default;
}

/* ── Results buttons ──────────────────────────────────────────────────────────── */
.lootbox-results-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
}

.lootbox-roll-again-btn {
  background: linear-gradient(135deg, #7733bb, #aa44dd);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 28px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
}

.lootbox-roll-again-btn:hover {
  background: linear-gradient(135deg, #9944dd, #cc55ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(180,80,255,0.45);
}

/* Grayed-out state when the player can't afford the re-roll. */
.lootbox-roll-again-btn:disabled {
  background: linear-gradient(135deg, #3a3340, #4a4350);
  color: #8a8090;
  cursor: not-allowed;
  opacity: 0.6;
}

.lootbox-roll-again-btn:disabled:hover {
  background: linear-gradient(135deg, #3a3340, #4a4350);
  transform: none;
  box-shadow: none;
}
