/* The editor's own dark console palette (scm-js/scm-js, src/styles/tokens.css): StarCraft's
   gold and teal as the two accents, with the app mark's violet kept for the mark itself. */

:root {
  --bg-0: #0a0c10;
  --bg-1: #12151b;
  --bg-2: #191d25;
  --bg-3: #222732;
  --bg-4: #2b313e;
  --border: #2c3341;
  --border-strong: #3b4453;
  --text: #dde2ea;
  --text-dim: #99a2b3;
  --text-faint: #5d6675;
  --text-inverse: #16130a;
  --gold: #e6b95c;
  --gold-hi: #f4d08a;
  --gold-dim: #a9853c;
  --teal: #4fd1c5;
  --violet: #a06cf0;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Mono", "JetBrains Mono", ui-monospace, Consolas, Menlo, monospace;
  --radius: 3px;
  --radius-lg: 5px;
  --wrap: 940px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-1);
  color: var(--text);
  font: 16px/1.6 var(--font-ui);
  /* The splash screen's own pink glow, once, behind the mark — the app is deliberately
     off-theme there and in the About dialog, and the mark on this page is that same drawing. */
  background-image: radial-gradient(900px 520px at 50% -160px, rgba(255, 95, 162, 0.11), transparent 70%);
  background-repeat: no-repeat;
}

code { font-family: var(--font-mono); font-size: 0.88em; color: var(--gold); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── hero ───────────────────────────────────────────────── */

/* The splash screen's own starfield (drawStars in the editor's starfield.ts), drifting behind the
   mark and the wordmark. Full viewport width rather than a child of the 940px .hero, so the field
   has no visible edges, and masked away well before the launch buttons: the sky belongs to the
   hero, not behind the downloads table. The pink glow on body sits under it and is what a reader
   with no JavaScript gets on its own. */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 560px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 42%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 42%, transparent 100%);
}

/* The sky is positioned and the hero is not, so without a layer of its own the hero's text would
   be painted under it rather than over. */
.hero {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 72px 24px 8px;
  text-align: center;
}

/* The canvas paints its own halo (drawSphereGlow); the flat mark, which is only there until
   globe.js runs or for a reader with no JavaScript, needs one from CSS. */
.globe canvas,
.globe img {
  display: block;
  margin: 0 auto;
  width: 180px;
  height: 180px;
}
.globe img { filter: drop-shadow(0 0 34px rgba(255, 95, 162, 0.35)); }

/* The About dialog's wordmark (.about-app-name in the editor's dialogs.css): pink "scm", the
   chrome's own colour for "JS", and its three-layer glow with the radii scaled for 56px from
   the 30px it is drawn at there. The one departure is the tracking: the dialog's 0.14em is
   drawn at 30px inside a narrow frame, and at 56px across a wide page the same figure reads
   as gappy, so it comes down to 0.10em. Letter-spacing is added after the last letter too, so
   a centred line sits half of it to the left; the indent puts that back. The home page draws it
   as .wordmark, a paragraph, so that its h1 can be the line that says what the editor is. */
h1,
.wordmark {
  margin: 10px 0 0;
  text-indent: 0.05em;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: #ff5fa2;
  text-shadow:
    0 0 44px rgba(255, 95, 162, 0.5),
    0 0 110px rgba(255, 95, 162, 0.15),
    0 1px 0 rgba(0, 0, 0, 0.6);
}
h1 span,
.wordmark span { color: var(--text); }

/* .about-rule from the editor's dialogs.css — the same fading pink hairline, widened from its
   80px in proportion to the type it sits under. The bottom margin collapses against the
   tagline's 12px top margin, so the figure below is the gap you get, not an addition to it. */
.rule {
  width: 150px;
  height: 1px;
  margin: 26px auto 28px;
  background: linear-gradient(90deg, transparent, rgba(255, 95, 162, 0.5), transparent);
}

.tagline {
  margin: 12px auto 0;
  /* Room for the home page's one-line description (about 760px at 19px), with some to spare
     for a wider system font. */
  max-width: 820px;
  font-size: 19px;
  color: var(--text);
}
/* The home page's h1, so none of the wordmark's h1 look. */
.hero h1.tagline {
  font-weight: 400;
  line-height: inherit;
  letter-spacing: normal;
  text-indent: 0;
  text-shadow: none;
}

.shot { margin: 0 0 24px; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sub {
  margin: 14px auto 0;
  max-width: 620px;
  font-size: 14.5px;
  color: var(--text-dim);
}

.launch {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 34px 0 0;
}

.btn {
  display: block;
  min-width: 250px;
  padding: 13px 26px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-3);
  color: var(--text);
  text-align: center;
}
.btn:hover { background: var(--bg-4); text-decoration: none; }

.btn.primary {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--text-inverse);
}
.btn.primary:hover { background: var(--gold-hi); }

.btn-main { display: block; font-size: 17px; font-weight: 600; }
.btn-note { display: block; margin-top: 2px; font-size: 12.5px; opacity: 0.75; }

/* Not a warning: the chip says what the thing is, and the box is the same quiet panel the
   cards below use. Nothing on the page is coloured for alarm. */
.beta {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 30px auto 0;
  max-width: 620px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  font-size: 13.5px;
  color: var(--text-dim);
  text-align: left;
}
/* The menu paths a bug report is collected from, lifted out of the dimmed prose around them. */
.beta strong { color: var(--text); font-weight: 600; }

/* The same banner one step quieter, on its own line under the beta notice: teal rather than
   gold, because it asks for something instead of warning about something. */
.beta.bugs { margin-top: 12px; }
/* The ask on its own line, the collecting instructions under it. */
.bugs-lead { display: block; margin-bottom: 3px; }
.beta-chip.bugs-chip {
  border-color: rgba(79, 209, 197, 0.45);
  background: rgba(79, 209, 197, 0.08);
  color: var(--teal);
}

.beta-chip {
  flex: none;
  margin-top: 2px;
  padding: 2px 9px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  background: rgba(230, 185, 92, 0.08);
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── plugins page ───────────────────────────────────────── */

.page-head { margin-top: 48px; }
.page-title {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.page-head .lede { max-width: 720px; font-size: 15px; }

.plugin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.plugin {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  font-size: 13.5px;
  color: var(--text-dim);
}
/* The five a fresh editor already has, marked the way the editor marks them. */
.plugin.is-default { border-color: var(--border-strong); }
.plugin.is-default .pl-badge { border-color: var(--gold-dim); color: var(--gold); }
.plugin > p { margin: 0 0 14px; flex: 1; }
.pl-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.pl-icon { width: 26px; height: 26px; flex: none; }
.pl-emoji { font-size: 21px; line-height: 26px; text-align: center; }
.pl-name { min-width: 0; }
.pl-name h3 { margin: 0; font-size: 15px; color: var(--text); }
.pl-version { font-size: 11.5px; color: var(--text-faint); }
.pl-badge {
  flex: none;
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pl-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -18px;
  padding: 9px 18px 10px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 12px;
}
.pl-tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pl-tag {
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 10.5px;
}
.pl-links { margin-left: auto; white-space: nowrap; }

/* ── sections ───────────────────────────────────────────── */

main { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

section { margin: 64px 0; }

h2 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 22px;
  font-weight: 600;
}

h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--gold); }

.lede { margin: 0 0 20px; color: var(--text-dim); font-size: 14.5px; }
.note { margin: 16px 0 0; color: var(--text-faint); font-size: 13px; }
.dim { color: var(--text-faint); font-weight: 400; }

/* ── downloads ──────────────────────────────────────────── */

/* The card the script builds for the visitor's own platform. It reuses the hero's .btn, so
   the primary download here and "Open the editor" up there are visibly the same offer. */
.pick {
  margin: 0 0 26px;
  padding: 18px 18px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
}
.pick-head { margin-bottom: 13px; font-size: 15px; color: var(--text); }
.pick-head strong { color: var(--gold); font-weight: 600; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pick-actions .btn { min-width: 230px; flex: 1 1 230px; }
.pick-alt { margin: 13px 0 0; font-size: 13px; color: var(--text-faint); }

.downloads {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.downloads th,
.downloads td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: baseline;
}
.downloads thead th {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
/* What each column is currently offering, under its heading. Empty until the releases API
   answers, and in its own case rather than the heading's capitals. */
.col-when {
  display: block;
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.col-when:empty { display: none; }
.downloads tbody th { font-weight: 500; white-space: nowrap; }
.downloads td:last-child a { color: var(--text-dim); }
.downloads tr.mine { background: rgba(79, 209, 197, 0.06); }
.downloads tr.mine tbody th { color: var(--text); }

/* ── cards ──────────────────────────────────────────────── */

/* Stacked, one card per row. Each is a heading and its explanation on the left with the
   command or the links on the right, so a full-width card is not a mostly empty band. */
.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  font-size: 13.5px;
  color: var(--text-dim);
}
.card h3 { margin: 0 0 8px; }
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
.card pre { margin: 12px 0; }
/* The links and file names sit along the bottom of the card, under a hairline, rather than in
   a second column beside the prose. */
.card-aside {
  margin: 14px -20px -18px;
  padding: 11px 20px 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 13px;
}
.card-aside p { margin: 0; }

pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-0);
}
pre code { color: var(--teal); font-size: 12.5px; }

/* ── features ───────────────────────────────────────────── */

.features { margin: 0; padding: 0; list-style: none; }
.features li {
  padding: 9px 0 9px 16px;
  border-left: 2px solid var(--border-strong);
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text-dim);
}
.features strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-weight: 600;
}

/* ── footer ─────────────────────────────────────────────── */

footer {
  max-width: var(--wrap);
  margin: 80px auto 0;
  padding: 20px 24px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  font-size: 13px;
}
footer .dim { margin-left: auto; }

@media (max-width: 620px) {
  /* A shorter hero, so the sky fades out over the same part of it. */
  .stars { height: 440px; }
  .plugin-list { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .rule { width: 110px; }
  h1, .wordmark { font-size: 40px; text-shadow: 0 0 32px rgba(255, 95, 162, 0.5), 0 0 78px rgba(255, 95, 162, 0.15), 0 1px 0 rgba(0, 0, 0, 0.6); }
  .globe canvas, .globe img { width: 132px; height: 132px; }
  .btn { min-width: 100%; }
  .card-aside { margin: 12px -14px -14px; padding: 10px 14px 11px; }
  .pick { padding: 14px; }
  .pick-actions .btn { min-width: 100%; }
  .downloads { font-size: 13px; }
  .downloads th, .downloads td { padding: 9px 6px; }
  footer .dim { margin-left: 0; }
}

/* ── languages ──────────────────────────────────────────── */


/* Korean pages. Hangul breaks between any two syllables unless told otherwise, which splits
   words across lines; keep-all breaks only at spaces, the way Korean is set. Segoe UI and Inter
   have no Hangul, so the Korean faces come right after them and the browser falls through to
   them glyph by glyph — Latin text keeps the site's face. */
html:lang(ko) {
  --font-ui: "Inter", "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR",
    system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
html:lang(ko) body {
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* The one-line offer of the Korean page, shown once to a browser that asks for Korean
   (lang.js) and never again after either choice. */
.lang-suggest {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 44px 8px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-dim);
  word-break: keep-all;
}
.lang-suggest button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  border: 0;
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.lang-suggest button:hover { color: var(--text); }


/* The privacy page's counting switch. */
.count-switch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.count-switch .btn { display: inline-block; min-width: 0; padding: 8px 16px; font: inherit; cursor: pointer; }

/* ── the doors, the drop zone and the library ───────────── */

/* The home page's blocks above the downloads are wider than the reading column: three doors
   side by side need the room. */
.wide { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wide > section { margin: 56px 0; }
.wide > section:first-child { margin-top: 38px; margin-bottom: 0; }

/* The home page's lower sections share the doors' width, so every block on the page starts at
   one left edge. Running text keeps a readable measure inside it; the cards and the editor's
   picture use the room. */
main.home { max-width: 1160px; }
main.home p, main.home .features { max-width: 80ch; }
main.home .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
main.home .card { display: flex; flex-direction: column; min-width: 0; }
main.home .card-main { flex: 1; }
main.home .card pre { overflow-x: auto; }
main.home #what { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
main.home #what > h2, main.home #what > p { grid-column: 1 / -1; }
main.home #what .shot { margin: 0; }
main.home + footer, main.page + footer { max-width: 1160px; }
@media (max-width: 900px) {
  main.home .cards, main.home #what { grid-template-columns: 1fr; }
  main.home #what .shot { margin-bottom: 24px; }
}

.label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.chip {
  flex: none;
  padding: 2px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.teal { border-color: rgba(79, 209, 197, 0.45); color: var(--teal); background: rgba(79, 209, 197, 0.08); }
.chip.gold { border-color: var(--gold-dim); color: var(--gold); background: rgba(230, 185, 92, 0.08); }

/* Small buttons, beside the hero's large .btn: the same family at the size a row or a sheet takes. */
.btn.sm, .btn.goldline, .btn.ghost { display: inline-block; min-width: 0; font: inherit; cursor: pointer; }
.btn.sm { padding: 5px 12px; border-radius: var(--radius); font-size: 13px; }
.btn.goldline { border-color: var(--gold-dim); background: rgba(230, 185, 92, 0.1); color: var(--gold); }
.btn.goldline:hover { background: rgba(230, 185, 92, 0.18); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-3); }
.btn.mid { display: inline-block; min-width: 0; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.mid:not(.primary) { font-weight: 500; }
button.btn { font-family: inherit; }

.field {
  width: 100%;
  min-width: 0;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-0);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
.field::placeholder { color: var(--text-faint); }
.linkrow { display: flex; gap: 8px; min-width: 0; flex: 1; }
.linkrow .field[readonly] { font-family: var(--font-mono); font-size: 12.5px; color: var(--gold); }

/* The drop zone. The whole page takes a drop; this is where it says so. */
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  margin: 18px 0 0;
  padding: 22px;
  border: 1px dashed var(--gold-dim);
  border-radius: 8px;
  background:
    radial-gradient(420px 180px at 50% 0, rgba(230, 185, 92, 0.09), transparent 70%),
    rgba(10, 12, 16, 0.55);
  text-align: center;
}
.drop[hidden] { display: none; }
.drop.is-over { border-style: solid; border-color: var(--gold); background-color: rgba(230, 185, 92, 0.07); }
.drop strong { font-size: 19px; font-weight: 600; }
/* The kinds of file it takes, on a line of their own above what happens to one. */
.drop-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 14px; }
.drop small { max-width: 60ch; color: var(--text-dim); font-size: 13.5px; }
.drop-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

/* What a dropped file is offered (open.js builds it). */
.sheet {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  text-align: left;
}
.sheet[hidden] { display: none; }
.sheet-file { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sheet-file > div { flex: 1; min-width: 0; }
.sheet-file b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.sheet-file span { color: var(--text-dim); font-size: 13px; }
.verbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.verb {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-3);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.verb:hover { border-color: var(--gold-dim); background: var(--bg-4); }
.verb.is-first { border-color: var(--gold-dim); }
.verb b { font-size: 16px; font-weight: 600; }
.verb span { color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.verb em { color: var(--text-faint); font-size: 12px; font-style: normal; }
.sheet-says { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; color: var(--text-dim); font-size: 13.5px; }
.sheet-says[hidden] { display: none; }

/* The three doors. Each card is a name, what it is for, and a foot that sits at the bottom of the
   card whatever the text above it runs to: what the door needs, then its buttons across the
   card's width. The buttons are the hero's two-line kind, so the three rows are one height. */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.door {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2) 46%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.045) inset;
}
.door h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.door h2 svg { flex: none; width: 24px; height: 24px; color: var(--gold); }
.door p { margin: 0; color: var(--text-dim); font-size: 14.5px; line-height: 1.6; }
.door-foot {
  display: grid;
  gap: 13px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.needs { display: flex; gap: 8px; align-items: baseline; color: var(--text-dim); font-size: 13px; }
.needs::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); transform: translateY(-2px); }
.needs.own::before { background: var(--gold); }
.door-acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.door-acts.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.door-acts .btn { display: grid; align-content: center; min-width: 0; min-height: 60px; padding: 8px; text-align: center; }
.door-acts .btn-main { font-size: 15.5px; white-space: nowrap; }
.door-acts .btn-note { font-size: 12px; }
/* Two buttons side by side: in a narrow card (three across on a small window) there is no room
   for the lines under their names, and the buttons keep their height without them. */
.door { container-type: inline-size; }
@container (max-width: 290px) {
  .door-acts.two .btn-note { display: none; }
  .door-acts.two .btn-main { font-size: 14.5px; }
}

.also { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; }
.also div { display: grid; gap: 4px; align-content: start; }
.also h3 { margin: 0; color: var(--text); }
.also p { margin: 0; color: var(--text-dim); font-size: 14px; }
.also a { font-size: 14px; }

.made { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.made a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  color: var(--text);
}
.made a:hover { border-color: var(--border-strong); text-decoration: none; }
.made img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--border); background: #000; }
.made b { display: block; padding: 10px 14px 0; font-size: 14.5px; }
.made span { display: block; padding: 0 14px 12px; color: var(--text-dim); font-size: 13px; }

.notices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.notices .beta { margin: 0; max-width: none; }

/* A page of its own under the bar: the library, the Replays page. */
.page { max-width: 1160px; margin: 0 auto; padding: 40px 24px 24px; }
.page-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 28px; margin-bottom: 24px; }
.page-top h1 {
  margin: 0;
  text-indent: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
  text-shadow: none;
}
.page-top p { margin: 6px 0 0; max-width: 62ch; color: var(--text-dim); font-size: 15px; }
.meter { margin-left: auto; min-width: 230px; display: grid; gap: 6px; color: var(--text-dim); font-size: 13px; }
.meter[hidden] { display: none; }
.meter div { height: 5px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.lib-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 2px; }
.tabs button {
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.tabs button sup { margin-left: 5px; color: var(--text-faint); font-size: 11px; vertical-align: baseline; }
.lib-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-bottom: 6px; }
.lib-tools .field { width: 200px; padding: 5px 10px; }
.rows { overflow-x: auto; }
.rows table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; }
.rows th {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}
.rows td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
.rows tr:hover td { background: rgba(255, 255, 255, 0.02); }
.rows td.name { color: var(--text); font-weight: 500; }
.rows td.name small { display: block; color: var(--text-faint); font-size: 12px; font-weight: 400; }
.rows td.r { text-align: right; white-space: nowrap; }
.rows td.r .btn + .btn { margin-left: 4px; }
.race { display: inline-block; width: 17px; height: 17px; margin-right: 5px; border-radius: 3px; font: 700 10.5px/17px var(--font-ui); text-align: center; color: #0a0c10; vertical-align: -3px; }
.race.t { background: #6fa8ff; } .race.z { background: #c986ff; } .race.p { background: var(--gold); } .race.r { background: var(--text-faint); }
.empty { margin: 0; padding: 40px 16px; color: var(--text-dim); text-align: center; }
.empty strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 17px; font-weight: 600; }
.empty .btn { margin-top: 14px; }
.row-says { color: var(--text-dim); font-size: 13px; }
.row-link { color: var(--gold); font-size: 12.5px; user-select: all; }
/* The line above the library's list: a file being kept, kept, or why it was not. Progress and
   success are quiet; a refusal is plain text, never an alarm colour. */
.lib-says { margin: -8px 0 14px; color: var(--text); font-size: 13.5px; }
.lib-says.is-quiet { color: var(--text-dim); }
.lib-says[hidden] { display: none; }
/* A file over the library page: the list (or the sign-in note) is where it lands. */
.lib-dragging #library, .lib-dragging #signed-out { outline: 1px dashed var(--gold); outline-offset: 6px; border-radius: var(--radius-lg); }
/* A row just kept: marked for a moment, then let go of slowly. */
.rows tr.is-new td { background: rgba(230, 185, 92, 0.1); }
.rows tr.is-new td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
.rows tr.was-new td { transition: background-color 1.5s ease, box-shadow 1.5s ease; }

@media (max-width: 900px) {
  .notices { grid-template-columns: 1fr; }
  .doors, .also, .made { grid-template-columns: 1fr 1fr; }
  .meter { margin-left: 0; }
}
@media (max-width: 620px) {
  .wide, .page { padding-left: 16px; padding-right: 16px; }
  .doors, .also, .made { grid-template-columns: 1fr; }
  .drop .btn { min-width: 0; }
  .lib-tools .field { width: 130px; }
  .page-top h1 { font-size: 26px; }
  /* A phone: each row is its name, a line of the rest, and its buttons under them, so the
     buttons are in view without scrolling the table. A row with no link leaves "none" out. */
  .rows table { min-width: 0; }
  .rows thead { display: none; }
  .rows tr { display: flex; flex-wrap: wrap; align-items: baseline; padding: 11px 8px; border-bottom: 1px solid var(--border); }
  .rows tr:hover td { background: none; }
  .rows td { padding: 0; border: 0; font-size: 13px; }
  .rows td.name { flex: 1 0 100%; padding-bottom: 3px; font-size: 14.5px; }
  .rows td.is-none { display: none; }
  .rows td:not(.name):not(.r):not(:nth-last-child(2))::after { content: "·"; margin: 0 7px; color: var(--text-faint); }
  .rows td.r { flex: 1 0 100%; padding-top: 9px; text-align: left; white-space: normal; }
  .rows td.r .btn { margin-bottom: 4px; }
  .rows td.r .row-says:not(:empty) { display: block; margin-bottom: 6px; }
  .rows tr.is-new { background: rgba(230, 185, 92, 0.1); box-shadow: inset 2px 0 0 var(--gold); }
  .rows tr.is-new td, .rows tr.is-new td:first-child { background: none; box-shadow: none; }
  .rows tr.was-new { transition: background-color 1.5s ease, box-shadow 1.5s ease; }
}
