:root {
  --bg: #070b14;
  --panel: #101827;
  --panel2: #152033;
  --border: #243247;
  --text: #e8eef9;
  --muted: #8b9bb4;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.14);
  --red: #f43f5e;
  --red-dim: rgba(244, 63, 94, 0.14);
  --accent: #38bdf8;
  --gold: #fbbf24;
  --xrp: #7c8cff;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: radial-gradient(1200px 600px at 10% -10%, #152a4a 0%, transparent 50%),
              radial-gradient(900px 500px at 100% 0%, #1a1538 0%, transparent 45%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}
.bg-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  z-index: 0;
}
header.top, main, footer { position: relative; z-index: 1; }
header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 8px;
  max-width: 1100px;
  margin: 0 auto;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 700; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: var(--shadow);
}
h1 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.tag { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.clock-box { text-align: right; }
.clock-label { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.clock { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; color: var(--accent); }
.updated { color: var(--muted); font-size: 0.75rem; margin-top: 2px; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 12px;
}
.card-h h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.src { color: var(--muted); font-size: 0.75rem; }

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hero-xrp {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(124, 140, 255, 0.45);
  background:
    radial-gradient(600px 200px at 90% 20%, rgba(124,140,255,0.25), transparent 60%),
    linear-gradient(135deg, #121a33, #0d1426);
  box-shadow: var(--shadow);
}
.hero-xrp h2 { margin: 4px 0; font-size: 2rem; letter-spacing: 0.04em; }
.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c7d2fe;
  background: rgba(124,140,255,0.18);
  border: 1px solid rgba(124,140,255,0.35);
  padding: 3px 8px;
  border-radius: 999px;
}
.hero-price {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  text-align: right;
}
.hero-right { text-align: right; }
.muted { color: var(--muted); margin: 0; font-size: 0.9rem; }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.asset {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: border-color .15s ease, transform .15s ease;
}
.asset:hover { border-color: #3b516f; transform: translateY(-1px); }
.asset.xrp-mini {
  border-color: rgba(124,140,255,0.5);
  background: linear-gradient(180deg, rgba(124,140,255,0.12), var(--panel2));
}
.asset-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.asset-sym { font-weight: 700; letter-spacing: 0.03em; }
.asset-name { color: var(--muted); font-size: 0.75rem; }
.asset-price { font-family: var(--mono); font-size: 1.15rem; font-weight: 600; margin: 4px 0 8px; }
.chg-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.hero-right .chg-row { justify-content: flex-end; }
.chg {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  white-space: nowrap;
}
.chg.up { color: var(--green); background: var(--green-dim); }
.chg.down { color: var(--red); background: var(--red-dim); }

.big-metric { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.big-price { font-family: var(--mono); font-size: 2rem; font-weight: 700; color: var(--gold); }
.unit { color: var(--muted); font-size: 0.85rem; }

.rates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rate {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.rate-name { color: var(--muted); font-size: 0.8rem; }
.rate-val { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.rate-date { color: var(--muted); font-size: 0.72rem; margin-top: 4px; }
.note { color: var(--muted); font-size: 0.8rem; margin: 12px 0 0; }

.gauge-card { min-height: 180px; }
.gauge { display: flex; flex-direction: column; align-items: center; }
.gauge-svg { width: min(220px, 100%); height: auto; }
.gauge-track { fill: none; stroke: #243247; stroke-width: 10; stroke-linecap: round; }
.gauge-arc {
  fill: none;
  stroke: url(#fngGradCrypto);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  transition: stroke-dashoffset .6s ease;
}
.grid.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.focus-card .hero-price {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 8px 0 6px;
}
.focus-card .gold-metric { align-items: flex-start; }
.focus-card .unit { margin-top: -2px; margin-bottom: 6px; }
@media (max-width: 900px) {
  .grid.three { grid-template-columns: 1fr; }
}
.gauge-val {
  fill: var(--text);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}
.gauge-label {
  margin-top: -4px;
  font-weight: 600;
  font-size: 0.95rem;
}

.news-list { display: flex; flex-direction: column; gap: 8px; }
.news-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  transition: border-color .15s ease, background .15s ease;
}
.news-item.news-ai {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.news-item:hover { border-color: #3d5a80; background: #18243a; }
.news-main { min-width: 0; flex: 1; }
.news-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.72rem; margin-top: 6px;
}
.news-title { font-weight: 600; font-size: 0.95rem; line-height: 1.35; }
.news-sum { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.news-ticks {
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-end; flex-shrink: 0;
}
.tk-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: #121a2b;
}
.tk-pill.tk-up { color: #22c55e; border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.08); }
.tk-pill.tk-down { color: #ef4444; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }
.tk-pill.tk-flat { color: var(--muted); }

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 20px 28px;
  color: var(--muted);
  font-size: 0.78rem;
}
.attrs a { color: var(--accent); text-decoration: none; }
.attrs a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  header.top { flex-direction: column; align-items: flex-start; }
  .clock-box { text-align: left; }
  .grid.two { grid-template-columns: 1fr; }
  .hero-xrp { flex-direction: column; align-items: flex-start; }
  .hero-right, .hero-price { text-align: left; }
  .hero-right .chg-row { justify-content: flex-start; }
  .hero-price { font-size: 2rem; }
  .rates { grid-template-columns: 1fr; }
}


/* —— Clickable suivis —— */
.focus-card.clickable { cursor: pointer; transition: border-color .15s, transform .12s; }
.focus-card.clickable:hover, .focus-card.clickable:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}
.focus-card.clickable .pill { background: rgba(56,189,248,.15); color: var(--accent); }

/* —— Globe Chart overlay (maison) —— */
.chart-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(4, 8, 16, 0.92);
  display: flex; flex-direction: column;
  padding: 0;
}
.chart-overlay.hidden { display: none; }
.chart-shell {
  display: flex; flex-direction: column;
  height: 100%; width: 100%;
  max-width: 1400px; margin: 0 auto;
  background: var(--bg);
}
.chart-top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chart-back {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 14px; font: 600 14px var(--sans); cursor: pointer;
}
.chart-back:hover { border-color: var(--accent); color: var(--accent); }
.chart-title-wrap { flex: 1; min-width: 0; }
.chart-title-wrap h2 { margin: 0; font-size: 1.15rem; }
.chart-src { color: var(--muted); font-size: 12px; }
.chart-live-price {
  font-family: var(--mono); font-size: 1.25rem; font-weight: 600; color: var(--accent);
}
.chart-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}
.tb-group { display: flex; flex-wrap: wrap; gap: 4px; }
.tb-group button {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 10px; font: 500 12px var(--sans); cursor: pointer;
}
.tb-group button:hover { color: var(--text); border-color: #3a4d6a; }
.tb-group button.on {
  background: rgba(56,189,248,.14); color: var(--accent); border-color: var(--accent);
}
.chart-main { flex: 1; min-height: 320px; position: relative; }
.chart-status {
  padding: 6px 16px 10px; font-size: 12px; color: var(--muted); flex-shrink: 0;
}
body.chart-open { overflow: hidden; }
@media (max-width: 640px) {
  .chart-live-price { font-size: 1rem; }
  .tb-group button { padding: 4px 8px; font-size: 11px; }
}

.live-row { display:flex; align-items:center; justify-content:flex-end; gap:8px; margin-top:2px; flex-wrap:wrap; }
.live-pill {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px;
  border: 1px solid rgba(139,155,180,.35); color: var(--muted);
  background: rgba(139,155,180,.08);
}
.live-pill.on {
  color: #22c55e; border-color: rgba(34,197,94,.55);
  background: rgba(34,197,94,.12);
  animation: livePulse 1.6s ease-in-out infinite;
}
.live-pill.off { color: var(--muted); }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.35); }
  50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}
.hero-price.flash-up { color: #22c55e; transition: color .15s; }
.hero-price.flash-down { color: #f43f5e; transition: color .15s; }

/* —— Predictions 5 min (UP/DOWN) —— */
/* pred5m-colors-v2: vert LONG/UP, rouge SHORT/DOWN, gris abstention */
.pred5m {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.pred5m-priority {
  border-color: rgba(251, 191, 36, 0.45);
  background:
    radial-gradient(280px 80px at 100% 0%, rgba(251,191,36,0.14), transparent 70%),
    rgba(255,255,255,0.03);
}
.pred5m-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.pred5m-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.pred5m-badge {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  white-space: nowrap;
}
.pred5m-badge.up {
  color: #22c55e;
  border-color: rgba(34,197,94,.5);
  background: rgba(34,197,94,.14);
}
.pred5m-badge.down {
  color: #f43f5e;
  border-color: rgba(244,63,94,.5);
  background: rgba(244,63,94,.14);
}
.pred5m-badge.abstain {
  color: #94a3b8;
  border-color: rgba(148,163,184,.4);
  background: rgba(148,163,184,.1);
}
.pred5m-meta {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}
.pred5m-panel .pred5m-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.pred5m-item {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.pred5m-item.priority {
  border-color: rgba(251, 191, 36, 0.45);
}
.pred5m-item-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.pred5m-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  .pred5m-badge { font-size: 0.72rem; padding: 2px 8px; }
  .pred5m-meta { font-size: 0.72rem; }
}

.pred5m-badge.up { color:#fff !important; background:#16a34a !important; border-color:#22c55e !important; }
.pred5m-badge.down { color:#fff !important; background:#dc2626 !important; border-color:#ef4444 !important; }
.pred5m-badge.abstain { color:#cbd5e1 !important; background:rgba(148,163,184,.18) !important; border-color:rgba(148,163,184,.45) !important; }
.pred5m.is-up, .pred5m-item.is-up { border-color:rgba(34,197,94,.7) !important; background:rgba(34,197,94,.10) !important; }
.pred5m.is-down, .pred5m-item.is-down { border-color:rgba(239,68,68,.7) !important; background:rgba(239,68,68,.10) !important; }
.pred5m.is-abstain, .pred5m-item.is-abstain { border-color:rgba(148,163,184,.35) !important; }


/* blend-v10 mix line */
.pred5m-mix {
  margin-top: 4px;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #94a3b8;
  word-break: break-word;
}
.pred5m-item .pred5m-mix { font-size: 0.72rem; }
