/* ==========================================================================
   Pons Hub — token market ranking theme
   Palette: dark #0f0f0f..#1b1b1b | accent #FF9000 | text #fff / #A0A0A0
   ========================================================================== */

:root {
  --bg-page: #0f0f0f;
  --bg-body: #1b1b1b;
  --bg-elevated: #202020;
  --bg-hover: #2a2a2a;
  --bg-inset: #161616;
  --accent: #ff9000;
  --accent-strong: #e67f00;
  --accent-soft: rgba(255, 144, 0, 0.14);
  --gold: #ffb43a;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --text-dim: #6f6f6f;
  --border: #2c2c2c;
  --badge-bg: rgba(0, 0, 0, 0.8);
  --verified: #3ea6ff;
  --pos: #22c55e;
  --neg: #ef4444;
  --radius: 8px;
  --header-h: 88px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The hidden attribute must always win over author display rules
   (e.g. .page-layout { display: grid }) when SPA views are toggled. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  background-image: radial-gradient(1200px 500px at 70% -10%, #232323 0%, transparent 60%),
                    linear-gradient(180deg, var(--bg-body) 0%, var(--bg-page) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
svg { display: block; flex: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   0. AGE GATE — exact Pornhub.com layout (black backdrop, centered card)
   ========================================================================== */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #000;
  overflow-y: auto;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.age-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.age-gate-locked { overflow: hidden; }

.age-gate-card {
  width: min(680px, 100%);
  background: #000;
  border: 1px solid #2c2c2c;
  border-radius: 6px;
  padding: 48px 56px 36px;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.age-gate-logo {
  height: 52px;
  width: auto;
  margin: 0 auto 28px;
  display: block;
}
.age-gate-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 18px;
}
.age-notice {
  display: inline-block;
  padding: 8px 22px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 22px;
}
.age-gate-text {
  font-size: 14.5px;
  color: #cccccc;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 14px;
}
.age-gate-law {
  margin-bottom: 24px;
}
.age-gate-law a,
.age-gate-foot a {
  color: var(--accent);
}
.age-gate-law a:hover,
.age-gate-foot a:hover { text-decoration: underline; }

.age-gate-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 30px;
}
.age-gate-actions button {
  flex: 1;
  max-width: 260px;
  padding: 14px 20px;
  background: #000;
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.age-gate-actions button:hover { background: #1a1a1a; }

.age-gate-foot strong {
  display: block;
  color: #cccccc;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.age-gate-foot p {
  font-size: 13px;
  color: #9e9e9e;
  line-height: 1.55;
  margin-bottom: 10px;
}
.age-gate-foot p i { color: #9e9e9e; }

.age-gate-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(680px, 100%);
  padding: 16px 6px 0;
  margin-top: 10px;
}
.age-gate-footer .copyright {
  color: #9e9e9e;
  font-size: 12.5px;
}
.rta-badge {
  width: 84px;
  height: 29px;
  border: 2px solid #fff;
  border-radius: 4px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  display: grid;
  place-items: center;
}

/* ==========================================================================
   0b. PONS PREMIUM — fake subscription modal
   ========================================================================== */

.premium-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(6px);
}
.premium-card {
  position: relative;
  width: min(520px, 100%);
  background: linear-gradient(180deg, #221a0c 0%, var(--bg-body) 40%);
  border: 1px solid var(--accent-strong);
  border-radius: 16px;
  padding: 34px 32px 26px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 144, 0, 0.25), var(--shadow);
}
.premium-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}
.premium-close:hover { color: var(--text); }
.premium-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), #ffb43a);
  color: #1a1206;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.premium-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.premium-sub { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
.premium-perks {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.premium-perks li { font-size: 13.5px; color: var(--text-muted); }
.premium-perks b { color: var(--text); }
.premium-price { font-size: 40px; font-weight: 900; color: var(--accent); letter-spacing: -1px; }
.premium-price span { font-size: 14px; color: var(--text-dim); font-weight: 500; letter-spacing: 0; }
.premium-cta {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 800;
  margin-top: 14px;
}
.premium-cta.premium-renew {
  background: linear-gradient(90deg, #3ea6ff, #7cc4ff);
}
.premium-foot { margin-top: 12px; font-size: 11px; color: var(--text-dim); }

/* ---- Comments section ---- */
.comments-count { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.comment-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: rgba(255, 144, 0, 0.06);
  border: 1px dashed var(--accent-strong);
  border-radius: 10px;
}
.comment-gate p { font-size: 13.5px; color: var(--text-muted); }
.comment-form { margin-bottom: 18px; }
.comment-input {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  resize: vertical;
}
.comment-input:focus { outline: none; border-color: var(--accent); }
.comment-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.comment-as { font-size: 12px; color: var(--text-dim); }
.comment-as b { color: var(--text-muted); }
.comment-list { display: flex; flex-direction: column; }
.comment {
  display: flex;
  gap: 12px;
  padding: 14px 4px;
  border-top: 1px solid var(--border);
}
.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}
.comment-body { min-width: 0; flex: 1; }
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.comment-author { font-weight: 700; font-size: 13px; }
.comment-time { font-size: 11.5px; color: var(--text-dim); }
.comment-text { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.55; }
.comment-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.comment-vote-btn, .comment-reply-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.comment-vote-btn:hover, .comment-reply-btn:hover { border-color: var(--accent); color: var(--text); }
.comment-vote-count { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 14px; text-align: center; }
.comment-reply-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent-strong);
  border-radius: 4px;
  padding: 1px 5px;
}
.comment-children { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 12px; }
.comment-reply-form { margin: 8px 0 8px 8px; }

/* ---- Profile page ---- */
.profile-page { padding: 4px 0 20px; }
.back-row { margin-bottom: 14px; }
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 18px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  background: #2a2a2a;
  flex: none;
}
.profile-title { font-size: 24px; font-weight: 800; }
.profile-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.profile-loading { text-align: center; color: var(--text-dim); padding: 40px 0; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid .dpanel:nth-child(3) { grid-column: 1 / -1; }
.profile-comments { display: flex; flex-direction: column; gap: 12px; }
.profile-comment {
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.profile-comment-token {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
}
.profile-comment-text { font-size: 13px; color: var(--text-muted); }
.profile-tokens { display: flex; flex-direction: column; gap: 8px; }
.profile-token {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}
.profile-token:hover { border-color: var(--accent); }
.profile-token-sym { font-weight: 700; font-size: 13px; }
.profile-token-addr { font-size: 12px; color: var(--text-dim); }

/* ---- 404 page ---- */
.nf-page { text-align: center; padding: 80px 24px; }
.nf-code {
  font-size: 110px;
  font-weight: 900;
  letter-spacing: -4px;
  line-height: 1;
  background: linear-gradient(90deg, var(--accent), #ffb43a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nf-title { font-size: 26px; font-weight: 800; margin: 18px 0 10px; }
.nf-text { font-size: 14.5px; color: var(--text-muted); max-width: 460px; margin: 0 auto 24px; line-height: 1.6; }
.nf-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.nf-wallet { font-size: 12px; color: var(--text-dim); }

/* ---- Top Degens leaderboard ---- */
.leaderboard-section { margin-top: 20px; }
.degen-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}
.degen-row:last-child { border-bottom: none; }
.degen-rank { flex: none; width: 22px; text-align: center; font-size: 14px; }
.degen-wallet { flex: 1; font-weight: 600; color: var(--text); }
.degen-count {
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11.5px;
}

/* ---- Share button + toast ---- */
.share-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 1200;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid var(--accent-strong);
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   1. HEADER BAR — single, larger utility bar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

/* ---- Top utility row ---- */
.header-top {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px;
}

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

.brand-logo {
  display: block;
  height: 52px;
  width: auto;
  border-radius: 8px;
}

/* ---- Search bar ---- */
.search-bar {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  display: grid;
  place-items: center;
  padding: 0 4px 0 16px;
  color: var(--text-muted);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  padding: 13px 8px;
}

.search-bar input::placeholder { color: var(--text-dim); }

.search-btn {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 52px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #111;
  transition: filter 0.15s ease;
}

.search-btn:hover { filter: brightness(1.1); }

/* ---- Header actions ---- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-upload {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-upload:hover { background: var(--bg-hover); }

.btn-upgrade {
  background: linear-gradient(135deg, #ffb43a 0%, #ff9000 60%, #f07f00 100%);
  color: #111;
  box-shadow: 0 3px 12px rgba(255, 144, 0, 0.35);
}

.btn-upgrade:hover { filter: brightness(1.07); }

.lang-select {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.lang-select:hover { background: var(--bg-hover); }
.lang-select .chev { color: var(--text-muted); }

.auth-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  margin-left: 4px;
}

.auth-sep { color: var(--text-dim); }

.auth-login { color: var(--text-muted); }
.auth-login:hover { color: var(--text); }

.auth-signup { color: var(--accent); }
.auth-signup:hover { text-decoration: underline; }

/* ---- Wallet connect button ---- */
.btn-wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ffb43a);
  color: #1a1206;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 2px 10px rgba(255, 144, 0, 0.25);
}
.btn-wallet:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255, 144, 0, 0.35); }
.btn-wallet.connected {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.wallet-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: none;
}
.btn-wallet.connected .wallet-dot { background: var(--pos); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); }

/* ==========================================================================
   2. NOTICE / BANNER STRIP
   ========================================================================== */

.notice-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 20px;
  background: linear-gradient(90deg, rgba(255, 144, 0, 0.16), rgba(255, 144, 0, 0.05));
  border-bottom: 1px solid var(--border);
}

.notice-text {
  font-size: 13.5px;
  color: #e8e8e8;
  text-align: center;
}

.notice-emoji { margin-right: 6px; }

.notice-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.notice-link:hover { color: #ffb43a; }

.notice-dismiss {
  position: absolute;
  right: 18px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.notice-dismiss:hover { background: var(--bg-hover); color: var(--text); }

.notice-bar.is-hidden { display: none; }

/* ==========================================================================
   3. PAGE LAYOUT
   ========================================================================== */

.page-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 28px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  align-items: start;
}

/* ==========================================================================
   4. LEFT FILTER SIDEBAR
   ========================================================================== */

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 26px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.filter-section { display: flex; flex-direction: column; gap: 12px; }

.filter-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- Production filter (segmented toggle) ---- */
.production-toggle {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 3px;
}

.prod-btn {
  flex: 1;
  padding: 7px 6px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.prod-btn:hover { color: var(--text); }
.prod-btn.active {
  background: var(--accent);
  color: #111;
  box-shadow: 0 2px 8px rgba(255, 144, 0, 0.35);
}

/* ---- Duration dual-handle slider ---- */
.dual-range {
  position: relative;
  height: 30px;
  margin: 6px 0 2px;
}

.range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  background: var(--bg-elevated);
  border-radius: 999px;
}

.range-fill {
  position: absolute;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  border-radius: 999px;
}

.range-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: transform 0.1s ease;
}

.range-input::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }

.range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

.duration-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
}

.duration-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ---- Category list ---- */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

.category-list::-webkit-scrollbar { width: 6px; }
.category-list::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 999px; }

.category-item { display: block; }

.category-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.category-link:hover { background: var(--bg-elevated); color: var(--text); }

.category-link.active {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
}

.category-count {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 1px 8px;
}

.category-link.active .category-count { color: var(--accent); }

/* ==========================================================================
   5. MAIN CONTENT AREA
   ========================================================================== */

.main-content { min-width: 0; }

/* ---- Toolbar ---- */
.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.toolbar-left { display: flex; align-items: baseline; gap: 12px; }

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 18px;
  margin-right: 10px;
  vertical-align: -2px;
  border-radius: 3px;
  background: var(--accent);
}

.result-count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Quality toggle (segmented) ---- */
.quality-toggle {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 3px;
}

.quality-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.quality-btn:hover { color: var(--text); }
.quality-btn.active {
  background: var(--accent);
  color: #111;
}

/* ---- Sort select ---- */
.sort-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label-text {
  font-size: 12.5px;
  color: var(--text-dim);
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a0a0a0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 32px 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.sort-select:hover { border-color: var(--accent); }
.sort-select option { background: var(--bg-elevated); color: var(--text); }

/* ==========================================================================
   6. VIDEO CARD GRID
   ========================================================================== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 22px 18px;
}

.video-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 144, 0, 0.45);
  box-shadow: var(--shadow);
}

/* ---- Thumbnail container (16:9) with overlay badges ---- */
.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, transparent 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 1;
}

.video-card:hover .thumb-play {
  opacity: 1;
  background: rgba(255, 144, 0, 0.9);
  border-color: var(--accent);
  color: #111;
}

.thumb-badge {
  position: absolute;
  bottom: 8px;
  z-index: 1;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  background: var(--badge-bg);
  border-radius: 4px;
}

.thumb-badge--hd { left: 8px; color: var(--accent); }
.thumb-badge--dur { top: 44px; right: 8px; bottom: auto; background: rgba(0,0,0,0.7); color: #fff; }

/* ---- Quality badges (HD / 4K / VR) — row below the rank badge ---- */
.thumb-badges-q {
  position: absolute;
  top: 32px;
  left: 8px;
  z-index: 1;
  display: inline-flex;
  gap: 4px;
}
.q-tag {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #111;
}
.q-hd { background: #ffb43a; }
.q-4k { background: #ff9000; }
.q-vr { background: #b06bff; color: #fff; }

/* ---- LIVE badge (fresh launches < 24h) ---- */
.thumb-badge--live {
  top: 32px;
  left: 8px;
  bottom: auto;
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: live-pulse 1.6s ease-in-out infinite;
}
.thumb-badge--live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}
@keyframes live-pulse { 50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25); } }
.thumb-badges-q + .thumb-badge--live { left: 64px; }

/* ---- Favorites heart button (Watch Later) ---- */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.fav-btn:hover { transform: scale(1.12); background: rgba(0, 0, 0, 0.85); }
.fav-btn.faved { color: #ff3b5c; }
.watch-later-btn.active { background: var(--accent); color: #1a1206; border-color: var(--accent); }

/* ---- Autoplay ---- */
.autoplay-btn.active { background: var(--accent); color: #1a1206; border-color: var(--accent); }
.token-card.autoplaying {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 144, 0, 0.15), var(--shadow);
}
.token-card.kb-active {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 144, 0, 0.1), var(--shadow);
}

/* ---- Card body ---- */
.card-body { display: flex; flex-direction: column; gap: 7px; padding: 11px 12px 13px; flex: 1; }

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-title a { color: var(--text); transition: color 0.12s ease; }
.card-title a:hover { color: var(--accent); }

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: auto;
}

.meta-rating { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; }

/* ---- Thumbs rating (PornHub-style approval) ---- */
.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 12.5px;
}
.rating-thumb { font-size: 13px; }
.rating-pct.pos { color: var(--pos); }
.rating-pct.neg { color: var(--neg); }

.meta-verified {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--verified);
  color: #0b0b0b;
  font-size: 10px;
  font-weight: 800;
}

/* ==========================================================================
   7. AD PLACEHOLDER SLOT
   ========================================================================== */

.ad-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border: 1.5px dashed #3a3a3a;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 10px, transparent 10px 20px),
    rgba(255, 255, 255, 0.02);
  text-align: center;
}

.ad-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 10px;
}

.ad-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 3px 10px;
}

.ad-size { font-size: 12px; color: var(--text-dim); }
.ad-slot .ad-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* ==========================================================================
   7b. TOKEN CARD VARIANT
   ========================================================================== */

.thumb {
  background-color: var(--bg-elevated);
}

.thumb-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: #101010;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.thumb-logo--fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.thumb-badge--rank {
  top: 8px;
  left: 8px;
  bottom: auto;
  color: #ff9000;
}

.thumb-badge--chg {
  right: 8px;
  bottom: 8px;
}

.chg-pos { color: #22c55e; }
.chg-neg { color: #ef4444; }

.thumb-badge--launchpad {
  left: 8px;
  bottom: 8px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.6px;
}

.token-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.token-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.stat-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}

.stat-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value.mcap { color: var(--accent); }

.card-meta .meta-verified { margin-left: 0; }

/* ==========================================================================
   8. EMPTY STATE + FOOTER
   ========================================================================== */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
  background: var(--bg-inset);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ---- Related Searches (PornHub-style tag cloud) ---- */
.related-searches {
  max-width: 1400px;
  margin: 8px auto 0;
  padding: 22px 24px 6px;
  border-top: 1px solid var(--border);
}
.rs-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.rs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rs-tag {
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 12.5px;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.rs-tag:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--bg-hover);
}

.site-footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-dim);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

/* ---- Footer popular tags ---- */
.footer-popular {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.footer-popular-label { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; }
.footer-tags { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.footer-tag {
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 3px 11px;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.footer-tag:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Featured carousel (PornHub-style banner) ---- */
.featured {
  margin-bottom: 18px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0a0a;
}
.featured-viewport {
  display: flex;
  transition: transform 0.6s ease;
}
.featured-slide {
  flex: 0 0 100%;
  min-height: 210px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 22px 26px;
  text-decoration: none;
}
.featured-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.25) 60%, transparent 100%);
}
.featured-logo {
  position: absolute;
  top: 22px;
  left: 26px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: #101010;
}
.featured-logo--fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
}
.featured-info { position: relative; z-index: 1; }
.featured-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--accent);
  color: #1a1206;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}
.featured-name { font-size: 30px; font-weight: 900; letter-spacing: -0.5px; }
.featured-sub { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.featured-stats { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 14px; }
.featured-price { font-weight: 800; font-size: 17px; }
.featured-chg { font-weight: 800; }
.featured-cap { color: var(--text-muted); font-size: 13px; }
.featured-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #0a0a0a;
}
.featured-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: #3a3a3a;
  transition: background 0.15s ease, transform 0.15s ease;
}
.featured-dot.active { background: var(--accent); transform: scale(1.25); }

/* ---- Recommended for you row ---- */
.rec-row { margin-bottom: 20px; }
.rec-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.rec-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.rec-item:hover { border-color: var(--accent); background: var(--bg-hover); }
.rec-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #101010;
  flex: none;
}
.rec-logo--fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}
.rec-body { min-width: 0; }
.rec-sym { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ==========================================================================
   9. TOKEN DETAIL PAGE
   ========================================================================== */

.detail-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.detail-container { min-width: 0; }

.detail-loading,
.detail-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 50vh;
  color: var(--text-muted);
}

.detail-error h2 { font-size: 22px; color: var(--text); }

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

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

/* ---- Head ---- */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  margin-bottom: 12px;
  transition: color 0.15s ease;
}

.back-btn:hover { color: var(--accent); }

.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: #101010;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  flex: none;
}

.detail-logo--fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.detail-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-badges { display: inline-flex; gap: 6px; }

.vd-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 999px;
}

.vd-good { background: rgba(34, 197, 94, 0.16); color: var(--pos); border: 1px solid rgba(34, 197, 94, 0.4); }
.vd-bad { background: rgba(239, 68, 68, 0.16); color: var(--neg); border: 1px solid rgba(239, 68, 68, 0.4); }

.detail-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.detail-lp { position: static; }

.detail-addr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  max-width: 100%;
}

.copy-btn {
  border: none;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  transition: background 0.15s ease, color 0.15s ease;
}

.copy-btn:hover { background: var(--accent); color: #111; }

.detail-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  margin-left: auto;
}

.detail-price-block { text-align: right; }

.detail-price {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.detail-change { font-size: 14px; font-weight: 700; margin-top: 2px; }

.detail-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ---- Satisfaction meter (pleasure level) ---- */
.satisfaction {
  margin-top: 10px;
  min-width: 180px;
  text-align: left;
}
.sat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}
.sat-track {
  height: 10px;
  border-radius: 6px;
  background: #1c1c1c;
  border: 1px solid var(--border);
  overflow: hidden;
}
.sat-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.sat-fill.up { background: linear-gradient(90deg, #22c55e, #4ade80); }
.sat-fill.down { background: linear-gradient(90deg, #ef4444, #f87171); }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.35; } }

.trade-btn { padding: 11px 22px; font-size: 14px; }

/* ---- Launchpad deep-link button ---- */
.btn-launchpad {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-launchpad:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-hover); }

/* ---- Stats grid ---- */
.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.dstat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}

.dstat-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}

.dstat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dstat-value.dstat-accent { color: var(--accent); }

/* ---- Main grid ---- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.detail-main { min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 18px; }

.dpanel {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.dpanel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ---- Chart ---- */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 1120px;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.chart-empty {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 14px;
}

.chart-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---- Fake video player chrome around the chart ---- */
.player-wrap { display: flex; flex-direction: column; background: #0a0a0a; }
.player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #141414;
  border-bottom: 1px solid var(--border);
}
.player-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.player-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pos);
  animation: pulse 1.8s ease-in-out infinite;
}
.player-views { font-size: 12px; color: var(--text-dim); }
.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #141414;
  border-top: 1px solid var(--border);
}
.player-play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #1a1206;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.player-play:hover { background: #ffb43a; }
.player-time { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.player-spacer { flex: 1; }
.player-quality {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: default;
}
.player-fullscreen {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}
.player-fullscreen:hover { color: var(--text); }

/* ---- Climax markers (ATH/ATL video-timeline highlights) ---- */
.climax-strip {
  padding: 10px 14px 4px;
  border-top: 1px solid var(--border);
}
.climax-track {
  position: relative;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1c1c1c, #2a2a2a);
}
.climax-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 7%, rgba(255,255,255,0.04) 7% 8%);
}
.climax-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}
.climax-emoji { font-size: 15px; line-height: 1; filter: drop-shadow(0 0 4px rgba(0,0,0,0.8)); }
.climax-tag {
  position: absolute;
  top: -8px;
  transform: translateY(-100%);
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
}
.climax-tag-ath { left: 0; background: rgba(34, 197, 94, 0.9); }
.climax-tag-atl { right: 0; background: rgba(239, 68, 68, 0.9); }
.marker-atl .climax-emoji { margin-top: 26px; }
.climax-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ---- Transaction summary (under the chart) ---- */
.txns-summary {
  margin-top: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.txns-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.txns-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.txns-total {
  font-size: 12px;
  color: var(--text-muted);
}

.txns-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-inset);
  margin-bottom: 12px;
}

.txns-bar-buy { background: linear-gradient(90deg, #16a34a, var(--pos)); }
.txns-bar-sell { background: linear-gradient(90deg, #b91c1c, var(--neg)); }

.txns-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px 14px;
}

.txn-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.txn-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}

.txn-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

/* ---- Links ---- */
.dl-links { display: flex; flex-direction: column; gap: 8px; }

.dl-link {
  display: block;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.dl-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Related Tokens (PornHub-style "Related Videos") ---- */
.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.related-item:hover { background: var(--bg-hover); }
.related-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #101010;
  flex: none;
}
.related-logo--fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}
.related-body { min-width: 0; }
.related-title { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---- Up Next (autoplay toast) ---- */
.upnext {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: min(340px, calc(100vw - 48px));
  animation: upnext-in 0.35s ease;
}
.upnext.is-leaving { animation: upnext-out 0.4s ease forwards; }
@keyframes upnext-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes upnext-out { to { opacity: 0; transform: translateY(24px); } }
.upnext-bar {
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: #1c1c1c;
  overflow: hidden;
}
.upnext-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ffb43a);
  transition: width 1s linear;
}
.upnext-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow);
}
.upnext-thumb { flex: none; }
.upnext-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #101010;
}
.upnext-logo--fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
}
.upnext-body { min-width: 0; flex: 1; }
.upnext-label { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: var(--accent); text-transform: uppercase; }
.upnext-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upnext-title a:hover { color: var(--accent); }
.upnext-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.upnext-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  padding: 2px;
}
.upnext-close:hover { color: var(--text); }

/* ---- Security ---- */
.sec-list { display: flex; flex-direction: column; gap: 8px; }

.sec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.sec-label { color: var(--text-muted); }
.sec-value { font-weight: 700; }

/* ---- Rug-o-meter ---- */
.rugometer {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
}
.rugometer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 7px;
}
.rugometer-track {
  height: 9px;
  border-radius: 5px;
  background: #1c1c1c;
  overflow: hidden;
}
.rugometer-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.rugometer-fill.rug-low { background: linear-gradient(90deg, #22c55e, #4ade80); }
.rugometer-fill.rug-mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rugometer-fill.rug-high { background: linear-gradient(90deg, #ef4444, #f87171); }
.rugometer-head.rug-low { color: #4ade80; }
.rugometer-head.rug-mid { color: #fbbf24; }
.rugometer-head.rug-high { color: #f87171; }
.rugometer-note { font-size: 11.5px; color: var(--text-dim); margin-top: 7px; line-height: 1.45; }
.sec-value.ok { color: var(--pos); }
.sec-value.bad { color: var(--neg); }
.sec-value.warn { color: var(--accent); }

/* ---- Pairs table ---- */
.table-scroll { overflow-x: auto; }

.pairs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.pairs-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.pairs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(44, 44, 44, 0.6);
  color: var(--text);
}

.pairs-table tbody tr { transition: background 0.12s ease; }
.pairs-table tbody tr:hover { background: var(--bg-elevated); }

.pair-dex { color: var(--accent); font-weight: 600; }
.pair-dex:hover { text-decoration: underline; }

.pair-label {
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
}

.dempty { color: var(--text-muted); font-size: 13.5px; }

/* ---- Detail responsive ---- */
@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { flex-direction: row; flex-wrap: wrap; }
  .detail-side .dpanel { flex: 1 1 260px; }
}

@media (max-width: 700px) {
  .detail-layout { padding: 16px 12px; }
  .detail-head { flex-direction: column; }
  .detail-head-right { align-items: flex-start; margin-left: 0; }
  .detail-price-block { text-align: left; }
  .detail-price { font-size: 26px; }
  .detail-name { font-size: 22px; }
  .chart-wrap { height: 800px; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1180px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .category-list { max-height: none; }
}

@media (max-width: 900px) {
  .sidebar { grid-template-columns: 1fr; }
  .header-actions { gap: 8px; }
  .btn span, .btn { padding: 8px 12px; }
  .auth-links { display: none; }
}

@media (max-width: 700px) {
  .header-top { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .search-bar { order: 3; max-width: none; flex-basis: 100%; }
  .lang-select { display: none; }
  .btn-upgrade { display: none; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px 12px; }
  .page-layout { padding: 16px 12px; }
  .content-toolbar { flex-direction: column; align-items: flex-start; }
}
