:root {
  --bg-dark: #0a0e17;
  --bg-card: rgba(19, 26, 43, 0.75);
  --bg-card-hover: rgba(26, 36, 61, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(147, 51, 234, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --accent-kakera: #38bdf8;
  --accent-gold: #fbbf24;

  /* Gem Color Themes */
  --gem-sapphire: #3b82f6;
  --gem-sapphire-glow: rgba(59, 130, 246, 0.3);
  --gem-silver: #94a3b8;
  --gem-silver-glow: rgba(148, 163, 184, 0.3);
  --gem-gold: #eab308;
  --gem-gold-glow: rgba(234, 179, 8, 0.3);
  --gem-bronze: #d97706;
  --gem-bronze-glow: rgba(217, 119, 6, 0.3);
  --gem-ruby: #ef4444;
  --gem-ruby-glow: rgba(239, 68, 68, 0.3);
  --gem-emerald: #10b981;
  --gem-emerald-glow: rgba(16, 185, 129, 0.3);
  
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* BACKGROUND GLOW EFFECTS */
.background-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: -150px;
  left: -100px;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
  top: 30%;
  right: -150px;
}

.orb-3 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
  bottom: -200px;
  left: 20%;
}

/* APP CONTAINER */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 80px;
}

/* NAVBAR */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  transform: rotate(45deg);
}

/* COMMON CARD */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 24px;
}

/* USER HERO CARD */
.user-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 75, 0.65) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  position: relative;
  overflow: hidden;
}

.user-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.user-hero-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.user-avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #38bdf8);
  animation: pulse-ring 3s infinite alternate;
}

@keyframes pulse-ring {
  0% { transform: scale(0.96); opacity: 0.6; }
  100% { transform: scale(1.04); opacity: 1; filter: blur(2px); }
}

.user-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  background: #1e1b4b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  z-index: 1;
}

.user-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-kakera);
  font-weight: 700;
  margin-bottom: 2px;
}

.user-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

/* KAKERA DISPLAY BOX */
.kakera-display-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.kakera-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kakera-value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.kakera-gem {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));
  animation: float-gem 3s ease-in-out infinite alternate;
}

@keyframes float-gem {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-3px) rotate(5deg); }
}

.kakera-counter {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.kakera-unit {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-pill-icon {
  font-size: 1.4rem;
}

.stat-pill-content {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

/* RC BUTTON */
.rc-btn-wrap {
  margin-top: 14px;
}

.btn-rc-action {
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  transition: all 0.2s ease;
}

.btn-rc-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
}

/* DISCOUNT BANNER */
.discount-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fecaca;
  font-size: 0.95rem;
}

.discount-icon {
  font-size: 1.3rem;
}

/* CATALOG HEADER */
.catalog-header {
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* BADGES GRID */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

/* BADGE CARD */
.badge-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.badge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* Badge specific themes */
.badge-card.theme-sapphire { border-color: rgba(59, 130, 246, 0.3); }
.badge-card.theme-sapphire:hover { box-shadow: 0 12px 32px var(--gem-sapphire-glow); }
.badge-card.theme-silver   { border-color: rgba(148, 163, 184, 0.3); }
.badge-card.theme-silver:hover   { box-shadow: 0 12px 32px var(--gem-silver-glow); }
.badge-card.theme-gold     { border-color: rgba(234, 179, 8, 0.3); }
.badge-card.theme-gold:hover     { box-shadow: 0 12px 32px var(--gem-gold-glow); }
.badge-card.theme-bronze   { border-color: rgba(217, 119, 6, 0.3); }
.badge-card.theme-bronze:hover   { box-shadow: 0 12px 32px var(--gem-bronze-glow); }
.badge-card.theme-ruby     { border-color: rgba(239, 68, 68, 0.3); }
.badge-card.theme-ruby:hover     { box-shadow: 0 12px 32px var(--gem-ruby-glow); }
.badge-card.theme-emerald  { border-color: rgba(16, 185, 129, 0.3); }
.badge-card.theme-emerald:hover  { box-shadow: 0 12px 32px var(--gem-emerald-glow); }

.badge-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.badge-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-emoji {
  font-size: 2rem;
  line-height: 1;
}

.badge-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.badge-category {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.badge-level-tag {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.badge-level-tag.max {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(245, 158, 11, 0.3));
  border-color: var(--gem-gold);
  color: var(--gem-gold);
}

/* LEVEL PROGRESS INDICATOR */
.level-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0 18px;
}

.track-segment {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.track-segment.filled {
  background: var(--text-main);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.theme-sapphire .track-segment.filled { background: var(--gem-sapphire); box-shadow: 0 0 8px var(--gem-sapphire); }
.theme-silver   .track-segment.filled { background: var(--gem-silver);   box-shadow: 0 0 8px var(--gem-silver); }
.theme-gold     .track-segment.filled { background: var(--gem-gold);     box-shadow: 0 0 8px var(--gem-gold); }
.theme-bronze   .track-segment.filled { background: var(--gem-bronze);   box-shadow: 0 0 8px var(--gem-bronze); }
.theme-ruby     .track-segment.filled { background: var(--gem-ruby);     box-shadow: 0 0 8px var(--gem-ruby); }
.theme-emerald  .track-segment.filled { background: var(--gem-emerald);  box-shadow: 0 0 8px var(--gem-emerald); }

/* PERKS BOX */
.perks-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.85rem;
}

.perk-row {
  margin-bottom: 8px;
}

.perk-row:last-child {
  margin-bottom: 0;
}

.perk-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.perk-label.current { color: var(--text-muted); }
.perk-label.next { color: var(--accent-kakera); }

.perk-desc {
  color: var(--text-main);
  font-weight: 600;
}

/* CARD FOOTER & BUY BUTTON */
.card-footer {
  margin-top: auto;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.price-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.price-values {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.original-price {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: line-through;
}

.final-price {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
}

.discount-tag {
  font-size: 0.72rem;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-buy {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* Buy button states */
.btn-buy.can-afford {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: white;
  box-shadow: 0 4px 14px rgba(147, 51, 234, 0.4);
}

.btn-buy.can-afford:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(147, 51, 234, 0.6);
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.btn-buy.can-afford:active {
  transform: scale(0.98);
}

.btn-buy.cannot-afford {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  cursor: not-allowed;
}

.btn-buy.max-level {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: var(--gem-gold);
  cursor: default;
}

/* STATE VIEWS (Loading, Error) */
.state-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.state-text {
  color: var(--text-muted);
  font-size: 1rem;
}

.error-card {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.error-icon-box {
  width: 70px;
  height: 70px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

.error-card h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.error-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.instructions-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-main);
}

.step-item:last-child {
  margin-bottom: 0;
}

.step-num {
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.step-item code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  font-family: monospace;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.error   { border-color: rgba(239, 68, 68, 0.5); }

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hidden {
  display: none !important;
}

/* RESPONSIVE DESIGN */
@media (max-width: 640px) {
  .app-container {
    padding: 12px 14px 70px;
  }

  .user-hero-header {
    flex-direction: row;
    gap: 12px;
  }

  .user-name {
    font-size: 1.35rem;
  }

  .kakera-counter {
    font-size: 2rem;
  }

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

  .stat-pill {
    padding: 8px 10px;
    gap: 8px;
  }

  .stat-pill-icon {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.62rem;
  }

  .stat-val {
    font-size: 0.8rem;
  }

  .badges-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .toast {
    max-width: 100%;
  }
}

/* NAVIGATION TABS */
.nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(168, 85, 247, 0.2));
  color: white;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.tab-btn-casino {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(244, 63, 94, 0.15));
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #fef08a !important;
  text-decoration: none;
}

.tab-btn-casino:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(244, 63, 94, 0.3)) !important;
  border-color: #eab308;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.25);
}

.tab-btn-sell:hover {
  color: #fef08a;
}

/* SEARCH BOX */
.sell-search-box {
  margin-top: 14px;
}

.search-input {
  width: 100%;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* CHARACTERS GRID */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.char-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.char-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.char-thumb-wrap {
  width: 100%;
  height: 240px;
  background: #111827;
  position: relative;
  overflow: hidden;
}

.char-img,
video.char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s ease;
  display: block;
}

.char-card:hover .char-img,
.char-card:hover video.char-img {
  transform: scale(1.05);
}

.char-badge-gif {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #9333ea, #db2777);
  box-shadow: 0 2px 10px rgba(219, 39, 119, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.char-badge-key {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #facc15;
  z-index: 2;
}

.char-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.char-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-series {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-payout-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
}

.char-payout-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.char-payout-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-kakera);
}

.btn-sell-char {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.3));
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sell-char:hover {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

/* MODAL OVERLAY & CARD */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: scale-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scale-up {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: white;
}

.modal-char-preview {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}

.modal-char-thumb {
  width: 70px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.modal-char-details h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-char-reward {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reward-val {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-kakera);
}

.modal-warning {
  font-size: 0.85rem;
  color: #fbbf24;
  line-height: 1.4;
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-modal {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

/* ============================================== */
/* MOBILE RESPONSIVE ENHANCEMENTS FOR SHOP & HAREM */
/* ============================================== */
@media (max-width: 640px) {
  .nav-tabs {
    gap: 6px;
    padding: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tab-btn svg {
    width: 16px;
    height: 16px;
  }

  .catalog-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .sell-search-box {
    margin-top: 0;
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

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

  .char-thumb-wrap {
    height: 180px;
  }

  .char-body {
    padding: 10px;
  }

  .char-name {
    font-size: 0.88rem;
  }

  .char-series {
    font-size: 0.72rem;
  }

  .char-payout-row {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }

  .char-payout-val {
    font-size: 0.85rem;
  }

  .btn-sell-char {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .modal-overlay {
    padding: 16px;
    align-items: center;
  }

  .modal-card {
    padding: 18px 16px;
    max-width: 100%;
    border-radius: 18px;
  }

  .btn-rc-action {
    font-size: 0.82rem;
    padding: 10px 14px;
  }
}

@media (max-width: 380px) {
  .characters-grid {
    grid-template-columns: 1fr;
  }

  .char-thumb-wrap {
    height: 220px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .stat-pill {
    padding: 6px 4px;
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }

  .stat-pill-icon svg {
    width: 15px;
    height: 15px;
  }

  .stat-label {
    font-size: 0.58rem;
  }

  .stat-val {
    font-size: 0.72rem;
  }
}

/* ==================================================== */
/* GLOBAL PLAYER SELECTOR & NAVBAR PILL STYLES          */
/* ==================================================== */

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* USER PROFILE PILL */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.user-avatar-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.user-info-pill {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-main);
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-kakera-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  color: #38bdf8;
}

.kakera-gem-sm {
  display: flex;
  align-items: center;
}

.btn-switch-player {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-switch-player:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: #fbbf24;
  color: #fbbf24;
}

.btn-nav-casino {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-nav-casino:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(245, 158, 11, 0.2));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
}

.user-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-hero-switch {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hero-switch:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #e9d5ff;
}

/* PLAYER SELECTION CARD */
.player-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
}

.select-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.select-badge-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}

.select-card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.select-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}

/* SEARCH INPUT */
.player-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.player-search-box:focus-within {
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
  background: rgba(30, 41, 59, 0.85);
  color: #a855f7;
}

.player-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.player-search-input::placeholder {
  color: #64748b;
}

/* PLAYERS GRID */
.players-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.players-list-grid::-webkit-scrollbar {
  width: 6px;
}

.players-list-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.player-select-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #fff;
  width: 100%;
}

.player-select-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.player-avatar-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.player-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-meta-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta-kakera {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #38bdf8;
}

.player-arrow {
  color: #64748b;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.player-select-btn:hover .player-arrow {
  color: #a855f7;
  transform: translateX(3px);
}

.players-empty-msg {
  padding: 24px 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-gradient:hover {
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

/* SWITCH MODAL */
.switch-modal-card {
  max-width: 520px;
  width: 100%;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-search-box {
  margin-bottom: 14px;
}

.modal-players-grid {
  grid-template-columns: 1fr;
  max-height: 320px;
}

@media (max-width: 640px) {
  .navbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .user-name-pill {
    max-width: 80px;
  }

  .players-list-grid {
    grid-template-columns: 1fr;
    max-height: 290px;
  }

  .player-select-card {
    padding: 20px 16px;
  }
}

/* ========================================================
   CHARACTER ACTIONS & CUSTOMIZER MODAL STYLES
   ======================================================== */

.char-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-customize-char {
  width: 100%;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-customize-char:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(99, 102, 241, 0.4));
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.sell-search-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-global-search-char {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-sm);
  color: #c084fc;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-global-search-char:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #f3e8ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

/* CUSTOMIZER MODAL */
.customizer-modal-card {
  max-width: 820px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.15);
}

.customizer-modal-card .modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.8);
}

.modal-title-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-subtitle-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* CUSTOMIZER TABS */
.customizer-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 18px 0;
  gap: 8px;
}

.cz-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.cz-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.cz-tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.customizer-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: calc(90vh - 150px);
}

/* GALLERY VIEW IN MODAL */
.cz-gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.cz-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
}

.btn-cz-web-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cz-web-search:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #7dd3fc;
}

.cz-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.cz-gallery-item {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  height: 220px;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
}

.cz-gallery-item:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.cz-gallery-item.active {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5), inset 0 0 0 1px #38bdf8;
}

.cz-gallery-thumb-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #090d16;
}

.cz-gallery-thumb-wrap img,
.cz-gallery-thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
  display: block;
}

.cz-gallery-item:hover .cz-gallery-thumb-wrap img,
.cz-gallery-item:hover .cz-gallery-thumb-wrap video {
  transform: scale(1.06);
}

.cz-gallery-badge-active {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(14, 165, 233, 0.92);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.5);
  z-index: 2;
}

.cz-gallery-badge-gif {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #9333ea, #ec4899);
  color: white;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.4);
  z-index: 2;
}

.cz-gallery-order {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #e2e8f0;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  z-index: 2;
}

.cz-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
  padding: 12px;
}

.cz-gallery-item:hover .cz-gallery-overlay {
  opacity: 1;
}

.cz-gallery-item.active .cz-gallery-overlay {
  background: rgba(15, 23, 42, 0.7);
}

.btn-cz-set-active {
  padding: 8px 14px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  color: white;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.btn-cz-set-active:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  transform: scale(1.02);
}

.btn-cz-delete {
  padding: 4px 8px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cz-delete:hover {
  background: rgba(239, 68, 68, 0.4);
  color: white;
}

/* UPLOAD TAB */
.upload-methods-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.upload-box-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.upload-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.03);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-2px);
}

.hidden-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.dropzone-text {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-top: 4px;
}

.dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
}

.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-divider span {
  padding: 0 12px;
}

.upload-url-row {
  display: flex;
  gap: 8px;
}

.upload-url-input {
  flex: 1;
  padding: 11px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.upload-url-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.btn-preview-url {
  padding: 11px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-preview-url:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #7dd3fc;
}

/* PREVIEW CONTAINER */
.cz-preview-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cz-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cz-preview-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.btn-clear-preview {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-clear-preview:hover {
  text-decoration: underline;
}

.cz-preview-media-box {
  width: 100%;
  max-height: 260px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050810;
}

.cz-preview-media-box img,
.cz-preview-media-box video {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 8px;
}

.cz-preview-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* CHECKBOX & SUBMIT */
.upload-options-row {
  margin: 6px 0;
}

.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-main);
  user-select: none;
}

.checkbox-container input {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.upload-actions-row {
  margin-top: 6px;
}

.btn-save-upload {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-save-upload:hover:not(:disabled) {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.btn-save-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* SEARCH MODAL */
.search-char-modal-card {
  max-width: 600px;
  width: 95%;
}

.global-char-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  margin-top: 14px;
}

.search-char-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.15s ease;
}

.search-char-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(56, 189, 248, 0.3);
}

.search-char-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #111827;
}

.search-char-meta {
  flex: 1;
  min-width: 0;
}

.search-char-meta h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-char-meta p {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-choose-search-char {
  padding: 7px 14px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  color: #7dd3fc;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-choose-search-char:hover {
  background: #0284c7;
  color: white;
  border-color: #0284c7;
}

/* SELL MODAL MEDIA WRAP */
.modal-char-thumb-wrap {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #111827;
}

.modal-char-thumb-wrap img,
.modal-char-thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

