/* ==========================================================================
   Plush & Gems Drop - Modern Futuristic Cyberpunk-Luxury Stylesheet
   Deep Space Obsidian, Glassmorphism, Neon Cyan, Electric Violet, Imperial Gold
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Core Backgrounds & Surfaces */
  --bg-deep-space: #070913;
  --bg-space-dark: #0a0d1d;
  --bg-obsidian: #0d1224;
  --bg-surface-glass: rgba(17, 24, 46, 0.72);
  --bg-surface-card: rgba(21, 30, 58, 0.65);
  --bg-surface-hover: rgba(30, 41, 79, 0.85);
  --bg-modal-backdrop: rgba(4, 6, 14, 0.88);

  /* Neon Brand Accents */
  --neon-cyan: #00f2fe;
  --neon-cyan-glow: rgba(0, 242, 254, 0.45);
  --neon-violet: #a855f7;
  --neon-violet-glow: rgba(168, 85, 247, 0.45);
  --neon-magenta: #ec4899;
  --neon-magenta-glow: rgba(236, 72, 153, 0.45);
  --neon-emerald: #10b981;
  --neon-emerald-glow: rgba(16, 185, 129, 0.45);
  --neon-gold: #f59e0b;
  --neon-gold-light: #fbbf24;
  --neon-gold-glow: rgba(245, 158, 11, 0.45);
  --neon-crimson: #ef4444;
  --neon-crimson-glow: rgba(239, 68, 68, 0.5);

  /* Glassmorphism & Borders */
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glass-bright: rgba(255, 255, 255, 0.18);
  --border-cyan: rgba(0, 242, 254, 0.4);
  --border-violet: rgba(168, 85, 247, 0.4);
  --glass-blur: blur(16px);
  --glass-blur-heavy: blur(24px);

  /* Typography Colors */
  --text-white: #ffffff;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-cyan: #38bdf8;
  --text-gold: #fcd34d;
  --text-emerald: #34d399;

  /* Rarity Tier Colors */
  --rarity-common-color: #94a3b8;
  --rarity-common-glow: rgba(148, 163, 184, 0.35);
  --rarity-uncommon-color: #10b981;
  --rarity-uncommon-glow: rgba(16, 185, 129, 0.45);
  --rarity-rare-color: #00f2fe;
  --rarity-rare-glow: rgba(0, 242, 254, 0.45);
  --rarity-epic-color: #a855f7;
  --rarity-epic-glow: rgba(168, 85, 247, 0.5);
  --rarity-legendary-color: #f59e0b;
  --rarity-legendary-glow: rgba(245, 158, 11, 0.6);
  --rarity-exclusive-color: #ec4899;
  --rarity-exclusive-glow: rgba(236, 72, 153, 0.65);

  /* UI Measurements & Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Font Families */
  --font-main: 'Rajdhani', 'Orbitron', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Transitions & Easings */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & Global Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-deep-space);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(0, 242, 254, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #070913 0%, #0a0e20 50%, #070913 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Cyber Scanlines Overlay Effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* Custom Cyber Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep-space);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.35);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
  user-select: none;
}

input, textarea, select {
  font-family: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(7, 9, 19, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ec4899, #00f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px var(--neon-cyan-glow);
  position: relative;
  animation: logoPulse 4s ease-in-out infinite alternate;
}

@keyframes logoPulse {
  0% { box-shadow: 0 0 14px var(--neon-cyan-glow); }
  50% { box-shadow: 0 0 24px var(--neon-magenta-glow); }
  100% { box-shadow: 0 0 16px var(--neon-cyan-glow); }
}

.brand-icon-wrap svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff, #00f2fe, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--neon-gold-light);
  text-transform: uppercase;
  opacity: 0.9;
}

/* Navigation Tabs */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 18, 36, 0.6);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.nav-tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.nav-tab-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #070913;
  background: linear-gradient(135deg, var(--neon-cyan), #4facfe);
  box-shadow: 0 0 16px var(--neon-cyan-glow);
  font-weight: 800;
}

/* Header User Controls */
.header-user-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Inline Editable Nickname Badge */
.user-nickname-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-nickname-badge:hover {
  border-color: var(--neon-violet);
  box-shadow: 0 0 12px var(--neon-violet-glow);
}

.nickname-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
}

.nickname-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nickname-edit-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.user-nickname-badge:hover .nickname-edit-icon {
  color: var(--neon-violet);
}

/* Animated Green Dollar Balance Box */
.balance-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 14px var(--neon-emerald-glow);
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.balance-box:hover {
  transform: translateY(-2px);
  border-color: var(--neon-emerald);
  box-shadow: 0 0 22px var(--neon-emerald-glow);
}

.balance-icon {
  color: var(--neon-emerald);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 8px var(--neon-emerald);
}

.balance-value {
  font-family: 'Orbitron', var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #6ee7b7;
  letter-spacing: 0.5px;
}

.balance-box.pulse-gain {
  animation: balanceGain 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes balanceGain {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); box-shadow: 0 0 28px var(--neon-emerald); }
  100% { transform: scale(1); }
}

/* Quick Blueprint & Sound Buttons */
.btn-icon-pill {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.btn-icon-pill:hover {
  color: var(--text-white);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
  transform: translateY(-1px);
}

.btn-icon-pill.btn-blueprint {
  border-color: rgba(0, 242, 254, 0.35);
  color: var(--text-cyan);
}

.btn-icon-pill.btn-blueprint:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--neon-cyan);
}

.btn-icon-pill.btn-sound.is-muted {
  color: var(--text-muted);
  opacity: 0.65;
  border-color: var(--border-glass);
}

/* --------------------------------------------------------------------------
   4. Top Live Drop Ticker
   -------------------------------------------------------------------------- */
.live-ticker-wrap {
  width: 100%;
  background: rgba(10, 14, 29, 0.92);
  border-bottom: 1px solid var(--border-glass);
  overflow: hidden;
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
}

.live-ticker-wrap::before,
.live-ticker-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}
.live-ticker-wrap::before {
  left: 0;
  background: linear-gradient(90deg, #070913 20%, transparent 100%);
}
.live-ticker-wrap::after {
  right: 0;
  background: linear-gradient(-90deg, #070913 20%, transparent 100%);
}

.ticker-badge-live {
  flex-shrink: 0;
  padding: 4px 12px;
  margin-left: 16px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.ticker-badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: liveBlink 1.4s infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.live-ticker-track {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  animation: tickerScroll 45s linear infinite;
  padding-left: 12px;
}

.live-ticker-wrap:hover .live-ticker-track {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(21, 28, 54, 0.6);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  transition: var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.ticker-item:hover {
  background: rgba(30, 41, 79, 0.85);
  border-color: var(--neon-cyan);
  transform: translateY(-1px);
}

.ticker-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  overflow: hidden;
}

.ticker-item-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ticker-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ticker-item-price {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-emerald);
}

/* --------------------------------------------------------------------------
   5. Rarity Cards System & Holo Effects
   -------------------------------------------------------------------------- */
.item-card {
  position: relative;
  background: var(--bg-surface-card);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  transition: var(--transition-bounce);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.item-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-glass-bright);
}

/* Bottom Rarity Neon Border Bars */
.item-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: var(--rarity-common-color);
  box-shadow: 0 0 12px var(--rarity-common-glow);
  transition: var(--transition-fast);
}

/* Rarity Radial Background Glows & Accent Colors */
.rarity-common {
  --rarity-accent: var(--rarity-common-color);
  background: radial-gradient(circle at 50% 20%, rgba(148, 163, 184, 0.12) 0%, var(--bg-surface-card) 75%);
}
.rarity-common::after {
  background: var(--rarity-common-color);
  box-shadow: 0 0 10px var(--rarity-common-glow);
}
.rarity-common:hover {
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.2);
  border-color: var(--rarity-common-color);
}

.rarity-uncommon {
  --rarity-accent: var(--rarity-uncommon-color);
  background: radial-gradient(circle at 50% 20%, rgba(16, 185, 129, 0.16) 0%, var(--bg-surface-card) 75%);
}
.rarity-uncommon::after {
  background: var(--rarity-uncommon-color);
  box-shadow: 0 0 14px var(--rarity-uncommon-glow);
}
.rarity-uncommon:hover {
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.25);
  border-color: var(--rarity-uncommon-color);
}

.rarity-rare {
  --rarity-accent: var(--rarity-rare-color);
  background: radial-gradient(circle at 50% 20%, rgba(0, 242, 254, 0.18) 0%, var(--bg-surface-card) 75%);
}
.rarity-rare::after {
  background: var(--rarity-rare-color);
  box-shadow: 0 0 16px var(--rarity-rare-glow);
}
.rarity-rare:hover {
  box-shadow: 0 12px 32px rgba(0, 242, 254, 0.3);
  border-color: var(--rarity-rare-color);
}

.rarity-epic {
  --rarity-accent: var(--rarity-epic-color);
  background: radial-gradient(circle at 50% 20%, rgba(168, 85, 247, 0.22) 0%, var(--bg-surface-card) 75%);
}
.rarity-epic::after {
  background: var(--rarity-epic-color);
  box-shadow: 0 0 18px var(--rarity-epic-glow);
}
.rarity-epic:hover {
  box-shadow: 0 14px 36px rgba(168, 85, 247, 0.35);
  border-color: var(--rarity-epic-color);
}

.rarity-legendary {
  --rarity-accent: var(--rarity-legendary-color);
  background: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.25) 0%, var(--bg-surface-card) 75%);
}
.rarity-legendary::after {
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706);
  box-shadow: 0 0 22px var(--neon-gold-glow);
}
.rarity-legendary:hover {
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.4);
  border-color: var(--rarity-legendary-color);
}

.rarity-exclusive {
  --rarity-accent: var(--rarity-exclusive-color);
  background: radial-gradient(circle at 50% 20%, rgba(236, 72, 153, 0.3) 0%, var(--bg-surface-card) 75%);
}
.rarity-exclusive::after {
  background: linear-gradient(90deg, #ec4899, #a855f7, #00f2fe);
  box-shadow: 0 0 24px var(--rarity-exclusive-glow);
}
.rarity-exclusive:hover {
  box-shadow: 0 16px 44px rgba(236, 72, 153, 0.45);
  border-color: var(--rarity-exclusive-color);
}

/* Card SVG Container */
.item-art-wrap {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 12px;
  transition: var(--transition-bounce);
}

.item-card:hover .item-art-wrap {
  transform: scale(1.08);
}

.item-art-wrap svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.item-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 4px;
}

.item-rarity-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--rarity-accent, var(--text-secondary));
}

.item-price {
  font-family: 'Orbitron', var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--neon-emerald);
}

/* --------------------------------------------------------------------------
   Holographic Foil Effect (.is-holo)
   -------------------------------------------------------------------------- */
.item-card.is-holo {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25), 0 0 35px rgba(236, 72, 153, 0.2);
}

/* Animated Rainbow Prismatic Sheen Overlay */
.item-card.is-holo::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 0, 128, 0.2) 35%,
    rgba(0, 242, 254, 0.25) 45%,
    rgba(254, 225, 64, 0.25) 55%,
    rgba(168, 85, 247, 0.2) 65%,
    transparent 80%
  );
  background-size: 200% 200%;
  animation: holoSheen 4.5s ease infinite alternate;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: color-dodge;
}

@keyframes holoSheen {
  0% { transform: rotate(0deg) translate(-10%, -10%); }
  50% { transform: rotate(10deg) translate(5%, 5%); }
  100% { transform: rotate(0deg) translate(10%, 10%); }
}

/* Floating ✨ HOLO ×1.5 Badge */
.holo-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.85), rgba(0, 242, 254, 0.85));
  border: 1px solid #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6), 0 0 16px rgba(236, 72, 153, 0.5);
  animation: badgeSparkle 2s ease-in-out infinite alternate;
}

@keyframes badgeSparkle {
  0% { filter: brightness(1) drop-shadow(0 0 4px #00f2fe); }
  100% { filter: brightness(1.25) drop-shadow(0 0 10px #ec4899); }
}

/* --------------------------------------------------------------------------
   6. Main Content Layout & Tab Panels
   -------------------------------------------------------------------------- */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 160px);
}

.tab-pane {
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-pane.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   7. Cases Arena (#tab-cases)
   -------------------------------------------------------------------------- */
.cases-banner {
  text-align: center;
  margin-bottom: 32px;
}

.cases-banner-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff, #00f2fe, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.cases-banner-sub {
  color: var(--text-secondary);
  font-size: 15px;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 48px;
}

.case-card {
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: var(--transition-bounce);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.case-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-glass-bright);
}

.case-card.case-plush-theme {
  background: radial-gradient(circle at 50% 25%, rgba(0, 242, 254, 0.15) 0%, var(--bg-surface-glass) 80%);
}
.case-card.case-plush-theme:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 16px 44px rgba(0, 242, 254, 0.3);
}

.case-card.case-gem-theme {
  background: radial-gradient(circle at 50% 25%, rgba(16, 185, 129, 0.18) 0%, var(--bg-surface-glass) 80%);
}
.case-card.case-gem-theme:hover {
  border-color: var(--neon-emerald);
  box-shadow: 0 16px 44px rgba(16, 185, 129, 0.3);
}

.case-card.case-imperial-theme {
  background: radial-gradient(circle at 50% 25%, rgba(245, 158, 11, 0.2) 0%, var(--bg-surface-glass) 80%);
}
.case-card.case-imperial-theme:hover {
  border-color: var(--neon-gold);
  box-shadow: 0 16px 44px rgba(245, 158, 11, 0.35);
}

.case-art-box {
  width: 170px;
  height: 170px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: var(--transition-bounce);
}

.case-card:hover .case-art-box {
  transform: scale(1.08) translateY(-4px);
}

.case-art-box svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.6));
}

.case-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
  color: var(--text-white);
}

.case-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  min-height: 38px;
}

.case-price-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 22px;
}

.case-price-amount {
  font-family: 'Orbitron', var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--neon-emerald);
}

.btn-open-case {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #070913;
  background: linear-gradient(135deg, var(--neon-cyan), #00c6ff);
  box-shadow: 0 4px 20px var(--neon-cyan-glow);
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.case-gem-theme .btn-open-case {
  background: linear-gradient(135deg, var(--neon-emerald), #059669);
  box-shadow: 0 4px 20px var(--neon-emerald-glow);
  color: #ffffff;
}

.case-imperial-theme .btn-open-case {
  background: linear-gradient(135deg, var(--neon-gold-light), #d97706);
  box-shadow: 0 4px 20px var(--neon-gold-glow);
  color: #070913;
}

.btn-open-case:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

.btn-open-case:active {
  transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   8. Case Roulette Modal / Arena
   -------------------------------------------------------------------------- */
.roulette-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-modal-backdrop);
  backdrop-filter: var(--glass-blur-heavy);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.roulette-modal.active {
  display: flex;
}

.roulette-dialog {
  width: 100%;
  max-width: 960px;
  background: rgba(13, 18, 36, 0.95);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.roulette-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.roulette-case-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roulette-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 1px;
}

.btn-close-modal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

/* Horizontal Roulette Viewport */
.roulette-viewport {
  width: 100%;
  height: 180px;
  background: #05070e;
  border: 2px solid rgba(0, 242, 254, 0.35);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 40px 0 35px -10px #05070e,
    inset -40px 0 35px -10px #05070e,
    0 0 24px rgba(0, 242, 254, 0.15);
  margin-bottom: 28px;
}

/* Center Laser Pointer Line */
.roulette-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: var(--neon-cyan);
  box-shadow: 0 0 16px var(--neon-cyan), 0 0 32px var(--neon-cyan-glow);
  z-index: 10;
  pointer-events: none;
}

/* Laser Triangle Pointers (Top & Bottom) */
.roulette-pointer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid var(--neon-cyan);
  filter: drop-shadow(0 2px 6px var(--neon-cyan));
}

.roulette-pointer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 14px solid var(--neon-cyan);
  filter: drop-shadow(0 -2px 6px var(--neon-cyan));
}

/* Transforming Track of Cards */
.roulette-track {
  display: flex;
  align-items: center;
  height: 100%;
  will-change: transform;
  transform: translateX(0);
}

.roulette-card {
  flex-shrink: 0;
  width: 140px;
  height: 160px;
  margin: 0 6px;
  background: rgba(17, 24, 46, 0.85);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.roulette-card .item-art-wrap {
  width: 76px;
  height: 76px;
  margin-bottom: 6px;
}

.roulette-card .item-name {
  font-size: 12px;
  max-width: 120px;
}

.roulette-card .item-price {
  font-size: 12px;
}

/* Winner Reveal Card Overlay */
.winner-reveal {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 14, 0.94);
  border-radius: var(--radius-xl);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 32px;
  animation: revealFadeIn 0.4s ease forwards;
}

.winner-reveal.active {
  display: flex;
}

@keyframes revealFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Spinning Radiant Light Rays */
.winner-rays-bg {
  position: absolute;
  width: 500px;
  height: 500px;
  background: conic-gradient(
    from 0deg,
    rgba(0, 242, 254, 0.15),
    transparent 15deg,
    rgba(236, 72, 153, 0.15) 30deg,
    transparent 45deg,
    rgba(245, 158, 11, 0.15) 60deg,
    transparent 75deg,
    rgba(0, 242, 254, 0.15) 90deg
  );
  border-radius: 50%;
  animation: spinRays 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes spinRays {
  to { transform: rotate(360deg); }
}

.winner-card-center {
  position: relative;
  z-index: 10;
  width: 200px;
  padding: 24px 20px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 0 50px rgba(0, 242, 254, 0.5);
  margin-bottom: 24px;
}

.winner-card-center .item-art-wrap {
  width: 130px;
  height: 130px;
}

.winner-actions {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 14px;
}

.btn-winner-action {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: var(--transition-bounce);
}

.btn-winner-action.btn-sell {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--neon-emerald);
  color: #34d399;
}
.btn-winner-action.btn-sell:hover {
  background: var(--neon-emerald);
  color: #070913;
  box-shadow: 0 0 20px var(--neon-emerald-glow);
}

.btn-winner-action.btn-keep {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-white);
}
.btn-winner-action.btn-keep:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-winner-action.btn-upgrade-won {
  background: linear-gradient(135deg, var(--neon-violet), var(--neon-magenta));
  color: #ffffff;
  box-shadow: 0 0 20px var(--neon-violet-glow);
}

/* --------------------------------------------------------------------------
   9. Upgrade Wheel Arena (.upgrade-grid)
   -------------------------------------------------------------------------- */
.upgrade-grid {
  display: grid;
  grid-template-columns: 1fr 380px 1fr;
  gap: 24px;
  align-items: start;
}

.upgrade-panel {
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.upgrade-panel-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-white);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Left Panel: Inventory & Balance Booster */
.upgrade-inventory-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 20px;
}

.upgrade-inv-item {
  background: rgba(13, 18, 36, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.upgrade-inv-item:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

.upgrade-inv-item.selected {
  border-color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.15);
  box-shadow: 0 0 14px var(--neon-cyan-glow);
}

.upgrade-inv-item .item-art-wrap {
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
}

.upgrade-inv-item .item-name {
  font-size: 11px;
}
.upgrade-inv-item .item-price {
  font-size: 11px;
}

/* Extra Balance Slider Box */
.extra-balance-box {
  background: rgba(7, 9, 19, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
}

.extra-balance-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.extra-balance-amount {
  font-family: var(--font-mono);
  color: var(--neon-emerald);
}

.cyber-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: #1e293b;
  outline: none;
  cursor: pointer;
}

.cyber-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
  cursor: pointer;
  transition: var(--transition-fast);
}

.cyber-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #ffffff;
}

/* Center Panel: Large Upgrade Wheel */
.upgrade-panel-wheel {
  align-items: center;
  text-align: center;
  position: relative;
}

.wheel-container {
  width: 320px;
  height: 320px;
  position: relative;
  margin: 16px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-canvas,
.wheel-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

/* Rotating Wheel Pointer Ring */
.wheel-pointer-needle {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--neon-gold-light);
  filter: drop-shadow(0 0 8px var(--neon-gold));
  z-index: 10;
}

/* Center Digital Readout Inside Wheel */
.wheel-center-core {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: #080b18;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 242, 254, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.wheel-percentage {
  font-family: 'Orbitron', var(--font-mono);
  font-size: 30px;
  font-weight: 800;
  color: var(--neon-cyan);
  text-shadow: 0 0 16px var(--neon-cyan-glow);
}

.wheel-chance-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.wheel-multiplier-badge {
  margin-top: 4px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--neon-gold);
  color: var(--neon-gold-light);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
}

/* Roll Under / Roll Over Toggle */
.roll-direction-toggle {
  display: flex;
  background: rgba(7, 9, 19, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 20px;
}

.btn-roll-dir {
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.btn-roll-dir.active {
  background: var(--neon-violet);
  color: #ffffff;
  box-shadow: 0 0 12px var(--neon-violet-glow);
}

/* Big Neon Upgrade Action Button */
.btn-perform-upgrade {
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #070913;
  background: linear-gradient(135deg, var(--neon-gold-light), #f59e0b);
  box-shadow: 0 4px 24px var(--neon-gold-glow);
  transition: var(--transition-bounce);
}

.btn-perform-upgrade:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 6px 30px var(--neon-gold-glow);
}

.btn-perform-upgrade:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.8);
}

/* Right Panel: Target Items & Multiplier Filters */
.multiplier-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.filter-pill:hover {
  color: var(--text-white);
  border-color: var(--border-glass-bright);
}

.filter-pill.active {
  background: var(--neon-cyan);
  color: #070913;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

/* Holo Toggle Switch */
.holo-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 9, 19, 0.6);
  border: 1px solid var(--border-glass);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
}

.cyber-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.cyber-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #1e293b;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.cyber-switch input:checked + .switch-slider {
  background: linear-gradient(90deg, #ec4899, #00f2fe);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

.cyber-switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.upgrade-target-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

/* --------------------------------------------------------------------------
   10. Contracts Arena (#tab-contracts)
   -------------------------------------------------------------------------- */
.contracts-arena {
  max-width: 980px;
  margin: 0 auto;
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  padding: 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contracts-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text-white);
}

.contracts-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
  text-align: center;
}

.contract-slots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  width: 100%;
  margin-bottom: 28px;
}

.contract-slot {
  height: 140px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  background: rgba(13, 18, 36, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  position: relative;
  cursor: pointer;
}

.contract-slot:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.08);
}

.contract-slot.filled {
  border-style: solid;
  border-color: var(--border-glass-bright);
  background: var(--bg-surface-card);
}

.contract-slot-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-muted);
}

.contract-summary-card {
  width: 100%;
  background: rgba(7, 9, 19, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.contract-expected-range {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contract-range-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.contract-range-values {
  font-family: 'Orbitron', var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--neon-emerald);
}

.btn-sign-contract {
  padding: 16px 40px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--neon-cyan), #4facfe);
  color: #070913;
  box-shadow: 0 4px 24px var(--neon-cyan-glow);
  transition: var(--transition-bounce);
}

.btn-sign-contract:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* --------------------------------------------------------------------------
   11. Inventory & Profile Tab (#tab-inventory)
   -------------------------------------------------------------------------- */
.inventory-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Stats Summary Banner */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.stat-box {
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat-value {
  font-family: 'Orbitron', var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-white);
}

.stat-value.color-emerald { color: var(--neon-emerald); }
.stat-value.color-gold { color: var(--neon-gold-light); }
.stat-value.color-cyan { color: var(--neon-cyan); }
.stat-value.color-magenta { color: var(--neon-magenta); }

/* Inventory Controls Bar */
.inventory-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  gap: 16px;
}

.inv-filters-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inv-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-inv-action {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: var(--transition-fast);
}

.btn-inv-action.btn-sell-selected {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--neon-emerald);
  color: #34d399;
}
.btn-inv-action.btn-sell-selected:hover {
  background: var(--neon-emerald);
  color: #070913;
  box-shadow: 0 0 16px var(--neon-emerald-glow);
}

.inventory-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.inventory-item-card {
  position: relative;
}

.inventory-item-card.is-selected {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px var(--neon-cyan-glow);
}

.inventory-checkbox-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: var(--transition-fast);
}

.inventory-item-card.is-selected .inventory-checkbox-badge {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

.inventory-checkbox-badge::after {
  content: '✓';
  font-size: 12px;
  font-weight: bold;
  color: #070913;
  display: none;
}

.inventory-item-card.is-selected .inventory-checkbox-badge::after {
  display: block;
}

/* --------------------------------------------------------------------------
   12. Bankruptcy Modal ("ВЫ ОФИЦИАЛЬНО НИЩУК")
   -------------------------------------------------------------------------- */
.bankruptcy-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(7, 3, 3, 0.94);
  backdrop-filter: var(--glass-blur-heavy);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bankruptcy-modal.active {
  display: flex;
  animation: alarmPulse 2.5s infinite alternate;
}

@keyframes alarmPulse {
  0% { box-shadow: inset 0 0 40px rgba(239, 68, 68, 0.2); }
  100% { box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.45); }
}

.bankruptcy-dialog {
  width: 100%;
  max-width: 620px;
  background: rgba(18, 10, 10, 0.98);
  border: 2px solid var(--neon-crimson);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 0 50px var(--neon-crimson-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.bankruptcy-hazard-banner {
  background: repeating-linear-gradient(
    -45deg,
    #ef4444,
    #ef4444 12px,
    #070913 12px,
    #070913 24px
  );
  height: 8px;
  width: 100%;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
}

.bankruptcy-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #f87171;
  text-shadow: 0 0 16px var(--neon-crimson);
  margin-bottom: 8px;
}

.bankruptcy-sub {
  color: #fca5a5;
  font-size: 14px;
  margin-bottom: 24px;
}

.beggar-avatar-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
}

.beggar-avatar-wrap svg {
  width: 80px;
  height: 80px;
}

/* Interactive Begging Clicker Area */
.beggar-clicker-area {
  width: 100%;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.beggar-clicker-area:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--neon-crimson);
}

.beggar-clicker-area:active {
  transform: scale(0.98);
}

.beggar-click-btn-text {
  font-size: 16px;
  font-weight: 800;
  color: #fca5a5;
  margin-bottom: 12px;
}

.beggar-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #1e1b1b;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.beggar-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ef4444, #fbbf24);
  box-shadow: 0 0 10px #fbbf24;
  transition: width 0.15s ease;
}

.beggar-progress-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Floating Click Particles */
.floating-particle {
  position: absolute;
  pointer-events: none;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
  color: #fbbf24;
  text-shadow: 0 0 6px #f59e0b;
  animation: floatUpFade 0.8s ease-out forwards;
}

@keyframes floatUpFade {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-40px) scale(1.2); opacity: 0; }
}

.btn-reset-session {
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass-bright);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.btn-reset-session:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-white);
}

/* --------------------------------------------------------------------------
   13. Factorio Blueprint Modal (.blueprint-modal)
   -------------------------------------------------------------------------- */
.blueprint-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--bg-modal-backdrop);
  backdrop-filter: var(--glass-blur-heavy);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.blueprint-modal.active {
  display: flex;
}

.blueprint-dialog {
  width: 100%;
  max-width: 640px;
  background: #090d18;
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 0 40px var(--neon-cyan-glow);
  display: flex;
  flex-direction: column;
}

.blueprint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.blueprint-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--neon-cyan);
}

.blueprint-terminal-textarea {
  width: 100%;
  height: 140px;
  background: #04060c;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #38bdf8;
  resize: none;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.blueprint-terminal-textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8), 0 0 14px var(--neon-cyan-glow);
}

.blueprint-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-blueprint-action {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition-fast);
}

.btn-blueprint-action.btn-copy {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
}
.btn-blueprint-action.btn-copy:hover {
  background: var(--neon-cyan);
  color: #070913;
  box-shadow: 0 0 14px var(--neon-cyan-glow);
}

.btn-blueprint-action.btn-import {
  background: linear-gradient(135deg, var(--neon-emerald), #059669);
  color: #ffffff;
  box-shadow: 0 0 14px var(--neon-emerald-glow);
}

.blueprint-preview-card {
  background: rgba(13, 18, 36, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   14. Floating Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-msg {
  background: rgba(13, 18, 36, 0.95);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass-bright);
  border-left: 4px solid var(--neon-cyan);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}

.toast-msg.toast-success { border-left-color: var(--neon-emerald); }
.toast-msg.toast-error { border-left-color: var(--neon-crimson); }
.toast-msg.toast-warning { border-left-color: var(--neon-gold); }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   15. Responsive Adaptations (Mobile & Tablets)
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .cases-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .upgrade-grid {
    grid-template-columns: 1fr;
  }
  .upgrade-panel-wheel {
    order: -1;
  }
  .profile-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .contract-slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  .header-nav {
    order: 3;
    width: 100%;
    justify-content: space-around;
    margin-top: 8px;
  }
  .cases-grid {
    grid-template-columns: 1fr;
  }
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contract-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .roulette-viewport {
    height: 150px;
  }
  .roulette-card {
    width: 110px;
    height: 130px;
  }
  .wheel-container {
    width: 260px;
    height: 260px;
  }
  .wheel-center-core {
    width: 140px;
    height: 140px;
  }
  .wheel-percentage {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
  .user-nickname-badge {
    display: none;
  }
  .contract-slots-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   16. Supplementary Styles & Enhancements
   ========================================================================== */

/* Player Drop Highlight in Live Ticker */
.ticker-item.player-drop {
  border-color: var(--neon-gold) !important;
  background: rgba(245, 158, 11, 0.22) !important;
  box-shadow: 0 0 12px var(--neon-gold-glow) !important;
}
.ticker-item.player-drop .ticker-item-user {
  color: var(--neon-gold-light) !important;
  font-weight: 800 !important;
}

/* Header Net Worth Tooltip & Subtext */
.balance-subtext {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}
.balance-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

/* Case Odds Bar & Odds Tags */
.case-odds-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.odds-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
}
.odds-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Case Items Dropdown / Preview Section */
.case-items-section {
  width: 100%;
  margin-top: 24px;
}
.case-items-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.case-items-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
  border-color: var(--border-glass-bright);
}
.case-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.case-mini-item {
  background: rgba(13, 18, 36, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}
.case-mini-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-glass-bright);
}
.case-mini-item .item-art-wrap {
  width: 50px;
  height: 50px;
  margin-bottom: 4px;
}
.case-mini-item .item-name {
  font-size: 10px;
  max-width: 90px;
}
.case-mini-item .item-price {
  font-size: 11px;
}
.case-mini-item .item-chance {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Roulette Modal Controls & Items */
.roulette-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.quick-spin-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.quick-spin-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--neon-cyan);
  cursor: pointer;
}
.btn-spin-roulette {
  padding: 14px 40px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #070913;
  background: linear-gradient(135deg, var(--neon-cyan), #00c6ff);
  box-shadow: 0 4px 24px var(--neon-cyan-glow);
  transition: var(--transition-bounce);
}
.btn-spin-roulette:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}
.btn-spin-roulette:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.8);
}

/* Inventory Item Action Buttons */
.inv-card-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
}
.btn-card-action {
  flex: 1;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  transition: var(--transition-fast);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}
.btn-card-action:hover {
  color: var(--text-white);
  border-color: var(--border-glass-bright);
}
.btn-card-sell {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.btn-card-sell:hover {
  background: var(--neon-emerald);
  color: #070913;
  box-shadow: 0 0 10px var(--neon-emerald-glow);
}
.btn-card-upgrade {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}
.btn-card-upgrade:hover {
  background: var(--neon-violet);
  color: #ffffff;
  box-shadow: 0 0 10px var(--neon-violet-glow);
}

/* Museum / Collection Section */
.museum-section {
  background: var(--bg-surface-glass);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  padding: 28px;
  margin-top: 16px;
}
.museum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.museum-title {
  font-family: 'Orbitron', var(--font-main);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-white);
}
.museum-progress-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-cyan);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
}
.museum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.museum-card {
  background: rgba(13, 18, 36, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}
.museum-card .item-art-wrap {
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
}
.museum-card .item-name {
  font-size: 11px;
  max-width: 110px;
}
.museum-card .item-price {
  font-size: 11px;
}
.museum-card.is-locked {
  filter: grayscale(1) opacity(0.38);
  border-style: dashed;
}
.museum-card.is-locked .item-art-wrap {
  filter: contrast(0.2) brightness(0.4);
}
.museum-card.is-locked::before {
  content: '🔒';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  filter: none;
}
.museum-card.is-unlocked {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}
.museum-card.is-unlocked::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  font-weight: 900;
  color: var(--neon-emerald);
}

/* Contracts inventory selection */
.contract-inv-section {
  width: 100%;
  margin-top: 24px;
}
.contract-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px 4px;
}
.contract-inv-card {
  background: rgba(13, 18, 36, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.contract-inv-card:hover {
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
}
.contract-inv-card.selected-in-contract {
  opacity: 0.35;
  pointer-events: none;
  border-color: var(--neon-emerald);
}
.contract-slot.filled .slot-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.contract-slot.filled .slot-remove-btn:hover {
  background: #ef4444;
  color: #fff;
}

/* Generic Modal Overlay Base */
.kz-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: var(--bg-modal-backdrop);
  backdrop-filter: var(--glass-blur-heavy);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.kz-modal.active {
  display: flex;
}
.kz-modal-dialog {
  width: 100%;
  max-width: 480px;
  background: #090d18;
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.nickname-input-cyber {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--neon-cyan);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  font-family: var(--font-main);
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
}
.nickname-input-cyber:focus {
  box-shadow: 0 0 14px var(--neon-cyan-glow);
}


/* ==========================================================================
   17. Upgrade Wheel Orbiting Pointer & Smooth Live Drop Feed Fixes
   ========================================================================== */

/* Fix SVG Wheel Orientation: polarToCartesian(0) already starts at 12 o'clock top */
.wheel-svg {
  transform: none !important;
  display: block;
}

/* Full-size Orbiting Wheel Pointer Container (320x320) */
.wheel-pointer-orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  will-change: transform;
}

.wheel-pointer-tip {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 24px solid var(--neon-gold-light);
  filter: drop-shadow(0 0 10px var(--neon-gold)) drop-shadow(0 0 4px #ffffff);
}

.wheel-pointer-tip::after {
  content: '';
  position: absolute;
  top: -27px;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px var(--neon-gold-light);
}

/* Smooth Live Drop Feed (No jerky CSS marquee jump on DOM removal) */
.live-ticker-track {
  animation: none !important;
  transform: none !important;
  overflow: hidden;
  flex: 1;
  gap: 10px;
}

.ticker-item {
  animation: tickerSlideInSmooth 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes tickerSlideInSmooth {
  0% {
    opacity: 0;
    transform: translateX(-32px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}


/* "$4000 быстро и сразу" button in Bankruptcy Modal */
.btn-fast-cash-contract {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  font-family: 'Orbitron', var(--font-main);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: #070913;
  background: linear-gradient(135deg, #fbbf24 0%, #10b981 100%);
  border: 1px solid #fde68a;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.45), 0 0 12px rgba(251, 191, 36, 0.4);
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-fast-cash-contract:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.12);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.7), 0 0 18px rgba(251, 191, 36, 0.65);
}

.btn-fast-cash-contract:active {
  transform: translateY(1px);
}


/* ==========================================================================
   18. Cosmic Starfield Background & Intergalactic Branding Styles
   ========================================================================== */

.cosmos-starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(168, 85, 247, 0.14) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(0, 242, 254, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.09) 0%, transparent 55%);
}

.cosmos-star {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  pointer-events: none;
  animation: starTwinkle var(--twinkle-dur, 4s) ease-in-out infinite alternate;
  animation-delay: var(--twinkle-delay, 0s);
}

.cosmos-star.star-cyan {
  background: #a5f3fc;
  box-shadow: 0 0 8px #00f2fe, 0 0 14px rgba(0, 242, 254, 0.6);
}

.cosmos-star.star-magenta {
  background: #fbcfe8;
  box-shadow: 0 0 8px #ec4899, 0 0 14px rgba(236, 72, 153, 0.6);
}

.cosmos-star.star-gold {
  background: #fef08a;
  box-shadow: 0 0 8px #f59e0b, 0 0 14px rgba(245, 158, 11, 0.6);
}

@keyframes starTwinkle {
  0% {
    opacity: var(--star-min-op, 0.15);
    transform: scale(0.75);
  }
  100% {
    opacity: var(--star-max-op, 0.95);
    transform: scale(1.25);
  }
}

/* Shooting Stars / Comets */
.shooting-star {
  position: absolute;
  width: 110px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(0, 242, 254, 0.4), transparent);
  border-radius: 999px;
  filter: drop-shadow(0 0 6px #00f2fe);
  opacity: 0;
  pointer-events: none;
  transform: rotate(-35deg);
  animation: cometFly var(--comet-dur, 7s) linear infinite;
  animation-delay: var(--comet-delay, 2s);
}

@keyframes cometFly {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-35deg) scaleX(0.4);
  }
  6% {
    opacity: 1;
    transform: translate(-180px, 126px) rotate(-35deg) scaleX(1);
  }
  14%, 100% {
    opacity: 0;
    transform: translate(-520px, 364px) rotate(-35deg) scaleX(0.2);
  }
}

/* Ensure main content & header sit above starfield */
.live-ticker-wrap,
.site-header,
.main-content {
  position: relative;
  z-index: 2;
}

.cosmic-subtitle-pill {
  display: inline-block;
  padding: 4px 14px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--neon-gold-light);
  font-family: 'Orbitron', var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.25);
}


/* ==========================================================================
   19. Text Ellipsis Fix in Upgrade & Full Mobile Phone Adaptation
   ========================================================================== */

/* Fix item name ellipsis inside flex/grid items (Upgrade, Museum, Contracts, Roulette) */
.upgrade-inv-item,
.museum-card,
.case-mini-item,
.contract-inv-card {
  min-width: 0;
  overflow: hidden;
}

.upgrade-inv-item .item-name,
.museum-card .item-name,
.case-mini-item .item-name,
.roulette-card .item-name {
  width: 100%;
  max-width: 100%;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#upgrade-target-summary {
  max-width: 185px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: bottom;
}

/* Comprehensive Mobile & Smartphone Layout (<= 768px and <= 480px) */
@media (max-width: 768px) {
  .main-content {
    padding: 14px 12px 36px;
  }

  .live-ticker-wrap {
    height: 38px;
  }

  .ticker-badge-live {
    padding: 3px 8px;
    margin-left: 8px;
    font-size: 9px;
  }

  .ticker-item {
    padding: 3px 9px 3px 4px;
    gap: 6px;
  }

  .ticker-item-icon {
    width: 22px;
    height: 22px;
  }

  .ticker-item-user,
  .ticker-item-name,
  .ticker-item-price {
    font-size: 11px;
  }

  /* Header compact mobile grid */
  .header-container {
    padding: 10px 12px;
    gap: 10px;
  }

  .brand-icon-wrap {
    width: 34px;
    height: 34px;
  }

  .brand-title {
    font-size: 15px;
    letter-spacing: 0.8px;
  }

  .brand-sub {
    font-size: 9px;
    letter-spacing: 1.2px;
  }

  .header-user-controls {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .user-nickname-badge {
    display: flex !important;
    padding: 4px 10px;
    gap: 6px;
  }

  .nickname-avatar {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .nickname-text {
    font-size: 12px;
    max-width: 78px;
  }

  .balance-box {
    padding: 4px 10px;
    gap: 5px;
  }

  .balance-value {
    font-size: 13px;
  }

  .balance-subtext {
    font-size: 9px;
  }

  .btn-icon-pill {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }

  /* Navigation Tabs scrollable / 4-column bar */
  .header-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-top: 2px;
  }

  .nav-tab-btn {
    padding: 7px 4px;
    font-size: 11px;
    letter-spacing: 0.2px;
    justify-content: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  /* Banners */
  .cases-banner {
    margin-bottom: 18px;
  }

  .cosmic-subtitle-pill {
    font-size: 9px;
    padding: 3px 10px;
    letter-spacing: 1px;
  }

  .cases-banner-title {
    font-size: 20px;
    letter-spacing: 1px;
    line-height: 1.25;
  }

  .cases-banner-sub {
    font-size: 12px;
  }

  /* Cases Cards */
  .cases-grid {
    gap: 16px;
    margin-bottom: 24px;
  }

  .case-card {
    padding: 20px 16px;
  }

  .case-art-box {
    width: 130px;
    height: 130px;
    margin-bottom: 12px;
  }

  .case-title {
    font-size: 18px;
  }

  /* Upgrade Arena on Mobile */
  .upgrade-grid {
    gap: 16px;
  }

  .upgrade-panel {
    padding: 16px 14px;
  }

  .upgrade-panel-title {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .upgrade-inventory-selector,
  .upgrade-target-selector {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 250px;
    gap: 8px;
  }

  .wheel-container {
    width: 250px;
    height: 250px;
    margin: 8px auto 16px;
  }

  .wheel-center-core {
    width: 136px;
    height: 136px;
  }

  .wheel-percentage {
    font-size: 22px;
  }

  .btn-perform-upgrade {
    padding: 14px 18px;
    font-size: 15px;
  }

  /* Contracts on Mobile */
  .contracts-arena {
    padding: 18px 14px;
  }

  .contracts-title {
    font-size: 19px;
    text-align: center;
  }

  .contract-slots-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .contract-summary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .contract-inv-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  /* Inventory & Profile on Mobile */
  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card-value {
    font-size: 17px;
  }

  .inventory-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .item-card {
    padding: 12px 10px;
  }

  .item-card .item-art-wrap {
    width: 76px;
    height: 76px;
    margin-bottom: 8px;
  }

  .inv-card-actions {
    flex-direction: column;
    gap: 5px;
  }

  .btn-card-action {
    width: 100%;
    padding: 6px 8px;
    font-size: 11px;
  }

  .museum-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  /* Modals (Roulette, Bankruptcy, Blueprint) on Mobile */
  .roulette-modal,
  .bankruptcy-modal,
  .blueprint-modal,
  .kz-modal {
    padding: 10px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .roulette-dialog,
  .bankruptcy-dialog,
  .blueprint-dialog,
  .kz-modal-dialog {
    padding: 18px 14px;
    margin: auto 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  .roulette-header {
    margin-bottom: 14px;
  }

  .roulette-title {
    font-size: 16px;
  }

  .roulette-controls-bar {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .roulette-controls-bar .btn-open-case {
    width: 100%;
    max-width: none !important;
  }

  .winner-reveal {
    padding: 18px 12px;
  }

  .winner-card-center {
    width: 170px;
    padding: 16px 12px;
    margin-bottom: 14px;
  }

  .winner-card-center .item-art-wrap {
    width: 96px;
    height: 96px;
  }

  .winner-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .btn-winner-action {
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
  }

  .case-items-mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .bankruptcy-title {
    font-size: 20px;
  }

  .bankruptcy-sub {
    font-size: 12px;
  }

  .beggar-avatar-wrap {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
  }

  .beggar-clicker-area {
    padding: 14px 12px;
  }

  .beggar-click-btn-text {
    font-size: 13px;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast-msg {
    font-size: 12px;
    padding: 10px 14px;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    gap: 8px;
  }

  .brand-title {
    font-size: 13px;
  }

  .nav-tab-btn {
    font-size: 10px;
    padding: 6px 2px;
  }

  .nav-tab-btn span:first-child {
    display: none;
  }

  .wheel-container {
    width: 224px;
    height: 224px;
  }

  .wheel-center-core {
    width: 120px;
    height: 120px;
  }

  .wheel-percentage {
    font-size: 19px;
  }

  .case-items-mini-grid,
  .museum-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
