/* $outhodl. rank is your bag. */

:root {
  --bg: #0a0b0d;
  --panel: #101216;
  --panel2: #14171c;
  --line: #1f242c;
  --ink: #e8ecef;
  --muted: #8b94a1;
  --dim: #5b6470;
  --green: #2ee59d;
  --green-dim: rgba(46, 229, 157, 0.12);
  --ember: #ff6a3d;
  --ember-dim: rgba(255, 106, 61, 0.12);
  --red: #ff5470;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green); color: #04120b; }

a { color: inherit; }

button { font-family: inherit; cursor: pointer; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }

.hl-green { color: var(--green); }
.hl-ember { color: var(--ember); }

/* ---------- buttons ---------- */

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:hover { border-color: var(--dim); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #04120b;
  font-weight: 700;
}
.btn-primary:hover { background: #4cf0b1; border-color: #4cf0b1; }

.btn-ember {
  background: var(--ember);
  border-color: var(--ember);
  color: #170a04;
  font-weight: 700;
}
.btn-ember:hover { background: #ff8259; border-color: #ff8259; }

.btn-ghost { background: transparent; }

.btn-wide { width: 100%; margin-top: 6px; }

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 22px;
  background: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  position: relative;
}
.wordmark .tick { color: var(--green); }
.wordmark:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.wordmark-hint {
  position: absolute;
  left: 0;
  top: 100%;
  font-size: 11px;
  color: var(--green);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.wordmark-hint.show { opacity: 1; }

.top-stats { display: flex; gap: 20px; margin-left: auto; }
.top-stat { display: flex; flex-direction: column; align-items: flex-end; }
.top-stat label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.top-stat b { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }

#connect-btn { white-space: nowrap; }
#connect-btn.connected { border-color: var(--green); color: var(--green); }

/* ---------- hero ---------- */

main { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

.hero { padding: 64px 0 40px; }

.hero h1 {
  font-size: clamp(31px, 6.5vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero-sub {
  max-width: 560px;
  color: var(--muted);
  margin-top: 18px;
  font-size: 17px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 34px;
  max-width: 720px;
}
.stat {
  background: var(--panel);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.stat label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); }
.stat b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b.pending { color: var(--dim); font-weight: 400; font-size: 14px; }

.hero-actions { display: flex; gap: 12px; margin-top: 26px; }

/* ---------- board zone ---------- */

.board-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  padding: 20px 0 56px;
  align-items: start;
}

.board-head, .feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.board-head h2, .feed-head h2 { font-size: 20px; }
.board-note { font-size: 12px; color: var(--dim); font-family: var(--font-mono); }

.board {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.board-pending { padding: 54px 34px; text-align: center; }
.board-pending h3 { font-size: 22px; color: var(--dim); margin-bottom: 10px; }
.board-pending p { color: var(--muted); max-width: 460px; margin: 0 auto 12px; font-size: 15px; }
.pending-rules { font-size: 13px !important; color: var(--dim) !important; }

.pending-flame {
  width: 34px; height: 34px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 70%, var(--ember) 0%, rgba(255,106,61,0.25) 55%, transparent 75%);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.18); opacity: 1; }
}

/* rows */

.row {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto 74px;
  align-items: center;
  gap: 12px;
  padding: 13px 18px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  transition: background 0.2s ease;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--panel2); }

.row .rank {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--dim);
  font-weight: 600;
}
.row.r1 .rank { color: var(--green); }
.row.r2 .rank, .row.r3 .rank { color: var(--ink); }

.row.eternal { box-shadow: inset 3px 0 0 var(--ember); }

.row .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.row .name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.row .name:hover, .row .name:hover { color: var(--green); }
.row .addr { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

.row .val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.row.eternal .val { color: var(--ember); }

.row .sup {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: calc(var(--w) * 1%);
  background: var(--green);
  opacity: 0.55;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.row.eternal .bar { background: var(--ember); }

/* badges */

.badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  border-radius: 4px;
  flex: none;
}
.badge.held { color: var(--green); background: var(--green-dim); }
.badge.eternal { color: var(--ember); background: var(--ember-dim); }

/* overtake flash */

@keyframes overtake {
  0% { background: var(--ember-dim); }
  100% { background: var(--panel); }
}
.row.flash { animation: overtake 1.6s ease-out; }

/* row enter */

@keyframes rowin {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.row.enter { animation: rowin 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards; }

/* FLIP reorder: app.js sets transform then releases */

.row.flipping { transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }

/* tx link on eternal rows */

.row .txlink {
  color: var(--dim);
  font-size: 11px;
  text-decoration: none;
  font-family: var(--font-mono);
  flex: none;
}
.row .txlink:hover { color: var(--ember); }

/* ---------- feed ---------- */

.feed-col { position: sticky; top: 74px; }

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--dim);
  display: inline-block;
}
.live-dot.on {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46, 229, 157, 0.5);
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(46, 229, 157, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(46, 229, 157, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 229, 157, 0); }
}

.feed {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.feed-empty { padding: 26px 20px; color: var(--dim); font-size: 13.5px; }

.ov {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  animation: rowin 0.35s ease backwards;
}
.ov:last-child { border-bottom: none; }
.ov b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; font-size: 12.5px; }
.ov .ov-rank { font-family: var(--font-mono); color: var(--ember); font-weight: 600; }
.ov .ov-from { color: var(--dim); }
.ov .ov-burn { color: var(--ember); font-family: var(--font-mono); font-weight: 600; }
.ov time { float: right; font-size: 11px; color: var(--dim); font-family: var(--font-mono); }

/* ---------- tldr ---------- */

.tldr { padding: 26px 0 56px; max-width: 760px; }
.tldr h2 { font-size: 22px; margin-bottom: 18px; }
.tldr ul { list-style: none; }
.tldr li {
  padding: 13px 0 13px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  position: relative;
}
.tldr li::before {
  content: '-';
  position: absolute;
  left: 4px;
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ---------- action cards ---------- */

.actions-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 0 0 56px;
}
.action-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 26px;
}
.action-card h3 { font-size: 19px; margin: 12px 0 10px; }
.action-card p { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }
.eternal-card { background: linear-gradient(180deg, rgba(255,106,61,0.05), var(--panel) 55%); }

/* ---------- furnace ---------- */

.furnace {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 56px;
  background: var(--panel);
}
.ember-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.furnace-inner { position: relative; padding: 40px 34px; text-align: center; }
.furnace h2 { font-size: 24px; }
.furnace-addr {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ember);
  margin: 14px auto 6px;
  word-break: break-all;
  max-width: 560px;
}
a.furnace-addr { text-decoration: none; }
a.furnace-addr:hover { color: #ff8259; }
.furnace-stats {
  display: flex;
  justify-content: center;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  max-width: 620px;
  margin: 22px auto;
}
.furnace-stats .stat { flex: 1; background: var(--panel2); }
.furnace-note {
  color: var(--dim);
  font-size: 13.5px;
  max-width: 540px;
  margin: 0 auto;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 22px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--green); }
.foot-muted { margin-left: auto; color: var(--dim); font-size: 12px; }

/* ---------- splash ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(4, 5, 6, 0.78);
  backdrop-filter: blur(6px);
  animation: fadein 0.3s ease;
}
.splash[hidden], .modal[hidden] { display: none !important; }
@keyframes fadein { from { opacity: 0; } }

.splash-card {
  width: min(460px, calc(100vw - 40px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 30px 26px;
  position: relative;
  animation: cardin 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardin { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.splash-notch {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 5px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 6px 6px;
}

.splash-title { font-family: var(--font-mono); font-size: 26px; margin-bottom: 20px; }
.splash-title .tick { color: var(--green); }

.splash-tldr h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--dim);
  margin-bottom: 8px;
}
.splash-tldr ul { list-style: none; }
.splash-tldr li {
  padding: 9px 0 9px 20px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
  position: relative;
}
.splash-tldr li::before {
  content: '-';
  position: absolute;
  left: 2px;
  color: var(--green);
  font-family: var(--font-mono);
}
.splash-cta { margin-top: 20px; }

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 6, 0.78);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: min(430px, calc(100vw - 40px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  animation: cardin 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-card h3 { font-size: 20px; margin-bottom: 8px; }
.modal-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
}
.modal-x:hover { color: var(--ink); }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 6px;
}
.field i { font-style: normal; color: var(--dim); }
.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 12px;
}
.field input:focus { outline: none; border-color: var(--green); }

.burn-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.preset {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 8px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.preset small { display: block; font-size: 10px; color: var(--dim); font-weight: 400; margin-top: 2px; }
.preset:hover { border-color: var(--ember); }
.preset.sel { border-color: var(--ember); background: var(--ember-dim); }

.burn-quote {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  min-height: 20px;
}
.burn-quote b { color: var(--ember); }

.modal-err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.modal-fine { color: var(--dim); font-size: 12px; margin-top: 12px; }

/* toast */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 13.5px;
  padding: 11px 18px;
  z-index: 95;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }


/* ---------- CA pill ---------- */

.ca-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  transition: border-color .15s ease, color .15s ease;
}
.ca-pill:hover { border-color: var(--green); color: var(--ink); }

.x-link {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--muted);
  transition: color .15s ease, background .15s ease;
}
.x-link:hover { color: var(--ink); background: var(--panel2); }
.x-link svg { width: 15px; height: 15px; }

/* ---------- wallet picker ---------- */

.wallet-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.wallet-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  transition: border-color .15s ease;
}
.wallet-opt::after { content: '\2192'; color: var(--dim); }
.wallet-opt:hover { border-color: var(--green); }

.furnace-sub { color: var(--muted); font-size: 14px; max-width: 560px; margin: 10px auto 0; }

.row.mine { background: rgba(46,229,157,.06); box-shadow: inset 2px 0 0 var(--green); }

.board-beyond {
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.board-beyond b { color: var(--muted); font-weight: 600; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .board-zone { grid-template-columns: minmax(0, 1fr); }
  .feed-col { position: static; }
  .feed { max-height: 320px; }
}

@media (max-width: 640px) {
  .top { padding: 10px 12px; gap: 8px; }
  .top-stats { display: none; }
  .ca-pill span { display: none; }
  .ca-pill { padding: 6px 10px; }
  .hero { padding: 44px 0 30px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .actions-two { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 12px 14px 14px; }
  .row .sup { display: none; }
  .row .addr { display: none; }
  main { padding: 0 14px; }
  .foot-muted { margin-left: 0; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .pending-flame { animation: none; }
  .live-dot.on { animation: none; }
}
