/* cyberspace: one blue setup utility for minds. Surfaces are 9-slice PNG plates (site/public/ui), never CSS boxes. */
@font-face { font-family: "Fixedsys"; src: url(fonts/fixedsys.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "VT323"; src: url(fonts/vt323.woff2) format("woff2"); font-display: swap; }

:root {
  --blue: #1616e4;
  --deep: #0c0cae;
  --white: #ffffff;
  --dim: #c4c4ff;
  --mute: #9a9aff;
  --lime: #d8f249;
  --ink: #10102a;
  --gray: #c0c0c0;
  --navy: #000080;
  --red: #ff5a4f;
  --sys: "Fixedsys", "Lucida Console", Consolas, monospace;
  --osd: "VT323", "Fixedsys", monospace;
  --gap: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--blue); color: var(--white); }
body {
  font: 16px/1.5 var(--sys);
  font-synthesis: none;
  -webkit-font-smoothing: none;
  cursor: url(ui/cursor.png) 0 0, auto;
  min-height: 100vh;
  overflow-x: hidden;
}
a, button, [role="button"], select, label[for], .row[data-href] { cursor: url(ui/hand.png) 10 0, pointer; }
a { color: inherit; }
::selection { background: var(--white); color: var(--blue); }
:focus-visible { outline: 2px dashed var(--lime); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the binary field behind everything: the bits of the newest dataset root */
.binary {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  font: 22px/1.05 var(--osd); color: rgba(255, 255, 255, 0.07); white-space: pre; letter-spacing: 2px;
  user-select: none;
}

.screen { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 28px 24px 48px; }

/* top line of the utility: emblem, lowercase wordmark, the premise */
.topline { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-bottom: 18px; }
.topline img { width: 84px; height: 84px; image-rendering: pixelated; display: block; }
.wordmark { font: 64px/0.9 var(--osd); letter-spacing: 1px; margin: 0; text-shadow: 4px 4px 0 var(--deep); }
.premise { margin: 6px 0 0; color: var(--dim); max-width: 720px; }

/* menu keys: the reference's "SELECT : ^ KEY / SET : > KEY" legend, clickable */
.keys { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 0 0 22px; padding: 0; list-style: none; font: 24px/1 var(--osd); }
.keys a { text-decoration: none; padding: 4px 10px 2px; color: var(--white); }
.keys a b { color: var(--lime); font-weight: normal; margin-right: 6px; }
.keys a[aria-current="page"] { background: var(--white); color: var(--blue); }
.keys a[aria-current="page"] b { color: var(--blue); }
.keys .legend { margin-left: auto; color: var(--mute); font-size: 20px; }

/* plates */
.osd { border: 8px solid transparent; border-image: url(ui/osd.png) 8 fill / 8px stretch; padding: 18px 22px; }
.win { border: 6px solid transparent; border-top-width: 26px; border-image: url(ui/win.png) 26 6 6 6 fill / 26px 6px 6px 6px stretch; color: var(--ink); position: relative; padding: 10px 12px 12px; }
.win > .title { position: absolute; top: -24px; left: -2px; right: -2px; height: 20px; display: flex; align-items: center; gap: 8px; color: #fff; font: 16px/20px var(--sys); padding: 0 4px; white-space: nowrap; overflow: hidden; }
.win > .title img { width: 16px; height: 16px; image-rendering: pixelated; }
.win > .title .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.alert { border: 6px solid transparent; border-image: url(ui/alert.png) 6 fill / 6px stretch; color: var(--blue); padding: 16px; }
.lime { border: 6px solid transparent; border-image: url(ui/lime.png) 6 fill / 6px stretch; color: var(--ink); padding: 14px 16px; }
.well { border: 2px solid transparent; border-image: url(ui/well.png) 2 fill / 2px stretch; color: var(--ink); padding: 6px 8px; }

.btn {
  font: 16px/1 var(--sys); color: var(--ink); background: none; border: 2px solid transparent;
  border-image: url(ui/btn.png) 2 fill / 2px stretch; padding: 8px 16px; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
}
.btn:active:not([disabled]) { border-image-source: url(ui/btn-down.png); transform: translate(1px, 1px); }
.btn[disabled], .btn[aria-disabled="true"] { color: #7a7a7a; text-shadow: 1px 1px 0 #fff; }
.btn img { width: 18px; height: 18px; object-fit: contain; }
.btn.wide { width: 100%; }

/* OSD rows (settings menu) */
.menu { display: grid; gap: 2px; font: 24px/1.15 var(--osd); }
.menu .row { display: grid; grid-template-columns: 12ch 1fr; gap: 14px; align-items: center; padding: 3px 8px; min-height: 36px; }
.menu .row > .k { color: var(--dim); }
.menu .row.sel, .menu .row:focus-within { background: var(--white); color: var(--blue); }
.menu .row.sel > .k, .menu .row:focus-within > .k { color: var(--blue); }
.choice { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.choice button { font: inherit; background: none; border: 0; color: inherit; padding: 0 8px; }
.choice button[aria-pressed="true"] { background: var(--blue); color: var(--white); }
.row.sel .choice button[aria-pressed="true"], .row:focus-within .choice button[aria-pressed="true"] { background: var(--blue); color: var(--white); }
.menu input, .menu select {
  font: 22px/1 var(--osd); color: var(--ink); background: #fff; border: 2px solid transparent;
  border-image: url(ui/well.png) 2 fill / 2px stretch; padding: 4px 8px; width: 100%; min-height: 34px;
}
.hint { font: 16px/1.4 var(--sys); color: var(--dim); }
.row.sel .hint, .row:focus-within .hint { color: var(--deep); }

/* mission table ('Keyboard Configuration') */
.table { font: 22px/1.15 var(--osd); }
.table h3 { font: 22px/1 var(--osd); color: var(--lime); margin: 14px 0 6px; font-weight: normal; }
.table h3:first-child { margin-top: 0; }
.table .row { display: grid; grid-template-columns: 3ch minmax(10ch, 16ch) 1fr 17ch; gap: 14px; padding: 4px 8px; align-items: center; text-decoration: none; color: var(--white); min-height: 34px; }
.table .row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.table .row.sel, .table .row:hover, .table .row:focus { background: var(--white); color: var(--blue); outline: none; }
.table .row.sel .t, .table .row:hover .t, .table .row:focus .t { color: var(--blue); }
.bar { letter-spacing: -1px; white-space: nowrap; }
.empty { color: var(--dim); font: 16px/1.5 var(--sys); padding: 8px; }

/* layout */
.cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: var(--gap); align-items: start; }
.stack { display: grid; gap: var(--gap); align-content: start; }
.panel-title { font: 22px/1 var(--osd); letter-spacing: 1px; margin: 0 0 12px; text-align: center; font-weight: normal; }
.panel-title::before, .panel-title::after { content: " ------- "; color: var(--mute); }

/* $cyber settings block */
.ca { font: 16px/1.4 var(--sys); word-break: break-all; user-select: all; }
.ca.unset { user-select: none; color: var(--mute); }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.links .btn { width: 100%; }
.note { font: 14px/1.4 var(--sys); color: var(--mute); margin-top: 8px; }

/* lime milestone posters (the ERROR 404 sheet) */
.poster { font: 14px/1.35 var(--sys); position: relative; }
.poster .big { font: 44px/1 var(--osd); margin: 6px 0 8px; letter-spacing: 1px; }
.poster .micro { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; text-transform: uppercase; }
.poster canvas { width: 100%; height: 34px; image-rendering: pixelated; display: block; margin-top: 8px; }
.poster a { color: var(--ink); }

/* coin page */
.coinhead { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: var(--gap); }
.coinhead canvas { width: 88px; height: 88px; image-rendering: pixelated; display: block; }
.coinhead h2 { font: 48px/0.95 var(--osd); margin: 0; font-weight: normal; }
.coinhead .sub { color: var(--dim); margin-top: 6px; }
.coinhead .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mission-line { font: 26px/1.2 var(--osd); margin: 0 0 6px; }
.progress { font: 26px/1 var(--osd); margin: 12px 0 4px; white-space: nowrap; overflow: hidden; }
.ticks { display: grid; grid-template-columns: repeat(4, 1fr); font: 16px/1.3 var(--sys); color: var(--dim); text-align: right; }
.ticks .on { color: var(--lime); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin-top: 14px; }
.facts div span { display: block; color: var(--dim); font-size: 14px; }
.facts div b { font: 26px/1.1 var(--osd); font-weight: normal; }

.screenbox { position: relative; background: var(--blue); aspect-ratio: 16 / 10; overflow: hidden; }
.screenbox canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.screenbox .sleep { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; font: 24px/1.3 var(--osd); padding: 20px; }
.screenbox .stuck { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, 86%); text-align: center; font: 22px/1.2 var(--osd); }
.stuck .acts { display: flex; gap: 14px; justify-content: center; margin-top: 12px; }
.stuck .acts span { border: 2px solid var(--blue); padding: 2px 12px; }
.statusline { display: flex; justify-content: space-between; gap: 10px; font: 14px/1.6 var(--sys); color: var(--ink); padding-top: 6px; }
.statusline span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notepad .menubar { display: flex; gap: 2px; font: 16px/1 var(--sys); margin: -4px -4px 6px; position: relative; }
.notepad .menubar button { font: inherit; background: none; border: 0; padding: 4px 8px; color: var(--ink); }
.notepad .menubar button[aria-expanded="true"] { background: var(--navy); color: #fff; }
.notepad .drop { position: absolute; top: 26px; left: 0; z-index: 5; min-width: 230px; padding: 4px; display: grid; border: 2px solid transparent; border-image: url(ui/btn.png) 2 fill / 2px stretch; }
.notepad .drop button, .notepad .drop a { font: 16px/1 var(--sys); text-align: left; background: none; border: 0; padding: 8px 10px; color: var(--ink); text-decoration: none; }
.notepad .drop button:hover, .notepad .drop a:hover, .notepad .drop :focus { background: var(--navy); color: #fff; outline: none; }
.notepad .text { height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 16px/1.45 var(--sys); padding: 8px 10px; }
.notepad .text .r { display: block; padding: 2px 0; border-bottom: 1px dotted #c8c8c8; }
.notepad .text .r b { color: var(--navy); font-weight: normal; }
.notepad .text a { color: var(--navy); }

.runs { font: 15px/1.4 var(--sys); width: 100%; border-collapse: collapse; }
.runs th { text-align: left; color: var(--lime); font: 20px/1 var(--osd); font-weight: normal; padding: 4px 6px; }
.runs td { padding: 4px 6px; border-top: 1px dashed rgba(255, 255, 255, 0.25); vertical-align: top; }
.runs tr.open td { background: rgba(255, 255, 255, 0.08); }
.runs .trace { color: var(--dim); white-space: pre-wrap; word-break: break-all; }
.runs button { font: inherit; color: var(--white); background: none; border: 0; text-decoration: underline; padding: 0; }

.journal { font: 24px/1.25 var(--osd); }
.journal p { margin: 0 0 12px; }
.journal time { display: block; color: var(--lime); font-size: 20px; }

.vote .opt { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed rgba(255, 255, 255, 0.3); }
.vote input { width: 100%; }

/* how it works */
.press { font: clamp(56px, 10vw, 132px)/0.86 var(--osd); margin: 8px 0 28px; letter-spacing: 2px; position: relative; }
.press span { display: block; }
.press span:nth-child(2) { padding-left: 1.6em; }
.press::after { content: attr(data-echo); position: absolute; left: 6px; top: 6px; color: rgba(255, 255, 255, 0.16); white-space: pre; pointer-events: none; z-index: -1; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.steps .osd h3 { font: 30px/1 var(--osd); margin: 0 0 8px; font-weight: normal; color: var(--lime); }
.steps p { margin: 0 0 8px; }
.split { width: 100%; border-collapse: collapse; font: 22px/1.3 var(--osd); }
.split td { padding: 4px 6px; border-top: 1px dashed rgba(255, 255, 255, 0.3); }
.split td:first-child { width: 6ch; color: var(--lime); }
.risk { font-size: 13px; color: var(--mute); margin-top: 28px; }

/* launch progress log */
.log { font: 16px/1.5 var(--sys); white-space: pre-wrap; max-height: 260px; overflow: auto; }
.log .ok { color: var(--lime); }
.log .bad { color: #ffb0a8; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 20; }

@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .keys .legend { display: none; }
}
@media (max-width: 640px) {
  .screen { padding: 16px 12px 36px; }
  .topline img { width: 56px; height: 56px; }
  .wordmark { font-size: 46px; }
  .keys { font-size: 22px; gap: 8px; }
  .keys a { padding: 6px 8px 4px; }
  .table .row { grid-template-columns: 2.5ch 1fr; grid-template-rows: auto auto auto; gap: 2px 10px; }
  .table .row .t, .table .row .bar { grid-column: 2; }
  .menu .row { grid-template-columns: 1fr; gap: 4px; }
  .coinhead { grid-template-columns: auto 1fr; }
  .coinhead .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .coinhead h2 { font-size: 38px; }
  .links { grid-template-columns: 1fr; }
  .notepad .text { height: 340px; }
  .runs .hide-s { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* fixes from the first audit */
.cols > *, .stack > *, .steps > * { min-width: 0; }
.btn { white-space: normal; text-align: center; line-height: 1.2; }
.notepad .drop[hidden] { display: none; }
.ca.unset { word-break: normal; }
.file input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.file .btn { font-size: 16px; }
@media (min-width: 641px) { .table .row { grid-template-columns: 3ch minmax(12ch, 22ch) 1fr 17ch; } }
.press::after { content: none; }
.press span { text-shadow: 6px 6px 0 rgba(255, 255, 255, 0.16); }
@media (max-width: 640px) { .table .row .t { white-space: normal; } }
@font-face { font-family: "Russo One"; src: url(fonts/russo.woff2) format("woff2"); font-display: swap; }
.wordmark { font-family: "Russo One", var(--osd); font-size: 58px; letter-spacing: 0; text-shadow: 4px 4px 0 var(--deep); }
.topline img { image-rendering: auto; }
@media (max-width: 640px) { .wordmark { font-size: 40px; } }
.topline > div { min-width: 0; }
@media (max-width: 380px) { .wordmark { font-size: 32px; } .topline { gap: 12px; } .topline img { width: 44px; height: 44px; } }
.choice { flex-wrap: nowrap; align-items: center; }
.choice b { min-width: 0; overflow-wrap: anywhere; text-align: center; }
.row .choice:has([data-tpl]) { flex-wrap: wrap; }
.screenbox img { width: 100%; height: 100%; display: block; image-rendering: pixelated; object-fit: cover; }
.cimg { width: 88px; height: 88px; image-rendering: pixelated; display: block; }
.barcode { display: flex; height: 34px; margin-top: 8px; }
.barcode i { flex: 1; }
.barcode i.on { background: var(--ink); }
.screenbox img[hidden] { display: none; }
.press { margin-bottom: 14px; }
.lead { font: 26px/1.3 var(--osd); color: var(--dim); max-width: 860px; margin: 0 0 28px; }
@media (max-width: 640px) { .lead { font-size: 22px; } }

/* ---- UX pass: actions, states, steps ---- */
.btn.primary { color: var(--ink); background: var(--lime); border-image: url(ui/btn.png) 2 / 2px stretch; text-shadow: none; }
.btn.primary:hover:not([disabled]) { background: #e6ff6e; }
.btn.primary:active:not([disabled]) { border-image: url(ui/btn-down.png) 2 / 2px stretch; }
.btn.primary[disabled] { background: none; border-image: url(ui/btn.png) 2 fill / 2px stretch; color: #7a7a7a; text-shadow: 1px 1px 0 #fff; }
.intro { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.intro p { margin: 0; color: var(--dim); max-width: 460px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; margin: 0 0 14px; font: 22px/1 var(--osd); color: var(--white); text-decoration: none; padding: 4px 8px 2px; }
.back:hover, .back:focus { background: var(--white); color: var(--blue); }
.back .hint { font-size: 16px; }
.side-title { font: 22px/1 var(--osd); margin: 0; color: var(--lime); font-weight: normal; letter-spacing: 1px; }
.tag { display: inline-block; font: 16px/1.1 var(--osd); padding: 1px 6px 0; border: 1px solid currentColor; letter-spacing: 1px; vertical-align: middle; }
.t-live { color: var(--lime); }
.t-asleep, .t-waiting { color: var(--mute); }
.t-voting, .t-complete { color: #ffd166; }
.table .row.sel .tag, .table .row:hover .tag, .table .row:focus .tag { color: var(--blue); }
.table .row.head { color: var(--mute); font-size: 18px; min-height: 0; padding-top: 0; padding-bottom: 4px; border-bottom: 1px dashed rgba(255, 255, 255, 0.25); }
.table .row .bar .hint, .table .row .hint { font-size: 14px; }
.table .row.sel .hint, .table .row:hover .hint { color: var(--deep); }
.coinhead .sub .tag { margin-right: 6px; }
small { font-size: 0.7em; color: var(--dim); }
.note a { color: var(--dim); }
button.link { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; }
.win button.link { color: var(--navy); }
.small { font-size: 18px; }

/* dataset window */
.notepad .menubar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 8px; }
.notepad .menubar .mb { font: 16px/1 var(--sys); color: var(--ink); text-decoration: none; padding: 7px 10px; border: 2px solid transparent; border-image: url(ui/btn.png) 2 fill / 2px stretch; }
.notepad .menubar .mb:active { border-image-source: url(ui/btn-down.png); }
.notepad .find { margin-left: auto; flex: 1 1 140px; max-width: 220px; }
.notepad .find input { width: 100%; font: 16px/1 var(--sys); padding: 6px 8px; border: 2px solid transparent; border-image: url(ui/well.png) 2 fill / 2px stretch; background: #fff; color: var(--ink); }
.notepad .text .r[hidden] { display: none; }

/* vote */
.opts { display: grid; gap: 6px; margin: 10px 0; }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; font: 20px/1.2 var(--osd); color: var(--white); background: none; border: 1px dashed rgba(255, 255, 255, 0.35); padding: 8px 10px; }
.opt[aria-checked="true"] { background: var(--white); color: var(--blue); border-style: solid; }
.opt[aria-checked="true"] small { color: var(--deep); }
.opt .dot { width: 14px; height: 14px; border: 2px solid currentColor; }
.opt[aria-checked="true"] .dot { background: currentColor; }
.opt b { font-weight: normal; white-space: nowrap; }
.opt[disabled] { opacity: 0.85; }
.votebox .amt { display: flex; gap: 8px; }
.votebox .amt input { flex: 1; }
.warn { color: #ffd166; font-size: 14px; margin: 8px 0; }
.win .warn { color: #8a4b00; }

/* launch */
.menu h3.group { font: 22px/1 var(--osd); color: var(--lime); margin: 16px 0 6px; font-weight: normal; }
.menu h3.group:first-child { margin-top: 0; }
.menu .row > span { display: grid; gap: 4px; }
.thumb { width: 56px; height: 56px; object-fit: cover; image-rendering: auto; border: 2px solid #fff; }
.lockline { margin: 0 0 12px; color: #ffd166; }
.lockline .link { color: #fff; }
.pv-title { font: 28px/1.15 var(--osd); margin: 0 0 8px; }
.wallet-line { font: 15px/1.4 var(--sys); margin: 0 0 8px; }
.steps2 { margin: 0 0 10px; padding-left: 22px; font: 15px/1.45 var(--sys); }
.steps2 li { margin-bottom: 8px; color: #555; }
.steps2 li.cur { color: var(--ink); }
.steps2 li.cur::marker { color: var(--blue); font-weight: bold; }
.steps2 li.done { color: #2a7a2a; }
.steps2 li.done b::after { content: " done"; color: #2a7a2a; }
.cost { font: 15px/1.45 var(--sys); padding: 8px 10px; margin: 0 0 8px; background: #fff; border: 1px dashed #888; }
.needs { font: 15px/1.4 var(--sys); color: #8a2a00; min-height: 0; margin: 0 0 8px; }
.needs:empty { display: none; }
#go-log { margin-top: 10px; min-height: 64px; }
.keyhint { margin-top: 14px; }
@media (max-width: 960px) { .keyhint { display: none; } }
@media (max-width: 640px) {
  .intro { flex-direction: column; align-items: stretch; }
  .cta .btn { flex: 1; }
  .opt { font-size: 18px; }
}
.table .row .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.choice button[aria-checked="true"] { background: var(--blue); color: var(--white); outline: 1px solid var(--white); }
.row:focus-within .choice button[aria-checked="true"] { outline-color: var(--blue); }
.menu .row > span.file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.facts { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.facts div span { min-height: 2.8em; display: flex; align-items: flex-end; }
@media (max-width: 640px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .panel-title::before, .panel-title::after { content: " -- "; } }
.vote .opt { grid-template-columns: auto 1fr auto; border-top: 1px dashed rgba(255, 255, 255, 0.35); padding: 8px 10px; }
.vote .opt[aria-checked="true"] { border: 1px solid var(--white); }
.opt b small { display: block; text-align: right; }
.menu .row > span.amt { display: flex; }
