/* Saat control room. Mark colours were validated on the card surface (#102a31) for lightness, chroma and
   colour-vision separation; text never wears a data colour. */
:root {
  color-scheme: dark;
  --bg: #061a1f;
  --card: #0f2a31;
  --card-2: #12323a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f2efe6;
  --ink-2: #b4c9cc;
  --ink-3: #7c979c;
  --gold: #f2b04a;       /* UI accent (buttons, highlights), not a chart colour */
  --solar: #c98016;
  --wind: #3b86d6;
  --red: #e0563f;
  --green: #2fa871;
  --teal: #1aa3ad;
  --purple: #9b7be0;
  --display: "Space Grotesk", Inter, -apple-system, sans-serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }
body { font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(242, 176, 74, 0.16), transparent 62%),
    radial-gradient(900px 700px at -8% 108%, rgba(59, 134, 214, 0.16), transparent 60%),
    radial-gradient(700px 500px at 50% 50%, rgba(26, 163, 173, 0.05), transparent 70%),
    linear-gradient(180deg, #08232a 0%, #061a1f 60%, #05161b 100%);
}
.sky::after {
  content: ""; position: absolute; inset: 0; opacity: 0.35;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(1200px 800px at 50% 20%, #000 30%, transparent 80%);
}

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
  padding: 12px 32px; background: rgba(6, 26, 31, 0.72); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(242,239,230,.85), 0 0 24px rgba(242,176,74,.35); }
.name { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: .3px; }
.tag { font-size: 12.5px; color: var(--ink-3); }
.where { margin-left: auto; font-size: 13.5px; color: var(--ink-2); }
.chain { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); background: rgba(255,255,255,.05); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #6ee7a8; box-shadow: 0 0 0 0 rgba(110,231,168,.6); animation: pulse 2s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(110,231,168,.55); } 70% { box-shadow: 0 0 0 9px rgba(110,231,168,0); } 100% { box-shadow: 0 0 0 0 rgba(110,231,168,0); } }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding: 28px 32px 80px; max-width: 1480px; margin: 0 auto; }
.steps { display: flex; flex-direction: column; gap: 26px; min-width: 0; }

.kicker { text-transform: uppercase; letter-spacing: 2px; font-size: 11.5px; font-weight: 700; color: var(--gold); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; }
h1 { font-size: 40px; line-height: 1.1; margin: 10px 0 14px; }
h1 .hl { background: linear-gradient(90deg, #f2b04a, #f08a5d 55%, #e0563f); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 23px; line-height: 1.25; margin: 8px 0 10px; }
h3 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 12px; color: var(--ink-2); max-width: 900px; }
.lead { font-size: 16px; }
.note { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }

.hero, .step, .evidence, .feed {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)), rgba(15, 42, 49, 0.78);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ---------------------------------------------------------------- hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; padding: 34px 36px; overflow: hidden; position: relative; }
.hero::before { content: ""; position: absolute; right: -120px; top: -120px; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(242,176,74,.14), transparent 65%); pointer-events: none; }
.stats { display: grid; grid-template-columns: 1fr 1.25fr; gap: 14px; margin: 18px 0 14px; }
.stat { border-radius: 16px; padding: 14px 18px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.stat .v { font-family: var(--display); font-size: 54px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.stat .l { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.stat.paper .v { color: transparent; -webkit-text-stroke: 1.5px rgba(242,239,230,.7); }
.stat.real { border-color: rgba(224,86,63,.45); background: radial-gradient(160% 140% at 0% 0%, rgba(224,86,63,.18), rgba(224,86,63,.04)); }
.stat.real .v { color: #ff8a73; text-shadow: 0 0 28px rgba(224,86,63,.55); }
.keys { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--ink-2); }
.keys i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.keys i.ghost { border: 1.5px dashed rgba(242,239,230,.6); }
.hero-ring { display: grid; place-items: center; min-height: 460px; }
.hero-ring svg, .claim-ring svg { width: 100%; max-width: 560px; height: auto; overflow: visible; }

/* ---------------------------------------------------------------- timeline of steps */
.timeline { position: relative; display: flex; flex-direction: column; gap: 26px; padding-left: 46px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 30px; bottom: 30px; width: 2px; background: linear-gradient(180deg, rgba(242,176,74,.7), rgba(26,163,173,.6) 50%, rgba(47,168,113,.7)); box-shadow: 0 0 12px rgba(242,176,74,.35); }
.step { position: relative; padding: 26px 30px; }
.step .node { position: absolute; left: -46px; top: 24px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #06171b; background: radial-gradient(circle at 35% 30%, #ffd78a, #f2b04a 60%, #c98016); box-shadow: 0 0 0 5px rgba(6,26,31,1), 0 0 22px rgba(242,176,74,.55); }

/* ---------------------------------------------------------------- controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 6px; }
label { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
select { font: inherit; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--ink); }
select option { background: #0f2a31; color: var(--ink); }
button { font: inherit; font-size: 13.5px; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; color: #1d1405; background: linear-gradient(180deg, #f6c46a, #f2b04a 50%, #e39a2e); box-shadow: 0 8px 22px -10px rgba(242,176,74,.8), inset 0 1px 0 rgba(255,255,255,.35); }
button.secondary { background: rgba(255,255,255,.04); color: var(--ink); border-color: var(--line-2); box-shadow: none; }
button.danger { background: rgba(224,86,63,.08); color: #ff9b86; border-color: rgba(224,86,63,.55); box-shadow: none; }
button.ghost { background: transparent; color: var(--ink-3); border-color: var(--line); box-shadow: none; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: default; filter: none; }
button.busy { position: relative; color: transparent !important; }
button.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid; border-color: var(--ink) transparent var(--ink) transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chart { position: relative; height: 280px; margin-top: 12px; }
.chart.tall { height: 330px; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.fact { background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 12px; padding: 8px 13px; font-size: 13px; color: var(--ink-2); }
.fact b { color: var(--ink); font-size: 15px; font-family: var(--display); }
.fact.bad { background: rgba(224,86,63,.1); border-color: rgba(224,86,63,.4); }
.fact.bad b { color: #ff9b86; }
.fact.good { background: rgba(47,168,113,.1); border-color: rgba(47,168,113,.45); }
.fact.good b { color: #7fe0ae; }
.hash { font-family: var(--mono); font-size: 12px; color: var(--ink); }

.verdict { display: flex; align-items: center; gap: 16px; margin: 14px 0 0; padding: 14px 18px; border-radius: 14px; border: 1px solid; }
.verdict .badge { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 1px; padding: 4px 12px; border-radius: 8px; }
.verdict .what { font-size: 14px; color: var(--ink-2); }
.verdict .what b { color: var(--ink); }
.verdict.held { border-color: rgba(224,86,63,.5); background: linear-gradient(90deg, rgba(224,86,63,.2), rgba(224,86,63,.04)); }
.verdict.held .badge { background: var(--red); color: #fff; box-shadow: 0 0 24px rgba(224,86,63,.6); }
.verdict.passed { border-color: rgba(47,168,113,.5); background: linear-gradient(90deg, rgba(47,168,113,.2), rgba(47,168,113,.04)); }
.verdict.passed .badge { background: var(--green); color: #04150c; box-shadow: 0 0 24px rgba(47,168,113,.55); }

/* ---------------------------------------------------------------- order book */
.book { display: grid; grid-template-columns: 64px repeat(24, minmax(0, 1fr)); gap: 4px; margin-top: 16px; font-size: 11px; }
.book .lab { color: var(--ink-3); display: flex; align-items: center; font-weight: 600; }
.book .hh { color: var(--ink-3); text-align: center; font-family: var(--mono); font-size: 10px; }
.book .cell { height: 46px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11px; position: relative; border: 1px solid rgba(255,255,255,.08); }
.book .cell .p { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.75); transform-origin: left; }
.book .cell.empty { background: rgba(255,255,255,.025); color: transparent; border-style: dashed; }
.book .legend { grid-column: 2 / span 24; display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11.5px; margin-top: 4px; }

/* ---------------------------------------------------------------- claim */
.claim-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px; align-items: center; margin-top: 14px; }
.scores { display: grid; gap: 12px; }
.score { border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; background: rgba(255,255,255,.03); }
.score .v { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; }
.score .l { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.score.ghost .v { color: transparent; -webkit-text-stroke: 1.4px rgba(242,239,230,.7); }
.score.red .v { color: #ff8a73; }
.score.final { border-color: rgba(47,168,113,.5); background: radial-gradient(150% 140% at 0% 0%, rgba(47,168,113,.22), rgba(47,168,113,.04)); }
.score.final .v { color: #7fe0ae; font-size: 60px; text-shadow: 0 0 30px rgba(47,168,113,.55); }
.claim-ring { display: grid; place-items: center; }
.terminal { margin-top: 14px; font-family: var(--mono); font-size: 13px; background: #04110f; border: 1px solid rgba(224,86,63,.5); border-radius: 12px; padding: 12px 16px; color: #c9d6d8; box-shadow: 0 0 30px -10px rgba(224,86,63,.5); }
.terminal .err { color: #ff8a73; font-weight: 700; }
.terminal .dim { color: var(--ink-3); }

/* ---------------------------------------------------------------- evidence */
.evidence { padding: 28px 30px; }
.ev-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 10px; }
.ev { border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; background: rgba(255,255,255,.025); display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 26px; align-items: center; min-width: 0; }
.ev .chart { margin-top: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td b { color: #7fe0ae; }
.tbl .bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--green); vertical-align: middle; margin-left: 8px; box-shadow: 0 0 10px rgba(47,168,113,.6); }

/* ---------------------------------------------------------------- live chain feed */
.feed { position: sticky; top: 86px; align-self: start; padding: 18px; max-height: calc(100vh - 112px); display: flex; flex-direction: column; }
.feed-head { font-family: var(--display); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.addr { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-bottom: 12px; line-height: 1.7; }
#feed { list-style: none; padding: 0; margin: 0 0 14px; overflow-y: auto; flex: 1; font-size: 12.5px; }
#feed li { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
#feed .blk { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); background: rgba(255,255,255,.05); border: 1px solid var(--line-2); border-radius: 8px; height: 36px; display: grid; place-items: center; }
#feed .who { font-weight: 700; color: var(--gold); margin-right: 4px; }
#feed .tx { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
#feed li.fresh { animation: flash 1.4s ease-out; }
#feed li.fresh .blk { border-color: rgba(110,231,168,.7); box-shadow: 0 0 14px rgba(110,231,168,.4); }
@keyframes flash { from { background: rgba(110,231,168,.12); } to { background: transparent; } }
.run { width: 100%; margin-bottom: 8px; }
.feed .ghost { width: 100%; }
.replay-note { font-size: 12px; color: var(--ink-2); background: rgba(242,176,74,.08); border: 1px solid rgba(242,176,74,.35); border-radius: 10px; padding: 8px 11px; margin: 0 0 10px; }
.sepolia { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sepolia p { font-size: 12.5px; margin-bottom: 10px; }
.sepolia button { width: 100%; }
.sepolia-out { font-size: 12.5px; color: var(--ink-2); margin: 10px 0 6px; line-height: 1.55; }
.sepolia-out b { color: var(--ink); }
.sepolia-out .score { font-family: var(--display); font-size: 22px; font-weight: 700; color: #7fe0ae; }
.sepolia-out .dim { color: var(--ink-3); font-size: 11px; }
.sepolia-links { font-size: 12px; color: var(--ink-3); }
.sepolia-links a { color: var(--gold); text-decoration: none; }
.sepolia-links a:hover { text-decoration: underline; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 20; }

@media (max-width: 1150px) {
  .layout { grid-template-columns: 1fr; }
  .feed { position: static; max-height: none; }
  .hero, .ev, .claim-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .where { margin-left: 0; width: 100%; }
  .layout { padding: 16px; }
  .hero, .step, .evidence { padding: 20px 16px; }
  .timeline { padding-left: 0; }
  .timeline::before, .step .node { display: none; }
  h1 { font-size: 28px; }
  .stats { grid-template-columns: 1fr; }
  .book { grid-template-columns: 44px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 8px; }
  .book .cell { height: 34px; font-size: 8px; }
}
