/* Mustershaw — a broadsheet printed on black paper. Cream ink, a coarse halftone screen, one spoke in hot pink.
   Card-stack: the live muster is the front card; settled editions sit behind it and come forward on a tap. */
:root {
  --paper: #100D0B;          /* the black newsprint ground */
  --card: #171311;           /* a sheet on the stack */
  --card2: #1E1916;          /* the sheet behind it */
  --ink: #EFE3C8;            /* cream ink */
  --ink-dim: rgba(239, 227, 200, .58);
  --ink-faint: rgba(239, 227, 200, .22);
  --rule: rgba(239, 227, 200, .34);
  --pink: #FF2D95;           /* the one spoke */
  --pink-soft: rgba(255, 45, 149, .16);
  --masthead: 'Pirata One', 'Newsreader', serif;
  --body: 'Newsreader', Georgia, serif;
  --figures: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sp-h: 96px;              /* room for the STOP PRESS strip */
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5;
  background: var(--paper); padding-bottom: calc(var(--sp-h) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* the halftone screen over the whole sheet */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(239, 227, 200, .085) .9px, transparent 1.1px);
  background-size: 5px 5px;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
code, .fig, .num { font-family: var(--figures); font-variant-numeric: tabular-nums; }

/* ---------------- the broadsheet ---------------- */
#broadsheet { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 14px 12px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }

/* ---------------- the stack ---------------- */
.stack { position: relative; min-width: 0; padding-top: 22px; }
.issue {
  position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: 3px; padding: 18px 16px 20px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
  background-image: radial-gradient(rgba(239, 227, 200, .05) .8px, transparent 1px); background-size: 4px 4px;
}
.issue.front { z-index: 3; }
.issue.back {
  position: absolute; left: 0; right: 0; top: 0; z-index: 1; padding: 12px 16px; background: var(--card2);
  transform: translateY(-14px) rotate(-1.2deg) scale(.985); transform-origin: 50% 100%; cursor: pointer; overflow: hidden; max-height: 64px;
  transition: transform .28s ease, max-height .28s ease;
}
.issue.back.second { z-index: 2; transform: translateY(-7px) rotate(.8deg) scale(.992); }
.issue.back:hover { transform: translateY(-22px) rotate(-1.2deg) scale(.99); }
.issue.back .backline { display: flex; gap: 10px; align-items: baseline; color: var(--ink-dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue.back .backline b { font-family: var(--masthead); font-weight: 400; color: var(--ink); font-size: 16px; letter-spacing: .01em; }
.issue.ghost { pointer-events: none; opacity: .55; }

.masthead { text-align: center; padding: 0 0 10px; border-bottom: 3px double var(--rule); }
.masthead .title { font-family: var(--masthead); font-weight: 400; font-size: clamp(38px, 11vw, 52px); line-height: 1; margin: 0; letter-spacing: .01em; }
.masthead .title i { font-style: normal; color: var(--pink); }
.masthead .dateline { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-dim); }
.masthead .dateline .clock { color: var(--ink); }
.contents { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.contents a { text-decoration: none; color: var(--ink-dim); padding: 2px 0; }
.contents a[aria-current] { color: var(--ink); border-bottom: 2px solid var(--pink); }

.lede { margin: 14px 0 0; }
.lede h1 { font-family: var(--masthead); font-weight: 400; font-size: clamp(26px, 7vw, 34px); line-height: 1.08; margin: 0 0 8px; }
.lede p { margin: 0; color: var(--ink-dim); font-size: 15.5px; }

/* the wheel */
.wheelbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; align-items: center; }
.wheel { width: min(78vw, 300px); margin: 0 auto; display: block; }
.wheel .rimdot { transition: r .2s ease; }
.wheel .cutarc { transition: stroke-dasharray .6s ease; }
.pot { text-align: center; }
.pot .num { font-size: clamp(34px, 9vw, 46px); font-weight: 600; line-height: 1; display: block; }
.pot .cap { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin-top: 6px; }
.pot .cap b { color: var(--pink); font-weight: 500; }

/* the tally and the roster */
.tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.tally div { padding: 8px 6px; text-align: center; border-right: 1px solid var(--rule); min-width: 0; }
.tally div:last-child { border-right: 0; }
.tally dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.tally dd { margin: 2px 0 0; font-size: 22px; font-weight: 600; }
.tally dd.pinkish { color: var(--pink); }

.roster { margin-top: 12px; }
.roster h3, .gutter h3, .galley-body h3 { font-family: var(--masthead); font-weight: 400; font-size: 20px; margin: 0 0 6px; letter-spacing: .01em; }
.roster .rosterhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.roster .rosterhead em { font-style: italic; color: var(--ink-dim); font-size: 14px; }
.head { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dotted var(--ink-faint); font-size: 14px; min-width: 0; }
.head .rank { color: var(--ink-dim); font-size: 12px; }
.head .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head .who small { display: block; color: var(--ink-dim); font-size: 12px; }
.head .stake { font-size: 14px; }
.head .badge { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-dim); white-space: nowrap; }
.head[data-capt="1"] .badge { border-color: var(--pink); color: var(--pink); }
.head[data-gone="1"] { color: var(--ink-faint); }
.head[data-gone="1"] .who, .head[data-gone="1"] .stake { text-decoration: line-through; }
.head[data-vote="aye"] .badge { color: var(--ink); }
.head[data-vote="nay"] .badge { color: var(--pink); border-color: var(--pink-soft); }
.head.me .who::after { content: " · you"; color: var(--pink); font-size: 12px; }

/* the action */
.order { margin-top: 16px; padding: 14px; border: 1px solid var(--rule); border-left: 4px solid var(--pink); background: rgba(0, 0, 0, .25); }
.order .ruling { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--pink); margin: 0 0 6px; }
.order p { margin: 0 0 10px; font-size: 15px; }
.order p:last-child { margin-bottom: 0; }
.orderrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.orderrow input { flex: 1 1 120px; min-width: 0; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); padding: 10px 12px; font-family: var(--figures); font-size: 16px; border-radius: 2px; }
.orderrow input:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.press { flex: 0 0 auto; min-height: 46px; padding: 10px 18px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 2px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.press:disabled { opacity: .45; cursor: default; }
.press.aye { background: var(--pink); border-color: var(--pink); color: #14060c; flex: 1 1 40%; }
.press.nay { background: transparent; color: var(--ink); flex: 1 1 40%; }
.press.wide { width: 100%; }
.smallprint { font-size: 12.5px; color: var(--ink-dim); font-style: italic; }

/* ---------------- the gutter ---------------- */
.gutter { min-width: 0; display: grid; gap: 18px; align-content: start; }
.column { border-top: 3px double var(--rule); padding-top: 8px; }
.column .colhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.column .colhead span { color: var(--ink-dim); font-size: 13px; font-style: italic; }
.wire { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; padding: 6px 0; border-bottom: 1px dotted var(--ink-faint); font-size: 13.5px; min-width: 0; animation: printline .5s ease; }
.wire i { font-style: normal; color: var(--ink-dim); font-size: 12px; letter-spacing: .04em; }
.wire em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wire u { text-decoration: none; color: var(--ink-dim); font-size: 12px; }
.wire[data-k="overboard"] em, .wire[data-k="settled"] em b { color: var(--pink); }
@keyframes printline { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.rulings ol { margin: 0; padding-left: 20px; font-size: 14.5px; }
.rulings li { margin: 6px 0; }
.rulings b { color: var(--ink); font-weight: 600; }
.issueline { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 7px 0; border-bottom: 1px dotted var(--ink-faint); font-size: 13.5px; cursor: pointer; }
.issueline:hover em { color: var(--pink); }
.issueline i { font-style: normal; color: var(--ink-dim); }
.issueline em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blank { color: var(--ink-dim); font-style: italic; font-size: 14px; margin: 6px 0 0; }

/* ---------------- inner pages ---------------- */
.folio { padding: 4px 0 0; }
.folio h2 { font-family: var(--masthead); font-weight: 400; font-size: clamp(28px, 7vw, 38px); margin: 12px 0 8px; line-height: 1.05; }
.folio p { margin: 0 0 12px; font-size: 16px; }
.folio p b { font-weight: 600; }
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th, .ledger td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--ink-faint); white-space: nowrap; }
.ledger th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); font-weight: 500; }
.ledger tr.pick { cursor: pointer; }
.ledger tr.pick:hover td { color: var(--pink); }

/* ---------------- colophon ---------------- */
.colophon { border-top: 3px double var(--rule); padding: 12px 0 4px; font-size: 13px; color: var(--ink-dim); display: grid; gap: 6px; min-width: 0; }
.colophon code { font-size: 12px; word-break: break-all; color: var(--ink); }
.colophon a { color: var(--ink); }

/* ---------------- STOP PRESS (fixed, every width) ---------------- */
#stoppress {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #0A0807; border-top: 2px solid var(--pink); padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .6);
}
.sp-row { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 1180px; margin: 0 auto; }
.sp-head { justify-content: flex-start; }
.sp-label { font-family: var(--masthead); font-size: 18px; letter-spacing: .04em; color: var(--pink); line-height: 1; white-space: nowrap; }
.sp-tick { font-family: var(--figures); font-size: 12px; color: var(--ink-dim); white-space: nowrap; }
.sp-gmgn { margin-left: auto; font-size: 12px; color: var(--ink-dim); text-decoration: none; white-space: nowrap; }
.sp-gmgn:hover { color: var(--ink); }
.sp-book { margin-left: auto; background: transparent; border: 1px solid var(--rule); color: var(--ink); border-radius: 2px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.sp-gmgn:not([hidden]) + .sp-book { margin-left: 0; }
.sp-book[data-on="1"] { border-color: var(--pink); font-family: var(--figures); }
.sp-addr { margin-top: 6px; }
.sp-ca { flex: 1 1 auto; min-width: 0; font-size: 12px; line-height: 1.35; color: var(--ink); word-break: break-all; user-select: all; }
.sp-ca[data-live="0"] { color: var(--ink-dim); font-family: var(--body); font-style: italic; font-size: 13px; user-select: text; }
.sp-copy { flex: 0 0 auto; min-height: 36px; padding: 6px 14px; background: var(--pink); color: #14060c; border: 1px solid var(--pink); border-radius: 2px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.sp-copy:disabled { background: transparent; color: var(--ink-faint); border-color: var(--ink-faint); cursor: default; }
.sp-copy[data-done="1"] { background: var(--ink); border-color: var(--ink); }

/* ---------------- the galley (modal) ---------------- */
#galley { position: fixed; inset: 0; z-index: 60; background: rgba(6, 4, 3, .8); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.galley-box { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--rule); border-top: 3px double var(--rule); border-radius: 3px; max-height: 88vh; overflow: auto; }
.galley-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule); font-family: var(--masthead); font-size: 22px; }
.galley-shut { background: transparent; border: 0; font-size: 26px; line-height: 1; color: var(--ink-dim); }
.galley-body { padding: 14px; font-size: 15px; }
.galley-body p { margin: 0 0 10px; }
.walletpick { display: grid; gap: 8px; }
.walletpick button { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--rule); padding: 10px 12px; border-radius: 2px; text-align: left; }
.walletpick img { width: 22px; height: 22px; border-radius: 4px; }
.dispatch { position: fixed; left: 50%; bottom: calc(var(--sp-h) + 14px); transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--paper); padding: 9px 14px; border-radius: 2px; font-size: 14px; max-width: 90vw; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }

/* ---------------- ≥ 700px: a wider measure, a bigger wheel ---------------- */
@media (min-width: 700px) {
  #broadsheet { padding: 22px 20px 32px; }
  .issue { padding: 24px 26px 26px; }
  .masthead .title { font-size: 64px; }
  .wheelbox { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
  .wheel { width: 100%; max-width: 340px; }
  .pot { text-align: left; }
  .pot .num { font-size: 52px; }
  .lede h1 { font-size: 36px; }
  .head { font-size: 15px; }
  :root { --sp-h: 74px; }
  #stoppress { padding: 8px 20px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .sp-ca { font-size: 13.5px; }
}
/* ---------------- ≥ 1000px: the sheet recomposes into two columns ---------------- */
@media (min-width: 1000px) {
  #broadsheet { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); grid-template-areas: "stack gutter" "colophon colophon"; gap: 28px 34px; padding: 28px 24px 40px; }
  .stack { grid-area: stack; }
  .gutter { grid-area: gutter; position: sticky; top: 18px; align-self: start; }
  .colophon { grid-area: colophon; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masthead .title { font-size: 76px; }
  .lede h1 { font-size: 40px; }
  .wheel { max-width: 380px; }
  .pot .num { font-size: 60px; }
  .tally dd { font-size: 26px; }
  #stoppress { padding: 8px 24px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .sp-row { max-width: 1132px; }
  .sp-ca { font-size: 14px; }
}
