/* ═══════════════════════════════════════════════════════════════════════════
   ShieldX — Advertise rail + "List your project" modal
   Shared by top-tokens.html / verified.html / latest-scans.html.
   Pairs with assets/shieldx-ads.js, which mounts the markup at runtime.
   Buttons (.btn / .btn-sm / .btn-primary / .btn-ghost) come from
   assets/shieldx-shell.css — never re-declare them here.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Rail ────────────────────────────────────────────────────────────────
   Deliberately chrome-less: no box, no heading, no footer — just the banners,
   like the aggregator strips this mirrors. Disclosure is the per-slot "Ad" tag.
   The track holds every slot rendered TWICE, so translateX(-50%) lands on a
   pixel-identical frame and the loop is seamless. shieldx-ads.js owns that
   duplication — if you change one, change the other. */
/* padding:0 is load-bearing — premium.css puts `padding-block: 116px` on every
   bare <section> at ≥1100px, and this rail is a <section>. Without the opt-out
   it inherits 116px top AND bottom on desktop. */
.adx-panel { margin: 0 0 24px; padding: 0; }

.adx-marquee {
  position: relative; overflow: hidden; padding: 2px 0;
  /* Fade widened 3% → 7%. At 3% the ramp was ~40px on a 1330px rail, far
     narrower than the 350px slot it has to hide, so a slot leaving the rail was
     sliced through its text at full opacity — "PREMIUM" and "r ad here +" cut
     mid-word, which reads as broken rather than as scrolling. 7% is ~93px: wide
     enough for the edge slot to dissolve, narrow enough that the middle of the
     rail stays at full strength. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
/* Always in motion — including a rail of nothing but open slots. A strip the
   visitor has to drag reads as broken, so this is never gated on inventory. */
.adx-track {
  display: flex; gap: 14px; width: max-content;
  animation: adxScroll 46s linear infinite;
  will-change: transform;
}
@keyframes adxScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.adx-marquee:hover .adx-track { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .adx-track { animation: none; }
  .adx-marquee {
    overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.10) transparent;
  }
  .adx-marquee::-webkit-scrollbar { height: 5px; }
  .adx-marquee::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 10px; }
}

/* ── Slots ───────────────────────────────────────────────────────────────── */
.adx-slot {
  /* ~3.1:1 — the banner proportions of the aggregator strip this mirrors.
     Advertisers are asked for 700×224 (2×) in the modal. */
  flex: 0 0 350px; height: 112px; position: relative; overflow: hidden;
  border-radius: 14px; text-decoration: none; color: inherit; cursor: pointer;
  background: linear-gradient(135deg, rgba(20,30,46,.92), rgba(10,16,26,.96));
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .18s, border-color .18s, box-shadow .18s;
  font: inherit; text-align: left; padding: 0; display: block;
}
.adx-slot:hover {
  transform: translateY(-2px); border-color: rgba(245,158,11,.32);
  box-shadow: 0 14px 34px rgba(0,0,0,.30);
}

/* Advertiser-supplied artwork. Sits above .adx-slot-auto; if it 404s the JS
   onerror drops the <img> and the generated tile below shows through. */
.adx-slot-img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Generated fallback tile — logo + name + symbol/tier. */
.adx-slot-auto {
  position: absolute; inset: 0;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.adx-slot-logo {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(20,184,166,.12));
  border: 1px solid rgba(255,255,255,.10);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 13px; font-weight: 800; color: #cfe3ff;
}
.adx-slot-logo img { width: 100%; height: 100%; object-fit: cover; }
.adx-slot-body { min-width: 0; }
.adx-slot-name {
  font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adx-slot-sub {
  display: flex; align-items: center; gap: 7px; margin-top: 4px;
  font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .04em;
}

/* "Ad" corner label — required disclosure on every paid slot. */
.adx-tag {
  position: absolute; right: 8px; bottom: 7px; z-index: 2;
  font-size: 9px; padding: 2px 7px; border-radius: 5px;
  background: rgba(0,0,0,.55); color: #9fb3cc; letter-spacing: .04em;
}

.adx-tier {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.adx-tier.featured { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.adx-tier.premium  { background: rgba(59,130,246,.13); color: #60a5fa; border: 1px solid rgba(59,130,246,.22); }
.adx-tier.basic    { background: rgba(148,163,184,.08); color: #94a3b8; border: 1px solid rgba(148,163,184,.15); }

/* Open inventory — there is ALWAYS at least one of these. Slots rotate through
   the three tiers so an unsold rail reads as a price list, not one repeated tile. */
.adx-slot.open {
  /* Near-opaque like a paid slot — at low alpha the token-particle canvas shows
     straight through and the tiles read as holes in the page. The dashed border
     and tier tint are what distinguish them, not transparency. */
  background: linear-gradient(135deg, rgba(20,30,46,.92), rgba(10,16,26,.96));
  border: 1px dashed rgba(255,255,255,.16); color: var(--text3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.adx-open-tier {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; opacity: .9;
}
.adx-slot.open b { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--text2); }
.adx-open-price { font-size: 10.5px; opacity: .75; }

.adx-slot.open.featured { border-color: rgba(245,158,11,.30); }
.adx-slot.open.featured .adx-open-tier { color: #fbbf24; }
.adx-slot.open.premium  { border-color: rgba(59,130,246,.28); }
.adx-slot.open.premium .adx-open-tier { color: #60a5fa; }
.adx-slot.open.basic    { border-color: rgba(148,163,184,.22); }
.adx-slot.open.basic .adx-open-tier { color: #94a3b8; }

.adx-slot.open:hover { background: rgba(255,255,255,.04); }
.adx-slot.open:hover b { color: #fff; }

/* Invoice created, payment not yet confirmed on-chain (local to this browser). */
.adx-slot.pending { opacity: .55; cursor: default; border-style: dashed; }
.adx-slot.pending:hover { transform: none; border-color: rgba(255,255,255,.08); box-shadow: none; }

@media (max-width: 600px) {
  .adx-slot { flex: 0 0 300px; height: 96px; }
}

/* ═══════════════════════ "List your project" modal ═══════════════════════ */

/* Buttons, copied from shieldx-shell.css:95-113 so this component stands alone on
   pages that don't load that stylesheet — scanner-pro.html is one, and it defines no
   .btn rules at all. Scoped to #adModal deliberately: scanner-pro has 8 unrelated
   .btn elements, and an unscoped copy would restyle them. The #id also lifts these
   above shieldx-shell.css's own .btn on the listing pages, where the declarations are
   identical so nothing changes visually. */
#adModal .btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 20px; border-radius: 14px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: var(--body); letter-spacing: .01em; text-decoration: none;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 34px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .22s ease, border-color .22s, background .22s, color .22s, box-shadow .22s; }
#adModal .btn:hover:not(:disabled) { transform: translateY(-1px); }
#adModal .btn:disabled { opacity: .55; cursor: not-allowed; }
#adModal .btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 12px; }
#adModal .btn-primary { background: linear-gradient(135deg, rgba(59,130,246,.96), rgba(37,99,235,.94) 48%, rgba(6,182,212,.84) 118%);
  color: #fff; border-color: rgba(96,165,250,.34);
  box-shadow: 0 18px 40px rgba(37,99,235,.26), inset 0 1px 0 rgba(255,255,255,.10); }
#adModal .btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, rgba(96,165,250,.98), rgba(37,99,235,.96) 48%, rgba(8,145,178,.90) 118%);
  box-shadow: 0 22px 48px rgba(37,99,235,.30), 0 0 0 1px rgba(96,165,250,.12), inset 0 1px 0 rgba(255,255,255,.14); }
#adModal .btn-ghost { background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.028));
  color: #d8e7f9; border: 1px solid rgba(255,255,255,.12); }
#adModal .btn-ghost:hover { background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.04));
  color: #fff; border-color: rgba(96,165,250,.22); }

/* Invoice caption — was .tk-meta-k, which also only exists in shieldx-shell.css. */
.adx-inv-label { font-size: 10px; color: var(--text3); text-transform: uppercase;
  letter-spacing: .07em; margin-bottom: 4px; text-align: center; }

.modal-overlay { position:fixed; inset:0; z-index:200; display:none; align-items:center; justify-content:center; padding:18px; background:rgba(3,7,13,.74); backdrop-filter:blur(6px); }
.modal-overlay.open { display:flex; }
.modal { width:100%; max-width:520px; max-height:92vh; overflow:auto; border-radius:20px; padding:26px;
  background:linear-gradient(180deg, rgba(16,26,40,.99), rgba(8,14,23,1)); border:1px solid rgba(255,255,255,.10); box-shadow:0 40px 90px rgba(0,0,0,.5); }
.modal h2 { font-family:var(--display); margin:0 0 4px; font-size:22px; }
.modal p.sub { color:var(--text2); font-size:13px; margin:0 0 18px; }
.modal-x { float:right; background:none; border:0; color:var(--text2); font-size:22px; cursor:pointer; line-height:1; }
.fld { margin-bottom:13px; }
.fld label { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--text3); margin-bottom:6px; }
.fld input, .fld select { width:100%; background:rgba(0,0,0,.30); border:1px solid rgba(255,255,255,.14); border-radius:10px; padding:11px 13px; color:#fff; font-family:var(--body); font-size:14px; outline:none; }
.fld input:focus, .fld select:focus { border-color:#3b82f6; }
.fld-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ad-token-row { display:flex; gap:10px; align-items:center; }
.ad-token-row input { flex:1; }
.ad-logo-prev { width:42px; height:42px; flex-shrink:0; border-radius:50%; overflow:hidden; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); font-family:var(--display); font-size:13px; color:var(--text3); }
.ad-logo-prev img { width:100%; height:100%; object-fit:cover; }
.ad-hint { font-size:11px; color:var(--text3); margin-top:7px; line-height:1.45; }
.ccy-group { display:flex; flex-wrap:wrap; gap:8px; }
.ccy-btn { display:inline-flex; align-items:center; gap:7px; padding:9px 13px; border-radius:11px; font-size:13px; font-weight:600; cursor:pointer;
  color:var(--text2); background:rgba(0,0,0,.28); border:1px solid rgba(255,255,255,.14); transition:border-color .15s, color .15s, background .15s; }
.ccy-btn img { width:18px; height:18px; border-radius:50%; }
.ccy-btn:hover { color:#fff; border-color:rgba(255,255,255,.28); }
.ccy-btn.active { color:#fff; border-color:#3b82f6; background:rgba(59,130,246,.16); }
.price-line { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-radius:12px; background:rgba(245,158,11,.08); border:1px solid rgba(245,158,11,.22); margin:6px 0 16px; }
.price-line b { font-family:var(--display); font-size:22px; color:#fcd34d; }
.invoice { text-align:center; }
.invoice .amt-big { font-family:var(--display); font-size:26px; color:#fff; margin:6px 0; }
.invoice .pay-addr { font-family:var(--mono); font-size:13px; word-break:break-all; background:rgba(0,0,0,.3); border:1px solid rgba(255,255,255,.12); border-radius:10px; padding:12px; margin:10px 0; color:#bfe3ff; }
.err { color:#fca5a5; font-size:13px; margin-top:10px; min-height:18px; }
@media (max-width:760px){ .fld-row { grid-template-columns:1fr; } }

/* ── Short-viewport budget ───────────────────────────────────────────────────
   Measured on a 1560×660 laptop (the reported case): the rail is 112px of slot
   plus panel margin, and the token grid did not start until y=222 — 34% of the
   visible screen spent before a single token, on a rail whose slots are all
   unsold "Your ad here" placeholders. Paid space earns its height once it is
   paid for; empty space should not cost a third of the fold.

   Height-based, not width-based: the complaint is vertical crowding, so a
   short-but-wide laptop gets the relief while a tall monitor keeps the full rail.

   Placed at the END OF THE FILE deliberately. The first attempt put this block
   above `.adx-slot { height: 112px }` and barely moved the number (34% → 32%),
   because a media query adds no specificity — the later plain rule simply won.
   Same specificity means source order decides, so this has to come last. */
@media (max-height: 780px) {
  .adx-panel { margin-bottom: 14px; }
  .adx-slot { height: 74px; }
  .adx-slot.open .adx-open-price { display: none; }   /* least useful line goes first */
  .adx-slot.open b { font-size: 13px; }
}
