@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  --accent-primary: #00C2A8;
  --accent-secondary: #1E8CFF;
  --bg: #0B0F14;
  --surface: #121923;
  --surface-2: #16202B;
  --border: #1F2A36;
  --text-main: #E6EDF3;
  --text-soft: #A8B3C2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(30, 140, 255, 0.08), transparent 60%),
    var(--bg);
}

.app-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: grid;
  gap: 20px;
}

.panel {
  background: linear-gradient(180deg, rgba(18, 25, 35, 0.98), rgba(18, 25, 35, 0.92));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 6px;
}

.brand-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.brand-url {
  display: none;
}

.header-link {
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
  color: #A8B3C2;
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-link:hover {
  color: #1E8CFF;
}

.header-link-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.header-link:hover .header-link-arrow {
  opacity: 1;
}

.controls-panel {
  padding: 18px;
}

.search-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.wallet-input,
.th-filter {
  background: rgba(11, 15, 20, 0.9);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  transition: all 0.2s ease;
}

.wallet-input {
  flex: 1;
  width: 100%;
  min-width: 260px;
  padding: 14px 16px;
  font-size: 16px;
}

.wallet-input::placeholder {
  color: #7f8b9a;
}

.wallet-input:focus,
.th-filter:focus {
  outline: none;
  border-color: rgba(30, 140, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(30, 140, 255, 0.18), 0 0 18px rgba(0, 194, 168, 0.12);
}

.primary-btn {
  border: 1px solid transparent;
  background: var(--accent-primary);
  color: #052722;
  border-radius: 12px;
  padding: 14px 18px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 18px rgba(0, 194, 168, 0.25);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 194, 168, 0.32);
}

.status-line {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.status-copyable {
  min-height: 24px;
}

.status-copy-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.status-copy-btn:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-panel {
  padding: 12px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  padding: 12px 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
}

tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  transition: all 0.2s ease;
}

tbody tr:hover td {
  background: var(--surface-2);
}

tbody tr:hover td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

tbody tr:hover td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

img.nft-img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
}

img.nft-img.loaded {
  opacity: 1;
}

.thumb-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  background: rgba(11, 15, 20, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.thumb-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  margin-left: -8px;
  border: 2px solid rgba(230, 237, 243, 0.26);
  border-top-color: var(--accent-secondary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.thumb-spinner.hidden {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.gold,
.silver,
.bronze {
  font-weight: 700;
}

.gold {
  color: #f4c24d;
}

.silver {
  color: #c8d2de;
}

.bronze {
  color: #cf8e57;
}

.rank-tier {
  margin-bottom: 2px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.listing-line {
  color: var(--text-main);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.listing-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.listing-link:hover {
  text-decoration: underline;
}

.listing-unlisted {
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.th-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.th-sort {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}

.th-sort:hover {
  color: #d5dee8;
}

.th-label {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.th-filter {
  min-width: 130px;
  padding: 6px 8px;
  font-size: 13px;
}

.sort-indicator {
  display: inline-flex;
  flex-direction: column;
  line-height: 8px;
  color: #5f6b78;
  min-width: 10px;
}

.sort-indicator .up,
.sort-indicator .down {
  font-size: 9px;
}

.sort-indicator.is-asc .up,
.sort-indicator.is-desc .down {
  color: var(--accent-secondary);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  image-rendering: pixelated;
  border: 1px solid var(--border);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  font-size: 40px;
  color: var(--text-main);
  cursor: pointer;
}

.site-footer {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
  text-align: center;
  opacity: 0.85;
}

.site-footer a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 20px 16px 36px;
  }

  .panel {
    padding: 12px;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn {
    width: 100%;
  }

  .th-wrap {
    flex-wrap: wrap;
    gap: 6px;
  }

  .th-filter {
    min-width: 112px;
  }

  thead th,
  tbody td {
    padding: 10px 8px;
  }
}
