/* The builder: a familiar site-builder layout (top bar, steps, big buttons) in the New Internet's 1997 look: the
   home template's starfield and yellow, gray beveled windows with navy title bars. Contrast is AA or better; motion
   stops under reduced motion. */

:root {
  --face: #c0c0c0;
  --face-2: #d4d0c8;
  --light: #ffffff;
  --hilite: #dfdfdf;
  --shadow: #808080;
  --dark: #000000;
  --navy: #000080;
  --night: #000033;
  --yellow: #ffff66;
  --cyan: #66ffff;
  --link: #0000ee;
  --ok: #005a00;
  --bad: #a40000;
  --sys: Tahoma, Geneva, Verdana, "Segoe UI", sans-serif;
  --mono: "Courier New", Courier, ui-monospace, monospace;
  --fun: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: #000;
  font: 15px/1.45 var(--sys);
  background: var(--face-2);
}
[hidden] { display: none !important; }
a { color: var(--link); }
:focus-visible { outline: 3px solid #ff00ff; outline-offset: 2px; }
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 12px; background: var(--yellow); color: #000;
}
.skip:focus { top: 8px; }

/* ---------- top bar: the starfield ---------- */
.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px;
  color: var(--yellow);
  background-color: var(--night);
  background-image: radial-gradient(1px 1px at 12px 9px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 43px 27px, #ffff99 50%, transparent 51%),
    radial-gradient(1px 1px at 77px 14px, #fff 50%, transparent 51%);
  background-size: 96px 36px;
  border-bottom: 3px ridge var(--face);
}
.brand { color: var(--yellow); text-decoration: none; font: 700 20px/1.2 var(--fun); white-space: nowrap; }
.brand small { font: 700 12px var(--sys); color: var(--night); background: var(--yellow); padding: 1px 6px;
margin-left: 4px;
  vertical-align: 3px; }
.brand .star { color: var(--cyan); }
.steps { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: thin; }
.steps a {
  color: #fff; text-decoration: none; padding: 6px 10px; white-space: nowrap; border: 2px solid transparent;
  font-weight: 700;
}
.steps a b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 2px;
border-radius: 50%;
  background: var(--navy); color: var(--yellow); border: 1px solid var(--yellow); font-size: 12px; }
.steps a:hover { border-color: #444477; }
.steps a[aria-current="page"] {
  background: var(--yellow); color: var(--night); border-color: var(--light) var(--shadow) var(--shadow) var(--light);
}
.steps a[aria-current="page"] b { background: var(--night); }
.steps a.done b { background: var(--ok); color: #fff; border-color: #fff; }
.banner { margin: 0; padding: 6px 16px; background: var(--yellow); color: #000; font-weight: 700; text-align: center;
  border-bottom: 2px solid var(--night); }

main {
  flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 16px; display: grid; gap: 16px;
  align-content: start;
}
main:focus { outline: none; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; padding: 10px 16px; color: #fff;
  background: var(--night); font-size: 13px; }
.foot a { color: var(--cyan); }
.loading { color: #333; }

/* ---------- windows ---------- */
.window {
  background: var(--face); min-width: 0;
  border: 2px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilite);
}
.titlebar {
  display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 8px; color: #fff;
  background: linear-gradient(90deg, var(--navy), #1084d0);
}
.titlebar h1, .titlebar h2 { margin: 0; font-size: 15px; flex: 1; }
.window > .body { padding: 14px 16px 16px; display: grid; gap: 12px; }
.window > .body > * { margin: 0; }
h3 { margin: 0; font-size: 16px; }
.sunken { background: #fff; border: 2px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  box-shadow: inset 1px 1px var(--dark); }
.hint { font-size: 13px; color: #333; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.mono { font-family: var(--mono); word-break: break-all; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- buttons and fields ---------- */
.btn {
  min-height: 34px; padding: 4px 14px; font: 700 14px var(--sys); color: #000; background: var(--face); cursor: pointer;
  border: 2px solid; border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilite); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active {
  border-color: var(--dark) var(--light) var(--light) var(--dark); box-shadow: inset 1px 1px var(--shadow);
}
.btn:disabled { color: #5a5a5a; cursor: not-allowed; }
.btn.big { min-height: 48px; padding: 8px 22px; font-size: 17px; }
.btn.go { background: var(--yellow); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 28px; padding: 2px 10px; font-size: 13px; }
.btn.x { min-height: 22px; width: 24px; padding: 0; font-size: 16px; }
.wallet-btn { margin-left: auto; background: var(--yellow); }
label { font-weight: 700; }
.field { display: grid; gap: 4px; }
input[type="text"], input[type="password"], input:not([type]), textarea, select {
  width: 100%; min-height: 36px; padding: 6px 8px; font: 15px var(--sys); color: #000; background: #fff;
  border: 2px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  box-shadow: inset 1px 1px var(--dark);
  border-radius: 0;
}
textarea { resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- find your name ---------- */
.find { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.find input { min-height: 54px; font-size: 22px; font-family: var(--mono); }
.find .btn { min-height: 54px; }
.verdict { padding: 14px 16px; display: grid; gap: 10px; }
.verdict .name { font: 700 24px var(--mono); word-break: break-all; }
.verdict.available { background: #e6ffe6; border-left: 6px solid var(--ok); }
.verdict.taken { background: #fff0f0; border-left: 6px solid var(--bad); }
.verdict.pending { background: #fffbe0; border-left: 6px solid #8a6d00; }
.verdict.yours { background: #e8f0ff; border-left: 6px solid var(--navy); }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; background: #fff;
  border: 1px solid var(--shadow); }

/* ---------- templates ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { display: grid; gap: 8px; padding: 12px; background: #fff; border: 2px solid; text-align: left; cursor: pointer;
  border-color: var(--light) var(--dark) var(--dark) var(--light); font: inherit; color: inherit; }
.card:hover { background: #ffffe0; }
.thumb {
  height: 110px; display: grid; place-items: center; font: 700 18px var(--fun); border: 2px inset var(--shadow);
}
.thumb.home {
  color: var(--yellow);
  background: var(--night) radial-gradient(1px 1px at 8px 8px, #fff 50%, transparent 51%) 0 0 / 24px 24px;
}
.thumb.blank { color: #000; background: #fff; font-family: var(--sys); }
.thumb.upload { color: var(--navy); background: repeating-linear-gradient(45deg, #eee, #eee 8px, #fff 8px, #fff 16px); }

/* ---------- editor ---------- */
.editor {
  display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; min-height: 520px;
  position: relative;
}
.files { display: grid; gap: 8px; align-content: start; }
.files ul { margin: 0; padding: 4px; list-style: none; max-height: 380px; overflow: auto; }
.files li button { width: 100%; text-align: left; padding: 6px 8px; font: 14px var(--mono); border: 0; background: none;
  cursor: pointer; word-break: break-all; color: #000; }
.files li button[aria-current="true"] { background: var(--navy); color: #fff; }
.files .tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.code { display: grid; grid-template-rows: auto 1fr; gap: 4px; min-width: 0; }
.code textarea { height: 100%; min-height: 460px; font: 14px/1.5 var(--mono); white-space: pre; tab-size: 2; }
.code .binary { display: grid; place-items: center; gap: 8px; padding: 16px; min-height: 200px; }
.code .binary img { max-width: 100%; max-height: 300px; image-rendering: pixelated; }
.view { display: grid; grid-template-rows: auto 1fr; gap: 4px; min-width: 0; }
.view iframe { width: 100%; height: 100%; min-height: 460px; border: 2px inset var(--shadow); background: #fff; }
.drop { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 51, 0.85);
color: var(--yellow);
  font: 700 24px var(--fun); border: 4px dashed var(--yellow); z-index: 2; pointer-events: none; }
.meter { display: grid; gap: 4px; }
.meter .bar { height: 22px; padding: 2px; background: #fff; border: 2px inset var(--shadow); }
.meter .fill { height: 100%; background: repeating-linear-gradient(90deg, var(--navy) 0 10px, transparent 10px 12px); }
.meter.over .fill { background: repeating-linear-gradient(90deg, var(--bad) 0 10px, transparent 10px 12px); }

/* ---------- summaries, progress, history ---------- */
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border: 1px solid var(--shadow); padding: 6px 8px; text-align: left; vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; background: #ffffe0; }
.table-wrap { overflow-x: auto; }
.fund { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 12px;
background: #ffffe0;
  border: 2px dashed #8a6d00; }
.fund img { width: 168px; height: 168px; image-rendering: pixelated; background: #fff; }
.steps-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.steps-list li { display: flex; gap: 8px; align-items: baseline; }
.steps-list li::before { content: "\25CB"; width: 1.2em; flex: none; color: var(--shadow); }
.steps-list li.doing::before { content: "\25D4"; color: var(--navy); }
.steps-list li.done::before { content: "\2714"; color: var(--ok); }
.steps-list li.failed::before { content: "\2716"; color: var(--bad); }
.steps-list li.doing { font-weight: 700; }
.live { padding: 14px 16px; background: #e6ffe6; border: 2px solid var(--ok); display: grid; gap: 8px; }
.live .big-link { font: 700 20px var(--mono); word-break: break-all; }
.warn { padding: 10px 12px; background: #fff0f0; border: 2px solid var(--bad); }
.note { padding: 10px 12px; background: #ffffe0; border: 1px solid #8a6d00; }
.diff { margin: 0; padding: 8px 0; background: #fff; font: 13px/1.45 var(--mono); overflow-x: auto; white-space: pre; }
.diff span { display: block; padding: 0 8px; }
.diff .add { background: #dcffdc; }
.diff .del { background: #ffdcdc; }
.diff .skip { color: #555; background: #f0f0f0; font-style: italic; }
details > summary { cursor: pointer; font-weight: 700; }
details .mono { font-size: 13px; }
.phrase {
  padding: 12px; font: 700 18px/1.7 var(--mono); background: #fff; border: 2px dashed var(--bad); word-spacing: 6px;
}

/* ---------- the wallet dialog ---------- */
dialog {
  padding: 0; border: 0; background: transparent; width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}
dialog::backdrop { background: rgba(0, 0, 51, 0.6); }
dialog .window > .body { max-height: calc(100vh - 80px); overflow: auto; }
.tabs { display: flex; gap: 4px; }
.tabs .btn[aria-pressed="true"] { background: var(--yellow); }
.balance { font: 700 26px var(--mono); }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; min-height: 0; }
  .files ul { max-height: 160px; }
  .code textarea { min-height: 260px; }
  .view iframe { min-height: 380px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .top { padding: 8px 12px; gap: 8px; }
  .wallet-btn { order: 2; }
  .steps { order: 3; flex-basis: 100%; }
  main { padding: 12px; }
  .find { grid-template-columns: 1fr; }
  .fund { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .btn.big { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* ---------- spacing: grids space their children, so paragraphs need no margins ---------- */
.grid { display: grid; gap: 10px; min-width: 0; }
main p, main h2, dialog p { margin: 0; }
.grid > :empty, .files > :empty, .body > :empty { display: none; }
.grid > .btn, .body > .btn, form.grid > .btn { justify-self: start; }
.row > .field { flex: 1; min-width: 160px; }
.verdict .says { font: 400 18px var(--sys); word-break: normal; }
.live h2 { font-size: 20px; }
/* Phones: the steps without their numbers, tables as cards */
@media (max-width: 560px) {
  .steps a { padding: 6px 7px; }
  .steps a b { display: none; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; }
  table.stack tr { border: 1px solid var(--shadow); margin-bottom: 8px; }
  table.stack th, table.stack td { border: 0; padding: 4px 8px; text-align: left; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 700; }
}
