/* MatrixV2-aligned store theme */
:root {
  --bg-primary: #0f0d15;
  --bg-card: rgba(14, 14, 20, 0.7);
  --text-primary: #ffffff;
  --text-secondary: #b1bad3;
  --text-muted: #7f8fa4;
  --blue: #1475e1;
  --purple: #7c5cfc;
  --purple-light: #9b8afb;
  --purple-dark: #5b45e8;
  --accent-green: #00e701;
  --danger: #ff6b8a;
  --border-purple: rgba(155, 138, 251, 0.32);
  --border-purple-soft: rgba(155, 138, 251, 0.2);
  --panel-bg: linear-gradient(145deg, rgba(15, 13, 21, 0.86) 0%, rgba(24, 18, 42, 0.78) 45%, rgba(14, 18, 34, 0.82) 100%);
  --panel-shadow:
    0 0 0 1px rgba(124, 92, 252, 0.14),
    0 10px 36px rgba(124, 92, 252, 0.16),
    0 4px 24px rgba(124, 92, 252, 0.07);
  --font-primary: "Inter", system-ui, sans-serif;
  --font-heading: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.2s ease;
  --heading-glow: 0 0 24px rgba(124, 92, 252, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-primary);
  color: var(--text-primary);
  background: var(--bg-primary);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 15% -10%, rgba(124, 92, 252, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 40% at 90% 10%, rgba(20, 117, 225, 0.18), transparent 50%),
    var(--bg-primary);
}

a { color: var(--purple-light); text-decoration: none; }
a:hover { color: #fff; }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 40;
  margin: 16px auto 0;
  width: min(1120px, calc(100% - 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-xl);
  background: var(--panel-bg);
  border: 1px solid var(--border-purple);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
}

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-shadow: var(--heading-glow);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.25s ease, opacity 0.25s ease;
  min-width: 0;
}
.logo:hover { transform: scale(1.02); opacity: 0.95; }
.logo-img-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(155, 138, 251, 0.22),
    0 0 14px rgba(124, 92, 252, 0.14);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}
.logo:hover .logo-img-wrap {
  box-shadow:
    0 0 0 1px rgba(155, 138, 251, 0.35),
    0 0 22px rgba(124, 92, 252, 0.28);
  transform: rotate(-5deg) scale(1.05);
}
.logo-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-text-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  line-height: 0;
}
.logo-text-img {
  width: auto;
  height: clamp(1.75rem, 4.2vw, 2.45rem);
  max-width: min(240px, 48vw);
  object-fit: contain;
  object-position: left center;
  display: block;
  filter: drop-shadow(0 0 10px rgba(124, 92, 252, 0.2));
  transition: filter 0.25s ease;
}
.logo:hover .logo-text-img {
  filter: drop-shadow(0 0 14px rgba(124, 92, 252, 0.38));
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-purple-soft);
  background: rgba(155, 138, 251, 0.08);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav a, .nav button {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav a:hover, .nav button:hover, .nav a.active {
  color: #fff;
  background: rgba(155, 138, 251, 0.13);
}

.points-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 231, 1, 0.1);
  border: 1px solid rgba(0, 231, 1, 0.35);
  color: #d4ffe0;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
.points-chip-sm { padding: 0.25rem 0.55rem; font-size: 0.8rem; }

.section-heading {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
  min-width: min(100%, 280px);
}
.search-row input {
  flex: 1;
  min-width: 160px;
}

.btn-sm {
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  line-height: 0;
}
.btn-block { width: 100%; }

.admin-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(155, 138, 251, 0.12);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: rgba(124, 92, 252, 0.2);
}
.avatar-btn {
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
  transition: var(--transition);
}
.avatar-btn:hover {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.25);
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.link-btn:hover strong {
  color: #fff;
  text-decoration: underline;
}
.avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.points-adjust {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.delta-input {
  width: 4.5rem;
  padding: 0.4rem 0.5rem;
}

.thumb-empty {
  display: inline-block;
  background: rgba(155, 138, 251, 0.12);
}

.span-all { grid-column: 1 / -1; }
.form-stack { grid-template-columns: 1fr !important; }
.modal-title {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
}

.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0;
}
.login-card { width: min(400px, 100%); }
.login-logo { margin-bottom: 1.25rem; }
.login-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
}
.login-sub {
  color: var(--text-muted);
  margin: 0.4rem 0 1.25rem;
}

.data-table code {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .site-header {
    top: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    padding: 0.75rem 0.9rem;
  }
  .nav-toggle { display: flex; margin-left: auto; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding-top: 0.35rem;
  }
  .nav.open { display: flex; }
  .nav .btn, .nav .points-chip { width: 100%; justify-content: center; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem; }
  .hero h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .main { padding: 1.25rem 0 3rem; }
  .container { width: min(1120px, calc(100% - 1.25rem)); }

  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-purple-soft);
  }
  .data-table td {
    border: none;
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .data-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  .data-table td:first-child {
    justify-content: flex-start;
    margin-bottom: 0.35rem;
  }
  .data-table td:first-child::before { display: none; }
  .points-adjust { width: 100%; justify-content: flex-end; }
}

@media (max-width: 480px) {
  .logo-text-img { max-width: 140px; height: 1.45rem; }
  .item-card .desc { -webkit-line-clamp: 2; }
  .chips { gap: 0.35rem; }
  .chip { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}

@media (max-width: 700px) {
  .claim-row { grid-template-columns: 48px 1fr; }
}


.main {
  padding: 2rem 0 4rem;
}

.hero {
  margin: 1.5rem 0 2rem;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-shadow: var(--heading-glow);
}

.hero p {
  margin: 0.65rem 0 0;
  color: var(--text-secondary);
  max-width: 36rem;
  line-height: 1.5;
}

.panel-glass {
  background: var(--panel-bg);
  border: 1px solid var(--border-purple);
  border-radius: var(--radius-lg);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
  padding: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 8px 24px rgba(124, 92, 252, 0.28);
}

.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }

.btn-kick {
  background: #53fc18;
  color: #000;
  box-shadow: 0 8px 24px rgba(83, 252, 24, 0.25);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-purple);
  box-shadow: none;
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(255, 107, 138, 0.5);
  color: var(--danger);
  box-shadow: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.store-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
}

.store-search {
  flex: 1;
  min-width: min(100%, 220px);
}
.store-search input {
  width: 100%;
}

.catalog-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.claim-btn {
  margin-top: 0.75rem;
  width: 100%;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin: 1.5rem 0 0.5rem;
}

.page-btn {
  min-width: 2.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-purple-soft);
  background: rgba(155, 138, 251, 0.08);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}
.page-btn:hover:not(:disabled) {
  color: #fff;
  border-color: var(--purple);
}
.page-btn.active {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .store-toolbar { align-items: stretch; }
  .catalog-meta { white-space: normal; }
}


.chip {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-purple-soft);
  background: rgba(155, 138, 251, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.chip:hover, .chip.active {
  color: #fff;
  border-color: var(--purple);
  background: rgba(124, 92, 252, 0.22);
}

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

.item-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-purple);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  transition: var(--transition);
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124, 92, 252, 0.28);
}

.item-media {
  width: 100%;
  aspect-ratio: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.item-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.item-card .body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.item-card h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
}

.item-card .desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cost {
  color: #d4ffe0;
  font-weight: 700;
  font-size: 0.95rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(155, 138, 251, 0.15);
  color: var(--text-secondary);
}

.badge.oos { background: rgba(255, 107, 138, 0.15); color: var(--danger); }

.status {
  min-height: 1.25rem;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.status.ok { color: var(--accent-green); }
.status.err { color: var(--danger); }

.empty, .loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.hidden { display: none !important; }

/* Admin */
.admin-layout { padding-top: 1rem; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-purple-soft);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
}
.tab.active {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  border-color: transparent;
}

.table-wrap { overflow-x: auto; margin-top: 1rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border-purple-soft);
  vertical-align: middle;
}
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; }
.thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: rgba(0,0,0,0.3);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
input, textarea, select {
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-purple-soft);
  background: rgba(10, 10, 16, 0.85);
  color: var(--text-primary);
  font: inherit;
}
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1rem;
}
.modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
}
.modal-wide {
  width: min(560px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.modal-head .modal-title {
  margin: 0;
}
.modal-body {
  max-height: min(60vh, 480px);
  overflow: auto;
}

.points-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.points-log-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-purple-soft);
  background: rgba(0, 0, 0, 0.22);
}
.points-log-delta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  padding-top: 0.1rem;
}
.delta-pos { color: #9dffb5; }
.delta-neg { color: #ff9d9d; }
.points-log-body strong {
  display: block;
  margin-bottom: 0.2rem;
}
.points-log-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.profile-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-purple);
}
.claim-list { display: grid; gap: 0.75rem; }
.claim-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem;
}

.profile-form {
  padding: 1rem 1.15rem 1.15rem;
  margin-bottom: 1.5rem;
}
.form-hint {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.stake-badge {
  margin: -0.35rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.stake-badge.verified { color: #9dffb5; }
.stake-badge.unverified { color: var(--text-muted); }

.stake-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.wallet-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  max-width: 220px;
}
.wallet-tag {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.wallet-code {
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-full {
  word-break: break-all;
  font-size: 0.85rem;
}
.text-muted { color: var(--text-muted); }
.badge-ok {
  background: rgba(80, 200, 120, 0.18);
  color: #9dffb5;
  border-color: rgba(80, 200, 120, 0.35);
}

.admin-user-profile {
  display: grid;
  gap: 1rem;
}
.admin-user-profile-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-purple);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  background: rgba(124, 92, 252, 0.2);
  color: #fff;
}
.admin-user-name {
  margin: 0 0 0.4rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}
.profile-fields {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.profile-field dt {
  margin: 0 0 0.2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-field dd {
  margin: 0;
}
.profile-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-purple-soft);
  background: rgba(0, 0, 0, 0.22);
}
.profile-field-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.profile-field-value {
  margin-right: 0.5rem;
  font-size: 0.95rem;
}
