/* ══════════════════════════════════════════
   BASE STYLES
══════════════════════════════════════════ */
:root {
  --window-gap: 15px;
  --color-theme-light: #07d;
  --color-theme-dark: #07d;
}
* { box-sizing: border-box; }
body {
  padding: 0; margin: 0;
  font: 20px Verdana, Arial, sans-serif;
  color: #fff; background-color: #000;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-y: auto;
}
a { outline:none; cursor:pointer; user-select:none; text-decoration:none; color:#fff; }
button { outline:none; cursor:pointer; user-select:none; margin:0; font:inherit; border:none; line-height:24px; color:#fff; }
input { font:20px Verdana,Arial,sans-serif; border:none; background:none; outline:none; line-height:24px; color:#fff; }
h1,h2 { font-family:Arial,sans-serif; }
h1 { margin:0; font-size:2em; text-transform:uppercase; white-space:nowrap; font-weight:400; }
h2 { margin:.5em 0; font-size:1.5em; }
p { margin:10px 0; }
strong { color:#07d; }
svg { fill:currentColor; pointer-events:none; height:24px; }
ul { margin:0; padding:0; list-style:none; }
fieldset { margin:0; padding:0; border:none; }
fieldset+fieldset { margin-top:15px; }
legend { margin:0; padding:0; color:#ccc; }

.color-secondary { color:#ccc; }
.right { text-align:right; }
.center { text-align:center; }
.grow { flex-grow:1; }
.gap-s { gap:5px; }
.gap-m { gap:10px; }
.flex-row { display:flex; align-items:center; }
.flex-column { display:flex; flex-direction:column; align-items:center; }
.flex-wrap { flex-wrap:wrap; }
.no-margin-bottom { margin-bottom:0; }
.padding-right { padding-right:5px; }
.justify-end { justify-content:flex-end; }

@keyframes loading { 0%{transform:scaleX(0);} to{transform:scaleX(1);} }
@keyframes spinning { 0%{transform:rotate(0);} 50%{transform:rotate(250deg);} to{transform:rotate(360deg);} }
@keyframes pulsing { 0%{transform:scale(1);} to{transform:scale(.8);} }
@keyframes fadeIn { from{opacity:0;transform:translateY(-8px);} to{opacity:1;transform:none;} }

.data-updater {
  transition:background-color .4s;
  position:absolute; bottom:0; left:0; right:0; height:2px;
  animation:loading 60s linear infinite;
  transform-origin:left;
  background-color:var(--color-theme-light,#07d);
}
.number { transition:color .4s; }

.window {
  box-shadow:0 4px 16px #0006; border-radius:12px;
  max-height:100%; overflow-y:auto;
  pointer-events:auto; background-color:#444444fc;
}
@supports (backdrop-filter:blur(8px)){
  .window { background-color:#444444e6; backdrop-filter:blur(8px); }
}
.window header { padding:var(--window-gap); background-color:transparent; position:static; box-shadow:none; }
.window-content { padding:var(--window-gap); }

.window-host {
  position:fixed; left:0; right:0; top:60px; bottom:8px;
  z-index:150; margin:0 auto; width:95%; max-width:600px;
  transform:translateY(calc(-100% - 80px));
  pointer-events:none;
}
.window-host.in, .window-host.out { transition:transform .4s; }
.window-host.in { transform:none; }

.icon-button {
  border-radius:50%; background-color:#ffffff1f;
  transition:background-color .4s;
  margin:0; padding:10px; display:inline-flex; justify-content:center;
}
.icon-button:hover { background-color:#ffffff40; }
.icon-button.active { background-color:#07d; }
.icon-button.hidden { opacity:0; pointer-events:none; }

.solid-button {
  border-radius:12px; background-color:#ffffff1f;
  transition:background-color .4s;
  margin:0; padding:10px 15px;
  display:inline-flex; align-items:center; gap:5px; white-space:nowrap;
}
.solid-button:hover { background-color:#ffffff40; }
.solid-button.active { background-color:#07d; }

.popup {
  box-shadow:0 4px 16px #0006; border-radius:12px;
  transition:transform .2s, opacity .2s;
  position:fixed; max-width:90vw; max-height:70%;
  z-index:170; overflow:auto; box-sizing:border-box;
  background-color:#444444fc;
  animation:fadeIn .2s ease;
}
@supports (backdrop-filter:blur(8px)){
  .popup { background-color:#444444e6; backdrop-filter:blur(8px); }
}
.popup-content { display:flex; flex-direction:column; gap:10px; padding:15px; }

.menu { list-style:none; padding:8px 0; margin:0; min-width:200px; }
.menu-item {
  display:flex; align-items:center; gap:10px;
  padding:8px 20px; cursor:pointer; user-select:none;
}
.menu-item:hover { background-color:#ffffff1f; }
.menu-item.selected { color:#09f; }
.menu-item svg, .menu-item .icon { flex-shrink:0; color:#ccc; }
.menu-item-header { display:flex; justify-content:space-between; align-items:flex-end; padding:15px 20px 5px; color:#ccc; font-size:.85em; }

.input {
  border-radius:12px; transition:box-shadow .4s;
  box-shadow:inset 0 0 1px 1px #ffffff4d;
  background-color:#0003;
  display:inline-flex; align-items:center;
  padding:5px 10px; cursor:text; box-sizing:border-box;
}
.input:focus-within { box-shadow:inset 0 0 1px 1px #09f; }
.input input { padding:5px; height:100%; flex-grow:1; }
.input-action { padding:5px; }

.currency-logo { width:24px; height:24px; object-fit:contain; border-radius:50%; }

.bubble-window-links { justify-content:center; gap:calc(var(--window-gap)*3); padding-bottom:var(--window-gap); }
.bubble-window-price { justify-content:center; white-space:nowrap; padding-bottom:var(--window-gap); }
.bubble-window-price input { width:7em; text-align:center; }
.bubble-window-details { display:flex; padding-bottom:var(--window-gap); }
.bubble-window-performance { display:flex; gap:5px; padding:5px; }
.bubble-window-performance > div {
  border-radius:12px; transition:background-color .4s;
  padding:5px 0; gap:3px; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; flex-grow:1;
}
.bubble-window-performance > div:hover,
.bubble-window-performance > div.selected { background-color:#ffffff14; }

.settings-page { display:flex; flex-direction:column; padding:var(--window-gap); gap:20px; }
.settings-page li.flex-row { display:flex; align-items:center; gap:12px; }

.status {
  border-radius:12px; position:fixed; left:50%; top:50%;
  transform:translate(-50%,-50%);
  display:flex; flex-direction:column; align-items:center; text-align:center;
  background-color:#222; gap:20px; padding:20px;
  user-select:none; white-space:nowrap;
}
.status img { animation:pulsing 1s infinite alternate; border-radius:50%; width:64px; height:64px; }

.navigation {
  position:fixed; bottom:10px; left:10px; right:10px;
  pointer-events:none; z-index:120;
}
.navigation > div {
  border-radius:12px; position:absolute; bottom:0; pointer-events:auto;
  background-color:#444; overflow:hidden;
}
.navigation > div button { background-color:transparent; border-radius:0; }
.navigation-filter { left:0; }
.navigation-pages { right:0; display:flex; }
.nav-filler { height:64px; }

.currency-rank { display:inline-flex; align-items:center; gap:.2em; }
.currency-rank-change { font-size:.7em; line-height:1em; }

footer {
  display:flex; justify-content:center;
  padding:20px; color:#ccc; font-size:12px;
  background-color:#000; font-family:Arial,sans-serif;
  gap:20px; flex-wrap:wrap; margin-top:20px;
}

.overlay-backdrop {
  position:fixed; inset:0; z-index:140;
  background:rgba(0,0,0,.3); backdrop-filter:blur(2px);
}

@media(max-width:1000px){
  header { height:50px; padding:0 5px; gap:5px; }
  h1 { font-size:1.4em; }
}
@media(max-width:600px){
  .tab { padding:10px; }
  h1 { font-size:1.2em; }
  .window { --window-gap:10px; font-size:.9em; }
}

/* ══════════════════════════════════════
   HEADER — minimalist
══════════════════════════════════════ */
header {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0 24px;
  background-color: #111;
  position: sticky; top: 0; z-index: 110;
  height: 46px;
  display: flex; align-items: center; gap: 10px;
  position: relative;
}
header h1 {
  font-size: 0.82em;
  font-weight: 200;
  letter-spacing: 7px;
  color: #fff;
  font-family: Arial, sans-serif;
  text-transform: uppercase;
}
header .logo { width:2em; height:2em; border-radius:50%; }
.header-padded { padding: 0 50px; }
header .input {
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  background-color: rgba(255,255,255,0.04);
  padding: 4px 12px;
  font-size: 0.82em;
  transition: border-color .2s, background-color .2s;
}
header .input:focus-within {
  border-color: rgba(255,255,255,0.28);
  background-color: rgba(255,255,255,0.07);
  box-shadow: none;
}
header .icon-button {
  background-color: transparent;
  border-radius: 6px;
  padding: 6px;
  color: rgba(255,255,255,0.6);
  transition: color .2s, background-color .2s;
}
header .icon-button:hover { background-color: rgba(255,255,255,0.07); color: #fff; }
header .icon-button.active { background-color: transparent; color: #07d; }
header .icon-button svg { height: 18px; }
header .solid-button {
  background-color: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.78em;
  font-family: Arial, sans-serif;
  font-weight: 300;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.75);
  transition: border-color .2s, color .2s, background-color .2s;
}
header .solid-button:hover { background-color: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.28); color: #fff; }
header .solid-button.active { border-color: #07d; color: #07d; background-color: transparent; }
header .solid-button svg { height: 10px; opacity: .6; }

.search-results { min-width:280px; max-height:320px; overflow-y:auto; }

.progress-bar {
  position: absolute; bottom: 0; left: 0; height: 1px;
  background: rgba(0,119,221,0.5);
  animation: loading 60s linear infinite;
  transform-origin: left;
}

#filter-popup {
  display: none; position: fixed; z-index: 180;
  background: rgba(16,16,16,0.97);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  overflow: hidden; animation: fadeIn .15s ease;
  min-width: 200px;
}
@supports (backdrop-filter: blur(12px)) {
  #filter-popup { background: rgba(16,16,16,0.88); backdrop-filter: blur(12px); }
}
#filter-popup.open { display: block; }
#filter-popup .filter-section { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
#filter-popup .filter-section:last-child { border-bottom: none; }
#filter-popup .filter-header { padding: 10px 16px 4px; font-size: 0.65em; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.12em; font-family: Arial, sans-serif; font-weight: 400; }
#filter-popup .filter-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 14px; cursor: pointer; font-size: 0.82em; font-family: Arial, sans-serif; font-weight: 300; color: rgba(255,255,255,0.65); border-left: 2px solid transparent; transition: color .15s, background .15s, border-color .15s; }
#filter-popup .filter-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.9); }
#filter-popup .filter-item.active { color: #fff; border-left-color: #07d; background: rgba(0,119,221,0.08); font-weight: 400; }

#settings-popup {
  display:none; position:fixed; z-index:180; top:60px; right:10px;
  background:#444; border-radius:14px;
  box-shadow:0 8px 32px #000a;
  width:280px; padding:16px;
  animation:fadeIn .2s ease;
}
#settings-popup.open { display:block; }
#settings-popup h3 { margin:0 0 12px; font-size:1em; color:#07d; }
#settings-popup .setting-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; font-size:.85em; }
#settings-popup .setting-label { color:#ccc; }
#settings-popup select { background:#333; color:#fff; border:1px solid #555; border-radius:8px; padding:4px 8px; font-size:.85em; cursor:pointer; }

.desktop-only { display: initial; }
.mobile-only  { display: none; }

#mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: #000;
  border-top: 1px solid #252836;
  align-items: center;
  padding: 0 10px;
  gap: 4px;
  z-index: 100;
  box-shadow: 0 -4px 20px #0008;
}

.mob-nav-spacer { flex: 1; }

.mob-nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #888;
  font-size: 0.72em;
  font-family: Arial, sans-serif;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: color .2s, background .2s;
  flex-shrink: 0;
}
.mob-nav-btn svg { height: 20px; width: 20px; }
.mob-nav-btn:hover { color: #ccc; background: rgba(255,255,255,0.07); }
.mob-nav-btn.active { color: var(--color-theme-light, #07d); }
.mob-nav-btn.active svg { filter: drop-shadow(0 0 4px currentColor); }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: flex; }

  header { padding: 0 14px; gap: 6px; height: 44px; }
  header h1 { font-size: 0.72em; letter-spacing: 5px; }

  #search-wrap {
    display: none;
    position: fixed;
    top: 48px; left: 0; right: 0;
    background: #000;
    border-bottom: 1px solid #252836;
    padding: 8px 12px;
    max-width: 100%;
    width: 100%;
    z-index: 120;
    box-shadow: 0 4px 16px #0006;
  }
  #search-wrap.mobile-search-open { display: flex; }

  #settings-popup { top: auto; bottom: 66px; right: 10px; }
  /* JS sets inline top/left for desktop — clear them on mobile via the JS fix in toggleFilter() */
  #filter-popup {
    bottom: 70px !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    width: 260px;
    max-width: 92vw;
  }
  #main-content { padding-bottom: 58px; }
  .bubble-chart-header { gap: 4px; padding: 0 8px; }
  .configuration-tabs .tab { font-size: 0.78em; padding: 5px 10px; }
}

/* ══════════════════════════════════════
   BUBBLE CHART
══════════════════════════════════════ */
.bubble-chart { position:relative; }
.bubble-chart canvas { position:absolute; left:0; top:0; touch-action:none; cursor:default; }

.tab {
  transition: color .2s, background-color .2s, border-color .2s;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 5px 14px; margin-right: 4px;
  white-space: nowrap; flex-shrink: 0;
  background-color: transparent;
  cursor: pointer;
  font-size: 0.75em; font-family: Arial, sans-serif;
  font-weight: 300; letter-spacing: 0.2px;
  color: rgba(255,255,255,0.45);
}
.tab:hover { background-color: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.18); }
.tab.selected { background-color: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.22) !important; color: #fff !important; font-weight: 400; }
.configuration-tabs { display:flex; padding: 6px 10px; overflow-x:auto; scrollbar-width:none; gap: 2px; }
.configuration-tabs::-webkit-scrollbar { display:none; }
.bubble-chart-header { display:flex; align-items:center; padding-right:10px; border-bottom: 1px solid rgba(255,255,255,0.05); }

#tt {
  position:absolute; pointer-events:none;
  background:rgba(6,6,18,0.96);
  border:1px solid rgba(255,255,255,0.13);
  border-radius:8px; padding:7px 11px;
  font-size:11.5px; color:#fff; display:none;
  z-index:9; line-height:1.7; min-width:145px;
  box-shadow:0 4px 16px #0006;
}

#root {
  width:100%; background:#000;
  border-radius:12px; overflow:hidden;
  position:relative;
  box-shadow:0 4px 24px #000a;
}
#root canvas { display:block; width:100%; touch-action:none; cursor:default; }
#bar {
  position:absolute; top:8px; left:8px; right:8px;
  display:flex; flex-wrap:wrap; gap:5px; pointer-events:none;
}
.btn {
  pointer-events:all; font-size:11px; padding:4px 12px;
  border-radius:14px; border:1px solid rgba(255,255,255,0.2);
  background:rgba(15,15,35,0.8); color:rgba(255,255,255,0.85);
  cursor:pointer; transition:background .4s, color .4s;
}
.btn:hover { background:rgba(255,255,255,0.15); }
.btn.on { background:rgba(255,255,255,0.92); color:#0a0a16; font-weight:700; }

.price-chart { position:relative; height:240px; }
.price-chart canvas { position:absolute; left:0; top:0; touch-action:none; }
.price-chart-label { position:absolute; bottom:4px; left:8px; color:#ccc; font-size:.7em; pointer-events:none; }

/* ══════════════════════════════════════
   TABLE WRAPPER
══════════════════════════════════════ */
#list-view {
  margin-top: 12px;
  background: #07080c;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #111318;
}

.scroll-container { overflow-x: auto; overflow-y: hidden; }

table {
  width: 100%;
  white-space: nowrap;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
}

thead {
  background: linear-gradient(180deg, #0e1120 0%, #090c16 100%);
  position: sticky;
  z-index: 50;
}
thead tr { border-bottom: 1px solid #151820; }

th {
  padding: 11px 10px;
  font-weight: 600;
  font-size: 0.68em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; transition: color .2s; }
th.sortable:hover { color: #aaa; }
th.sorted-asc, th.sorted-desc { color: var(--color-theme-light); }
th svg { transition: transform .3s; transform: scale(0); height: 12px; margin-left: 2px; vertical-align: middle; }
th:hover svg, th.sorted-desc svg { transform: none; }
th.sorted-asc svg { transform: rotate(-180deg); }

tbody tr {
  border-bottom: 1px solid #0c0e14;
  transition: background-color .15s;
  cursor: pointer;
  position: relative;
}
tbody tr:nth-child(even) { background-color: rgba(255,255,255,0.02); }
tbody tr:hover { background-color: #0f1220; }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--color-theme-light); }

td { padding: 10px 10px; font-size: 0.8em; vertical-align: middle; text-align: center; }

.rank-td {
  text-align: right;
  color: #555;
  font-size: 0.72em;
  padding-right: 6px;
  min-width: 28px;
}

.fav-td { padding: 0 4px; }

.fav-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid #252835;
  border-radius: 5px;
  color: #888;
  font-size: 14px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  padding: 0;
  line-height: 1;
}
.fav-btn:hover { border-color: var(--color-theme-light); color: #fff; background: rgba(255,255,255,0.12); }
.fav-btn.active { background: rgba(255,200,0,0.15); border-color: gold; color: gold; }

.name-td { min-width: 120px; max-width: 160px; }

.coin-name-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}
.coin-logo-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.coin-fullname {
  font-weight: 600;
  color: #ddd;
  font-size: 0.84em;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coin-sym {
  color: #555;
  font-size: 0.75em;
}

.num-td {
  text-align: right;
  color: #bbb;
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
}

.perf-td {
  text-align: center;
  font-weight: 700;
  font-size: 0.76em;
  min-width: 58px;
  border-radius: 0;
  padding: 5px 6px;
  font-variant-numeric: tabular-nums;
}

.links-td { padding: 6px 8px; min-width: 0; }

.links-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.links-info-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.links-divider {
  height: 1px;
  background: #0d0f16;
  margin: 1px 0;
}

.links-exchange-row {
  display: flex;
  align-items: center;
  justify-content: center;
  /* flex-wrap: wrap;as */
  gap: 4px;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: rgba(255,255,255,0.07);
  transition: background .15s, transform .15s;
  text-decoration: none;
  flex-shrink: 0;
}
.link-icon:hover {
  background: rgba(255,255,255,0.20);
  transform: translateY(-1px);
}

.link-icon img, .link-icon svg {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: block;
}

.center-container {
  display: flex;
  justify-content: center;
}

/* ══════════════════════════════════════
   COIN DETAIL MODAL
══════════════════════════════════════ */
#coin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}
#coin-modal.open { display: block; }
#coin-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

.window-host {
  position: fixed;
  left: 0; right: 0;
  top: 58px; bottom: 8px;
  z-index: 201;
  margin: 0 auto;
  width: 95%;
  max-width: 600px;
  transform: translateY(calc(-100% - 80px));
  pointer-events: none;
  overflow-y: auto;
}
.window-host.in, .window-host.out { transition: transform .4s cubic-bezier(.4,0,.2,1); }
.window-host.in { transform: none; pointer-events: auto; }

.window {
  box-shadow: 0 8px 32px #000a;
  border-radius: 14px;
  overflow: hidden;
  background-color: rgba(52,52,52,0.97);
}
@supports (backdrop-filter: blur(10px)) {
  .window { background-color: rgba(52,52,52,0.88); backdrop-filter: blur(10px); }
}
.window > header { padding: var(--window-gap,15px); border-bottom: 1px solid rgba(255,255,255,0.08); }
.window-content { padding: 0 var(--window-gap,15px) var(--window-gap,15px); }

.bubble-window-links {
  justify-content: center;
  gap: 40px;
  padding: var(--window-gap,15px) 0;
}
.bubble-window-price {
  justify-content: center;
  white-space: nowrap;
  padding-bottom: var(--window-gap,15px);
  font-size: .95em;
}
.bw-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.2);
  padding: 4px 10px;
  cursor: text;
}
.bw-input input {
  width: 6em;
  text-align: center;
  font-size: .85em;
  background: none;
  border: none;
  outline: none;
  color: #fff;
}
.bubble-window-details {
  display: flex;
  padding-bottom: var(--window-gap,15px);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-top: 12px;
  margin-bottom: 4px;
}

.price-chart {
  position: relative;
  height: 200px;
  margin: 10px 0;
}
.price-chart span, .price-chart > img {
  pointer-events: none;
  user-select: none;
  position: absolute;
}
.price-chart > span {
  display: none;
  bottom: 6px;
  left: 8px;
  font-size: .75em;
  color: #aaa;
}
.price-chart > img {
  left: 0; top: 0; right: 0; bottom: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transition: opacity .4s;
  animation: bw-spinning 1.5s infinite;
}
.price-chart canvas {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  touch-action: none;
}
.price-chart.loaded > span { display: block; }
.price-chart.loaded > img { opacity: 0; animation-play-state: paused; }

@keyframes bw-spinning {
  0%   { transform: rotate(0); }
  50%  { transform: rotate(250deg); }
  100% { transform: rotate(360deg); }
}

.bubble-window-performance {
  display: flex;
  gap: 4px;
  padding: 4px 0 2px;
}
.bubble-window-performance > div {
  border-radius: 10px;
  padding: 6px 0;
  gap: 4px;
  cursor: pointer;
  transition: background-color .3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.bubble-window-performance > div > span:first-child {
  font-size: .72em;
  color: #aaa;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background-color .3s, color .3s;
}
.bubble-window-performance > div > span:last-child {
  color: var(--color-light);
  font-weight: 700;
  font-size: .9em;
}
.bubble-window-performance > div:hover,
.bubble-window-performance > div.selected {
  background-color: rgba(255,255,255,0.08);
}
.bubble-window-performance > div.selected > span:first-child {
  background-color: var(--color-dark, rgba(255,255,255,.2));
  color: #fff;
}

.icon-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  width: 160px;
}
.icon-box > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 5px;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  background: rgba(255,255,255,0.07);
  padding: 2px;
}
.icon-box > img:hover { transform: scale(1.15); background: rgba(255,255,255,0.18); }
.dense-link-trade { padding: 6px 10px; }

/* ── PAGINATION ── */
#pagination {
  display: none;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 14px 10px;
  background: #0e1016;
  border-top: 1px solid #1e2130;
}
.pg-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 8px; background: rgba(255,255,255,0.07);
  color: #aaa; font-size: 0.82em; font-family: Arial, sans-serif;
  cursor: pointer; transition: background .15s, color .15s;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
}
.pg-btn:hover:not([disabled]) { background: rgba(255,255,255,0.18); color: #fff; }
.pg-btn.active { background: var(--color-theme-light, #07d); color: #fff; border-color: var(--color-theme-light, #07d); }
.pg-btn[disabled] { opacity: 0.3; cursor: default; }
.pg-ellipsis { color: #555; font-size: 0.85em; padding: 0 4px; font-family: Arial, sans-serif; }
.pg-info { color: #555; font-size: 0.75em; font-family: Arial, sans-serif; margin-left: 8px; white-space: nowrap; }

/* All table columns visible on all screen sizes — table scrolls horizontally on mobile */

@media(max-width:768px) {
  th { padding: 9px 10px; font-size: 0.62em; }
  td { padding: 9px 10px; font-size: 0.74em; }

  .rank-td  { padding-right: 4px; min-width: 20px; font-size: 0.68em; }
  .fav-td   { padding: 0 2px; }
  .fav-btn  { width: 20px; height: 20px; font-size: 12px; }
  .name-td  { min-width: 90px; max-width: 120px; }
  .num-td   { font-size: 0.72em; }
  .perf-td  { min-width: 44px; padding: 3px 4px; font-size: 0.7em; }
  .links-td { padding: 3px 5px; }

  .coin-logo-sm   { width: 28px; height: 28px; }
  .coin-fullname  { font-size: 0.8em; max-width: 70px; }
  .coin-sym       { font-size: 0.7em; }
  .coin-name-cell { gap: 5px; }

  .link-icon      { width: 28px; height: 28px; }
  .link-icon img  { width: 16px; height: 16px; }

  #pagination { padding: 10px 6px; gap: 3px; }
  .pg-btn     { min-width: 28px; height: 28px; padding: 0 7px; font-size: 0.75em; }
  .pg-info    { font-size: 0.7em; margin-left: 4px; }
}
