/* INUTELLIGENCE extras: charts, quick buy, watchlist + alerts, share cards, skeletons. Loaded after styles.css. */

/* top-bar watchlist button */
.watch-btn { position: relative; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; font-size: 17px; }
.watch-btn:hover { color: var(--amber); }
.watch-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--card-3); border: 1px solid var(--line-2); color: var(--text); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.watch-count.hot { background: var(--red); border-color: var(--red); color: #fff; animation: pop .4s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }

/* star toggles */
.star-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-3); color: var(--muted); cursor: pointer; font-size: 14px; flex: none; transition: color .15s, background .15s; }
.star-btn:hover { color: var(--amber); }
.star-btn.on { color: var(--amber); background: var(--amber-soft); border-color: rgba(245, 184, 65, .35); }
.star-btn.on svg { fill: currentColor; }
.star-btn.big { width: auto; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }

/* coin rows: sparkline + hover actions */
.tc { position: relative; }
.tc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.spark { display: block; }
.tc-act { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; padding: 6px; border-radius: 12px; background: rgba(22, 28, 37, .97); border: 1px solid var(--line-2); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .12s; }
.tc:hover .tc-act, .tc:focus-within .tc-act { opacity: 1; pointer-events: auto; }
.qbuy { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 8px; background: var(--brand); color: #1B0D00; font-weight: 700; font-size: 12.5px; }
.qbuy:hover { background: #FF9B3D; }
.tc.starred::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.tc.flash { animation: rowin .5s ease-out, rowflash 1.4s ease-out; }
@keyframes rowin { from { opacity: 0; transform: translateY(-6px); } }
@media (hover: none) { .tc-act { display: none; } }

/* drawer toolbar */
.d-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* charts */
.chart-card { padding: 14px 14px 10px; }
.chart-box { position: relative; }
.live-chart { display: block; width: 100%; height: auto; aspect-ratio: 600 / 220; }
.live-chart.tall { aspect-ratio: 600 / 240; }
.chart-y { position: absolute; top: 0; right: 0; bottom: 0; width: 64px; pointer-events: none; }
.chart-y span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; top: 4px; padding: 6px 10px; border-radius: 10px; background: var(--card-3); border: 1px solid var(--line-2); font-size: 12px; pointer-events: none; display: grid; gap: 1px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); white-space: nowrap; z-index: 2; }
.chart-tip b { font-size: 13px; }
.chart-tip span { color: var(--muted); font-size: 11.5px; }
.chart-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--text); border: 2px solid var(--card); transform: translate(-50%, -50%); pointer-events: none; }
.chart-legend { display: flex; gap: 14px; justify-content: flex-end; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.seg-sm { margin-left: auto; padding: 2px; }
.seg-sm button { height: 26px; padding: 0 10px; font-size: 12px; }

/* quick-buy buttons */
.buy-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.buy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13px; transition: border-color .15s, background .15s; }
.buy-btn:hover { border-color: var(--line-2); background: var(--card-2); }
.buy-btn i { width: 8px; height: 8px; border-radius: 50%; }

/* clickable x-ray rows */
.tbl tbody tr[data-open-coin], .bag[data-open-coin] { cursor: pointer; }

/* share modal */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 9, .72); }
.modal-card { position: relative; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; border-radius: 20px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal-close { position: absolute; top: 16px; right: 16px; }
.modal-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.modal-title .i { color: var(--acc); }
.card-preview { display: block; width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.modal-note { margin: 10px 0 0; font-size: 12.5px; }

/* watchlist panel */
.watch-hero { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); font-size: 26px; flex: none; }
.watch-hero svg { fill: currentColor; }
.watch-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.wl { overflow: hidden; }
.wl-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; }
.wl-row + .wl-row { border-top: 1px solid var(--line); }
.wl-row:hover { background: var(--card-2); }
.wl-main { flex: 1; min-width: 0; }
.wl-main b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-main span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-val { text-align: right; }
.wl-val b { display: block; font-size: 13.5px; }
.wl-val span { font-size: 12px; font-weight: 600; }
.w-av-sm { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.alert-row { cursor: default; }
.alert-row[data-open-coin] { cursor: pointer; }
.link-btn { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.link-btn:hover { color: var(--text); }

/* alert toasts */
.alerts { position: fixed; right: 20px; bottom: 20px; z-index: 65; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); }
.alert-card { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); cursor: pointer; animation: slidein .3s cubic-bezier(.2, .8, .2, 1); transition: opacity .3s, transform .3s; }
.alert-card.out { opacity: 0; transform: translateX(20px); }
.alert-card > div { flex: 1; min-width: 0; }
.alert-card > div b { display: block; font-size: 13.5px; }
.alert-card > div span { display: block; color: var(--text-2); font-size: 12.5px; }
.alert-card .icon-btn { width: 26px; height: 26px; }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } }
.alert-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; flex: none; background: var(--card-3); color: var(--text-2); }
.tone-green .alert-ic, .alert-ic.tone-green { background: var(--green-soft); color: var(--green); }
.tone-red .alert-ic, .alert-ic.tone-red { background: var(--red-soft); color: var(--red); }
.tone-acc .alert-ic, .alert-ic.tone-acc { background: var(--acc-soft); color: var(--acc); }

/* loading skeletons */
.skel { padding: 0; text-align: left; }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sk-row > div { flex: 1; display: grid; gap: 8px; }
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--card-2) 0%, var(--card-3) 50%, var(--card-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-av { width: 46px; height: 46px; border-radius: 13px; flex: none; }
.sk-l { height: 12px; width: 55%; }
.sk-s { height: 10px; width: 80%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- token info grid, holders, social links ---------- */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.info-tile { padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-width: 0; cursor: help; }
.info-tile > span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-tile > b { display: block; margin-top: 2px; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-tile > small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-tile small .bar { display: block; margin-top: 6px; }
.t-good { color: var(--green); } .t-warn { color: var(--amber); } .t-bad { color: var(--red); }

.holders { padding: 4px 0; }
.hold-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 90px 52px; gap: 10px; align-items: center; padding: 8px 14px; font-size: 12.5px; }
.hold-row + .hold-row { border-top: 1px solid var(--line); }
.hold-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hold-main .pill { height: 18px; font-size: 10px; padding: 0 6px; }
.hold-bar { height: 6px; border-radius: 6px; background: var(--card-3); overflow: hidden; }
.hold-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--acc), #8AE9F7); }
.hold-row > b { text-align: right; font-weight: 600; }

.soc-row { margin-bottom: 6px; }
.d-links a.soc-link { color: var(--text); background: var(--card-2); border-color: var(--line-2); font-weight: 600; }
.d-links a.soc-link svg { width: 13px; height: 13px; }

@media (max-width: 720px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
  .hold-row { grid-template-columns: 20px minmax(0, 1fr) 60px 46px; }
}

.status-pill.frozen .live-dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); animation: none; }
.status-pill.frozen { color: var(--amber); border-color: rgba(245,184,65,.35); }
.cleared { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cleared b { color: var(--text-2); font-weight: 600; }

/* ---------- animated mascot ---------- */
.hero-copy { z-index: 3; }
.hero-visual { z-index: 1; position: relative; }
.laser { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.live-card { z-index: 3; }
button.mascot { padding: 0; border: 0; background: none; cursor: pointer; z-index: 1; filter: none; -webkit-tap-highlight-color: transparent; }
button.mascot .m-svg { display: block; width: 100%; height: auto; overflow: visible; }
button.mascot:focus-visible { outline-offset: -10px; border-radius: 40%; }
button.mascot.barking .m-svg { animation: woof .42s ease-out; }
@keyframes woof { 25% { transform: scale(1.05) translateY(-4px); } 60% { transform: scale(.98); } }
.bark { position: absolute; right: 300px; top: 44px; z-index: 4; padding: 10px 16px; border-radius: 16px 16px 4px 16px; background: #fff; color: #0A0D12; font-weight: 800; font-size: 18px; letter-spacing: .02em; white-space: nowrap; box-shadow: 0 12px 30px rgba(0,0,0,.4); pointer-events: none; }
.bark.pop { animation: barkpop .32s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes barkpop { from { opacity: 0; transform: scale(.5) translateY(10px); } }
.live-card.zapped { animation: zap .9s ease-out; }
.live-card.zapped::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(63, 216, 240, .35), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: zapscan .7s ease-out; }
@keyframes zap { from { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft), 0 0 30px rgba(63, 216, 240, .35); } }
@keyframes zapscan { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (max-width: 1000px) { .bark { right: auto; left: 50%; top: -6px; transform: translateX(-50%); } }
@media (max-width: 720px) { .bark { left: 16px; top: -34px; transform: none; font-size: 14px; padding: 7px 12px; } }

/* ---------- polish pass 2 ---------- */
.tk-x { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--red); background: var(--red-soft); border-radius: 999px; padding: 1px 6px; }
.lc-label .lc-n { margin-left: auto; color: var(--text-2); letter-spacing: 0; text-transform: none; font-weight: 600; }
.lc-foot { display: flex; align-items: center; gap: 10px; white-space: nowrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.lc-foot b { color: var(--text); font-weight: 600; }
.lc-foot .hsp { margin-left: auto; display: inline-flex; }
.col-note { padding: 18px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }
.hours-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
.hours-note b { color: var(--text); font-weight: 600; }
.tbl tbody tr.more { display: none; }
.tbl.all tbody tr.more { display: table-row; }
.show-all { display: block; width: calc(100% + 40px); margin: 20px -20px -20px; padding: 13px; border: 0; border-top: 1px solid var(--line); background: var(--card-2); color: var(--acc); font-weight: 600; font-size: 13px; cursor: pointer; border-radius: 0 0 var(--r) var(--r); }
.show-all:hover { background: var(--card-3); }

/* footer */
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px 48px; align-items: start; }
.footer-brand .brand { margin-bottom: 8px; }
.footer-tag { margin: 0 0 14px !important; color: var(--text-2) !important; font-size: 13.5px !important; }
.footer-links { display: flex; gap: 8px; }
.footer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; justify-self: end; }
.footer-nav a { color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.footer-nav a:hover { color: var(--text); }
.footer-legal { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); max-width: none !important; }

@media (max-width: 720px) {
  /* compact hero on phones */
  .hero-copy { padding-bottom: 20px; }
  .hero h1 { font-size: 34px; }
  .lead { font-size: 15px; margin: 12px 0 18px; }
  .ctas { display: grid; grid-template-columns: 1fr 1fr; }
  .ctas .btn-lg { height: 46px; padding: 0 10px; font-size: 14px; }
  .ca-row { margin-top: 14px; }
  .hero-visual { min-height: 0; display: flex; align-items: center; gap: 12px; padding: 4px 16px 20px; }
  .hero-glow { width: 200px; height: 200px; left: -40px; right: auto; transform: translateY(-50%); }
  .mascot { position: relative; right: auto; bottom: auto; transform: none; width: 96px; flex: none; }
  .live-card { position: relative; left: auto; bottom: auto; width: auto; flex: 1; min-width: 0; padding: 10px; }
  .live-card .lc-foot .hsp { display: none; }

  /* spotlight becomes a swipe row */
  .spot-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; gap: 10px; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .spot-grid::-webkit-scrollbar { display: none; }
  .spot-card { flex: 0 0 78%; scroll-snap-align: start; }
  .spot-body .sw { display: inline-flex; }

  /* x-ray plays: just coin, PnL and return on phones */
  table.tbl { min-width: 0; }
  .tbl th:nth-child(2), .tbl td:nth-child(2), .tbl th:nth-child(3), .tbl td:nth-child(3),
  .tbl th:nth-child(4), .tbl td:nth-child(4), .tbl th:nth-child(7), .tbl td:nth-child(7) { display: none; }
  .tbl th, .tbl td { padding-left: 14px; padding-right: 14px; }
  .tbl-wrap { margin: 0 -20px -20px; }
  .hours { height: 100px; }
  .xr .tape .tape-row:nth-child(n+7) { display: none; }
  .road { grid-template-columns: 1fr 1fr; }
  .road-step { padding: 16px; }
  .road-step h4 { font-size: 15px; margin-top: 10px; }
  .road-step p { font-size: 12.5px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { justify-self: start; }
}

/* ---------- polish pass ---------- */
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.tc:focus-visible, .wl-row:focus-visible { outline-offset: -2px; }
body.locked { overflow: hidden; }
::selection { background: rgba(63, 216, 240, .3); }

.spot-spark { height: 48px; margin: -2px 0; }
.spot-spark .spark { width: 100%; height: 48px; }

.xr-empty { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; }
.xr-empty > .i { width: 38px; height: 38px; border-radius: 11px; background: var(--acc-soft); color: var(--acc); font-size: 18px; }
.xr-empty b { display: block; font-size: 15px; }
.xr-empty span { color: var(--text-2); }
.xr-row.single { grid-template-columns: 1fr; }

.search-toggle { display: none; }
.bottom-nav { display: none; }

@media (max-width: 720px) {
  .buy-row { grid-template-columns: 1fr 1fr; }
  .spark { width: 52px; }
  .spot-spark .spark { width: 100%; }
  .xr-actions { width: 100%; }
  .xr-actions .btn, .xr-actions .star-btn.big { flex: 1; }

  /* search slides over the top bar */
  .search-toggle { display: inline-grid; }
  .top-bar { position: relative; }
  .top.searching .search { display: flex; position: absolute; inset: 9px 16px; max-width: none; margin: 0; z-index: 2; background: var(--card-3); }

  /* app-style bottom bar */
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(10, 13, 18, .97); border-top: 1px solid var(--line); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; color: var(--text-2); font-size: 11px; font-weight: 600; cursor: pointer; }
  .bottom-nav .i { font-size: 20px; }
  .bottom-nav .bn-buy { color: var(--brand); }
  .alerts { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .top-right .btn-brand { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
