:root{
  --bg: #0c0c0f;
  --bg2:#0f1117;
  --fg: #e9ecf1;
  --muted:#9aa3b2;
  --accent:#f7931a;      /* warm accent */
  --accent-2:#7dd3fc;    /* cool accent for contrast */
  --card:#12141b88;      /* glass card (semi) */
  --border:#232632;
  --good:#12c29a;
  --bad:#ef4444;
}

* { box-sizing: border-box }
html, body { height: 100% }
html, body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1b1220 0%, transparent 60%),
    radial-gradient(1200px 600px at 110% 10%, #101827 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}

.wrap {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(10,12,18,.6);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.brand { display:flex; align-items:center; gap: 12px; text-decoration: none; color: inherit; }
.brand-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.brand-text small { color: var(--muted) }

.header-kpis { display:flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display:inline-flex; align-items:center; gap: 8px;
  font-size:.9rem; padding: 6px 10px; border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(18,20,27,.65);
}
.pill.dim { opacity:.85 }
.pill.good { color: #cafff3; background: rgba(18, 61, 52, .5); border-color: #1b4c3f; }

/* Hero */
.hero { padding: 28px 0 14px }
.hero-card {
  display:grid; grid-template-columns: 1.3fr .9fr; gap: 18px;
  border:1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16,18,25,.7), rgba(12,14,20,.6));
  box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.03);
}
.glass { backdrop-filter: blur(10px) }

.hero-text { padding: 24px; }
.hero-text h1 { margin: 0 0 8px; font-size: clamp(1.25rem, 1.2rem + 1vw, 1.75rem) }
.lead { color: var(--muted); font-size: 1rem }

.join { margin-top: 18px; display: grid; gap: 10px }
.join-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; }
.label { color: var(--muted) }
code {
  background: #151823; color: var(--accent);
  padding: .4rem .55rem; border-radius: 10px; border:1px solid var(--border);
  user-select: all; display:inline-block; max-width: 100%; overflow: auto;
}
.btn {
  border:1px solid var(--border); background: #171a24; color: var(--fg);
  border-radius: 10px; padding: .45rem .8rem; cursor: pointer;
}
.btn:hover { background: #1b1f2b }
.btn-min { padding: .3rem .6rem }

.hint { margin: 4px 0 0; color: var(--muted); font-size: .9rem }

.hero-side { padding: 24px; border-left: 1px solid var(--border); background: linear-gradient(180deg, rgba(12,14,20,.2), rgba(6,7,10,.2)); border-top-right-radius: 16px; border-bottom-right-radius: 16px; }
.stats-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px }
.stat { background: rgba(18,20,27,.55); border:1px solid var(--border); border-radius: 12px; padding: 10px 12px }
.stat-label { color: var(--muted); font-size: .85rem }
.stat-value { font-size: 1.1rem; font-weight: 700 }

.status-leds { display:flex; gap: 10px; margin-top: 12px; flex-wrap: wrap }
.led-item { display:flex; align-items:center; gap: 8px; background: rgba(18,20,27,.55); border:1px solid var(--border); padding: 6px 10px; border-radius: 999px }
.led { width: 10px; height: 10px; border-radius: 50%; background: #555; box-shadow: 0 0 0 0 rgba(0,0,0,0); }
.led.up { background: var(--good); box-shadow: 0 0 16px 2px rgba(18,194,154,.35) }
.led.down { background: var(--bad) }

/* Charts & Panels */
.charts { padding: 24px 0 34px }
.panel {
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(17,19,26,.55), rgba(10,11,16,.5));
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
}
.panel-head { display:flex; align-items: baseline; gap: 12px; margin-bottom: 8px }
.panel h2 { margin: 0; font-size: 1.1rem }
.sub { color: var(--muted); font-size: .9rem }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 36px;
  background: linear-gradient(180deg, rgba(9,11,16,.35), rgba(7,8,12,.35));
}
.donate { display:flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin: 0 0 8px }
.fine { color: var(--muted); text-align: center; margin: 0 }

/* Responsive */
@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-side { border-left: none; border-top: 1px solid var(--border); border-top-right-radius: 0; border-bottom-left-radius: 16px; }
}

/* Charts fixed height (for smoother rendering) */
.chart-fixed {
  height: 300px;
  max-height: 300px;
  display: block !important;
}

/* Ensure canvas can’t collapse in grid/flex */
canvas { display: block; }

/* User stats */
.userstats .us-input input#addrInput{
  background:#151823; color:var(--fg); border:1px solid var(--border);
  border-radius:10px; padding:.45rem .6rem; width:100%;
}
.userstats .us-kpis { margin-top: 12px }

/* Tables (generic) */
.us-tablewrap{
  overflow-x: auto;       /* scroll horizontal si nécessaire */
  overflow-y: hidden;
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:12px;
}
.us-table{
  width: 100%;
  max-width: 100%;
  min-width: 0;           /* empêche la largeur mini rigide */
  margin: 0 auto;         /* centre le tableau dans son conteneur */
  border-collapse: collapse;
  table-layout: fixed;    /* évite l’étirement incontrôlé des colonnes */
}
.us-table th, .us-table td{
  border-bottom:1px solid var(--border);
  padding:10px 12px;
  text-align:left;
  white-space:nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.us-table thead th{ color:var(--muted); font-weight:600 }
.us-table tbody tr:hover{ background: rgba(255,255,255,0.03) }
.us-table .rank { width: 2.5rem; text-align: center; opacity: .85; }
.us-table .t-right { text-align: right; }
.us-table .muted { opacity: .6; text-align: center; }

/* Leaders (Top Hashrate / Top Best Shares) */
.leaders .wrap { display: grid; gap: 20px; }
@media (min-width: 900px){
  .leaders .wrap { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } /* permet la contraction sans overflow */
}
.leaders .panel { min-width: 0; } /* indispensable pour permettre au contenu de rétrécir */
