:root {
  --hub-bg: var(--bg-primary);
  --hub-panel: var(--bg-card);
  --hub-border: var(--border-primary);
  --hub-text: var(--text-primary);
  --hub-muted: var(--text-muted);
  --hub-accent: var(--primary-color);
}

body.hub-page {
  margin: 0;
  color: var(--hub-text);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 100% 80% at 15% -10%, rgba(124, 58, 237, 0.22), transparent 50%),
    radial-gradient(ellipse 80% 60% at 95% 10%, rgba(34, 211, 238, 0.12), transparent 45%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(219, 39, 119, 0.1), transparent 55%),
    var(--gradient-dark);
  background-attachment: fixed;
  font-family: var(--font-body, var(--font-secondary));
}

.hub-main {
  padding-top: 96px;
  padding-bottom: 2rem;
}

.hub-container {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

.hub-hero {
  border: 1px solid var(--hub-border);
  border-radius: 14px;
  background: var(--gradient-card);
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.hub-hero h1 {
  margin: 0.5rem 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.hub-kicker {
  margin: 0;
  font-size: 0.8rem;
  color: var(--hub-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hub-sub {
  margin: 0;
  color: var(--hub-muted);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.hub-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.9rem;
}

.hub-card {
  border: 1px solid var(--hub-border);
  border-radius: 14px;
  background: var(--gradient-card);
  padding: 1rem;
}

.hub-card h2,
.hub-card h3 {
  margin-top: 0;
}

.hub-card p,
.hub-card li,
.hub-card label,
.hub-card small {
  color: var(--hub-muted);
}

.hub-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.hub-input,
.hub-select {
  width: 100%;
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.55rem 0.7rem;
}

.hub-list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.hub-list li {
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  background: rgba(26, 15, 40, 0.7);
  padding: 0.55rem 0.65rem;
}

.hub-filters {
  border: 1px solid var(--hub-border);
  border-radius: 14px;
  background: rgba(18, 10, 28, 0.82);
  padding: 0.75rem;
  margin-bottom: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.hub-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.hub-stat {
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  background: rgba(18, 10, 28, 0.82);
  padding: 0.7rem;
}

.hub-stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--hub-accent);
}

.hub-table-wrap {
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  overflow: auto;
  background: rgba(18, 10, 28, 0.82);
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.hub-table th,
.hub-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-primary);
  text-align: left;
}

.hub-table th {
  color: var(--text-secondary);
  font-weight: 700;
}

.deck-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.deck-pane {
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  background: rgba(18, 10, 28, 0.82);
  padding: 0.6rem;
}

.deck-pane h3 {
  margin-top: 0;
}

@media (max-width: 980px) {
  .hub-grid-2 {
    grid-template-columns: 1fr;
  }
  .deck-columns {
    grid-template-columns: 1fr;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-secondary);
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.hub-status {
  display: block;
  margin-top: 0.55rem;
  color: var(--text-secondary);
}

.nav-item--group {
  position: relative;
  padding-bottom: 4px;
}

.nav-link--group {
  cursor: pointer;
}

.nav-submenu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  border: 1px solid rgba(124, 58, 237, 0.45);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 10, 28, 0.97), rgba(10, 7, 18, 0.98));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
  z-index: 50;
}

.nav-item--group:hover .nav-submenu,
.nav-item--group:focus-within .nav-submenu,
.nav-item--group.is-open .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-sublink {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-sublink--button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.nav-sublink:hover {
  background: rgba(124, 58, 237, 0.22);
  color: var(--text-primary);
}

.favorites-hero {
  position: relative;
  overflow: hidden;
}

.favorites-hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.2), transparent 65%);
  pointer-events: none;
}

.favorites-stats {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.favorites-stat {
  border: 1px solid rgba(124, 58, 237, 0.5);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(12, 8, 20, 0.85);
  animation: favFadeIn 520ms ease both;
}

.favorites-stat strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.3rem;
  color: #f6f0ff;
}

.favorites-deck-hub {
  margin-bottom: 1rem;
}

.favorites-toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.favorites-toolbar h2 {
  margin: 0;
  flex: 1 1 200px;
}

.favorites-toolbar .hub-select {
  max-width: 180px;
}

.favorites-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.favorites-search-input {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
}

.favorites-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.8rem;
}

.favorites-grid--stack .favorite-card:nth-child(odd) {
  transform: rotate(-2.8deg) translateY(-3px);
}

.favorites-grid--stack .favorite-card:nth-child(even) {
  transform: rotate(2.8deg) translateY(3px);
}

.favorites-grid--3d {
  perspective: 1300px;
}

.favorites-grid--3d .favorite-card {
  transform-style: preserve-3d;
}

.favorites-grid--3d .favorite-card:hover {
  transform: rotateY(12deg) rotateX(6deg) translateY(-8px);
}

.favorite-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.8rem;
  border: 1px solid rgba(124, 58, 237, 0.38);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(20, 12, 34, 0.9), rgba(12, 9, 21, 0.92));
  padding: 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  animation: favFadeIn 380ms ease both;
}

.favorite-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
}

.favorites-pagination {
  margin-top: 0.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

#favorites-stack.is-active,
#favorites-3d.is-active {
  border-color: rgba(34, 211, 238, 0.8);
  background: rgba(34, 211, 238, 0.15);
  color: #c5f5ff;
}

.favorite-card__media {
  align-self: start;
}

.favorite-card__media img,
.favorite-card__media-placeholder {
  width: 100%;
  max-height: 220px;
  aspect-ratio: 59 / 86;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  object-position: top center;
  background: radial-gradient(ellipse at 50% 20%, rgba(124, 58, 237, 0.2), transparent 55%), #0a0612;
}

.favorite-card__media-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(124, 58, 237, 0.6);
  color: var(--text-secondary);
  background: rgba(25, 15, 38, 0.7);
}

.favorite-card__type {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9be9ff;
  font-size: 0.72rem;
}

.favorite-card__title {
  margin: 0.2rem 0 0.4rem;
  color: #f7f3ff;
}

.favorite-card__meta {
  margin: 0;
  color: #cbc2ea;
}

.favorite-card__desc {
  margin: 0.45rem 0 0.35rem;
  color: #b7afcf;
  font-size: 0.93rem;
}

.favorite-card__desc-label {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9be9ff;
}

.favorite-card__desc-scroll {
  margin: 0 0 0.65rem;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: rgba(8, 6, 16, 0.75);
  color: #dcd5f0;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.favorite-card__ebay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.favorite-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.favorite-empty {
  border: 1px dashed var(--border-secondary);
  border-radius: 10px;
  text-align: center;
}

@keyframes favFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .favorite-card {
    grid-template-columns: 1fr;
  }

  .favorite-card__media img,
  .favorite-card__media-placeholder {
    max-height: 320px;
  }
}
