:root {
  --bg: #0b0b12;
  --surface: #15151f;
  --surface-2: #1d1d2a;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f8;
  --muted: #9a9ab2;
  --like: #21e18c;
  --nope: #ff4d6d;
  --super: #3fa9ff;
  --gold: #ffb800;
  --brand-a: #ff2e7e;
  --brand-b: #ffb627;
  --brand: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #24142a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }
.muted { color: var(--muted); font-weight: 500; }
.up { color: var(--like); }
.down { color: var(--nope); }

/* ---------- layout ---------- */

.layout { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }

.app {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
}
.top-side { display: flex; gap: 8px; width: 92px; }
.top-side.right { justify-content: flex-end; }
.liked-btn { color: var(--brand-a) !important; }

/* ---------- side panels: passed (left) + liked (right) ---------- */

.panel {
  position: fixed; top: 0; bottom: 0; z-index: 45;
  width: min(380px, 90vw);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .25s ease-out;
  padding-top: env(safe-area-inset-top);
}
.panel.left { left: 0; transform: translateX(-102%); }
.panel.right { right: 0; transform: translateX(102%); }
.panel.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .6); }
.panel-backdrop { position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, .55); animation: fade .2s; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 2px; }
.panel-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.panel-sub { margin: 2px 14px 8px; font-size: 12.5px; color: var(--muted); }
.panel-list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.like { background: var(--like); box-shadow: 0 0 10px var(--like); }
.dot.nope { background: var(--nope); box-shadow: 0 0 10px var(--nope); }

@media (min-width: 1100px) {
  .layout {
    grid-template-columns: minmax(280px, 360px) minmax(400px, 480px) minmax(280px, 360px);
    justify-content: center;
    gap: 22px;
    padding: 0 18px;
  }
  .panel, .panel.left, .panel.right {
    position: static;
    transform: none;
    width: auto;
    height: calc(100dvh - 28px);
    margin: 14px 0;
    border-radius: 20px;
    background: rgba(21, 21, 31, .75);
  }
  .panel.open { box-shadow: none; }
  .panel-backdrop, .mobile-only, .panel-close { display: none !important; }
}
.brand { display: flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.brand-flame { width: 26px; height: 26px; }
.brand b { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

.icon-btn {
  position: relative;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: color .15s, transform .15s;
}
.icon-btn:hover { color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.small { width: 34px; height: 34px; font-size: 14px; }
#btnMatches { color: var(--brand-a); }
.icon-btn .count {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
  border: 2px solid var(--bg);
}

.feeds {
  display: flex;
  gap: 6px;
  padding: 6px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.feeds button {
  flex: 1 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.feeds button.active { background: var(--text); color: #111; border-color: transparent; }

/* ---------- deck + cards ---------- */

.deck {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 10px 16px 0;
}
.deck-status {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}
.deck-status h3 { margin: 0; color: var(--text); font-size: 19px; }
.deck-status p { margin: 0; max-width: 300px; }
.deck-status .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 4px solid var(--surface-2);
  border-top-color: var(--brand-a);
  animation: spin .8s linear infinite;
}
.pulse { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
.pulse::before, .pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--brand); opacity: .35; animation: ping 1.6s ease-out infinite;
}
.pulse::after { animation-delay: .8s; }
.pulse span { position: relative; font-size: 38px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { from { transform: scale(.5); opacity: .5; } to { transform: scale(1.6); opacity: 0; } }

.card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transform-origin: 50% 90%;
  transition: transform .32s cubic-bezier(.2, .8, .3, 1.2), opacity .32s;
  will-change: transform;
}
.card.d1 { transform: translateY(12px) scale(.955); }
.card.d2 { transform: translateY(24px) scale(.91); opacity: .7; }
.card.d1, .card.d2 { pointer-events: none; }
.card.dragging { transition: none; cursor: grabbing; }
.card.leaving { transition: transform .42s ease-in, opacity .42s ease-in; pointer-events: none; }

.card-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 11px 12px 9px; }
.avatar-sm { position: relative; width: 48px; height: 48px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-2); border: 2px solid rgba(255, 255, 255, .12); }
.avatar-sm img, .avatar-sm .placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 16px; pointer-events: none; -webkit-user-drag: none; }
.head-text { flex: 1; min-width: 0; }
.head-text h2 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-text .sub { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .75); }
.head-text .badges { margin-top: 3px; gap: 4px; }
.head-text .badge { font-size: 10.5px; padding: 1px 7px; backdrop-filter: none; background: var(--surface-2); }
.head-text .badge.live { background: #e3173e; }
.head-text .badges:empty { display: none; }
.score-slot { flex: none; align-self: flex-start; }

.card-media {
  position: relative;
  flex: 1 1 auto;
  min-height: 150px;
  margin: 0 10px;
  border-radius: 14px;
  background: #0e0e15;
  overflow: hidden;
}
.media-chart, .media-photo { position: absolute; inset: 0; }
.media-chart:not(.live) { padding: 16px 10px 8px; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; }
.media-chart.live { overflow: hidden; }
/* crop DexScreener's toolbar + legend; its footer and attribution stay visible */
.media-chart.live .dex-frame { position: absolute; left: 0; top: 0; border-radius: 0; transform-origin: 0 0; }
.media-chart.live .live-dot { top: 10px; right: 10px; }
.media-chart.live .cc-empty { position: absolute; inset: 0; }
.media-photo { opacity: 0; transition: opacity .2s; }
.card-media.show-photo .media-photo { opacity: 1; }
.card-media.show-photo .media-chart { visibility: hidden; }
.media-photo img, .media-photo .placeholder {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.pages { position: absolute; top: 5px; left: 30%; right: 30%; z-index: 3; display: flex; gap: 4px; pointer-events: none; }
.pages i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .9); }
.pages i:last-child, .card-media.show-photo .pages i:first-child { background: rgba(255, 255, 255, .28); }
.card-media.show-photo .pages i:last-child { background: rgba(255, 255, 255, .9); }
.placeholder {
  display: grid; place-items: center;
  font-size: 64px; font-weight: 800; letter-spacing: -0.04em;
  color: rgba(255, 255, 255, .9);
}
.media-top {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .12);
  white-space: nowrap;
}
.badge.live { background: #e3173e; border-color: transparent; }
.badge.grad { color: var(--like); }
.badge.koth { color: var(--gold); }
.badge.age { color: #fff; }
.badge.warn { color: #ffd166; border-color: rgba(255, 209, 102, .4); }
.badge.mayhem { color: #c4b5fd; }
.badge.mayhem.on { color: #fff; background: linear-gradient(135deg, #7c3aed, #db2777) !important; border-color: transparent; }
.mayhem-card { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 10px; font-size: 13.5px; }
.mayhem-card.on { border-color: rgba(167, 139, 250, .5); background: linear-gradient(180deg, rgba(124, 58, 237, .14), var(--surface-2)); }
.mayhem-card p { margin: 0; }
.mayhem-card a { color: #c4b5fd; }
.media-title { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 2; }
.media-title h2 {
  margin: 0;
  font-size: 27px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.media-title .ticker { font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.media-title .mc { float: right; font-size: 15px; font-weight: 800; }

.stamp {
  position: absolute; z-index: 3;
  padding: 2px 12px;
  border: 4px solid currentColor;
  border-radius: 10px;
  font-size: 36px; font-weight: 900; letter-spacing: .06em;
  opacity: 0;
  pointer-events: none;
}
.stamp.like { top: 52px; left: 22px; color: var(--like); transform: rotate(-16deg); }
.stamp.nope { top: 52px; right: 22px; color: var(--nope); transform: rotate(16deg); }
.stamp.super { bottom: 70px; left: 50%; color: var(--super); transform: translateX(-50%) rotate(-6deg); }

.card-chart {
  flex: none;
  height: 88px;
  padding: 9px 14px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
}
.card-chart.live { height: 176px; padding: 8px 10px 0; display: block; position: relative; }
.card-chart.live .cc-empty { height: 100%; }
.dex-frame { display: block; width: 100%; height: 100%; border: 0; border-radius: 12px; background: #0e0e15; pointer-events: none; }
.dex-frame.full { height: min(520px, 62dvh); pointer-events: auto; margin-bottom: 6px; }
.live-dot {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 6px;
  background: rgba(227, 23, 62, .9); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  pointer-events: none;
}
.live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
.live-dot.inline { position: static; vertical-align: 1px; }
@keyframes blink { 50% { opacity: .2; } }
.tick-up { animation: tick-up 1.2s; }
.tick-down { animation: tick-down 1.2s; }
@keyframes tick-up { 0%, 40% { color: var(--like); text-shadow: 0 0 12px var(--like); } }
@keyframes tick-down { 0%, 40% { color: var(--nope); text-shadow: 0 0 12px var(--nope); } }
.media-chart { padding: 14px 10px 8px; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; }
.cc-svg { min-height: 0; overflow: hidden; }
.media-chart .cc-head { flex-wrap: wrap; row-gap: 0; }
.media-chart .cc-head .muted { font-size: 11px; }
.cc-svg.skel { width: 100%; height: 100%; }
.cc-svg svg { display: block; }
.cc-price { font-size: 15px; }
.cc-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.cc-last { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; }
.cc-last .live-dot { margin-left: 6px; }
.cc-head.flash .cc-price { animation: tick-up 1s; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
#chartMeta .cc-head { width: 100%; flex-wrap: wrap; }
.cc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; white-space: nowrap; }
.cc-head .muted { font-size: 11.5px; }
.cc-svg { min-height: 0; border-radius: 6px; }
.cc-svg svg { width: 100%; height: 100%; }
.cc-empty { grid-row: 1 / -1; display: grid; place-items: center; font-size: 12.5px; color: var(--muted); background: rgba(255, 255, 255, .03); border-radius: 10px; }
.chart { position: relative; height: 240px; touch-action: none; display: block; overflow: hidden; }
.chart-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .35); pointer-events: none; }
.chart-tip {
  position: absolute; top: 6px;
  display: grid; gap: 1px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(11, 11, 18, .92);
  border: 1px solid var(--line);
  font-size: 11.5px; font-variant-numeric: tabular-nums;
  white-space: pre;
  pointer-events: none;
}
.card-body { flex: none; padding: 12px 14px 14px; display: grid; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 6px 9px; min-width: 0; }
.stat label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stat b { display: block; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.curve-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
.curve-top b { color: var(--text); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #17c37b, var(--like)); }
.bar.done i { background: linear-gradient(90deg, var(--gold), #ffd866); }

.desc {
  margin: 0;
  font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 0;
}
.desc:empty { display: none; }

.links { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: rgba(255, 255, 255, .25); }
.chip svg { width: 13px; height: 13px; }
.chip.pump { background: rgba(33, 225, 140, .12); color: var(--like); border-color: rgba(33, 225, 140, .25); }
.chip.none { color: var(--muted); font-weight: 500; }

/* ---------- controls ---------- */

.controls { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 14px 16px 4px; }
.ctl {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  transition: transform .15s, background .15s;
}
.ctl svg { width: 30px; height: 30px; }
.ctl.small { width: 50px; height: 50px; }
.ctl.small svg { width: 22px; height: 22px; }
.ctl:hover { transform: scale(1.07); }
.ctl:active { transform: scale(.9); }
.ctl:disabled { opacity: .35; pointer-events: none; }
.ctl.nope { color: var(--nope); }
.ctl.like { color: var(--like); }
.ctl.super { color: var(--super); }
.ctl.undo { color: var(--gold); }
.ctl.info { color: var(--muted); }
.ctl.nope:hover { background: rgba(255, 77, 109, .12); }
.ctl.like:hover { background: rgba(33, 225, 140, .12); }
.ctl.super:hover { background: rgba(63, 169, 255, .12); }
.hint { margin: 6px 0 10px; text-align: center; font-size: 11.5px; color: #5d5d73; }
@media (hover: none) { .hint { display: none; } .controls { padding-bottom: 14px; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 0;
  font-weight: 700; font-size: 15px;
  text-decoration: none;
}
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(253, 38, 122, .35); }
.btn.green { background: var(--like); color: #062a19; }
.btn.ghost { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); }
.btn.link { background: none; color: var(--muted); }
.btn.sm { padding: 9px 16px; font-size: 13.5px; }
.text-btn { background: none; border: 0; padding: 6px 4px; color: var(--brand-b); font-weight: 600; font-size: 13.5px; }
.text-btn.danger { color: var(--nope); }

/* ---------- sheets ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
#detailsWrap { z-index: 55; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); animation: fade .2s; }
.sheet {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet.details {
  left: 50%; bottom: 0;
  width: min(560px, 100%);
  max-height: 92dvh;
  transform: translateX(-50%);
  border-radius: 24px 24px 0 0;
  animation: up .28s cubic-bezier(.2, .8, .3, 1);
}
.sheet.side { top: 0; right: 0; bottom: 0; width: min(420px, 100%); animation: from-right .25s ease-out; }
.sheet.side.left { right: auto; left: 0; animation-name: from-left; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes from-right { from { transform: translateX(100%); } }
@keyframes from-left { from { transform: translateX(-100%); } }

.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 19px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.sheet-foot { padding: 12px 16px 18px; border-top: 1px solid var(--line); }
.sheet-foot.stack { display: grid; gap: 8px; justify-items: start; }
.disclaimer { margin: 0; font-size: 12px; color: var(--muted); }

/* details */
.details-scroll { overflow-y: auto; padding: 0 16px 16px; }
.grabber { width: 42px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); margin: 10px auto 4px; flex: none; }
.d-head { display: flex; gap: 14px; align-items: center; padding: 10px 0 14px; }
.d-img { width: 76px; height: 76px; border-radius: 18px; overflow: hidden; flex: none; background: var(--surface-2); position: relative; }
.d-img img, .d-img .placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 28px; }
.d-title { min-width: 0; flex: 1; }
.d-title h2 { margin: 0; font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; }
.d-title .ticker { color: var(--muted); font-weight: 700; }
.d-title .badges { margin-top: 6px; }
.d-title .badge { background: var(--surface-2); }
.d-title .badge.live { background: #e3173e; }
.ca {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; margin-bottom: 14px;
  border-radius: 12px;
  background: var(--surface-2); border: 1px dashed rgba(255, 255, 255, .15);
  font: 12.5px ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: left;
}
.ca + .creator { margin: -6px 0 14px; font-size: 12.5px; color: var(--muted); }
.creator a { color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.ca span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca em { font: 600 12px Inter, sans-serif; font-style: normal; color: var(--brand-b); flex: none; }
.section { margin: 16px 0 0; }
.section h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.d-stats { grid-template-columns: repeat(3, 1fr); }
.chart-box { background: var(--surface-2); border-radius: 14px; padding: 10px 12px 12px; }
.chart-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; margin-bottom: 6px; font-size: 13px; }
.chart-meta .small { font-size: 12px; }
.chart-meta b { font-size: 16px; }
.chart { color: var(--muted); font-size: 13px; }
.chart svg { width: 100%; height: 100%; }
.intervals { display: flex; gap: 6px; margin-top: 8px; }
.intervals button { flex: 1; padding: 5px 0; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.intervals button.active { background: var(--text); color: #111; }
.d-desc { margin: 0; color: #cfcfe0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.trades { display: grid; gap: 2px; font-size: 13px; }
.trade { display: grid; grid-template-columns: 46px 1fr 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.trade:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.trade .t-type { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.trade .t-user { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 12px; text-decoration: none; }
.trade .t-time { color: var(--muted); font-size: 12px; text-align: right; }
.d-actions {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.d-actions .ctl { width: 54px; height: 54px; box-shadow: none; }
.d-actions .ctl svg { width: 24px; height: 24px; }

/* list rows (liked + passed) */
.m-name .score { margin-left: 4px; vertical-align: 1px; }
.m-perf .tag { font-weight: 700; }
.match-row.auto { opacity: .75; }
.empty-note { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty-note b { display: block; font-size: 17px; color: var(--text); margin-bottom: 6px; }
.match-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 14px; }
.match-row:hover { background: rgba(255, 255, 255, .03); }
.match-row .m-img { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; position: relative; background: var(--surface-2); cursor: pointer; }
.match-row .m-img img, .match-row .m-img .placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 18px; }
.match-row.super .m-img { box-shadow: 0 0 0 2px var(--super); }
.m-info { min-width: 0; }
.m-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-name .ticker { color: var(--muted); font-weight: 600; font-size: 13px; }
.m-perf { font-size: 12.5px; color: var(--muted); }
.m-perf b { font-weight: 700; }
.m-links { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.m-links .chip { padding: 3px 8px; font-size: 11px; }
.m-remove { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 6px; }
.m-remove:hover { color: var(--nope); }

/* filters */
.filters { padding: 16px; display: grid; gap: 16px; overflow-y: auto; flex: 1; align-content: start; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); font-weight: 600; }
.field select { padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.toggle { display: flex; gap: 12px; align-items: center; font-size: 14px; cursor: pointer; }
.toggle input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked { background: var(--like); }
.toggle input:checked::after { transform: translateX(18px); }

/* ---------- match overlay ---------- */

.match-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, rgba(253, 38, 122, .45), rgba(11, 11, 18, .94) 65%);
  backdrop-filter: blur(8px);
  animation: fade .25s;
}
.match-inner { text-align: center; width: min(380px, 100%); }
.match-title {
  margin: 0;
  font: 400 56px/1.15 Pacifico, cursive;
  background: linear-gradient(135deg, #fff 10%, #ffd0e0 50%, var(--brand-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: rotate(-4deg);
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
.match-title.super { background: linear-gradient(135deg, #fff, #9fd5ff 50%, var(--super)); -webkit-background-clip: text; background-clip: text; }
.match-sub { margin: 10px 0 26px; color: #e4e4ee; }
.match-why { list-style: none; margin: -14px 0 22px; padding: 0; display: grid; gap: 4px; font-size: 13.5px; color: var(--like); font-weight: 600; }
.m-why { font-size: 12px; font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-avatars { display: flex; justify-content: center; margin-bottom: 34px; }
.avatar {
  width: 128px; height: 128px; border-radius: 50%;
  border: 4px solid #fff;
  background: var(--surface-2);
  overflow: hidden; position: relative;
  display: grid; place-items: center;
  font-size: 54px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.avatar img, .avatar .placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 40px; }
.avatar.you { transform: translateX(14px) rotate(-8deg); animation: slide-l .5s ease-out; background: var(--brand); }
.avatar.coin { transform: translateX(-14px) rotate(8deg); animation: slide-r .5s ease-out; }
.match-actions { display: grid; gap: 10px; }
@keyframes pop { from { transform: scale(.3) rotate(-4deg); opacity: 0; } }
@keyframes slide-l { from { transform: translateX(-120px) rotate(-30deg); opacity: 0; } }
@keyframes slide-r { from { transform: translateX(120px) rotate(30deg); opacity: 0; } }

/* ---------- first-visit tutorial ---------- */

.onboard {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 35%, rgba(253, 38, 122, .28), rgba(11, 11, 18, .97) 62%);
  backdrop-filter: blur(10px);
  animation: fade .3s;
  overflow-y: auto;
}
.onboard.leaving { opacity: 0; transition: opacity .25s; }
.ob-inner { width: min(380px, 100%); text-align: center; display: grid; justify-items: center; gap: 12px; }
.ob-brand { font-size: 22px; }
.ob-title { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.ob-step { margin: 0; height: 26px; font-size: 18px; font-weight: 800; animation: pop .35s; }
.ob-step.like { color: var(--like); }
.ob-step.nope { color: var(--nope); }
.ob-step.super { color: var(--super); }
.ob-stage { position: relative; width: 230px; height: 300px; margin: 8px 0 4px; }
.ob-card {
  position: absolute; inset: 0;
  border-radius: 20px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column;
  touch-action: none; cursor: grab; user-select: none;
  animation: ob-swipe 6s ease-in-out infinite;
}
.ob-card.manual { animation: none; cursor: grabbing; }
.ob-img { flex: 1; display: grid; place-items: center; font-size: 92px; background: linear-gradient(135deg, #1f8f5a, #0f4d6b); }
.ob-meta { padding: 10px 14px 12px; display: grid; gap: 2px; text-align: left; font-size: 13px; }
.ob-meta b { font-size: 18px; }
.ob-chart { width: 100%; height: 30px; margin-top: 4px; }
.ob-card .stamp { font-size: 26px; top: 26px; }
.ob-card .stamp.super { bottom: 90px; top: auto; }
.ob-card:not(.manual) .stamp.like { animation: ob-like 6s infinite; }
.ob-card:not(.manual) .stamp.nope { animation: ob-nope 6s infinite; }
.ob-card:not(.manual) .stamp.super { animation: ob-super 6s infinite; }
.ob-hand {
  position: absolute; left: 50%; top: 58%;
  font-size: 46px; margin-left: -23px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5));
  pointer-events: none;
  animation: ob-hand 6s ease-in-out infinite;
}
.ob-legend { display: flex; gap: 22px; font-weight: 800; font-size: 14px; }
.super-c { color: var(--super); }
.ob-note { margin: 0; font-size: 13.5px; color: var(--muted); }
.ob-note b { color: var(--brand-a); }
.ob-inner .btn { width: 100%; }

/* one 6s loop: like (0-2s), pass (2-4s), super (4-6s) */
@keyframes ob-swipe {
  0%, 4% { transform: none; }
  16%, 22% { transform: translateX(120px) rotate(14deg); }
  30%, 37% { transform: none; }
  49%, 55% { transform: translateX(-120px) rotate(-14deg); }
  63%, 70% { transform: none; }
  82%, 88% { transform: translateY(-90px); }
  96%, 100% { transform: none; }
}
@keyframes ob-hand {
  0%, 4% { transform: translate(0, 0) scale(1); }
  8% { transform: translate(0, 0) scale(.9); }
  16%, 22% { transform: translate(120px, 0) scale(.9); }
  30%, 37% { transform: translate(0, 0) scale(1); }
  41% { transform: translate(0, 0) scale(.9); }
  49%, 55% { transform: translate(-120px, 0) scale(.9); }
  63%, 70% { transform: translate(0, 0) scale(1); }
  74% { transform: translate(0, 0) scale(.9); }
  82%, 88% { transform: translate(0, -90px) scale(.9); }
  96%, 100% { transform: translate(0, 0) scale(1); }
}
@keyframes ob-like { 0%, 8% { opacity: 0; } 16%, 22% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes ob-nope { 0%, 41% { opacity: 0; } 49%, 55% { opacity: 1; } 63%, 100% { opacity: 0; } }
@keyframes ob-super { 0%, 74% { opacity: 0; } 82%, 88% { opacity: 1; } 96%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ob-card, .ob-hand, .ob-card .stamp { animation: none !important; }
}

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 130px; z-index: 70;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff; color: #111;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- safety intel ---------- */

.good { color: var(--like); }
.warn { color: #ffcc4d; }
.bad { color: var(--nope); }

.score {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 800;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(6px);
  border: 1px solid currentColor;
  white-space: nowrap;
}
.score.loading { color: var(--muted); border-color: rgba(255, 255, 255, .15); font-weight: 600; }
.score.loading::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
.score.sm { padding: 1px 7px; font-size: 11px; backdrop-filter: none; background: transparent; }

.media-title .sub { font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.media-title .sub .age { font-weight: 500; color: rgba(255, 255, 255, .65); }

.skel {
  display: block;
  height: 1em; width: 70%;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.14), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.intel-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ichip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11.5px; font-weight: 700;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  white-space: nowrap;
}
.ichip.good { background: rgba(33, 225, 140, .08); border-color: rgba(33, 225, 140, .25); }
.ichip.warn { background: rgba(255, 204, 77, .08); border-color: rgba(255, 204, 77, .3); }
.ichip.bad { background: rgba(255, 77, 109, .1); border-color: rgba(255, 77, 109, .35); }
.ichip.skel { width: 74px; height: 22px; }
.verdict { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -3px; }
.verdict b { font-weight: 800; }

.scan-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px; background: var(--surface-2); border-radius: 14px; font-size: 13.5px; }
.scan-loading .spinner { width: 22px; height: 22px; border-width: 3px; flex: none; }
.scan-head { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.scan-head.good { border-color: rgba(33, 225, 140, .35); }
.scan-head.warn { border-color: rgba(255, 204, 77, .35); }
.scan-head.bad { border-color: rgba(255, 77, 109, .45); }
.ring { width: 74px; height: 74px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.scan-verdict { font-size: 20px; font-weight: 800; }
.small { font-size: 12px; }
.flags { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.flags li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); color: var(--text); }
.flags li .f-ico { width: 18px; flex: none; text-align: center; }
.flags li.bad { background: rgba(255, 77, 109, .09); }
.flags li.warn { background: rgba(255, 204, 77, .07); }
.flags li.good .f-ico { color: var(--like); }

.holders { display: grid; gap: 3px; margin-top: 8px; font-size: 12.5px; }
.holder { position: relative; display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; overflow: hidden; }
.holder .hbar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(63, 169, 255, .12); z-index: 0; }
.holder.flagged .hbar { background: rgba(255, 77, 109, .14); }
.holder > * { position: relative; z-index: 1; }
.holder .rank { color: var(--muted); font-weight: 700; }
.holder a { font-family: ui-monospace, Consolas, monospace; text-decoration: none; }
.holder .tags { display: inline-flex; gap: 4px; margin-left: 6px; }
.tag-pill { font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 4px; letter-spacing: .04em; }
.tag-pill.dev { background: #6c4bff; color: #fff; }
.tag-pill.sniper { background: #ff4d6d; color: #fff; }
.tag-pill.bundler { background: #ff9f1c; color: #1a1000; }
.tag-pill.insider { background: #ffcc4d; color: #1a1400; }
.holder .hp { font-weight: 800; }

.flowbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 4px 0 8px; }
.flowbar i { display: block; height: 100%; }
.flowbar .b { background: var(--like); }
.flowbar .s { background: var(--nope); }
.flow-legend { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; }

.sec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.sec-item { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); font-size: 13px; }
.sec-item span { color: var(--muted); }
.sec-item b { font-weight: 800; text-align: right; }

.dev-card { padding: 12px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 8px; font-size: 13.5px; }
.dev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dev-top b { font-size: 15px; }
.dev-coins { display: grid; gap: 3px; }
.dev-coin { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .03); text-decoration: none; }
.dev-coin span:first-child { font-family: ui-monospace, Consolas, monospace; color: var(--muted); }
.risk-list { display: grid; gap: 4px; }
.risk { padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); font-size: 13px; }
.risk b { display: block; }
.risk.danger b { color: var(--nope); }
.risk.warn b { color: #ffcc4d; }
.risk span { color: var(--muted); font-size: 12px; }

/* short screens: give the photo less room so the stats still fit */
@media (max-height: 760px) {
  .card .links { display: none; }
}
@media (max-height: 700px) {
  .card-chart { height: 64px; }
  .card-chart.live { height: 124px; }
  .desc, .card .verdict { display: none; }
  .stat { padding: 5px 8px; }
  .media-title h2 { font-size: 23px; }
  .ctl { width: 56px; height: 56px; }
  .ctl.small { width: 44px; height: 44px; }
}

/* ---------- card: coin photo as the hero, live chart floating over it ---------- */
.card-media .media-photo { position: absolute; inset: 0; opacity: 1; }
.card-media .media-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 25%, rgba(10, 10, 16, .55) 60%, rgba(10, 10, 16, .85));
}
.card-media .media-chart {
  position: absolute; inset: auto 8px 8px 8px; height: 64%;
  padding: 8px 8px 4px;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 4px;
  border-radius: 12px;
  background: rgba(12, 12, 18, .72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: opacity .2s, transform .2s;
}
.card-media.show-photo .media-chart { opacity: 0; transform: translateY(12px); visibility: visible; pointer-events: none; }
.card-media.show-photo .media-photo::after { opacity: 0; }
.media-photo::after { transition: opacity .2s; }
.photo-hint {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 11px; font-weight: 700;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.card-media.show-photo .photo-hint { opacity: 1; }
.card-media { min-height: 200px; }
.brand .tld { font-style: normal; font-weight: 700; font-size: .62em; color: var(--muted); margin-left: 1px; letter-spacing: 0; }

/* ---------- card: photo on top, chart below (no overlap) ---------- */
.card-media { display: flex; flex-direction: column; gap: 6px; background: transparent; overflow: visible; min-height: 260px; }
.card-media .media-photo {
  position: relative; inset: auto;
  flex: 0 0 42%; min-height: 90px;
  border-radius: 12px; overflow: hidden;
  background: var(--surface-2);
  transition: flex-basis .25s ease;
}
.card-media .media-photo::after { display: none; }
.card-media .media-chart {
  position: relative; inset: auto; height: auto;
  flex: 1 1 auto; min-height: 120px;
  background: #0e0e15;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-radius: 12px;
}
/* tap the picture area: photo grows to fill it, tap again for the chart back */
.card-media.show-photo .media-photo { flex-basis: 100%; }
.card-media.show-photo .media-chart { display: none; }
.photo-hint { top: 8px; right: 8px; }

/* phones: compact stats so the photo + chart get the room */
@media (max-width: 520px) {
  .card-body { padding: 8px 12px 10px; gap: 7px; }
  .stat { padding: 4px 8px; }
  .stat label { font-size: 9.5px; }
  .stat b { font-size: 13.5px; }
  .ichip { font-size: 10.5px; padding: 2px 6px; }
  .card-head { padding: 9px 12px 7px; }
  .head-text h2 { font-size: 18px; }
}

/* show the whole coin picture; a blurred copy fills the empty sides */
.card-media .media-photo > img, .card-media .media-photo > .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.card-media .media-photo > .placeholder { object-fit: initial; }
.photo-bg { position: absolute; inset: 0; overflow: hidden; }
.photo-bg img, .photo-bg .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px) brightness(.55) saturate(1.2); transform: scale(1.25); }

/* chart temporarily unavailable: calm placeholder instead of an empty box */
.cc-offline { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; color: var(--muted); font-size: 12.5px; text-align: center; border-radius: 10px; background: rgba(255, 255, 255, .02); }
.cc-offline a { pointer-events: auto; font-size: 12px; }
.spinner.sm { width: 18px; height: 18px; border-width: 2.5px; }
.chart-offline { display: grid; grid-template-rows: auto 1fr; gap: 6px; height: 100%; }

/* ---------- trading terminal ---------- */
.terminal {
  position: fixed; inset: 0; z-index: 65;
  overflow-y: auto;
  background: radial-gradient(1200px 600px at 50% -200px, #1d1430 0%, var(--bg) 60%) fixed, var(--bg);
  animation: fade .2s;
}
body.in-terminal { overflow: hidden; }
.t-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(11, 11, 18, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.t-top .icon-btn { font-size: 20px; color: var(--text); flex: none; }
.t-coin { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.t-coin .avatar-sm { width: 42px; height: 42px; }
.t-coin-text { min-width: 0; }
.t-coin h2 { margin: 0; font-size: 18px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-coin .sub { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.t-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "chart side" "info side";
  align-items: start;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}
.t-chart-card { grid-area: chart; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 10px; min-width: 0; }
.t-side { grid-area: side; display: grid; gap: 12px; position: sticky; top: 76px; }
.t-info { grid-area: info; min-width: 0; display: grid; gap: 12px; }
.t-chart { height: min(440px, 52vh); }
.t-chart-card .chart-foot { flex-wrap: wrap; }
.t-chart-card .links .chip { padding: 3px 9px; }

.t-stats { grid-template-columns: repeat(4, 1fr); }
.t-tabs { display: flex; gap: 6px; }
.t-tabs button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 13px; }
.t-tabs button.active { background: var(--text); color: #111; }
.t-tabbody { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.trade.mine { background: rgba(124, 58, 237, .18) !important; }

.t-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.t-panel h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.t-connect { width: 100%; }
.t-wallet { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.t-wname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.t-wallet-list { display: grid; gap: 6px; }
.t-side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.t-side-toggle button { padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; font-size: 15px; }
.t-side-toggle .on.buy { background: var(--like); color: #062a19; }
.t-side-toggle .on.sell { background: var(--nope); color: #fff; }
.t-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.t-amount { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.t-amount:focus-within { border-color: rgba(255, 255, 255, .3); }
.t-input { flex: 1; min-width: 0; padding: 13px 0; border: 0; outline: none; background: transparent; font-size: 20px; font-weight: 800; }
.t-input::-webkit-outer-spin-button, .t-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.t-unit { color: var(--muted); font-weight: 800; }
.t-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.t-quick.four { grid-template-columns: repeat(4, 1fr); }
.t-quick button { padding: 7px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 700; }
.t-quick button:hover { border-color: rgba(255, 255, 255, .3); }
.t-est { font-size: 13.5px; min-height: 18px; }
.t-settings { font-size: 12.5px; color: var(--muted); }
.t-settings summary { cursor: pointer; font-weight: 600; }
.t-settings label { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.t-mini { width: 90px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); text-align: right; }
.t-settings p { margin: 8px 0 0; }
.t-risks { display: grid; gap: 6px; }
.t-risk { padding: 8px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; }
.t-risk.bad { background: rgba(255, 77, 109, .12); color: #ff8fa3; }
.t-risk.warn { background: rgba(255, 204, 77, .1); color: #ffd56b; }
.t-go { width: 100%; padding: 15px; font-size: 16px; font-weight: 800; }
.t-go:disabled { opacity: .6; }
.btn.red { background: var(--nope); color: #fff; }
.t-go.risky { background: #b91c1c; color: #fff; animation: pop .3s; }
.t-status { font-size: 13px; min-height: 0; }
.t-status:empty { display: none; }
.t-status.good { color: var(--like); }
.t-status.bad { color: #ff8fa3; }
.t-status.warn { color: #ffd56b; }
.t-status a { color: inherit; font-weight: 700; }
.t-fine { margin: 0; font-size: 11.5px; color: var(--muted); }
.t-pos-stats { grid-template-columns: repeat(3, 1fr); }
.t-mytrades { display: grid; gap: 3px; }
.chip.trade { font-weight: 800; }

@media (max-width: 900px) {
  .t-grid { grid-template-columns: 1fr; grid-template-areas: "chart" "side" "info"; padding: 12px 12px 40px; }
  .t-side { position: static; }
  .t-chart { height: 300px; }
  .t-stats { grid-template-columns: repeat(2, 1fr); }
  .t-top .chip { display: none; }
}
#tChartMeta .cc-head { flex-wrap: wrap; row-gap: 2px; width: 100%; }

/* quick match flash -> terminal */
.match-flash { position: fixed; inset: 0; z-index: 72; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle at 50% 42%, rgba(253, 38, 122, .55), rgba(11, 11, 18, .92) 62%); }
.match-flash .mf-inner { display: grid; justify-items: center; gap: 14px; text-align: center; }
.match-flash .mf-title { font: 400 58px/1.2 Pacifico, cursive; transform: rotate(-4deg);
  background: linear-gradient(135deg, #fff 10%, #ffd0e0 50%, var(--brand-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.match-flash .mf-img { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; border: 4px solid #fff; position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.match-flash .mf-img img, .match-flash .mf-img .placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 32px; }
.match-flash .mf-sub { font-size: 16px; font-weight: 700; color: #f2f2f8; }
.match-flash.go { animation: mf-fade 1.8s ease both; }
.match-flash.go .mf-inner { animation: mf-pop 1.8s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes mf-fade { 0% { opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mf-pop { 0% { transform: scale(.6); } 14% { transform: scale(1); } 100% { transform: scale(1.06); } }

.toast.actionable { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding-right: 8px; }
.toast-btn { border: 0; border-radius: 999px; padding: 6px 14px; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }

/* ================= GMGN-style terminal ================= */
.t-top { flex-wrap: wrap; row-gap: 8px; }
.t-coin { flex: 0 1 auto; min-width: 200px; }
.t-coin h2 { font-size: 17px; }
.t-coin h2 .muted { font-size: 13px; font-weight: 700; }
.t-coin .sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow: visible; white-space: normal; }
.ca-mini { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font: 600 11px ui-monospace, Consolas, monospace; color: var(--muted); }
.ca-mini:hover { color: var(--text); }
.chip.mini { padding: 1px 7px; font-size: 10.5px; }
.chip.mini svg { width: 10px; height: 10px; }
.t-top-stats { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: flex-end; min-width: 0; }
.ts { display: grid; gap: 1px; }
.ts span { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ts b { font-size: 14px; font-weight: 800; white-space: nowrap; }

.t-grid { grid-template-columns: minmax(0, 1fr) 370px; max-width: 1480px; }
.t-chart-card { padding: 8px 10px 10px; }
.t-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.t-tf { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.t-tf button { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; padding: 5px 8px; border-radius: 7px; }
.t-tf button:hover { color: var(--text); }
.t-tf button.active { background: var(--text); color: #111; }
.t-links { margin-left: auto; display: flex; gap: 6px; }
.t-links .chip { padding: 3px 9px; }
.t-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding: 2px 4px 6px; font-variant-numeric: tabular-nums; min-height: 22px; }
.t-legend b { font-weight: 700; }
.t-chart-wrap { position: relative; height: min(520px, 58vh); border-radius: 12px; overflow: hidden; background: #0e0e15; }
.t-chart-wrap .t-chart { position: absolute; inset: 0; height: auto; }
.t-chart-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.t-chart-note[hidden] { display: none; }

.t-win { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: grid; gap: 8px; }
.tw-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tw-tabs button { display: grid; gap: 1px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.tw-tabs button b { font-size: 13px; }
.tw-tabs button.active { border-color: rgba(255, 255, 255, .35); color: var(--text); }
.tw-vals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tw-vals div { display: grid; gap: 1px; }
.tw-vals span { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.tw-vals b { font-size: 15px; font-weight: 800; }
.t-win .flowbar { margin: 0; height: 6px; }

.t-signer { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.t-signer button { border: 0; border-radius: 9px; padding: 8px 6px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-signer button.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.t-qw { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(33, 225, 140, .08), var(--surface-2)); border: 1px solid rgba(33, 225, 140, .25); }
.t-qw.empty { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border-color: var(--line); }
.t-qw-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.t-qw-top .t-wname { flex: 1; text-align: left; background: none; border: 0; color: var(--text); font: 700 12.5px ui-monospace, Consolas, monospace; }
.t-qw-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.t-qw-actions button { padding: 7px 0; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 700; }
.t-qw-actions button:hover { border-color: rgba(255, 255, 255, .3); }

.t-quick { display: grid; grid-template-columns: repeat(5, 1fr) 34px; gap: 6px; }
.t-quick.sell { grid-template-columns: repeat(4, 1fr) 34px; }
.t-quick button { padding: 9px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; font-weight: 800; }
.t-quick.instant button:not(.pen) { background: rgba(33, 225, 140, .1); border-color: rgba(33, 225, 140, .35); color: var(--like); }
.t-quick.instant.sell button:not(.pen) { background: rgba(255, 77, 109, .1); border-color: rgba(255, 77, 109, .35); color: #ff8fa3; }
.t-quick.instant button:not(.pen):hover { filter: brightness(1.25); }
.t-quick button:disabled { opacity: .5; }
.t-quick .pen, .t-quick .save { color: var(--muted); }
.t-quick.edit { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); }
.t-quick.edit .t-mini { width: 100%; text-align: center; }
.t-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.t-pills button { padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--muted); }
.t-pills button.active { color: var(--text); border-color: rgba(255, 255, 255, .35); }
.t-set-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.t-set-row > span:first-child { width: 58px; font-weight: 700; }
.t-set-row .t-mini { width: 74px; }
.toggle-row { cursor: pointer; }
.toggle-row span { width: auto !important; font-weight: 600 !important; }

.t-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.t-filters button { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--muted); }
.t-filters button.active { background: var(--text); color: #111; border-color: transparent; }
.t-table { display: grid; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.t-tr { display: grid; grid-template-columns: 54px 46px 1fr 1fr 1fr 1.6fr; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.t-tr:nth-child(even):not(.head) { background: rgba(255, 255, 255, .025); }
.t-tr.head { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.t-tr.mine { background: rgba(63, 169, 255, .14) !important; }
.t-tr.fresh { animation: t-fresh 1.2s ease-out; }
@keyframes t-fresh { from { background: rgba(255, 255, 255, .14); } }
.t-tr .maker { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.t-tr .maker a { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--muted); text-decoration: none; }
.t-tr .maker a:hover { color: var(--text); }
.tag-pill.you { background: #3fa9ff; color: #04182a; }
.tag-pill.bot { background: #7c3aed; color: #fff; }

.t-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); animation: fade .15s; }
.t-modal-card { width: min(460px, 100%); max-height: 90dvh; overflow-y: auto; display: grid; gap: 12px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); font-size: 14px; }
.t-modal-card p { margin: 0; color: #d6d6e4; }
.t-modal-head { display: flex; align-items: center; justify-content: space-between; }
.t-modal-head h3 { margin: 0; font-size: 18px; }
.t-modal-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: #d6d6e4; font-size: 13.5px; }
.t-modal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t-addr { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font: 600 12.5px ui-monospace, Consolas, monospace; word-break: break-all; }
.t-key { padding: 12px; border-radius: 12px; background: #1a0f14; border: 1px dashed rgba(255, 77, 109, .5); font: 600 12px ui-monospace, Consolas, monospace; word-break: break-all; transition: filter .2s; }
.t-key.blurred { filter: blur(6px); user-select: none; }
.t-mini.wide { width: 100%; text-align: left; padding: 10px 12px; }

@media (max-width: 900px) {
  .t-top-stats { justify-content: flex-start; order: 3; width: 100%; gap: 4px 14px; }
  .t-chart-wrap { height: 340px; }
  .t-tr { grid-template-columns: 42px 36px 1fr 0.8fr 1.4fr; gap: 6px; font-size: 12px; }
  .t-tr > :nth-child(5) { display: none; }
  .tw-vals b { font-size: 13.5px; }
}


/* terminal on phones / narrow screens (after the desktop rules so it wins) */
@media (max-width: 900px) {
  .t-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chart" "side" "info"; padding: 10px 10px 40px; gap: 12px; }
  .t-top { padding: 8px 12px; gap: 8px; }
  .t-coin { flex: 1; min-width: 0; }
  .t-top-stats { flex: 0 0 100%; order: 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 10px; justify-content: stretch; }
  .ts b { font-size: 13px; }
  .t-chart-card { padding: 6px 6px 8px; }
  .t-toolbar { gap: 6px; }
  .t-tf button { padding: 5px 6px; font-size: 11.5px; }
  .t-links { margin-left: 0; }
  .t-legend { gap: 8px; font-size: 11px; }
  .t-legend span { white-space: nowrap; }
  .t-chart-wrap { height: 330px; }
  .t-side { position: static; }
  .tw-vals { grid-template-columns: repeat(2, 1fr); }
}


/* ---------- entry gate: 18+ / terms / risk agreement (above everything, including the tutorial) ---------- */

.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 30%, rgba(253, 38, 122, .22), rgba(11, 11, 18, .98) 60%);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  animation: fade .25s;
}
.gate.leaving { opacity: 0; transition: opacity .2s; }
.gate-card {
  width: min(520px, 100%);
  display: grid; gap: 12px;
  padding: 24px 22px;
  border-radius: 26px;
  background: rgba(21, 21, 31, .96);
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
}
.gate-brand { justify-self: center; font-size: 22px; }
.gate-title { margin: 2px 0 4px; text-align: center; font-size: 26px; letter-spacing: -.03em; }
.gate-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gate-points li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; padding: 9px 11px; border-radius: 14px; background: rgba(255, 255, 255, .04); font-size: 14px; line-height: 1.4; color: #dcdce8; }
.gate-points li span { font-size: 17px; line-height: 1.25; }
.gate-points b { color: var(--text); }
.gate-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 14px; line-height: 1.4; cursor: pointer; }
.gate-check:has(input:checked) { border-color: rgba(33, 225, 140, .45); background: rgba(33, 225, 140, .06); }
.gate-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--like); cursor: pointer; }
.gate-check a, .gate-fine a { color: var(--brand-b); font-weight: 700; }
.gate-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 2px; }
.gate-actions .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.gate-fine { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }
a.text-btn { display: inline-block; text-decoration: none; }
.t-fine a { color: var(--brand-b); font-weight: 600; }

@media (max-width: 480px) {
  .gate { padding: 10px; place-items: start center; }
  .gate-card { padding: 18px 14px; gap: 10px; border-radius: 22px; }
  .gate-title { font-size: 22px; }
  .gate-points li { font-size: 13.5px; padding: 8px 10px; }
  .gate-actions { grid-template-columns: 1fr; }
}

/* ---------- ApeMatch identity: heart-eyed ape, Lilita One wordmark, pink → banana ---------- */

.brand-ape { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.wordmark { font-family: "Lilita One", Inter, sans-serif; font-weight: 400; letter-spacing: 0; color: #fff4d6; }
.wordmark b { font-weight: 400; }
.gate-brand .brand-ape, .ob-brand .brand-ape { width: 48px; height: 48px; }

/* ---------- token bar (CA) above the app ---------- */

:root { --tb: 38px; }
.token-bar {
  height: var(--tb);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 12px;
  background: linear-gradient(90deg, #ff2e7e, #ff6a52 55%, #ffb627);
  color: #1b1023;
  font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden;
  position: relative; z-index: 46;
}
.token-bar img { flex: none; }
.tb-sym { font-family: "Lilita One", Inter, sans-serif; font-weight: 400; font-size: 16px; letter-spacing: .01em; }
.tb-ca { font: 700 12.5px ui-monospace, Consolas, monospace; background: rgba(27, 16, 35, .14); padding: 3px 9px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb-copy, .tb-buy { flex: none; border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: 12.5px; background: #1b1023; color: #fff4d6; text-decoration: none; }
.tb-buy { background: #fff4d6; color: #1b1023; }
.tb-copy:hover, .tb-buy:hover { filter: brightness(1.15); }
.tb-note { flex: none; color: rgba(27, 16, 35, .7); font-size: 11px; font-weight: 700; text-decoration: none; }
.tb-note:hover { text-decoration: underline; }

/* everything that used the full screen height now leaves room for the bar */
.layout { height: calc(100dvh - var(--tb)); }
.app { height: calc(100dvh - var(--tb)); }
.panel { top: var(--tb); }
@media (min-width: 1100px) {
  .panel, .panel.left, .panel.right { top: auto; height: calc(100dvh - 28px - var(--tb)); }
}
@media (max-width: 640px) {
  :root { --tb: 34px; }
  .token-bar { gap: 7px; font-size: 12px; justify-content: flex-start; }
  .tb-note { display: none; }
  .tb-ca { font-size: 11.5px; }
  .tb-buy { padding: 4px 10px; }
}
.token-bar .short { display: none; }
@media (max-width: 640px) {
  .token-bar .full { display: none; }
  .token-bar .short { display: inline; }
  .tb-ca { flex: none; }
}
