/* ============================================================
   BROKEN // CRYPTO  —  Mythos Exploit Risk Index
   ============================================================ */
:root {
  --bg: #06070b;
  --bg2: #0b0d14;
  --panel: #0f111a;
  --panel2: #14172230;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.12);
  --text: #e9ebf2;
  --muted: #888fa6;
  --faint: #5a6076;
  --accent: #7b61ff;
  --accent2: #ff3b6b;
  --green: #2ecc71;
  --red: #ff4d4d;
  --crit: #ff3b3b;
  --high: #ff7a45;
  --elev: #ffc53d;
  --mod: #73d13d;
  --res: #36cfc9;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* animated grid + glow backdrop */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(123, 97, 255, 0.16), transparent 60%),
    radial-gradient(800px 500px at 0% 0%, rgba(255, 59, 107, 0.12), transparent 55%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.5;
  animation: drift 40s linear infinite;
}
@keyframes drift { from { background-position: 0 0; } to { background-position: 46px 46px; } }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 22px; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(6, 7, 11, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 9px; cursor: default; user-select: none; }
.brand .mark {
  font-family: var(--mono); font-weight: 800; font-size: 19px; letter-spacing: -0.5px;
  background: linear-gradient(92deg, #fff, var(--accent) 60%, var(--accent2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand .by { font-size: 11px; color: var(--faint); letter-spacing: 2px; text-transform: uppercase; }
.nav .spacer { flex: 1; }
.nav .stamp { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.nav .stamp b { color: var(--muted); font-weight: 600; }

.btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--text); background: var(--panel); border: 1px solid var(--line2);
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: all 0.15s ease;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.12); }
.btn:active { transform: translateY(1px); }
.btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.btn.loading .dot { background: var(--elev); animation: pulse 0.7s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.btn.ghost { background: transparent; }

/* ---------- hero ---------- */
.hero { padding: 56px 0 30px; position: relative; }
.hero h1 {
  font-family: var(--mono); font-weight: 800; letter-spacing: -1.5px; line-height: 1.02;
  font-size: clamp(38px, 7vw, 78px);
}
.hero h1 .g { background: linear-gradient(95deg, #fff 10%, var(--accent) 55%, var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero h1 .glitch { position: relative; color: var(--text); }
.hero h1 .glitch::before, .hero h1 .glitch::after {
  content: attr(data-t); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden;
}
.hero h1 .glitch::before { color: var(--accent2); animation: gl1 3.4s infinite steps(2); clip-path: inset(0 0 62% 0); }
.hero h1 .glitch::after { color: var(--accent); animation: gl2 2.8s infinite steps(2); clip-path: inset(58% 0 0 0); }
@keyframes gl1 { 0%,92%,100% { transform: none; } 93% { transform: transl(-3px,0); } 96% { transform: translate(2px,0); } }
@keyframes gl2 { 0%,90%,100% { transform: none; } 91% { transform: translate(3px,0); } 95% { transform: translate(-2px,0); } }
.hero p.lede {
  margin-top: 20px; max-width: 720px; font-size: 16px; color: var(--muted); line-height: 1.6;
}
.hero p.lede b { color: var(--text); }
.hero .tag {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent2); border: 1px solid rgba(255,59,107,.3); background: rgba(255,59,107,.07);
  padding: 5px 12px; border-radius: 100px;
}
.tag .blink { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); animation: pulse 1.1s infinite; }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 30px 0 8px; }
.stat {
  background: linear-gradient(180deg, var(--panel), #0b0d1480);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent); opacity: .5; }
.stat.crit::after { background: var(--crit); }
.stat.bridge::after { background: var(--accent2); }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); }
.stat .v { font-family: var(--mono); font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -1px; }
.stat .s { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- controls ---------- */
.controls {
  position: sticky; top: 62px; z-index: 40; margin-top: 26px; padding: 14px 0;
  background: rgba(6,7,11,.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.controls .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input {
  width: 100%; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  padding: 11px 14px 11px 38px; color: var(--text); font-size: 14px; font-family: var(--sans);
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123,97,255,.12); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }

.select {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; color: var(--text);
  padding: 11px 12px; font-size: 13px; font-family: var(--sans); cursor: pointer;
}
.select:focus { outline: none; border-color: var(--accent); }

.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 10px 13px; cursor: pointer; font-size: 13px; display: flex; }
.seg button.on { background: var(--accent); color: #fff; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  font-size: 12px; padding: 6px 12px; border-radius: 100px; cursor: pointer; user-select: none;
  border: 1px solid var(--line2); color: var(--muted); background: var(--panel);
  display: inline-flex; align-items: center; gap: 7px; transition: all .14s ease;
}
.chip:hover { border-color: var(--line2); color: var(--text); }
.chip .swatch { width: 8px; height: 8px; border-radius: 50%; }
.chip.on { color: #fff; border-color: transparent; }
.chip .ct { font-family: var(--mono); font-size: 10px; opacity: .7; }

.resultline { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.resultline .n { font-family: var(--mono); color: var(--text); font-weight: 700; }
.resultline .m { font-size: 12px; color: var(--faint); }
.resultline .clear { margin-left: auto; font-size: 12px; color: var(--accent); cursor: pointer; background: none; border: 0; }

/* ---------- table ---------- */
.tablewrap { margin: 8px 0 60px; }
table.coins { width: 100%; border-collapse: collapse; }
table.coins thead th {
  position: sticky; top: 132px; z-index: 30; background: rgba(8,9,15,.95); backdrop-filter: blur(8px);
  text-align: right; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--faint);
  font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line2); cursor: pointer; white-space: nowrap;
}
table.coins thead th.l { text-align: left; }
table.coins thead th:hover { color: var(--text); }
table.coins thead th .ar { color: var(--accent); margin-left: 4px; }
table.coins tbody tr {
  border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s ease;
}
table.coins tbody tr:hover { background: linear-gradient(90deg, rgba(123,97,255,.07), transparent); }
table.coins td { padding: 13px 14px; text-align: right; font-variant-numeric: tabular-nums; }
table.coins td.l { text-align: left; }
.rankcell { color: var(--faint); font-family: var(--mono); font-size: 12px; width: 46px; }

.coincell { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.coincell img { width: 30px; height: 30px; border-radius: 50%; background: #1a1d29; flex: 0 0 30px; }
.coincell .nm { display: flex; flex-direction: column; line-height: 1.25; }
.coincell .nm b { font-weight: 600; font-size: 14px; }
.coincell .nm span { font-size: 11px; color: var(--faint); font-family: var(--mono); text-transform: uppercase; }

.price { font-family: var(--mono); font-weight: 600; }
.chg { font-family: var(--mono); font-weight: 600; }
.chg.up { color: var(--green); } .chg.down { color: var(--red); }

.archtag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 9px; border-radius: 7px;
  background: var(--panel); border: 1px solid var(--line2); color: var(--muted); white-space: nowrap;
}
.archtag .swatch { width: 7px; height: 7px; border-radius: 50%; }

/* risk meter cell */
.riskcell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; min-width: 150px; }
.riskbar { flex: 1; max-width: 90px; height: 7px; border-radius: 100px; background: #1a1d29; overflow: hidden; }
.riskbar > i { display: block; height: 100%; border-radius: 100px; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.riskval { font-family: var(--mono); font-weight: 700; font-size: 14px; width: 26px; text-align: right; }

.tierbadge {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .6px;
  padding: 3px 7px; border-radius: 6px; white-space: nowrap;
}

/* sparkline */
.spark { width: 92px; height: 30px; display: block; }

/* ---------- card grid view ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 16px 0 60px; }
.card {
  background: linear-gradient(180deg, var(--panel), #0a0c1280); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; cursor: pointer; transition: all .16s ease; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.card .top { display: flex; align-items: center; gap: 11px; }
.card .top img { width: 38px; height: 38px; border-radius: 50%; }
.card .top .nm b { font-size: 15px; } .card .top .nm span { font-size: 11px; color: var(--faint); font-family: var(--mono); display: block; }
.card .top .rk { margin-left: auto; text-align: right; }
.card .top .rk .v { font-family: var(--mono); font-size: 24px; font-weight: 800; line-height: 1; }
.card .top .rk .l { font-size: 9px; font-family: var(--mono); letter-spacing: .5px; }
.card .mid { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 10px; }
.card .mid .p { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.card .riskbar { max-width: none; margin: 4px 0 12px; height: 8px; }
.card .foot { display: flex; align-items: center; gap: 8px; }

/* ---------- modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(3,4,8,.72); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.scrim.on { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; z-index: 101; top: 50%; left: 50%; width: min(680px, 94vw); max-height: 90vh; overflow-y: auto;
  transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, #11131d, var(--bg2)); border: 1px solid var(--line2); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); transition: all .22s cubic-bezier(.2,.8,.2,1);
}
.modal.on { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.modal .x { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line2); color: var(--muted); cursor: pointer; font-size: 16px; }
.modal .x:hover { color: #fff; border-color: var(--accent2); }
.modal .head { padding: 26px 26px 18px; display: flex; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.modal .head img { width: 56px; height: 56px; border-radius: 50%; }
.modal .head .ttl b { font-size: 22px; } .modal .head .ttl .sub { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.modal .head .gauge { margin-left: auto; text-align: center; }
.modal .head .gauge .num { font-family: var(--mono); font-size: 38px; font-weight: 800; line-height: 1; }
.modal .head .gauge .lab { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; margin-top: 3px; }

.modal .body { padding: 22px 26px 28px; }
.section-h { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--faint); margin: 22px 0 12px; }
.section-h:first-child { margin-top: 0; }

.assessment { font-size: 14.5px; line-height: 1.65; color: #cdd2e0; }
.assessment .lead { color: var(--accent2); font-weight: 600; }

.factors { display: flex; flex-direction: column; gap: 11px; }
.factor { display: grid; grid-template-columns: 130px 1fr 38px; align-items: center; gap: 12px; }
.factor .fl { font-size: 12px; color: var(--muted); }
.factor .fbar { height: 8px; border-radius: 100px; background: #1a1d29; overflow: hidden; }
.factor .fbar > i { display: block; height: 100%; border-radius: 100px; width: 0; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.factor .fv { font-family: var(--mono); font-size: 13px; font-weight: 700; text-align: right; }

.signals { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.signals li { display: flex; gap: 10px; font-size: 13px; color: #c2c7d6; line-height: 1.5; }
.signals li::before { content: "▸"; color: var(--accent2); flex: 0 0 auto; }

.mstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mstat { background: var(--bg2); padding: 12px 14px; }
.mstat .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; }
.mstat .v { font-family: var(--mono); font-size: 15px; font-weight: 600; margin-top: 3px; }

.mythos-note { margin-top: 22px; border: 1px solid rgba(255,59,107,.28); background: rgba(255,59,107,.06); border-radius: 12px; padding: 14px 16px; }
.mythos-note .h { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--accent2); text-transform: uppercase; margin-bottom: 6px; }
.mythos-note p { font-size: 13px; color: #cbd0de; line-height: 1.55; }

/* ---------- methodology drawer ---------- */
.method { display: none; }
.method.on { display: block; }
.methodbox { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; margin: 10px 0 50px; }
.methodbox h3 { font-family: var(--mono); font-size: 14px; margin-bottom: 10px; }
.methodbox p { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 10px; }
.methodbox .ws { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-top: 16px; }
.methodbox .w { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.methodbox .w .pct { font-family: var(--mono); font-size: 22px; font-weight: 800; color: var(--accent); }
.methodbox .w .nm { font-size: 12px; font-weight: 600; margin-top: 4px; }
.methodbox .w .d { font-size: 11px; color: var(--faint); margin-top: 4px; line-height: 1.45; }

/* ---------- hover exposure tooltip ---------- */
#tip {
  position: fixed; z-index: 120; width: 330px; max-width: 88vw; pointer-events: none;
  background: linear-gradient(180deg, #14172a, #0b0d16); border: 1px solid var(--line2);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.55); padding: 14px 15px;
  opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .13s ease, transform .13s ease;
}
#tip.on { opacity: 1; transform: translateY(0) scale(1); }
#tip .th { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
#tip .th img { width: 22px; height: 22px; border-radius: 50%; }
#tip .th b { font-size: 13px; }
#tip .th .rk { margin-left: auto; font-family: var(--mono); font-weight: 800; font-size: 18px; }
#tip .th .rk small { font-size: 8.5px; display: block; letter-spacing: .5px; text-align: right; font-weight: 700; }
#tip .frow { display: grid; grid-template-columns: 78px 1fr 24px; align-items: center; gap: 8px; margin: 4px 0; }
#tip .frow .fl { font-size: 10.5px; color: var(--faint); }
#tip .frow .fb { height: 5px; border-radius: 100px; background: #1c2030; overflow: hidden; }
#tip .frow .fb > i { display: block; height: 100%; border-radius: 100px; }
#tip .frow .fv { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--muted); }
#tip .frow.hot .fl { color: var(--text); }
#tip .frow.hot .fv { color: var(--text); font-weight: 700; }
#tip .expo-h {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent2); margin: 12px 0 8px; display: flex; align-items: center; gap: 6px;
}
#tip .expo-h.clean { color: var(--res); }
#tip .expo { list-style: none; display: flex; flex-direction: column; gap: 8px; }
#tip .expo li { display: flex; gap: 8px; align-items: flex-start; }
#tip .expo .ic {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 5px; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); margin-top: 1px;
}
#tip .expo .ic.l2 { background: rgba(255,92,168,.16); color: #ff5ca8; }
#tip .expo .ic.prog { background: rgba(123,97,255,.16); color: #7b61ff; }
#tip .expo .ic.bridge { background: rgba(255,59,59,.16); color: #ff3b3b; }
#tip .expo .ic.liq { background: rgba(255,197,61,.16); color: #ffc53d; }
#tip .expo .ic.ok { background: rgba(54,207,201,.16); color: #36cfc9; }
#tip .expo .tx b { font-size: 11.5px; font-weight: 600; color: var(--text); display: block; line-height: 1.3; }
#tip .expo .tx span { font-size: 10.5px; color: var(--faint); line-height: 1.35; }
#tip .hint { font-size: 10px; color: var(--faint); margin-top: 11px; border-top: 1px solid var(--line); padding-top: 9px; }

/* modal exposure list reuses .expo styling but with pointer events */
.modal .expo li { padding: 2px 0; }

footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--faint); font-size: 12px; }
footer a { color: var(--muted); }

.empty { text-align: center; padding: 60px 0; color: var(--faint); }

@media (max-width: 920px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  table.coins .hide-sm { display: none; }
  .modal .head .gauge .num { font-size: 30px; }
  .factor { grid-template-columns: 100px 1fr 34px; }
}
@media (max-width: 560px) {
  table.coins .hide-xs { display: none; }
  .hero { padding: 36px 0 20px; }
}
