/* TrifangX Shop — dedicated page (light theme, aligned with season track / site) */

.cs-main {
  flex: 1;
  width: 100%;
  padding: 0 0 2rem;
  max-width: none;
  margin: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 40%, rgba(167, 139, 250, 0.1), transparent 50%),
    linear-gradient(165deg, #ecfeff 0%, #f0fdf4 35%, #faf5ff 70%, #fffbeb 100%);
  background-color: #f8fafc;
  min-height: calc(100vh - 120px);
}

.cs-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
  text-align: center;
}

.cs-hero-inner {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.99) 100%);
  border-radius: 20px;
  padding: 1.75rem 1.5rem 1.5rem;
  border: 1px solid rgba(13, 148, 136, 0.18);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 16px 40px rgba(15, 118, 110, 0.08);
}

.cs-tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #0f766e;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cs-hero h2 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 900;
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
  color: #0f172a;
}

.cs-hero-sub {
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 auto 1.15rem;
  max-width: 540px;
}

.cs-wallet {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

.cs-wallet-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b45309;
  font-weight: 600;
}

.cs-wallet-value {
  font-family: "Orbitron", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #92400e;
}

.cs-wallet-value span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #d97706;
  margin-left: 0.1rem;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-width: 1100px;
  margin: 0 auto 1.25rem;
  padding: 0 1.25rem;
}

.cs-stat {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.55), rgba(204, 251, 241, 0.45));
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  text-align: center;
}

.cs-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.cs-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f766e;
  font-family: "DM Sans", sans-serif;
}

.cs-stat-value--accent {
  color: #d97706;
}

.cs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  align-items: start;
}

.cs-sidebar {
  position: sticky;
  top: 1rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.99));
  border: 1px solid rgba(13, 148, 136, 0.18);
  border-radius: 16px;
  padding: 0.65rem;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.06);
}

.cs-nav-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  font-weight: 700;
  padding: 0.45rem 0.65rem 0.3rem;
}

.cs-cat-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.15rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}

.cs-cat-btn:hover {
  background: rgba(224, 242, 254, 0.7);
  color: #0f172a;
}

.cs-cat-btn.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(45, 212, 191, 0.12));
  color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.25);
}

.cs-cat-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.cs-cat-text strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

.cs-cat-text small {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 0.05rem;
  line-height: 1.25;
}

.cs-sidebar-links {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cs-sidebar-links a {
  display: block;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  color: #64748b;
  text-decoration: none;
  border-radius: 8px;
}

.cs-sidebar-links a:hover {
  color: #0f766e;
  background: rgba(204, 251, 241, 0.5);
}

.cs-content {
  min-width: 0;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.99));
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 16px;
  padding: 1rem 1rem 1.25rem;
  box-shadow: 0 8px 28px rgba(15, 118, 110, 0.06);
}

.cs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  align-items: center;
}

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

.cs-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #94a3b8;
  pointer-events: none;
}

#shop-search {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}

#shop-search:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

#shop-filter,
#shop-sort {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 0.85rem;
  font-family: inherit;
}

.cs-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.cs-section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.cs-section-head p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.cs-featured {
  margin-bottom: 1rem;
}

.cs-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.cs-featured-card {
  background: linear-gradient(135deg, #eff6ff, #ecfdf5);
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cs-featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.12);
}

.cs-featured-card h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.cs-featured-card .cs-feat-price {
  font-size: 0.82rem;
  color: #d97706;
  font-weight: 700;
}

/* Item grid */
#shop-items-container.cs-grid,
.cs-grid.shop-items-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
  padding: 0;
}

.cs-grid .shop-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 0.75rem 0.75rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  position: relative;
}

.cs-grid .shop-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  border-color: rgba(13, 148, 136, 0.35);
}

.cs-grid .shop-item.unlocked {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(165deg, #f0fdf4 0%, #fff 100%);
}

.cs-grid .shop-item.locked {
  opacity: 0.88;
  filter: none;
}

.cs-grid .shop-item-name {
  color: #1e293b;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.cs-grid .shop-item-desc {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.35;
  margin: 0.25rem 0;
}

.cs-grid .shop-item-price {
  color: #d97706;
  font-size: 0.95rem;
  margin: 0.35rem 0;
}

/* Compact previews */
.cs-grid .shop-item-preview {
  background: #f1f5f9;
  border-radius: 10px;
  min-height: 0;
  height: auto;
  max-height: 92px;
  margin: 0.35rem 0;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cs-grid .shop-item-preview-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
}

.shop-preview-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  width: 72px;
  height: 72px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.shop-preview-cell {
  min-width: 0;
  min-height: 0;
}

.cs-grid .shop-preview-board {
  width: 56px;
  height: 56px;
}

.cs-grid .shop-preview-pieces {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-wrap: nowrap;
  max-width: 100%;
}

.cs-grid .shop-preview-piece {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.cs-grid .shop-preview-swatch {
  width: 36px;
  height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
}

.cs-grid .shop-preview-arrow {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-grid .shop-preview-arrow svg {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px;
  max-height: 22px;
  display: block;
}

.cs-grid .shop-preview-theme {
  width: 72px;
  height: 44px;
  border-radius: 6px;
}

.cs-grid .shop-preview-legal-dot {
  width: 20px;
  height: 20px;
}

.cs-grid .shop-preview-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.cs-grid .shop-preview-lb-row {
  min-height: 32px !important;
  max-height: 36px;
}

.cs-grid .shop-preview-hint {
  font-size: 0.6rem;
  color: #94a3b8;
}

.cs-grid .shop-item-button {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.cs-grid .shop-item-button.unlock {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
}

.cs-grid .shop-item-button.equip {
  background: linear-gradient(135deg, #0d9488, #0891b2);
  color: #fff;
}

.cs-grid .shop-item-button.equipped {
  background: #d1fae5;
  color: #047857;
}

.cs-grid .shop-item-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.shop-item-rarity {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.shop-item-rarity.rarity-8,
.shop-item-rarity.rarity-9,
.shop-item-rarity.rarity-10 {
  color: #7c3aed;
}

.shop-item-equipped-pill {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #047857;
  background: #d1fae5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.cs-empty,
.cs-loading {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #64748b;
  font-size: 0.95rem;
}

.cs-stubs {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Confirm modal */
#shop-confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#shop-confirm-modal.show {
  display: flex;
}

.shop-confirm-dialog {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.35rem;
  max-width: 400px;
  width: 100%;
  color: #334155;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.shop-confirm-dialog h3 {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  color: #0f172a;
}

#shop-confirm-message {
  margin: 0 0 1rem;
  line-height: 1.5;
  color: #64748b;
}

.shop-confirm-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
}

.shop-confirm-actions button {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
}

#shop-confirm-cancel {
  background: #f1f5f9;
  color: #475569;
}

#shop-confirm-ok {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
}

#notification-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10060;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 340px;
  pointer-events: none;
}

#notification-toast .toast-item {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#notification-toast .toast-item.success {
  border-color: #6ee7b7;
  background: #ecfdf5;
  color: #065f46;
}

#notification-toast .toast-item.error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

#notification-toast .toast-item.info {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e40af;
}

#notification-toast .toast-item.warning {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.generic-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.generic-confirm-overlay.show {
  display: flex;
}

.generic-confirm-dialog {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  border: 2px solid #3498db;
}

.generic-confirm-dialog h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: #2c3e50;
}

.generic-confirm-dialog p {
  margin: 0 0 18px;
  color: #5a6c7d;
  line-height: 1.5;
  font-size: 0.95rem;
}

.generic-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
}

.generic-confirm-actions button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.generic-confirm-cancel {
  background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
  color: #555;
}

.generic-confirm-ok {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
}

@media (max-width: 900px) {
  .cs-layout {
    grid-template-columns: 1fr;
  }

  .cs-sidebar {
    position: static;
  }

  .cs-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  #shop-items-container.cs-grid,
  .cs-grid.shop-items-container {
    grid-template-columns: 1fr;
  }
}
