/* All coins page (/moedas, /coins): the orbit in the hero, the searchable coin list and every pair page. */

/* ---------- Hero: Monero at the center, every other coin on two slow rings ---------- */
.coins-hero { padding-bottom: 40px; }
.ch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 48px; align-items: center; }
.coins-hero h1 { font-size: clamp(64px, 8vw, 120px); }
.coins-hero .sub { max-width: 420px; }

.corbit { --o: 520px; --ri: 148px; --ro: 232px; --ob: 52px; --core: 112px;
  position: relative; width: var(--o); height: var(--o); margin: 0 auto; }
.ring { position: absolute; inset: 0; }
/* The track each ring runs on. */
.ring::before { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1);
  border-radius: 50%; border: 1px solid var(--line-2); }
.ring-o::before { border-style: dashed; border-color: color-mix(in srgb, var(--line-2) 80%, transparent); }
.ring-i { --r: var(--ri); }
.ring-o { --r: var(--ro); }
.ob { position: absolute; left: 50%; top: 50%; width: var(--ob); height: var(--ob); margin: calc(var(--ob) / -2); padding: 0; border-radius: 50%;
  transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(var(--a) * -1)) scale(1);
  transition: transform 1.1s cubic-bezier(.34,1.3,.64,1) calc(320ms + var(--i) * 45ms), opacity .5s ease calc(320ms + var(--i) * 45ms); }
.ob span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px -14px rgba(10,10,10,.45); transition: box-shadow .25s, scale .35s cubic-bezier(.34,1.45,.64,1); }
.ob img { width: calc(var(--ob) - 10px); height: calc(var(--ob) - 10px); border-radius: 50%; }
.ob:hover span, .ob:focus-visible span { scale: 1.16; box-shadow: 0 0 0 2px var(--accent), 0 14px 30px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
.ob:focus-visible { outline: none; }
/* Its name, under the coin, while the pointer is on it. */
.ob span::after { content: attr(data-n); position: absolute; top: calc(100% + 8px); left: 50%; translate: -50% 4px; white-space: nowrap; pointer-events: none;
  padding: 4px 9px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 11.5px/1.2 var(--sans); opacity: 0; transition: opacity .2s, translate .2s; }
.ob span { position: relative; }
.ob:hover span::after, .ob:focus-visible span::after { opacity: 1; translate: -50% 0; }

.o-core { position: absolute; left: 50%; top: 50%; width: var(--core); height: var(--core); margin: calc(var(--core) / -2); padding: 0; border-radius: 50%;
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 10%, transparent), 0 0 90px 10px color-mix(in srgb, var(--accent) 38%, transparent);
  transition: scale .4s cubic-bezier(.34,1.45,.64,1); }
.o-core img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.o-core:hover { scale: 1.05; }
/* The signal Monero sends out to the rings. */
/* First in the orbit, so the pulse passes behind the rings and every coin. */
.o-pulse { position: absolute; left: 50%; top: 50%; width: var(--core); height: var(--core); margin: calc(var(--core) / -2); border-radius: 50%; pointer-events: none; }
.o-pulse::before, .o-pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; pointer-events: none; }

/* Motion: the coins fly out from Monero once, then the rings turn slowly in opposite directions. */
.motion .corbit:not(.on) .ob { opacity: 0; transform: rotate(var(--a)) translateX(0) rotate(calc(var(--a) * -1)) scale(.3); }
.motion .corbit.on .ring-i { animation: orbit-spin 90s linear infinite; }
.motion .corbit.on .ring-o { animation: orbit-spin 140s linear infinite reverse; }
/* Each coin turns back as much as its ring turns, so it stays upright. */
.motion .corbit.on .ring-i .ob span { animation: orbit-spin 90s linear infinite reverse; }
.motion .corbit.on .ring-o .ob span { animation: orbit-spin 140s linear infinite; }
.motion .corbit.on .o-pulse::before { animation: orbit-ping 3.6s cubic-bezier(.2,.6,.3,1) 1.2s infinite; }
.motion .corbit.on .o-pulse::after { animation: orbit-ping 3.6s cubic-bezier(.2,.6,.3,1) 3s infinite; }
.motion .corbit:hover .ring, .motion .corbit:hover .ob span, .motion .corbit:focus-within .ring, .motion .corbit:focus-within .ob span { animation-play-state: paused; }
@keyframes orbit-spin { to { rotate: 360deg; } }
@keyframes orbit-ping { 0% { opacity: .7; scale: 1; } 100% { opacity: 0; scale: 4.1; } }

/* ---------- Toolbar: search, filters, count ---------- */
.clist { padding: 24px 0 40px; }
.ctool { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.csearch { flex: 0 1 320px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.csearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.csearch svg { width: 18px; height: 18px; flex: none; }
.csearch input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 500 15px var(--sans); color: var(--ink); }
.csearch input::-webkit-search-cancel-button { cursor: pointer; }
.cfilters { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--bg-2); }
.cfilters button { position: relative; z-index: 1; height: 38px; padding: 0 15px; border-radius: 999px; font: 600 13.5px/1 var(--sans); color: var(--muted); white-space: nowrap; transition: color .25s; }
.cfilters button:hover { color: var(--ink); }
.cfilters button[aria-pressed="true"] { color: var(--ink); }
.cfilters button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The pill behind the chosen filter slides to it (coins.js sets its place). */
.cthumb { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(10,10,10,.08), 0 0 0 1px var(--line);
  transition: transform .45s cubic-bezier(.16,1,.3,1), width .45s cubic-bezier(.16,1,.3,1); }
.ccount { margin-left: auto; font-size: 13.5px; font-weight: 550; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Coin rows ---------- */
.crows { border-top: 1px solid var(--line); }
.cr { border-bottom: 1px solid var(--line); }
.cr[hidden] { display: none; }
.cr-head { position: relative; display: grid; grid-template-columns: 44px minmax(150px, 1.1fr) minmax(0, 1.7fr) 130px auto 18px; gap: 20px; align-items: center;
  padding: 16px 12px; border-radius: 18px; transition: background-color .25s; }
.cr-head:hover, .cr.open .cr-head { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.cr-ico img { width: 44px; height: 44px; border-radius: 50%; display: block; transition: transform .5s cubic-bezier(.34,1.45,.64,1); }
.cr-head:hover .cr-ico img { transform: rotate(-10deg) scale(1.06); }
.cr-name { margin: 0; min-width: 0; }
.cr-tog { display: flex; align-items: baseline; gap: 8px; padding: 0; text-align: left; font: inherit; color: var(--ink); }
/* The whole row opens the coin; the "Swap" link sits above this layer. */
.cr-tog::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.cr-tog:focus-visible { outline: none; }
.cr-tog:focus-visible::after { box-shadow: 0 0 0 2px var(--accent) inset; }
.cr-tog b { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-tog small { font-size: 13px; font-weight: 600; color: var(--muted); }
.cr-nets { display: flex; flex-wrap: wrap; gap: 6px; }
.nchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.nchip img { width: 14px; height: 14px; border-radius: 50%; }
.cr-price { text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-price.tick { animation: price-tick .9s ease; }
@keyframes price-tick { 0% { color: var(--accent-text); } 100% { color: var(--ink); } }
.cr-go { position: relative; z-index: 1; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 13.5px; font-weight: 650; white-space: nowrap; transition: background-color .2s, color .2s, transform .2s; }
.cr-go:hover { background: var(--accent); color: var(--accent-ink); }
.cr-go:active { transform: scale(.97); }
.cr-pm { width: 16px; height: 16px; color: var(--muted); transition: transform .35s cubic-bezier(.16,1,.3,1), color .2s; }
.cr-pm svg { width: 100%; height: 100%; display: block; }
.cr.open .cr-pm { transform: rotate(45deg); color: var(--accent-text); }

/* Opening a coin: its row grows from 0 to its own height. */
.cr-body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .5s cubic-bezier(.16,1,.3,1), visibility 0s .5s; }
.cr.open .cr-body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .5s cubic-bezier(.16,1,.3,1); }
.cr-in { min-height: 0; overflow: hidden; }
.cr-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 6px 12px 28px 76px;
  opacity: 0; translate: 0 -6px; transition: opacity .3s, translate .4s cubic-bezier(.16,1,.3,1); }
.cr.open .cr-grid { opacity: 1; translate: none; transition-delay: .08s; }
.cr-about { margin: 0; max-width: 44ch; font-size: 15px; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.cr-col h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cnets { display: grid; gap: 6px; }
.cnet { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s; }
.cnet img { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.cnet span { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cnet b { font-size: 14px; font-weight: 600; }
.cnet small { font-size: 12px; color: var(--muted); }
.cnet svg, .pgl svg { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform .2s, color .2s; }
.cnet:hover, .pgl:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cnet:hover svg, .pgl:hover svg { transform: translateX(3px); color: var(--accent-text); }
.cpairs { display: flex; flex-wrap: wrap; gap: 6px; }
.cpairs a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--bg-2); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background-color .2s, color .2s; }
.cpairs a:hover { background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); color: var(--accent-text); }

/* Rows that come back after a search or filter settle in, one after the other. */
.cr.enter { animation: row-in .45s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--n, 0) * 22ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } }

.cempty { padding: 56px 0; text-align: center; }
.cempty p { margin: 0 0 16px; color: var(--muted); }
.cempty .btn { height: 44px; padding: 0 20px; }

/* ---------- Every pair page, grouped by the coin received ---------- */
.cpairs-sec .sec-grid > h2 { font-size: clamp(36px, 4vw, 52px); }
.pgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.pg h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding-left: 15px; font-size: 15px; font-weight: 650; }
.pg h3 img { width: 24px; height: 24px; border-radius: 50%; }
.pg-l { display: grid; gap: 6px; }
.pgl { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s; }
.pgl img { width: 24px; height: 24px; border-radius: 50%; }
.pgl span { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 550; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  .cr-head { grid-template-columns: 44px minmax(140px, 1fr) minmax(0, 1.4fr) 110px auto 18px; gap: 16px; }
}
@media (max-width: 960px) {
  .ch-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .coins-hero h1 { font-size: clamp(56px, 17vw, 96px); }
  .coins-hero .sub { margin-left: auto; margin-right: auto; }
  .corbit { --o: 360px; --ri: 100px; --ro: 160px; --ob: 42px; --core: 80px; }
  .ctool { flex-wrap: wrap; }
  .csearch { flex: 1 1 100%; }
  .cfilters { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .cfilters::-webkit-scrollbar { display: none; }
  .ctool { gap: 10px; padding: 12px 0; }
  .ccount { margin-left: auto; }
}
@media (max-width: 760px) {
  .cr-head { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: 'ico name price' 'ico nets go'; gap: 8px 14px; padding: 14px 8px; }
  .cr-ico { grid-area: ico; align-self: start; }
  .cr-ico img { width: 40px; height: 40px; }
  .cr-name { grid-area: name; }
  .cr-nets { grid-area: nets; }
  .cr-price { grid-area: price; }
  .cr-go { grid-area: go; align-self: start; height: 32px; padding: 0 14px; font-size: 13px; }
  .cr-pm { display: none; }
  .cr-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 4px 8px 24px 62px; }
  .pgs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  /* The sticky bar stays short on phones: the list itself shows how many coins match. */
  .ccount { display: none; }
}
@media (max-width: 420px) {
  .corbit { --o: 320px; --ri: 88px; --ro: 142px; --ob: 38px; --core: 70px; }
  .cfilters button { padding: 0 12px; font-size: 13px; }
  .cr-grid { padding-left: 8px; }
  .nchip { height: 24px; padding: 0 8px; font-size: 12px; }
}
@media (max-width: 960px) {
  .coins-hero .crumbs { justify-content: center; }
}
