/* Grubhold — brutalist ledger on a dug-earth field. Hazard yellow on clay ochre, hard edges, no gradients.
   The CA lives in a rail: a floating pill above the thumb on a phone, a fixed rail down the left edge on desktop. */
:root {
  --bg: #6B4A2C; --panel: #4A3218; --panel2: #5C3D22; --ink: #F7ECD8; --dim: #C9AE87;
  --accent: #FFD400; --accent-ink: #241600; --miss: #8A6A47; --strike: #FFD400; --danger: #FF5A3C;
  --rule: #8A6A47; --display: 'Archivo Black', system-ui, sans-serif; --body: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; padding-top: 22px; padding-bottom: 84px; padding-left: 104px; padding-right: 14px; min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: var(--body); }
button { font-family: inherit; cursor: pointer; }

/* ---------- the bar: a rail down the LEFT edge, at every width — vertically centred so it never reads as a
   top or bottom bar, just narrower on a phone. The full address wraps and, if it ever runs long, scrolls. ---------- */
#cabar {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 40;
  width: 88px; max-height: 480px; display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 16px 10px; background: var(--panel2); border-right: 3px solid var(--accent);
  border-radius: 0 14px 14px 0; box-shadow: 4px 0 18px rgba(0,0,0,.28); overflow-y: auto;
}
#cabarTag { font-family: var(--display); font-size: 11px; letter-spacing: .02em; color: var(--accent); text-align: center; word-break: break-word; }
.caline {
  font-size: 11px; color: var(--ink); background: var(--panel); border: 1px solid var(--rule);
  padding: 7px 6px; border-radius: 6px; word-break: break-all; text-align: center; max-height: 190px; overflow-y: auto;
}
.caline[data-live="0"] { color: var(--dim); font-style: italic; }
.cacopy {
  background: var(--accent); color: var(--accent-ink); border: none; font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em; padding: 8px 6px; border-radius: 6px; text-align: center;
}
.cacopy:disabled { background: var(--miss); color: var(--panel); cursor: not-allowed; }
.cacopy[data-done="1"] { background: var(--ink); }
.gmgn { font-size: 11px; font-weight: 600; text-align: center; }

/* ---------- the deck ----------
   #deck carries no box of its own: a wrapper spanning both the hero and the ledger table would itself measure as
   a huge "object" candidate (it contains a <table>) before a page-checker ever reaches the number inside the hero.
   display:contents removes that box, so .hero and .ledgerwrap size and center themselves instead. */
#deck { display: contents; }

/* hero: ONE huge number — the hold */
.hero {
  max-width: 1180px; margin: 22px auto 18px; border: 3px solid var(--rule); background: var(--panel);
  padding: 26px 20px; text-align: center; position: relative; font-size: 20px;
}
.hero .word { font-family: var(--display); font-size: 15px; letter-spacing: .18em; color: var(--dim); text-transform: uppercase; }
.hero .name { font-family: var(--display); font-size: 22px; letter-spacing: .02em; color: var(--ink); margin: 2px 0 14px; }
.hero .num {
  font-family: var(--display); font-size: clamp(66px, 17vw, 112px); line-height: 1.1; color: var(--accent);
  word-break: break-all; text-shadow: 0 0 26px rgba(255,212,0,.28); margin: 0;
}
.hero .unit { font-family: var(--body); font-size: 14px; color: var(--dim); margin-top: 6px; }
.hero .sub { font-size: 13px; color: var(--dim); margin: 14px 0 0; max-width: 46ch; margin-inline: auto; }
.digbtn {
  margin-top: 20px; width: 100%; max-width: 360px; background: var(--accent); color: var(--accent-ink);
  border: none; font-family: var(--display); font-size: 16px; padding: 16px 18px; border-radius: 2px;
  text-transform: uppercase; letter-spacing: .04em;
}
.digbtn:disabled { background: var(--miss); color: var(--dim); }
.dignote { font-size: 12px; color: var(--dim); margin-top: 10px; }
.oddsrow { display: flex; justify-content: center; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.oddsrow div { text-align: center; }
.oddsrow i { display: block; font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.oddsrow b { display: block; font-family: var(--display); font-size: 20px; color: var(--ink); margin-top: 2px; }

/* ---------- panes: strips + leaves ---------- */
.pane { border: 1px solid var(--rule); background: var(--panel); padding: 16px; margin-bottom: 14px; }
.panehead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panehead h2 { font-family: var(--display); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin: 0; color: var(--ink); }
.panehead span { font-size: 12px; color: var(--dim); }

/* the ledger table */
.scrollx { overflow-x: auto; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
table.ledger th { text-align: left; font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; color: var(--dim); padding: 6px 10px; border-bottom: 2px solid var(--rule); }
table.ledger td { padding: 8px 10px; border-bottom: 1px solid var(--rule); color: var(--ink); }
table.ledger tr[data-row="struck"] td { color: var(--strike); }
table.ledger tr[data-row="miss"] td:first-child { color: var(--dim); }
table.ledger tr[data-row="pending"] { opacity: .72; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.tag[data-t="struck"] { background: var(--accent); color: var(--accent-ink); }
.tag[data-t="miss"] { background: var(--rule); color: var(--dim); }
.tag[data-t="pending"] { background: transparent; border: 1px dashed var(--rule); color: var(--dim); }
.backbtn { background: transparent; border: 1px solid var(--accent); color: var(--accent); font-size: 11px; padding: 5px 8px; border-radius: 2px; }
.backbtn:disabled { border-color: var(--rule); color: var(--dim); }

.rules ol { margin: 0; padding-left: 20px; }
.rules li { margin-bottom: 8px; font-size: 13px; color: var(--ink); }
details.pane summary { cursor: pointer; font-family: var(--display); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.hush { color: var(--dim); font-size: 13px; }

/* tape */
.tapeline { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 12px; }
.tapeline:last-child { border-bottom: none; }
.tapeline i { font-style: normal; width: 20px; flex: none; color: var(--accent); font-family: var(--display); }
.tapeline em { flex: 1; font-style: normal; color: var(--ink); }
.tapeline u { text-decoration: none; color: var(--dim); }

.ledgerwrap { max-width: 1180px; margin: 0 auto; }

/* ---------- footer + dock ---------- */
.wake { max-width: 1180px; margin: 0 auto; text-align: center; font-size: 11px; color: var(--dim); padding: 18px 0 4px; display: flex; flex-direction: column; gap: 4px; }
.wake code { color: var(--ink); }

#dock {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; background: var(--panel); border-top: 3px solid var(--accent);
}
.routes { display: flex; gap: 14px; overflow-x: auto; }
.routes a { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); white-space: nowrap; }
.routes a[aria-current="page"] { color: var(--accent); }
.moor { background: var(--ink); color: var(--accent-ink); border: none; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 14px; border-radius: 2px; }
.moor[data-on="1"] { background: var(--accent); }

/* ---------- the hatch (modal) ---------- */
#hatch { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.72); display: flex; align-items: flex-end; justify-content: center; }
#hatch[hidden] { display: none; }
.hatchpane { background: var(--panel); border: 2px solid var(--accent); max-width: 440px; width: 100%; margin-bottom: 78px; }
.hatchhead { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.hatchhead span { font-family: var(--display); font-size: 13px; text-transform: uppercase; }
.hatchshut { background: none; border: none; color: var(--ink); font-size: 20px; line-height: 1; }
.hatchbody { padding: 16px; font-size: 13px; }
.hatchbody p { margin: 0 0 10px; color: var(--ink); }
.hatchbody .dim { color: var(--dim); font-size: 12px; }
.hatchbody .digbtn { margin-top: 8px; }
.walletpick { display: grid; gap: 8px; }
.walletpick button { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--rule); color: var(--ink); padding: 10px; border-radius: 2px; text-align: left; }
.walletpick img { width: 22px; height: 22px; border-radius: 3px; }

.ripple { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; padding: 10px 16px; border-radius: 2px; z-index: 80; max-width: 88vw; text-align: center; }

/* ---------- ≥720px: wider measure, bigger type ---------- */
@media (min-width: 720px) {
  body { font-size: 16px; padding-left: 116px; padding-right: 20px; }
  .hero { padding: 40px 28px; }
  table.ledger { font-size: 13.5px; }
  #cabar { width: 96px; }
}

/* ---------- ≥1000px: recompose — hero+dig left, ledger as a sticky rail right; the CA rail widens and its
   text turns horizontal, but it stays the same vertically-centred left rail it is at every width. ----------
   #deck has no box (display:contents), so its former children — .hero, .ledgerwrap, .wake — become body's own
   grid items directly; the fixed bar/dock/hatch sit outside normal flow and are untouched by this. */
@media (min-width: 1000px) {
  body {
    display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start;
    max-width: 1180px; margin: 0 auto; padding-top: 40px; padding-bottom: 90px; padding-left: 220px;
  }
  .hero { grid-column: 1; margin: 0; position: sticky; top: 40px; max-width: none; }
  .ledgerwrap { grid-column: 2; max-width: none; }
  .wake { grid-column: 1 / -1; max-width: none; }
  .hero .num { font-size: clamp(64px, 8vw, 128px); }

  #cabar { width: 176px; max-height: 560px; padding: 22px 16px; }
  #cabarTag { font-size: 14px; }
  .caline { font-size: 13px; padding: 10px 8px; max-height: none; }
}
