.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.head-row h1 {
  font-size: 1.6rem;
  font-weight: 800;
}

.head-sub {
  font-size: 0.86rem;
  opacity: 0.7;
  margin-top: 0.2rem;
}

/* ===== Toolbar ===== */
.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.95);
  padding: 0.55rem 0.95rem 0.55rem 2.3rem;
  border-radius: 999px;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 0.88rem;
}

.search-wrap input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.search-wrap::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  opacity: 0.55;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}

.toolbar-btn {
  padding: 0.55rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.95);
  border-radius: 999px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s;
}

.toolbar-btn:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #e5e7eb;
}

.toolbar-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(91, 139, 196, 0.12));
  border-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}

.toolbar-btn .count-badge {
  background: #38bdf8;
  color: #020617;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
}

/* ===== Category bar ===== */
/* ===== Game picker (item 2) ===== */
.game-grid-scroll {
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 1.6rem;
  padding-right: 0.3rem;
}

.game-grid-scroll::-webkit-scrollbar {
  width: 8px;
}

.game-grid-scroll::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.all-listings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.all-listings-head h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.view-all-btn {
  background: transparent;
  border: none;
  color: #7dd3fc;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}

.game-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(31, 41, 55, 0.95);
  border-radius: 0.9rem;
  padding: 1.3rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.game-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
}

.game-card .gc-icon {
  font-size: 1.8rem;
}

.game-card .gc-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.game-card .gc-count {
  font-size: 0.72rem;
  opacity: 0.6;
}

.shop-game-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.back-game-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  border-radius: 0.6rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.back-game-btn:hover {
  border-color: rgba(56, 189, 248, 0.6);
}

.shop-game-name {
  font-size: 1.15rem;
  font-weight: 800;
}

/* clickable game selector */
.game-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #e5e7eb;
  border-radius: 0.7rem;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  transition: border-color .15s;
}

.game-select-btn:hover {
  border-color: rgba(56, 189, 248, 0.6);
}

.game-select-btn .gs-caret {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: 0.15rem;
}

.game-select-wrap {
  position: relative;
}

.game-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 50;
  background: #0f1729;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 0.8rem;
  padding: 0.5rem;
  min-width: 240px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: none;
}

.game-dropdown.open {
  display: block;
}

.game-dropdown input {
  width: 100%;
  background: #131c33;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 0.5rem;
  padding: 0.5rem 0.7rem;
  color: #e5e7eb;
  font-size: 0.85rem;
  box-sizing: border-box;
  margin-bottom: 0.4rem;
  font-family: inherit;
}

.gd-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  background: transparent;
  border: none;
  color: #cbd5e1;
  padding: 0.55rem 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
}

.gd-item:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #e5e7eb;
}

.gd-item.active {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  font-weight: 700;
}

.gd-item .gd-count {
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.6;
}

.map-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.map-pill {
  padding: 0.4rem 0.85rem;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #d8b4fe;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
}

.map-pill.active {
  background: linear-gradient(135deg, #3d6fa8, #7c3aed);
  color: #fff;
  border-color: transparent;
}

.cat-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.cat-pill {
  padding: 0.45rem 0.95rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(31, 41, 55, 0.95);
  color: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cat-pill:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #e5e7eb;
}

.cat-pill.active {
  background: linear-gradient(135deg, #5b8bc4, #0ea5e9);
  color: #020617;
  border-color: transparent;
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.85rem;
}

.card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(31, 41, 55, 0.95);
  border-radius: 0.85rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.cover-carousel {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cc-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
}

.cc-img.active {
  opacity: 1;
}

.cc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

.card:hover .cc-nav {
  opacity: 1;
}

.cc-nav:hover {
  background: rgba(56, 189, 248, 0.7);
}

.cc-prev {
  left: 6px;
}

.cc-next {
  right: 6px;
}

.cc-nav:hover {
  background: rgba(56, 189, 248, 0.6);
}

.cc-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 4px;
}

.cc-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.2s;
}

.cc-dot.active {
  background: #fff;
  width: 16px;
}

.card-badges {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.card-badge {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.card-badge.bump {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-color: transparent;
}

.card-badge.auto {
  background: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.5);
}

.card-badge.sold {
  background: rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.5);
}

.fav-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
  color: #fff;
}

.fav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.08);
}

.fav-btn.fav-on {
  background: rgba(239, 68, 68, 0.85);
  border-color: #ef4444;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.stock-mini {
  font-size: 0.68rem;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.seller-mini {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.75;
  margin-top: 0.3rem;
}

.empty {
  padding: 3rem;
  text-align: center;
  opacity: 0.65;
  font-size: 0.9rem;
  grid-column: 1/-1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(31, 41, 55, 0.95);
  border-radius: 0.85rem;
}

/* ===== Filter Drawer ===== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 200;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.99);
  border-left: 1px solid rgba(31, 41, 55, 0.95);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 201;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.drawer-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0.3rem 0.5rem;
  border-radius: 0.4rem;
}

.drawer-close:hover {
  color: #e5e7eb;
  background: rgba(148, 163, 184, 0.1);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
}

.drawer-foot {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  display: flex;
  gap: 0.6rem;
}

.drawer-foot button {
  flex: 1;
  padding: 0.65rem;
  border-radius: 0.55rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-clear {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.btn-clear:hover {
  background: rgba(148, 163, 184, 0.08);
}

.btn-apply {
  background: linear-gradient(135deg, #5b8bc4, #0ea5e9);
  color: #020617;
  border: none;
}

.filter-section {
  margin-bottom: 1.2rem;
}

.filter-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.55rem;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.86rem;
}

.filter-check:hover {
  background: rgba(56, 189, 248, 0.06);
}

.filter-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.price-inputs>div {
  position: relative;
}

.price-inputs input {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
  padding: 0.45rem 0.6rem 0.45rem 1.3rem;
  border-radius: 0.4rem;
  font-family: inherit;
  font-size: 0.85rem;
}

.price-inputs input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
}

.price-inputs .ccy {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: #fbbf24;
  font-weight: 600;
  font-size: 0.85rem;
  pointer-events: none;
}

.sort-select {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
  padding: 0.5rem 0.65rem;
  border-radius: 0.4rem;
  font-family: inherit;
  font-size: 0.86rem;
}

.sort-select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
}

@media (max-width: 768px) {
  .toolbar {
    gap: 0.4rem;
  }

  .toolbar-btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
  }

  .search-wrap {
    min-width: 100%;
    order: -1;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 0.65rem;
  }
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 0.55rem;
  }

  .card .body {
    padding: 0.55rem 0.65rem 0.7rem;
  }

  .title {
    font-size: 0.82rem;
  }

  .cat-pills {
    gap: 0.3rem;
  }

  .cat-pill {
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
  }
}

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

/* Skeleton loading */
.skel-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(31, 41, 55, 0.95);
  border-radius: 0.85rem;
  overflow: hidden;
}

.skel-cover {
  width: 100%;
  aspect-ratio: 16/10;
  background: rgba(148, 163, 184, 0.08);
}

.skel-line {
  height: 12px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.1);
  margin: 0.5rem 0.85rem;
}

.skel-line.short {
  width: 50%;
}

@keyframes shimmer {
  0% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.8;
  }

  100% {
    opacity: 0.4;
  }
}

.skel-card .skel-cover,
.skel-card .skel-line {
  animation: shimmer 1.4s ease-in-out infinite;
}
