/* === CS2 Inventory Viewer — UI/UX Pro Max === */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Ultra Premium Dark Theme */
  --bg-base: #030305;
  --bg-card: rgba(15, 15, 20, 0.4);
  --bg-surface: rgba(25, 25, 35, 0.6);
  --bg-elevated: rgba(40, 40, 55, 0.8);

  /* Glassmorphism Borders */
  --border-light: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);

  /* Text */
  --text: #f0f0f5;
  --text-dim: #a0a5b5;
  --text-muted: #656a80;

  /* Accents */
  --accent: #ff2a5f;
  --accent-glow: rgba(255, 42, 95, 0.4);
  --accent-gradient: linear-gradient(135deg, #ff2a5f 0%, #ff7b54 100%);

  /* Colors */
  --blue: #00d2ff;
  --green: #00ff87;
  --yellow: #ffb800;
  --red: #ff3366;

  /* Golden Ratio Spacing Base: 8px */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  /* Radius */
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;

  /* Animation */
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* CS2 Rarity Colors (Slightly adjusted for neon/glow) */
  --rarity-consumer: #b0c3d9;
  --rarity-industrial: #5e98d9;
  --rarity-milspec: #4b69ff;
  --rarity-restricted: #8847ff;
  --rarity-classified: #d32ce6;
  --rarity-covert: #eb4b4b;
  --rarity-contraband: #e4ae39;
  --rarity-extraordinary: #e4ae39;
}

body {
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(
      circle at 15% 50%,
      rgba(255, 42, 95, 0.05),
      transparent 25%
    ),
    radial-gradient(circle at 85% 30%, rgba(0, 210, 255, 0.05), transparent 25%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === App Container === */
.app {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-7);
}

/* === Header (Glassmorphism Sticky) === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  background: rgba(3, 3, 5, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-light);
}

.header-left {
  display: flex;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.logo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 8px rgba(255, 42, 95, 0.5));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.logo:hover .logo-img {
  transform: rotate(10deg) scale(1.1);
}
.logo h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}
.logo h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.h1-dash {
  background: none !important;
  -webkit-text-fill-color: var(--text-muted) !important;
  font-weight: 300;
  margin: 0 2px;
}

.header-right {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.trader-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: transparent;
  padding: 12px 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}
.trader-badge .trader-label {
  color: var(--text-dim);
}
.trader-badge .trader-name {
  color: var(--text);
  font-weight: 700;
}

/* === Shiny Buttons & Ghost Buttons === */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-bounce);
  white-space: nowrap;
  overflow: hidden;
  outline: none;
}
.btn:active {

}

.btn-primary {
  background: var(--bg-surface);
  color: #fff;
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0.1;
  transition: var(--transition);
}
.btn-primary:hover {
  border-color: var(--accent);
  box-shadow:
    0 8px 32px var(--accent-glow),
    inset 0 0 0 1px var(--accent);

}
.btn-primary:hover::before {
  opacity: 0.2;
}

/* Ultra Shiny Button for "Inspect in CS2" */
.btn-shiny {
  background: var(--bg-surface);
  color: #fff;
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 210, 255, 0.1);
}
.btn-shiny::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transform: skewX(-20deg);
  transition: 0s;
}
.btn-shiny:hover {
  border-color: var(--blue);
  box-shadow:
    0 8px 32px rgba(0, 210, 255, 0.3),
    inset 0 0 0 1px var(--blue);

}
.btn-shiny:hover::before {
  animation: shine 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);

}
.fb-link {
  text-decoration: none;
  background: rgba(24, 119, 242, 0.12);
  border-color: rgba(24, 119, 242, 0.3);
  color: #60a5fa;
}
.fb-link:hover {
  background: rgba(24, 119, 242, 0.2);
  border-color: #1877f2;
  color: #fff;
  box-shadow: 0 4px 20px rgba(24, 119, 242, 0.3);

}
.btn-icon {
  padding: 12px;
}

/* === Add Account & Inputs === */
.add-account-section {
  margin-top: var(--space-5);
  margin-bottom: var(--space-4);
}
.add-account-bar {
  display: flex;
  gap: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 8px 8px 8px var(--space-4);
  align-items: center;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 2px 20px rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}
.add-account-bar:focus-within {
  border-color: var(--border-hover);
  box-shadow:
    inset 0 2px 20px rgba(255, 255, 255, 0.05),
    0 8px 32px rgba(0, 0, 0, 0.3);
}
.add-account-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.add-account-bar input::placeholder {
  color: var(--text-muted);
}

/* === Account Selector (Bento Style Mega Menu) === */
.account-selector-container {
  width: 100%;
}

.account-trigger {
  width: 100%;
  height: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 20px rgba(255, 255, 255, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.account-trigger:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
  box-shadow: inset 0 2px 20px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.2);
}

.account-trigger-content {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.account-menu {
  width: 100%;
  padding: 0;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.account-search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: rgba(18, 22, 28, 0.95);
  backdrop-filter: blur(24px);
  z-index: 2;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.account-search-box svg {
  color: var(--text-dim);
  flex-shrink: 0;
}

.account-search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.account-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.account-list::-webkit-scrollbar {
  width: 6px;
}
.account-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.account-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.account-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.account-item:hover {
  background: rgba(255, 255, 255, 0.05);

}

.account-item.active {
  background: linear-gradient(135deg, rgba(255, 42, 95, 0.1) 0%, rgba(255, 123, 84, 0.1) 100%);
  border-color: rgba(255, 42, 95, 0.3);
}

.account-item .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-hover);
  transition: var(--transition);
  flex-shrink: 0;
}

.account-trigger-content .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-hover);
  flex-shrink: 0;
}

.account-item.active .avatar, .account-trigger-content .avatar {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.account-item .tab-info, .account-trigger-content .tab-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.account-item .tab-name, .account-trigger-content .tab-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.2;
}

.account-item .tab-stats, .account-trigger-content .tab-stats {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.account-tab .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-hover);
  transition: var(--transition);
}
.account-tab.active .avatar {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.account-tab .tab-info {
  flex: 1;
  min-width: 0;
}
.account-tab .tab-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.account-tab .tab-stats {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  flex-shrink: 0;
}
.online-dot.online {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
.online-dot.offline {
  background: var(--text-muted);
}

/* === Filters (Modern Segments) === */
.filters-section {
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* Increased spacing between top and bottom rows */
}

.filters-row-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  width: 100%;
  position: relative;
  z-index: 100; /* Ensure dropdowns overlay bottom row */
}

.filters-row-bottom {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  width: 100%;
  position: relative;
  z-index: 10; /* Lower z-index than top row */
}

.filters-dropdowns {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  width: 300px; /* Fixed neat width instead of stretching */
  transition: var(--transition);
  backdrop-filter: blur(12px);
}
.search-box:focus-within {
  border-color: var(--border-hover);
  background: var(--bg-surface);
}
.search-box svg {
  color: var(--text-dim);
  flex-shrink: 0;
}
.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.filter-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.chip {
  padding: 10px 20px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition-bounce);
  font-family: inherit;
  backdrop-filter: blur(12px);
}
.chip:hover {
  border-color: var(--border-hover);
  color: var(--text);

}
.chip.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg-base);
}

.custom-dropdown {
  position: relative;
  display: inline-block;
  z-index: 20;
}
.dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-bounce);
  backdrop-filter: blur(12px);
  min-width: 180px;
  height: 42px;
  user-select: none;
}
.dropdown-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);

}
.custom-dropdown.open .dropdown-btn {
  border-color: var(--text);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.dropdown-btn svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  stroke: currentColor;
}
.custom-dropdown.open .dropdown-btn svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 100%;
  background: rgba(18, 22, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 8px;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 320px;
  overflow-y: auto;
}
.dropdown-menu::-webkit-scrollbar {
  width: 6px;
}
.dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.custom-dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  gap: 10px;
  align-items: center;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.dropdown-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-weight: 600;
}
.dropdown-item .count {
  font-size: 12px;
  opacity: 0.6;
  margin-left: auto;
}
.checkbox-custom {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}
.checkbox-custom.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.dropdown-item:hover .checkbox-custom:not(.checked) {
  border-color: var(--text-dim);
}
.rarity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-3);
  font-weight: 500;
}

/* === Inventory Grid (Bento Grid Style) === */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}
/* Glowing hover effect */
.item-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0);
  transition: var(--transition);
  pointer-events: none;
  z-index: 10;
}
.item-card:hover {

  background: var(--bg-surface);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.item-card:hover::after {
  box-shadow: inset 0 0 0 1px var(--border-hover);
}

.item-card .item-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  padding: var(--space-4);
  background: radial-gradient(
    circle at 50% 0%,
    rgba(255, 255, 255, 0.03) 0%,
    transparent 70%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.item-card .item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-slow);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
}
.item-card:hover .item-image img {
  transform: scale(1.15) rotate(-2deg);
}

.item-card .item-info {
  padding: var(--space-3);
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}
.item-card .item-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.item-card .item-type {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.item-card .item-exterior {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  align-self: flex-start;
}
.rarity-bar {
  height: 4px;
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  opacity: 0.8;
  transition: var(--transition);
}
.item-card:hover .rarity-bar {
  opacity: 1;
  height: 6px;
  box-shadow: 0 -4px 12px var(--rarity-color, rgba(255, 255, 255, 0.2));
} /* Note: We will inject var(--rarity-color) in inline style */

/* Trade Badges */
.trade-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.trade-badge.ready {
  background: rgba(0, 255, 135, 0.15);
  color: var(--green);
  border: 1px solid rgba(0, 255, 135, 0.3);
}
.trade-badge.hold {
  background: rgba(255, 184, 0, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(255, 184, 0, 0.3);
}
.trade-badge.locked {
  background: rgba(255, 51, 102, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 51, 102, 0.3);
}

/* Float Preview Badge */
.float-preview {
  position: absolute;
  bottom: 12px;
  right: 12px; /* Moved to bottom right to fit Bento design */
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-bounce);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.float-preview svg {
  flex-shrink: 0;
  opacity: 0.8;
}
.item-card:hover .float-preview {

  border-color: var(--border-hover);
}

/* Item Owner Tag */
.item-owner {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}
.item-owner img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

/* === Modal (Ultra Premium) === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.4s ease;
}
.modal.show {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 5, 0.85);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
}

.modal-content {
  position: relative;
  background: rgba(15, 15, 20, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  transform: scale(0.95) translateY(20px);
  transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.5),
    inset 0 2px 20px rgba(255, 255, 255, 0.05);
}
.modal.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}
.modal-close:hover {
  color: var(--text);
  border-color: var(--border-hover);
  transform: rotate(90deg);
}

/* Item Modal Body */
.item-modal {
  max-width: 800px;
  width: 100%;
  padding: var(--space-5);
}
.item-modal-body {
  display: flex;
  gap: var(--space-5);
}

.item-modal-image {
  width: 320px;
  flex-shrink: 0;
  aspect-ratio: 3/4;
  background: radial-gradient(
    circle at center,
    var(--bg-surface) 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}
.item-modal-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
}
.item-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.8));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.item-modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.item-modal-info h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.item-modal-info .item-weapon {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

/* Details row bento */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.detail-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.detail-value {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}
.detail-value.ready {
  color: var(--green);
}
.detail-value.hold {
  color: var(--yellow);
}
.detail-value.locked {
  color: var(--red);
}

/* Float Value Bar */
.float-bar-container {
  padding: var(--space-3) 0;
  margin-top: var(--space-4);
  border-top: 1px solid var(--border-light);
}
.float-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  position: relative;
  background: linear-gradient(
    to right,
    #00ff87 0%,
    #a2ff00 7%,
    #ffb800 15%,
    #ff7b54 38%,
    #ff3366 45%,
    #990033 100%
  );
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.float-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 18px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: translateX(-2px);
  transition: left 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.float-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}
.page-btn {
  min-width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-bounce);
  backdrop-filter: blur(12px);
}
.page-btn:hover:not(:disabled) {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-surface);

}
.page-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg-base);
}
.page-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* States */
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 20px;
  text-align: center;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
  margin-bottom: var(--space-4);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* API Modal specifics */
.api-key-modal {
  max-width: 540px;
  text-align: center;
}
.api-key-modal .modal-icon {
  font-size: 48px;
  margin-bottom: var(--space-3);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}
.api-key-modal h2 {
  font-size: 24px;
  margin-bottom: var(--space-2);
  font-weight: 800;
}
.api-key-modal p {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: var(--space-4);
}
.api-key-modal a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.input-group {
  display: flex;
  gap: var(--space-2);
}
.input-group input {
  flex: 1;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 42, 95, 0.1);
}
.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-3);
}

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.8);
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.scroll-top-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.scroll-top-btn:active {

}

/* Responsive */
@media (max-width: 900px) {
  .item-modal-body {
    flex-direction: column;
  }
  .item-modal-image {
    width: 100%;
    aspect-ratio: 1;
  }
  .inventory-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}
@media (max-width: 600px) {
  .app {
    padding: 0 var(--space-3) var(--space-5);
  }

  /* Header Mobile */
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding-top: var(--space-3);
  }
  .header-sub {
    margin-left: 0;
    display: block;
    margin-top: 4px;
    font-size: 13px;
  }
  .header-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
  }
  .header-right .btn {
    flex: 1;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
  }
  .logo h1 {
    font-size: 20px;
  }
  .logo-img {
    width: 24px;
    height: 24px;
  }

  /* Tabs Mobile */
  .accounts-section {
    margin-top: var(--space-3);
  }
  .account-tab {
    min-width: 180px;
    padding: 10px 12px;
  }
  .account-tab .avatar {
    width: 36px;
    height: 36px;
  }
  .account-tab.all-tab {
    min-width: unset;
    padding: 10px 16px;
    white-space: nowrap;
  }

  /* Filters Mobile */
  .filters-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: stretch;
    position: relative;
  }
  .search-box {
    width: 100%;
    min-width: unset;
  }
  .filter-chips {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    gap: 8px;
    scrollbar-width: none;
  }
  .filter-chips::-webkit-scrollbar {
    display: none;
  }
  .filter-chips .chip {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Dropdowns Mobile - Full width, stacked */
  .custom-dropdown {
    width: 100%;
    min-width: 0;
    z-index: 20;
  }
  .custom-dropdown.open {
    z-index: 50;
  }
  .dropdown-btn {
    width: 100%;
    min-width: unset;
  }
  .dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 280px;
  }

  /* Grid Mobile */
  .inventory-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .item-card {
    border-radius: 16px;
  }
  .item-card .item-image {
    padding: 12px;
  }
  .item-card .item-name {
    font-size: 13px;
  }
  .item-price {
    font-size: 14px;
  }
  .item-float {
    font-size: 10px;
  }

  /* Bottom Sheet Modal */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .item-modal {
    border-radius: 24px 24px 0 0;
    margin: 0;
    width: 100%;
    max-height: 90vh;
    padding: var(--space-4) var(--space-4) var(--space-6);
    transform: translateY(100%);
  }
  .modal-overlay.active .item-modal {
    transform: translateY(0);
  }
  .details-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}
