:root {
  --tg-bg: #0f0f0f;
  --tg-surface: #212121;
  --tg-surface-2: #2b2b2b;
  --tg-inset: #181818;
  --tg-border: rgba(255, 255, 255, 0.07);
  --tg-accent: #8774e1;
  --tg-accent-hover: #7662d4;
  --rarity-mil_spec: #4b69ff;
  --rarity-restricted: #8847ff;
  --rarity-classified: #d32ce6;
  --rarity-covert: #eb4b4b;
  --rarity-rare_special: #ffd700;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, select, textarea {
  user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--tg-bg);
  color: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

body {
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.font-display {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.015em;
}

.font-cyber {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: tabular-nums;
}

/* Custom Scrollbar (Telegram Web Dark style) */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  scrollbar-width: none;
}

/* Telegram Web Surface Utilities */
.tg-card {
  background-color: var(--tg-surface);
  border: 1px solid var(--tg-border);
  border-radius: 22px;
}

.tg-pill-btn {
  background-color: var(--tg-surface-2);
  border: 1px solid var(--tg-border);
  border-radius: 999px;
  color: #ffffff;
  transition: background-color 0.16s ease, transform 0.14s ease;
}
.tg-pill-btn:active {
  transform: scale(0.96);
  background-color: #363636;
}

.tg-primary-btn {
  background-color: var(--tg-accent);
  color: #ffffff;
  border-radius: 16px;
  transition: background-color 0.16s ease, transform 0.14s ease, opacity 0.16s ease;
}
.tg-primary-btn:hover {
  background-color: var(--tg-accent-hover);
}
.tg-primary-btn:active {
  transform: scale(0.98);
}

/* Fast Open Compact Square Toggle (⚡) */
.fast-toggle-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background-color: var(--tg-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #7c7c84;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}
.fast-toggle-btn:active {
  transform: scale(0.94);
}
.fast-toggle-btn.active {
  background-color: #8B78E6;
  border-color: #a695f7;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(139, 120, 230, 0.62);
}

/* Toast Notifications (Dense Blur + Top Slide Animation) */
@keyframes toastSlideDown {
  0% {
    opacity: 0;
    transform: translate3d(0, -18px, 0) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.chicase-toast {
  background: rgba(24, 24, 28, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 11px 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.68);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideDown 0.26s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.chicase-toast-hide {
  opacity: 0 !important;
  transform: translate3d(0, -14px, 0) scale(0.96) !important;
}

/* Slide-Out Left Drawer (Telegram Web Style) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.left-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  width: 288px;
  max-width: 84vw;
  background-color: var(--tg-surface);
  border-right: 1px solid var(--tg-border);
  border-radius: 0 26px 26px 0;
  transform: translate3d(-104%, 0, 0);
  will-change: transform;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 18px 0 48px rgba(0, 0, 0, 0.65);
}
.left-drawer.open {
  transform: translate3d(0, 0, 0);
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  color: #e5e5e5;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.drawer-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.drawer-item:active {
  transform: scale(0.98);
}
.drawer-item.active {
  background-color: rgba(135, 116, 225, 0.2);
  color: #ffffff;
}

/* Case Category Badges Differentiation */
.case-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.case-badge-hot {
  background: rgba(255, 94, 58, 0.18);
  color: #ff7e5f;
  border: 1px solid rgba(255, 94, 58, 0.42);
}
.case-badge-new {
  background: rgba(50, 215, 75, 0.16);
  color: #4ce364;
  border: 1px solid rgba(50, 215, 75, 0.40);
}
.case-badge-limited {
  background: rgba(139, 120, 230, 0.22);
  color: #b9aaff;
  border: 1px solid rgba(139, 120, 230, 0.48);
}
.case-badge-classic {
  background: #2b2b2b;
  color: #bbbbbb;
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.case-badge-free {
  background: rgba(255, 215, 0, 0.16);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.42);
}
.capsule-badge-unique {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(139, 120, 230, 0.28));
  color: #ffe58f;
  border: 1px solid rgba(255, 215, 0, 0.55);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.18);
}
.case-card-unique {
  border-color: rgba(255, 215, 0, 0.36) !important;
  box-shadow: inset 0 0 22px rgba(139, 120, 230, 0.12);
}

/* Compact Wear & StatTrak™ Badges */
.wear-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.5px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.wear-badge-FN {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.36);
}
.wear-badge-MW {
  background: rgba(132, 204, 22, 0.18);
  color: #a3e635;
  border: 1px solid rgba(132, 204, 22, 0.36);
}
.wear-badge-FT {
  background: rgba(234, 179, 8, 0.18);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.36);
}
.wear-badge-WW {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.36);
}
.wear-badge-BS {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.36);
}

.st-badge {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(207, 106, 50, 0.22);
  color: #ff945e;
  border: 1px solid #CF6A32;
  line-height: 1.25;
}

/* Rarity Helpers & Radial Glow */
.rarity-card-consumer { --rc: #b0c3d9; }
.rarity-card-industrial { --rc: #5e98d9; }
.rarity-card-mil_spec { --rc: #4b69ff; }
.rarity-card-restricted { --rc: #8847ff; }
.rarity-card-classified { --rc: #d32ce6; }
.rarity-card-covert { --rc: #eb4b4b; }
.rarity-card-contraband { --rc: #e4ae39; }
.rarity-card-rare_special { --rc: #ffd700; }

.skin-card {
  position: relative;
  background-color: var(--tg-surface);
  border: 1px solid var(--tg-border);
  border-bottom: 3px solid var(--rc, #4b69ff);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.16s ease, border-color 0.16s ease, opacity 0.18s ease;
}
.skin-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--rc, #4b69ff) 34%, transparent), transparent 72%);
  pointer-events: none;
}
.skin-card:active {
  transform: scale(0.97);
}

/* Case Card */
.case-card {
  position: relative;
  background-color: var(--tg-surface);
  border: 1px solid var(--tg-border);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.18s ease, border-color 0.18s ease;
}
.case-card:hover {
  background-color: #252525;
  border-color: rgba(255, 255, 255, 0.14);
}
.case-card:active {
  transform: scale(0.97);
}

/* Live Drop Ticker (Compact & Interactive) */
.live-drops-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1px 0;
}
.live-drops-strip::-webkit-scrollbar {
  display: none;
}

.live-drop-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.live-drop-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--rc, #4b69ff) 28%, transparent), transparent 76%);
  pointer-events: none;
}
.live-drop-card:active {
  transform: scale(0.95);
}

/* Roulette Roll Strip (Hardware-Accelerated 60/120 FPS) */
.roulette-viewport {
  position: relative;
  width: 100%;
  height: 158px;
  background-color: #151518;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 22px;
  overflow: hidden;
  contain: layout paint;
  transform: translateZ(0);
  backface-visibility: hidden;
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.78);
}
.roulette-viewport.compact {
  height: 112px;
  border-radius: 18px;
}

.roulette-viewport::before,
.roulette-viewport::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 15;
  pointer-events: none;
}
.roulette-viewport::before {
  left: 0;
  background: linear-gradient(90deg, #151518 12%, transparent 100%);
}
.roulette-viewport::after {
  right: 0;
  background: linear-gradient(270deg, #151518 12%, transparent 100%);
}

.roulette-center-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2.5px;
  transform: translateX(-50%);
  background: #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.96), 0 0 5px rgba(139, 120, 230, 0.85);
  z-index: 20;
  pointer-events: none;
}

.roulette-marker-top,
.roulette-marker-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 21;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}
.roulette-marker-top {
  top: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #ffffff;
}
.roulette-marker-bottom {
  bottom: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 9px solid #ffffff;
}

.roll-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: max-content;
  align-items: center;
  height: 100%;
  gap: 8px;
  padding: 0 12px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.roll-card {
  flex: 0 0 126px;
  width: 126px;
  height: 132px;
  background-color: #1e1e22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 4px solid var(--rc, #4b69ff);
  border-radius: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 9px;
  overflow: hidden;
  contain: layout style paint;
  backface-visibility: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.26s ease, border-color 0.26s ease;
}
.roll-card.roll-card-winner {
  transform: scale3d(1.045, 1.045, 1);
  z-index: 5;
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 22px rgba(135, 116, 225, 0.55), inset 0 0 14px rgba(255, 255, 255, 0.12);
}
.roulette-viewport.compact .roll-card {
  flex: 0 0 104px;
  width: 104px;
  height: 94px;
  padding: 6px 7px;
  border-radius: 14px;
}

.roll-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--rc, #4b69ff) 42%, transparent), transparent 73%);
  pointer-events: none;
}

/* Golden ★ Особый предмет Mystery Card in Roulette */
.roll-card-mystery {
  background: linear-gradient(160deg, #33280a 0%, #1d180a 60%, #2d2208 100%);
  border: 1px solid rgba(255, 215, 0, 0.48);
  border-bottom: 4px solid #ffd700;
  box-shadow: inset 0 0 22px rgba(255, 215, 0, 0.22);
}
.roll-card-mystery::before {
  background: radial-gradient(circle at 50% 45%, rgba(255, 215, 0, 0.52), transparent 72%);
}

/* Special Item Golden Flash & Particle Burst */
@keyframes goldFlashAnim {
  0% { opacity: 0; }
  18% { opacity: 1; }
  65% { opacity: 0.85; }
  100% { opacity: 0; }
}

@keyframes goldParticleBurst {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(0.4) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--tx), var(--ty), 0) scale(1.15) rotate(var(--rot));
  }
}

.special-reveal-flash {
  animation: goldFlashAnim 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.gold-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(135deg, #fff6b7, #ffd700, #f59e0b);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.9);
  pointer-events: none;
  animation: goldParticleBurst 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bottom Sheet Modals (Inspect & Player Mini-Profile) */
@keyframes sheetSlideUp {
  0% {
    transform: translate3d(0, 100%, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.bottom-sheet-panel {
  border-radius: 28px 28px 0 0;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  animation: sheetSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform;
}

/* Drop Reveal Modal & Light Rays */
@keyframes spinRays {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes float3d {
  0%, 100% {
    transform: perspective(800px) rotateY(-8deg) rotateX(4deg) translateY(0px);
  }
  50% {
    transform: perspective(800px) rotateY(8deg) rotateX(-4deg) translateY(-10px);
  }
}

@keyframes popReveal {
  0% { opacity: 0; transform: scale(0.84); }
  70% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

.reveal-rays {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 540px;
  height: 540px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 20deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 20deg 40deg,
    transparent 40deg 60deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 60deg 80deg,
    transparent 80deg 100deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 100deg 120deg,
    transparent 120deg 140deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 140deg 160deg,
    transparent 160deg 180deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 180deg 200deg,
    transparent 200deg 220deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 220deg 240deg,
    transparent 240deg 260deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 260deg 280deg,
    transparent 280deg 300deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 300deg 320deg,
    transparent 320deg 340deg,
    var(--ray-color, rgba(135, 116, 225, 0.22)) 340deg 360deg
  );
  mask-image: radial-gradient(circle, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 68%);
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 68%);
  animation: spinRays 20s linear infinite;
  pointer-events: none;
}

.floating-weapon-3d {
  animation: float3d 4.2s ease-in-out infinite;
  transform-style: preserve-3d;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.75));
}

.pop-in {
  animation: popReveal 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Float Wear Bar with Boundary Ticks (0.07, 0.15, 0.38, 0.45) */
.wear-spectrum {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #10b981 0% 7%,
    #84cc16 7% 15%,
    #eab308 15% 38%,
    #f97316 38% 45%,
    #ef4444 45% 100%
  );
  position: relative;
}

.wear-tick {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1.5px;
  background: rgba(15, 15, 18, 0.88);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.48);
  pointer-events: none;
}

.wear-pin {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 0 9px #ffffff;
  transform: translateX(-50%);
  z-index: 3;
}

/* Overpay Exclusivity Badges (LOW FLOAT / BLUE GEM / MAX FADE) */
.special-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1.5px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.25;
  white-space: nowrap;
}
.special-tag-low_float {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.26), rgba(245, 158, 11, 0.22));
  color: #ffe066;
  border: 1px solid rgba(255, 215, 0, 0.62);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.24);
}
.special-tag-blue_gem {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(59, 130, 246, 0.25));
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}
.special-tag-max_fade {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(245, 158, 11, 0.25));
  color: #fda4af;
  border: 1px solid rgba(251, 113, 133, 0.62);
}

/* Quick 1-Tap Card Lock Button in Inventory */
.card-lock-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 24, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #888890;
  transition: transform 0.12s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.card-lock-btn:active {
  transform: scale(0.9);
}
.card-lock-btn.locked {
  background: rgba(135, 116, 225, 0.28);
  border-color: rgba(166, 149, 247, 0.65);
  color: #cabfff;
}

/* Inspect Sheet Premium Rarity Radial Glow */
.inspect-stage-box {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(
    circle at 50% 52%,
    color-mix(in srgb, var(--insp-glow, #8774e1) 46%, transparent) 0%,
    color-mix(in srgb, var(--insp-glow, #8774e1) 16%, transparent) 44%,
    transparent 76%
  );
}

/* Upgrader Wheel (Hardware-Accelerated Pointer & Arc) */
#upgrader-arc {
  transition: stroke-dasharray 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.upgrader-pointer {
  will-change: transform;
  transition: transform 4.4s cubic-bezier(0.12, 0.82, 0.18, 1);
  transform-origin: 120px 120px;
  transform-box: view-box;
  backface-visibility: hidden;
}

/* Single-Case Rare Drop Opening Animation */
@keyframes rareCaseChargeShake {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  20% { transform: translate3d(-3px, 2px, 0) scale(1.03); }
  40% { transform: translate3d(3px, -2px, 0) scale(1.06); }
  60% { transform: translate3d(-4px, -1px, 0) scale(1.09); }
  80% { transform: translate3d(4px, 2px, 0) scale(1.11); }
}

@keyframes rareSealBeam {
  0% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  35% { opacity: 0.95; transform: scale(1.08) rotate(35deg); }
  100% { opacity: 0; transform: scale(1.65) rotate(90deg); }
}

@keyframes rareWeaponHeroReveal {
  0% { opacity: 0; transform: scale(0.55) translateY(18px); filter: brightness(2.2) blur(4px); }
  60% { opacity: 1; transform: scale(1.06) translateY(-4px); filter: brightness(1.18) blur(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: brightness(1) blur(0); }
}

@keyframes rareShardBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.25) rotate(var(--rot, 180deg)); }
}

#rare-case-anim-overlay {
  --rare-color: #ffd700;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--rare-color) 28%, #070709) 0%, rgba(7, 7, 10, 0.96) 72%);
  backdrop-filter: blur(10px);
}

#rare-case-anim-overlay.charging #rare-anim-case-box {
  animation: rareCaseChargeShake 0.45s ease-in-out infinite;
  filter: drop-shadow(0 0 28px color-mix(in srgb, var(--rare-color) 70%, transparent));
}

#rare-case-anim-overlay.bursting #rare-anim-beam {
  animation: rareSealBeam 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#rare-case-anim-overlay.bursting #rare-anim-hero {
  animation: rareWeaponHeroReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.rare-shard-particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--rare-color, #ffd700);
  box-shadow: 0 0 12px var(--rare-color, #ffd700);
  pointer-events: none;
  animation: rareShardBurst 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Single Toast Pulse on Replace */
@keyframes toastReplacePulse {
  0% { transform: translateY(-6px) scale(0.95); opacity: 0.35; }
  65% { transform: translateY(0) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.chicase-toast-pop {
  animation: toastReplacePulse 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Case Mastery 100% Golden Card Frame */
.case-card-mastered {
  border-color: rgba(255, 215, 0, 0.62) !important;
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.16), inset 0 0 16px rgba(255, 215, 0, 0.08);
}

/* Prestige Live-Feed Card Effects */
@keyframes cyberPlasmaBorder {
  0%, 100% { box-shadow: 0 0 14px rgba(56, 189, 248, 0.38), inset 0 0 10px rgba(135, 116, 225, 0.18); border-color: rgba(56, 189, 248, 0.78); }
  50% { box-shadow: 0 0 16px rgba(167, 139, 250, 0.45), inset 0 0 12px rgba(56, 189, 248, 0.22); border-color: rgba(167, 139, 250, 0.85); }
}
.live-effect-gold {
  border-color: rgba(255, 215, 0, 0.75) !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.25), inset 0 0 10px rgba(255, 215, 0, 0.10);
}
.live-effect-neon {
  border-color: rgba(167, 139, 250, 0.78) !important;
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.32), inset 0 0 10px rgba(135, 116, 225, 0.16);
}
.live-effect-cyber {
  animation: cyberPlasmaBorder 2.4s ease-in-out infinite;
}

/* Prestige Titles & Applied Sticker Badges */
.prestige-title-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}
.sticker-mini-dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: rgba(18, 18, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1px;
  object-fit: contain;
}
.sticker-slot-box {
  border-radius: 14px;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.09);
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.crash-stage-card {
  background: radial-gradient(circle at 50% 35%, rgba(135, 116, 225, 0.20) 0%, #16161b 70%);
}

/* Side Drawer Grouping */
.drawer-section-label {
  padding: 6px 12px 2px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
}

/* Minigames Hub Cards */
.minigame-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.minigame-card:active {
  transform: scale(0.98);
}
.minigame-card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* On-Weapon 3D Sticker Overlays (Inspect & Market Detail Stage) */
.weapon-stage-rig {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.14s ease-out;
}
.onweapon-stickers-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.onweapon-sticker {
  position: absolute;
  width: 46px;
  height: 46px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.72));
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s ease;
}
.onweapon-sticker.slot-0 { left: 26%; top: 53%; transform: translate(-50%, -50%) rotate(-7deg); }
.onweapon-sticker.slot-1 { left: 42%; top: 47%; transform: translate(-50%, -50%) rotate(4deg); }
.onweapon-sticker.slot-2 { left: 57%; top: 46%; transform: translate(-50%, -50%) rotate(-4deg); }
.onweapon-sticker.slot-3 { left: 73%; top: 49%; transform: translate(-50%, -50%) rotate(8deg); }

/* Compact Card Weapon + Sticker Overlay */
.card-weapon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.card-onweapon-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}
.card-onweapon-sticker {
  position: absolute;
  width: 20px;
  height: 20px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}
.card-onweapon-sticker.slot-0 { left: 27%; top: 56%; }
.card-onweapon-sticker.slot-1 { left: 43%; top: 49%; }
.card-onweapon-sticker.slot-2 { left: 58%; top: 48%; }
.card-onweapon-sticker.slot-3 { left: 73%; top: 52%; }

/* Authentic Sticker Finish Glows */
@keyframes holoShimmer {
  0%, 100% { filter: drop-shadow(0 3px 8px rgba(211, 44, 230, 0.65)) hue-rotate(0deg); }
  50% { filter: drop-shadow(0 4px 12px rgba(94, 152, 217, 0.85)) hue-rotate(28deg); }
}
.sticker-fx-Holo {
  animation: holoShimmer 3.2s ease-in-out infinite;
}
.sticker-fx-Foil {
  filter: drop-shadow(0 3px 9px rgba(235, 75, 75, 0.65)) contrast(1.08);
}
.sticker-fx-Gold {
  filter: drop-shadow(0 3px 10px rgba(255, 215, 0, 0.78)) saturate(1.2);
}
.sticker-fx-Lenticular {
  animation: holoShimmer 2.1s linear infinite;
}
.sticker-fx-Glitter {
  filter: drop-shadow(0 2px 8px rgba(136, 71, 255, 0.65));
}

/* Timer Reactor Stage Animations */
@keyframes timerRadarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes timerCorePulse {
  0%, 100% { transform: scale(1); opacity: 0.72; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes timerBustShock {
  0% { box-shadow: inset 0 0 0 rgba(244, 63, 94, 0); }
  30% { box-shadow: inset 0 0 70px rgba(244, 63, 94, 0.55); }
  100% { box-shadow: inset 0 0 0 rgba(244, 63, 94, 0); }
}
.timer-radar-ring {
  transform-origin: 104px 104px;
}
.timer-radar-active {
  animation: timerRadarSpin 3.6s linear infinite;
}
.timer-core-running {
  animation: timerCorePulse 0.9s ease-in-out infinite;
}
.timer-bust-flash {
  animation: timerBustShock 0.75s ease-out;
}
.crash-heat-bar {
  width: 100%;
  height: 100%;
  background-color: #8774e1;
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  transition: background-color 0.25s ease;
}
.crash-heat-bar.snap-smooth {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
}

/* Smooth Screen, Modal, Live-Feed & Battle Transitions */
@keyframes viewEnterSmooth {
  0% { opacity: 0; transform: translate3d(0, 8px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
.view-enter {
  animation: viewEnterSmooth 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalBackdropIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
#drop-modal:not(.hidden),
#multi-drop-modal:not(.hidden),
#sticker-drop-modal:not(.hidden),
#inspect-modal:not(.hidden),
#market-item-modal:not(.hidden),
#player-mini-modal:not(.hidden),
#admin-user-modal:not(.hidden) {
  animation: modalBackdropIn 0.18s ease-out;
}

.modal-closing {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.18s ease-in !important;
}
.modal-closing .pop-in {
  animation: none !important;
  transform: scale3d(0.93, 0.93, 1) translate3d(0, 8px, 0) !important;
  opacity: 0 !important;
  transition: transform 0.17s cubic-bezier(0.4, 0, 1, 1), opacity 0.16s ease-in !important;
}
.modal-closing .bottom-sheet-panel {
  animation: none !important;
  transform: translate3d(0, 100%, 0) !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1) !important;
}

@keyframes liveDropSlideIn {
  0% { opacity: 0; transform: translate3d(-14px, 0, 0) scale(0.95); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.live-drop-enter {
  animation: liveDropSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes battleRoundReveal {
  0% { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.98); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
.battle-round-enter {
  animation: battleRoundReveal 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes balanceBumpPulse {
  0% { transform: scale3d(1, 1, 1); }
  45% { transform: scale3d(1.06, 1.06, 1); border-color: rgba(135, 116, 225, 0.65); }
  100% { transform: scale3d(1, 1, 1); }
}
.balance-bump {
  animation: balanceBumpPulse 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
