/* The Dereth launcher, drawn in CSS and SVG.
 *
 * Two registers. The controls you press (the rail, the buttons, PLAY) are soft pixel art: every
 * ornament sits on a pixel grid (`--px` is one art pixel), frames are pixel-grid SVGs used as border
 * images with crisp edges, and plates are banded rather than smoothly graded. Everything that holds
 * or shows something (panels, text boxes, drop-downs, status) is quiet: a thin line, a rounded
 * corner, a dark glass over the painting, a plain coloured dot. Text stays type: Cinzel for display,
 * EB Garamond to read. */

@font-face { font-family: "Cinzel"; src: url("assets/fonts/Cinzel-var.ttf") format("truetype"); font-weight: 400 900; }
@font-face { font-family: "EB Garamond"; src: url("assets/fonts/EBGaramond-var.ttf") format("truetype"); font-weight: 400 800; }

:root {
  --px: 3px;

  /* The palette: stone, ink, three golds, and the status colours. Few colours, on purpose. */
  --ink: #0c0a10;
  --stone: #17141d;
  --stone-2: #211c29;
  --stone-3: #2d2636;
  --gold-dark: #6b4e22;
  --gold: #b58a3c;
  --gold-bright: #e9c77a;
  --text: #efe6d2;
  --muted: #a99f8b;
  --faint: #6f6757;
  --green-dark: #1d4a25;
  --green: #2f7a36;
  --green-bright: #58b04c;
  --online: #5fcf55;
  --high: #e3b344;
  --offline: #d8584a;
  --unknown: #8e8a82;

  /* The realm's accent, from its emblem: teal for Dereth, violet for Auberean. It eases from one to
   * the other over `--swap`, which is nothing for someone who asks for less motion. */
  --realm: #17a9bf;
  --realm-bright: #74eef2;
  --realm-dark: #01506f;
  --swap: 520ms;
  transition: --realm var(--swap) ease, --realm-bright var(--swap) ease, --realm-dark var(--swap) ease;

  /* The quiet register: lines, glass and rounding for panels and fields. */
  --line: rgba(233, 199, 122, 0.22);
  --line-strong: rgba(233, 199, 122, 0.5);
  --glass: rgba(20, 17, 25, 0.86);
  --well: rgba(10, 8, 13, 0.72);
  --radius: 10px;
  --radius-small: 6px;

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "EB Garamond", Garamond, Georgia, serif;

  /* Frames, drawn on a pixel grid. Each is a 12x12 tile: a dark outer line, a gold line lit on the
   * top and left and shaded on the bottom and right, and a stud in each corner. Sliced 4 in and
   * stretched along the edges, which repeat nothing, so the result is crisp at any size. */
  --frame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Crect width='12' height='12' fill='%230c0a10'/%3E%3Crect x='1' y='1' width='10' height='10' fill='%23b58a3c'/%3E%3Crect x='1' y='1' width='10' height='1' fill='%23e9c77a'/%3E%3Crect x='1' y='1' width='1' height='10' fill='%23e9c77a'/%3E%3Crect x='1' y='10' width='10' height='1' fill='%236b4e22'/%3E%3Crect x='10' y='1' width='1' height='10' fill='%236b4e22'/%3E%3Crect x='2' y='2' width='8' height='8' fill='%230c0a10'/%3E%3Crect x='3' y='3' width='6' height='6' fill='%2317141d'/%3E%3Crect x='0' y='0' width='3' height='3' fill='%23e9c77a'/%3E%3Crect x='9' y='0' width='3' height='3' fill='%23e9c77a'/%3E%3Crect x='0' y='9' width='3' height='3' fill='%23b58a3c'/%3E%3Crect x='9' y='9' width='3' height='3' fill='%23b58a3c'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%230c0a10'/%3E%3Crect x='10' y='1' width='1' height='1' fill='%230c0a10'/%3E%3Crect x='1' y='10' width='1' height='1' fill='%230c0a10'/%3E%3Crect x='10' y='10' width='1' height='1' fill='%230c0a10'/%3E%3C/svg%3E");
  /* A quieter frame for buttons and fields: one gold line, lit and shaded, no studs. */
  --frame-quiet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%230c0a10'/%3E%3Crect x='1' y='1' width='6' height='6' fill='%236b4e22'/%3E%3Crect x='1' y='1' width='6' height='1' fill='%23b58a3c'/%3E%3Crect x='1' y='1' width='1' height='6' fill='%23b58a3c'/%3E%3Crect x='2' y='2' width='4' height='4' fill='%23211c29'/%3E%3Crect x='0' y='0' width='1' height='1' fill='none'/%3E%3C/svg%3E");
  /* The same, lit, for a control that is on or hovered. */
  --frame-lit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Crect width='8' height='8' fill='%230c0a10'/%3E%3Crect x='1' y='1' width='6' height='6' fill='%23b58a3c'/%3E%3Crect x='1' y='1' width='6' height='1' fill='%23e9c77a'/%3E%3Crect x='1' y='1' width='1' height='6' fill='%23e9c77a'/%3E%3Crect x='2' y='2' width='4' height='4' fill='%232d2636'/%3E%3C/svg%3E");

  /* A 2x2 dither: the soft-pixel texture on every panel. */
  --dither: repeating-conic-gradient(rgba(255, 240, 210, 0.022) 0% 25%, transparent 0% 50%) 0 0 / calc(var(--px) * 2) calc(var(--px) * 2);
}

/* Registered, so the accent can ease between the realms rather than jump. */
@property --realm { syntax: "<color>"; inherits: true; initial-value: #17a9bf; }
@property --realm-bright { syntax: "<color>"; inherits: true; initial-value: #74eef2; }
@property --realm-dark { syntax: "<color>"; inherits: true; initial-value: #01506f; }
:root[data-realm="auberean"] { --realm: #8a35d0; --realm-bright: #c77df5; --realm-dark: #3d1186; }
/* The page opens in its realm without easing into it. */
:root.still { transition: none; }
@media (prefers-reduced-motion: reduce) { :root { --swap: 0s; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--ink);
  color: var(--text);
  font: 18px/1.35 var(--body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
input, select, textarea { user-select: text; -webkit-user-select: text; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: var(--px) solid var(--gold-bright); outline-offset: var(--px); }
/* While a pad moves about the page, the focus is drawn on every control, and a row it is on is lit. */
body.pad .pad-focus { outline: var(--px) solid var(--gold-bright); outline-offset: var(--px); }
body.pad tr.pad-focus > td, body.pad .row.pad-focus { background: rgba(233, 199, 122, 0.12); }

/* ----- the painting ----------------------------------------------------------------------------- */

.vista { position: fixed; inset: 0; z-index: 0; }
.vista img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  /* The paintings are pixel art; they are scaled as pixel art. */
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}
.vista img.on { opacity: 1; }
/* A change of realm brings its painting in over the one shown, which goes once it is covered. */
.vista img.coming { z-index: 1; opacity: 1; transition: none; }
/* The realm's glow at the top of the curtain, in a launcher that offers both games. */
.vista { --realm-glow: transparent; }
:root[data-realms] .vista { --realm-glow: color-mix(in srgb, var(--realm-dark) 38%, transparent); }
.vista::after {
  /* The two washes that let text sit on a painted sky, top and bottom, and a curtain on the left
   * under the lockup and rail, with the realm's glow at its top. */
  content: ""; position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(ellipse 420px 320px at 0 0, var(--realm-glow), transparent),
    linear-gradient(to bottom, rgba(12, 10, 16, 0.72), rgba(12, 10, 16, 0) 34%),
    linear-gradient(to top, rgba(12, 10, 16, 0.82), rgba(12, 10, 16, 0) 42%),
    linear-gradient(to right, rgba(12, 10, 16, 0.66), rgba(12, 10, 16, 0) 30%);
}

.drag { position: fixed; top: 0; left: 0; right: 0; height: 36px; z-index: 5; }

.shell {
  --foot-height: 34px;
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  gap: 26px;
  height: 100%;
  padding: 40px 28px var(--foot-height) 28px;
}

/* ----- the lockup and the rail ------------------------------------------------------------------ */

.side { display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.lockup { display: flex; align-items: center; gap: 10px; }
/* The crest: the Dereth client's emblem, or in a launcher that offers both games the network's,
 * teal and violet, glowing in the realm's colour. Painted, not pixel art, so scaled smoothly. */
.lockup .crest { position: relative; width: 54px; height: 54px; flex: none; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.6)); }
:root[data-realms] .lockup .crest { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 9px color-mix(in srgb, var(--realm) 30%, transparent)); }
.lockup .emblem { position: absolute; inset: 0; width: 100%; height: 100%; }
.lockup .word {
  font: 600 22px/0.98 var(--display);
  letter-spacing: 0.045em;
  color: var(--gold-bright);
  text-shadow: 1px 1px 0 rgba(12, 10, 16, 0.55), 2px 3px 0 rgba(12, 10, 16, 0.7);
}

.rail { display: flex; flex-direction: column; gap: 8px; width: 176px; }
.rail button {
  position: relative; z-index: 1;
  height: 38px;
  border: calc(var(--px) * 2) solid transparent;
  border-image: var(--frame-quiet) 2 / calc(var(--px) * 2) stretch;
  background: var(--stone-2) var(--dither);
  font: 600 12px var(--display);
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  cursor: pointer;
  image-rendering: pixelated;
}
/* The footnote: the launcher's version, the website, and the desktop-shortcut button, as a line of
 * small print rather than a destination, in the middle of the strip under the rail and the page. */
.foot {
  position: absolute; left: 28px; bottom: 0;
  display: flex;
  align-items: center;
  height: var(--foot-height);
  gap: 7px;
  font: 13px var(--body);
  letter-spacing: 0.04em;
  color: var(--faint);
}
/* Each piece of the footnote on one line, whatever its version's length. */
.foot > * { flex: none; white-space: nowrap; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--gold-bright); text-decoration: underline; }
.foot .sep { opacity: 0.6; }
.foot .iconbtn {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  line-height: 0;
}
.foot .iconbtn svg { width: 15px; height: 15px; shape-rendering: crispEdges; }
.foot .iconbtn:hover { color: var(--gold-bright); }
.rail button:hover { border-image-source: var(--frame-lit); color: #fff; }
.rail button.lit { border-image-source: var(--frame-lit); background-color: var(--stone-3); color: #fff; }
/* In a launcher that offers both games, lit from below in the realm's colour: one art pixel and a
 * glow. */
:root[data-realms] .rail button.lit {
  box-shadow: inset 0 calc(var(--px) * -1) 0 var(--realm), inset 0 -10px 14px -8px color-mix(in srgb, var(--realm) 55%, transparent);
}
/* Hosting and building: both realms' names, each passing out to its own side as the other comes in. */
.rail .tool span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--swap) ease, transform var(--swap) ease;
}
:root[data-realm="dereth"] .rail .tool [data-realm-of="auberean"] { opacity: 0; transform: translateX(18px); }
:root[data-realm="auberean"] .rail .tool [data-realm-of="dereth"] { opacity: 0; transform: translateX(-18px); }
/* Plugins are Dereth's alone. In Auberean's realm the button folds up under Accounts, above it, and
 * what is below closes up; it is a layer beneath the rail's other buttons, so it slides under them.
 * Once folded it is hidden, and neither the pointer nor a pad reaches it. */
.rail [data-realm-only] {
  z-index: 0;
  transition: margin-top var(--swap) ease, opacity var(--swap) ease, visibility 0s;
}
:root[data-realm="auberean"] .rail [data-realm-only="dereth"] {
  margin-top: -46px; opacity: 0; visibility: hidden;
  transition: margin-top var(--swap) ease, opacity var(--swap) ease, visibility 0s var(--swap);
}

/* ----- the realm picker ------------------------------------------------------------------------- */

/* A portal for each game, side by side above the rail, as wide as it: painted, not pixel art, in a
 * gold ring. The one picked glows in its own colour and its vortex turns under the ring, drawing
 * inward; the other waits, dimmed and still. Changing realm opens the new realm's painting out from
 * the portal picked. A launcher that offers one game has none. */
.realm { display: flex; justify-content: space-around; width: 176px; flex: none; padding: 2px 0; }
.realm:empty { display: none; }
.realm .pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none;
  font: 600 10px var(--display); letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--swap);
}
.realm .pick[aria-checked="true"] { color: #fff; }
.realm .pick:hover { color: var(--gold-bright); }
.realm .pick[aria-checked="true"]:hover { color: #fff; }
/* Each realm's own colour, for its portal's glow: steady, where the page's accent is still easing
 * over, so the glow comes in with the portal rather than chasing the accent. */
.realm .pick[data-realm-of="dereth"] { --own: #17a9bf; }
.realm .pick[data-realm-of="auberean"] { --own: #8a35d0; }
/* Each look of a portal names the same filters, so one eases into another. */
.realm .portal {
  position: relative; width: 72px; height: 72px;
  filter: saturate(0.3) brightness(0.55) drop-shadow(0 0 0 transparent);
  transform: scale(0.8);
  transition: filter var(--swap), transform var(--swap) cubic-bezier(0.3, 1.4, 0.5, 1);
}
.realm .portal img { position: absolute; inset: 0; width: 100%; height: 100%; }
.realm .vortex { animation: turn 14s linear infinite paused; }
@keyframes turn { to { transform: rotate(-360deg); } }
.realm .pick:hover .portal { filter: saturate(0.6) brightness(0.8) drop-shadow(0 0 0 transparent); }
.realm .pick[aria-checked="true"] .portal { filter: saturate(1) brightness(1) drop-shadow(0 0 8px var(--own)); transform: none; }
.realm .pick[aria-checked="true"] .vortex { animation-play-state: running; }
@media (prefers-reduced-motion: reduce) { .realm .vortex { animation: none; } }

/* ----- the content column ----------------------------------------------------------------------- */

.main { display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; align-items: flex-end; }
.column { display: flex; flex-direction: column; gap: 16px; width: 100%; max-height: 100%; min-height: 0; }
.column.narrow { max-width: 560px; }
.column.wide { max-width: 980px; }

.panel {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 22px 18px;
}
.panel.grow { flex: 1 1 auto; }
.panel > header {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.panel > header h1 {
  flex: 1; margin: 0;
  font: 600 19px var(--display);
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* The scroll bar's room is kept whether it shows or not, so what is inside never changes width. */
.scroll { overflow-y: auto; scrollbar-gutter: stable; min-height: 0; flex: 1 1 auto; padding-right: 6px; }
/* Every scroll bar of the launcher's own, a text box of several lines' included. */
.scroll::-webkit-scrollbar, details.notes pre::-webkit-scrollbar, .log::-webkit-scrollbar, textarea.field::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-track, details.notes pre::-webkit-scrollbar-track, .log::-webkit-scrollbar-track, textarea.field::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb, details.notes pre::-webkit-scrollbar-thumb, .log::-webkit-scrollbar-thumb, textarea.field::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.scroll::-webkit-scrollbar-corner, details.notes pre::-webkit-scrollbar-corner, .log::-webkit-scrollbar-corner, textarea.field::-webkit-scrollbar-corner { background: transparent; }

h2 {
  margin: 18px 0 8px;
  font: 600 14px var(--display);
  letter-spacing: 0.14em;
  color: var(--gold-bright);
}
p { margin: 6px 0; }
.muted { color: var(--muted); }
/* A count of players grows dimmer as it ages; the words on hover say how old. */
.count-aging { opacity: 0.75; }
.count-old { opacity: 0.5; }
.small { font-size: 15px; }
.warn { color: var(--high); }
.bad { color: #ef8a7c; }
.good { color: var(--online); }

/* ----- controls --------------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 0 10px;
  border: calc(var(--px) * 2) solid transparent;
  border-image: var(--frame-quiet) 2 / calc(var(--px) * 2) stretch;
  background: var(--stone-2) var(--dither);
  font: 600 11px var(--display);
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-image-source: var(--frame-lit); color: #fff; }
.btn:active:not(:disabled) { transform: translateY(var(--px)); }
.btn:disabled { opacity: 0.45; cursor: default; }
.icon-btn { min-width: 30px; padding: 0; font-size: 15px; }
/* Two buttons that are one choice: the lit one is chosen. */
.btn.seg { min-width: 108px; min-height: 36px; font-size: 12px; letter-spacing: 0.12em; }
.btn.seg:not(.on) { color: var(--muted); }
.btn.seg.on {
  border-image-source: var(--frame-lit);
  background: linear-gradient(to bottom, #8a6a30 0, #8a6a30 calc(var(--px) * 1), #6b4e22 calc(var(--px) * 1), #5a4120 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(12, 10, 16, 0.6);
}
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btns.end { justify-content: flex-end; }

/* The plate. Banded green rather than a smooth gradient, with a lit top edge and a gold frame. */
.play {
  width: 100%; height: 64px;
  border: calc(var(--px) * 4) solid transparent;
  border-image: var(--frame) 4 / calc(var(--px) * 4) stretch;
  background:
    linear-gradient(to bottom,
      #78c865 0, #78c865 calc(var(--px) * 1),
      #4f9f44 calc(var(--px) * 1), #4f9f44 18%,
      #3f8a39 18%, #3f8a39 40%,
      #33772f 40%, #33772f 62%,
      #2a6628 62%, #2a6628 84%,
      #214f21 84%);
  font: 700 32px var(--display);
  letter-spacing: 0.16em;
  color: #f7f0dc;
  text-shadow: 0 3px 0 rgba(12, 10, 16, 0.55);
  cursor: pointer;
}
.play:hover:not(:disabled) { color: #fff; filter: brightness(1.07); }
.play:active:not(:disabled) { transform: translateY(var(--px)); }
.play:disabled {
  cursor: default;
  color: rgba(239, 230, 210, 0.45);
  background: repeating-linear-gradient(to bottom, #2b3a2b 0 6px, #263426 6px 12px);
}

.field, select.field {
  height: 36px; width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--well);
  font: 17px var(--body);
  color: var(--text);
  outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.field:hover { border-color: var(--line-strong); }
.field:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(233, 199, 122, 0.18); }
.field::placeholder { color: var(--faint); }
/* A value the web view filled in from its own memory keeps the well's colours: its autofill style
 * would otherwise paint the box white. The inset shadow covers the background it forces. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #0d0b11 inset;
  transition: background-color 9999s;
}
input:-webkit-autofill:focus { box-shadow: 0 0 0 1000px #0d0b11 inset, 0 0 0 3px rgba(233, 199, 122, 0.18); }
select.field {
  padding-right: 34px;
  background: var(--well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e9c77a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px;
  cursor: pointer;
}
select.field option { background: #17141d; color: var(--text); }
select.field:disabled { color: var(--faint); cursor: default; }
.plain { font-size: 17px; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); font-size: 16px; }
.check:hover { color: var(--text); }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--gold); cursor: pointer; }

/* Two choices in one pill, a line between them: the chosen half is lit, and neither is when the
 * choice is off. */
.toggle {
  display: inline-flex;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--well);
  overflow: hidden;
}
.toggle button {
  padding: 0 14px;
  border: 0;
  background: none;
  font: 14px var(--body); color: var(--muted);
  cursor: pointer;
}
.toggle button + button { border-left: 1px solid var(--line); }
.toggle button:hover { color: var(--text); background: rgba(233, 199, 122, 0.06); }
.toggle button.on { background: rgba(181, 138, 60, 0.34); color: #fff; }
.toggle:has(button.on) { border-color: var(--line-strong); }

/* A small drop-down, for a table cell. */
select.field.mini { height: 28px; width: auto; min-width: 120px; max-width: 220px; padding: 0 28px 0 8px; font-size: 15px; background-position: right 9px center; }

/* The pixel-grid icons inside buttons: chevrons and the bin. */
.btn svg { width: 10px; height: 14px; shape-rendering: crispEdges; }

/* A status dot: a plain disc, with the state said in words beside it. */
.dot {
  display: inline-block; flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--unknown);
}
.dot.online, .dot.pass { background: var(--online); box-shadow: 0 0 6px rgba(95, 207, 85, 0.55); }
.dot.high, .dot.starting, .dot.warn { background: var(--high); }
.dot.offline, .dot.block { background: var(--offline); }
.dot.unknown { background: var(--unknown); }

/* ----- lists ------------------------------------------------------------------------------------ */

.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px;
  min-height: 50px; padding: 6px 14px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: var(--radius-small);
  cursor: pointer;
}
.row:hover { background: rgba(233, 199, 122, 0.06); }
.row.static { cursor: default; }
.row.static:hover { background: none; }
.row.sel {
  border-color: var(--gold-bright);
  background: rgba(181, 138, 60, 0.16);
}
.row .grow { flex: 1; min-width: 0; }
.row .name { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { color: var(--muted); font-size: 15px; white-space: nowrap; }
/* A row's pin, on Home and in the world list: a favorite shows its star, and on hover the button that
 * takes it off; any other row shows, on hover, the button that makes it a favorite. The pin keeps the
 * star's height and the button stands out of it, so a row is the same size hovered or not. */
.pin { width: 34px; height: 18px; display: flex; justify-content: center; align-items: center; margin-left: auto; }
.pin .btn { display: none; }
.pin .star { color: var(--gold-bright); font-size: 18px; line-height: 1; }
.row:hover .pin .btn, table.worlds tr:hover .pin .btn { display: inline-flex; }
.row:hover .pin .star, table.worlds tr:hover .pin .star { display: none; }


.tag {
  font: 600 11px var(--display); letter-spacing: 0.12em;
  color: var(--gold-bright);
  border: 1px solid var(--line-strong); border-radius: var(--radius-small);
  padding: 4px 8px;
}

/* A panel that must keep its full height above a growing one, as the Library's pending add does. */
.panel.pending { flex: none; }

/* Fixed columns: what is shown in them (a folded section, an open row) never moves them. */
table.worlds { width: 100%; border-collapse: collapse; font-size: 16px; table-layout: fixed; }
table.worlds col.c-dot { width: 26px; }
table.worlds col.c-emu { width: 150px; }
table.worlds col.c-era { width: 192px; }
table.worlds col.c-rules { width: 76px; }
table.worlds col.c-players { width: 84px; }
table.worlds col.c-end { width: 50px; }
table.worlds select.field.mini { width: 100%; min-width: 0; }
table.worlds td { overflow: hidden; text-overflow: ellipsis; }
table.worlds td.end { overflow: visible; }
/* PLAY in an open row: the same green plate, small. */
.play.mini {
  width: auto; height: 44px; flex: none;
  padding: 0 18px;
  border-width: calc(var(--px) * 2);
  border-image: var(--frame) 4 / calc(var(--px) * 2) stretch;
  font-size: 18px; letter-spacing: 0.14em;
}
table.worlds td, table.worlds th { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
/* Above the rows as they scroll under it, a dimmed count among them. */
table.worlds th { font: 600 12px var(--display); letter-spacing: 0.12em; color: var(--gold); position: sticky; top: 0; z-index: 1; background: #17141d; }
table.worlds tbody tr { cursor: pointer; }
table.worlds tbody tr:hover { background: rgba(233, 199, 122, 0.07); }
table.worlds td.name { font-size: 19px; color: var(--text); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.worlds td { color: var(--muted); }
table.worlds tr.dim td { opacity: 0.6; }
table.worlds td.end { text-align: right; width: 1%; }
table.worlds tr.open { background: rgba(181, 138, 60, 0.12); }
table.worlds tr.open td { border-bottom-color: transparent; }
/* A section's header: its name, how many it holds, and whether it is open. */
table.worlds tr.section td {
  padding: 14px 8px 6px;
  font: 600 12px var(--display); letter-spacing: 0.14em;
  color: var(--gold-bright);
  cursor: pointer;
}
table.worlds tr.section td .fold { display: inline-block; width: 16px; color: var(--gold); }
table.worlds tr.section td .muted { margin-left: 10px; font: 14px var(--body); letter-spacing: 0; }
table.worlds tr.section:hover td { color: #fff; }
/* An open row's details, under it. */
table.worlds tr.detail { cursor: default; background: rgba(181, 138, 60, 0.12); }
table.worlds tr.detail:hover { background: rgba(181, 138, 60, 0.12); }
table.worlds tr.detail td { white-space: normal; padding-top: 0; }
.detail-body { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 8px; color: var(--text); }
.detail-body p { margin: 0; }
.detail-top { display: flex; gap: 14px; align-items: flex-start; }
.detail-top p { flex: 1; }
/* An open row's PLAY, and under it, for a world the player added, the button that removes it. */
.detail-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.detail-body .strip b, .era-line b { font: 600 11px var(--display); letter-spacing: 0.14em; color: var(--gold); margin-right: 6px; }
.era-line { display: flex; align-items: center; gap: 4px; font-size: 16px; }
/* The one word beside an era: verified or assumed. */
.era-note { margin-left: 5px; font-size: 12px; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; }
.features .check { font-size: 15px; gap: 8px; }
.features .check input { width: 15px; height: 15px; }
.features .check:has(input:disabled) { cursor: default; color: var(--muted); }
.features .check input:disabled { cursor: default; }
/* A system a world's settings turn on or off over its era's. */
.features .check.changed { color: var(--gold-bright); }

/* ----- the world page --------------------------------------------------------------------------- */

.form { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px 14px; align-items: center; }
.form label.lab, .form span.lab { font: 600 12px var(--display); letter-spacing: 0.14em; color: var(--gold-bright); }
.form .pair { display: flex; gap: 12px; align-items: center; }
.form .pair > .small { flex: 1; }
.form .pair > .small.fit { flex: none; }
.form .pair > .field { flex: 1; }
.form .pair > .field.narrow-field { flex: none; }
.form .note { grid-column: 2; margin-top: -4px; font-size: 15px; }
/* A world's Settings and the new world's form: the label column is wide enough for the longest
 * label on one line, the same in every section, and no label wraps. */
.form.long-labels { grid-template-columns: minmax(330px, max-content) minmax(0, 1fr); }
.form.long-labels > .lab { white-space: nowrap; }
/* A label with a tooltip says so under the pointer. */
.form .lab[title] { cursor: help; }
/* A check box sits where a value goes, with its few words, if any, after it. */
.form .box { min-height: 24px; }
.form .box input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--gold); cursor: pointer; }
.form .box .trail { color: var(--muted); font-size: 16px; cursor: pointer; }
.form .box .trail:hover { color: var(--text); }
.facts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.strip { display: flex; gap: 18px; flex-wrap: wrap; font-size: 16px; }
.strip span { display: inline-flex; align-items: center; gap: 7px; }

/* ----- the interface question ------------------------------------------------------------------- */

/* Three cards side by side, each a choice: the screen in miniature, its name and one line. The
 * picked one is lit, as a segmented button is. The pictures are pixel-grid SVGs at one art pixel to
 * `--px`, with crisp edges. */
.ifaces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 10px; }
.iface {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 12px 14px;
  border: calc(var(--px) * 2) solid transparent;
  border-image: var(--frame-quiet) 2 / calc(var(--px) * 2) stretch;
  background: var(--stone-2) var(--dither);
  text-align: center;
  cursor: pointer;
}
.iface:hover { border-image-source: var(--frame-lit); }
.iface.on {
  border-image-source: var(--frame-lit);
  background-color: var(--stone-3);
  box-shadow: 0 0 0 1px var(--gold-bright), 0 0 18px rgba(233, 199, 122, 0.22);
}
.iface .pic { width: calc(var(--px) * 64); max-width: 100%; height: auto; aspect-ratio: 64 / 40; flex: none; }
.iface .iname { font: 600 15px var(--display); letter-spacing: 0.14em; color: var(--gold-bright); }
.iface.on .iname { color: #fff; }
.iface .iline { font-size: 16px; line-height: 1.25; color: var(--muted); }
.iface.on .iline { color: var(--text); }

/* ----- the check -------------------------------------------------------------------------------- */

.finding { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.finding .dot { margin-top: 8px; justify-self: center; }
.finding .title { font-size: 19px; }
.finding.block .title { color: #ef8a7c; }
.finding.warn .title { color: var(--high); }
.finding .detail { grid-column: 2; color: var(--muted); font-size: 16px; }
.finding .btns { grid-column: 2; margin-top: 6px; }

/* ----- the notice ------------------------------------------------------------------------------ */

/* Floats over the top right, clear of the window's drag strip, and takes no room from any screen. */
.notice {
  position: fixed; top: 40px; right: 28px; z-index: 30;
  width: min(380px, 40vw);
  pointer-events: none;
}
.notice .status {
  pointer-events: auto;
  gap: 6px;
  padding: 8px 12px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  animation: notice-in 0.18s ease-out;
}
@keyframes notice-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.bar {
  height: 8px;
  border-radius: 4px;
  background: var(--well);
  overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  border-radius: 4px;
  background: var(--gold);
  transition: width 0.3s;
}
.bar.sweep > i { width: 33%; animation: sweep 2s linear infinite alternate; }
@keyframes sweep { from { transform: translateX(0); } to { transform: translateX(200%); } }
/* A Library kind's buttons, right-aligned under its sets, and what a Download folds out below them:
   its explainer, or how the download goes. */
.set-btns { margin: 8px 0 4px; }
.set-explain { margin: 4px 0 10px; padding: 8px 10px; background: var(--well); }
.set-explain p { margin: 0 0 6px; }
.set-explain .bar { margin: 4px 0; }
.set-explain .sub { margin-bottom: 6px; }
.status .line { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.status .line span { flex: 1; }
.status .line.error { color: #ef8a7c; }
.status .line button:not(.btn) { background: none; border: 0; padding: 0 2px; color: var(--gold); cursor: pointer; font-size: 14px; }

.demo-flag {
  position: fixed; right: 14px; bottom: 8px; z-index: 20;
  font: 600 11px var(--display); letter-spacing: 0.12em; color: var(--high);
}

/* ----- Host a world and Build a world --------------------------------------------------------- */

/* Between the play buttons and the two for hosting and building worlds: a gold rule one art pixel
 * high, edged in ink like the frames so it reads over any painting, with a stud at its middle, and
 * no more room around it than the gap between two buttons. */
.rail-divider {
  position: relative;
  height: calc(var(--px) * 3);
  margin: 2px 8px;
}
.rail-divider::before {
  content: ""; position: absolute; left: 0; right: 0; top: var(--px);
  height: var(--px);
  background: var(--gold);
  box-shadow: 0 var(--px) 0 var(--ink), 0 calc(var(--px) * -1) 0 var(--ink);
}
.rail-divider::after {
  content: ""; position: absolute; left: 50%; top: 0;
  width: calc(var(--px) * 3); height: calc(var(--px) * 3);
  margin-left: calc(var(--px) * -1.5);
  background: var(--gold-bright);
  box-shadow: 0 0 0 var(--px) var(--ink);
}

/* A row whose buttons sit beside a line or two of what it is. */
.row.program { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.row.program .btns { padding-top: 2px; }
.row .bar { margin: 6px 0 2px; max-width: 360px; }
.row .chev { width: 16px; display: flex; justify-content: center; color: var(--gold); }
.row .chev svg { width: 8px; height: 12px; shape-rendering: crispEdges; }
.row .sub.bad, p.bad { color: #ef8a7c; }
.btn.mini-btn { min-height: 22px; padding: 0 8px; font-size: 10px; vertical-align: middle; }

/* Release notes, folded until asked for. */
details.notes { margin-top: 4px; }
details.notes summary { cursor: pointer; color: var(--gold); font-size: 15px; }
details.notes summary:hover { color: var(--gold-bright); }
details.notes pre, .log {
  margin: 6px 0 0;
  padding: 8px 10px;
  max-height: 220px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius-small);
  background: var(--well);
  white-space: pre-wrap; overflow-wrap: anywhere;
  font: 14px/1.35 var(--body); color: var(--text);
  user-select: text; -webkit-user-select: text;
}
details.notes pre a { color: var(--gold-bright); }
/* A world's log: a line to a row, so a line the person reads can be found again as new ones come. */
.log { position: relative; max-height: 260px; font: 12px/1.4 Consolas, "Cascadia Mono", Menlo, monospace; }
.log > div { min-height: 1.4em; }
.field.narrow-field { width: 120px; }
.field.mini-field { width: 220px; height: 30px; font-size: 15px; }
select.field.narrow-select { width: 160px; }
/* A field of several lines: a welcome message, or a list one to a line. */
textarea.field.area { height: auto; min-height: 60px; padding: 7px 12px; resize: vertical; font: 16px/1.4 var(--body); }

/* Each program's emblem, beside its page's title. Painted, so scaled smoothly. */
.panel > header .brand { width: 34px; height: 34px; flex: none; margin-right: -2px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); }

/* The program, in one line under its page's title. */
.program-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 30px; font-size: 16px; color: var(--muted); }
.program-line > span:first-child { color: var(--text); }
.program-line .btns { margin-left: auto; }
.program-line.first { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(181, 138, 60, 0.08); }
/* Play's line for a client not yet downloaded, with room under it before the worlds. */
.client-line { margin: 8px 0 12px; }
.program-line + .bar { margin: 6px 0 2px; max-width: 360px; }

/* A section of a world's page that folds: its heading opens and shuts it. */
details.fold > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "\25B8"; width: 14px; color: var(--gold); font-size: 18px; line-height: 1; }
details.fold[open] > summary::before { content: "\25BE"; }
details.fold > summary:hover h2 { color: #fff; }
details.fold > summary h2 { margin: 16px 0 8px; }
.fold-body { padding-bottom: 4px; }
code { font: 14px Consolas, "Cascadia Mono", Menlo, monospace; color: var(--text); user-select: text; -webkit-user-select: text; }

/* Sharing a world: a label, a value and its button on a line. */
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 34px; }
.share-row .lab { width: 150px; flex: none; font: 600 12px var(--display); letter-spacing: 0.14em; color: var(--gold-bright); }
.share-row .addr { font: 16px Consolas, "Cascadia Mono", Menlo, monospace; color: var(--text); user-select: text; -webkit-user-select: text; }
.share-row details.notes { flex: 1 1 260px; margin: 0; }
p.reach { margin: 2px 0 8px 160px; }
.share-row.confirm { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: rgba(216, 88, 74, 0.08); }

/* The console: a command line, and the log under it. */
.console-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.console-line .field { flex: 1; min-width: 0; height: 32px; font: 14px Consolas, "Cascadia Mono", Menlo, monospace; }
.console-line .field.kind-field { flex: none; width: 190px; font: 15px var(--body); }
.console-line .grow { flex: 1; }
.log-tools { margin-top: 8px; }
.h2-row { display: flex; align-items: center; gap: 12px; }
.h2-row h2 { margin-right: auto; }

/* A state in words beside its dot, after the button that changes it. */
.share-row .state { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.share-row .state a { color: var(--gold-bright); }

/* Lyceum's worlds: a row opens in place, like a world on the Worlds list, to what the world
 * changes and the ways to export and publish it. */
.ly-row .fold-mark { width: 14px; color: var(--gold); font-size: 16px; flex: none; }
.ly-world.open { background: rgba(181, 138, 60, 0.12); border-radius: var(--radius-small); }
.ly-world.open > .ly-row { border-bottom-color: transparent; }
.ly-world.open > .ly-row:hover { background: none; }
.ly-detail { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 12px 42px; border-bottom: 1px solid var(--line); }
.ly-detail p { margin: 0; }
.ly-detail .strip b { font: 600 11px var(--display); letter-spacing: 0.14em; color: var(--gold); margin-right: 6px; }
.ly-detail .share-row .btn { min-width: 108px; }
.ly-actions { display: flex; flex-direction: column; gap: 2px; }
.ly-actions .share-row { min-height: 28px; }

/* A world's Lyceum and Advanced sections: each line's button or label first, and what it says of
 * the world after it, in one column. */
.aligned .share-row > .btn:first-child { min-width: 208px; }
.aligned .share-row > .lab { width: 208px; }

/* The Plugins page: three sections whose headings fold them, as the Worlds list's do, and plugin
 * rows that open in place, one at a time, to everything known about the plugin. */
.plugins-page > h2:first-child { margin-top: 6px; }
h2.fold-head { display: flex; align-items: center; cursor: pointer; }
h2.fold-head .fold { display: inline-block; width: 16px; color: var(--gold); }
h2.fold-head .muted { margin-left: 10px; font: 14px var(--body); letter-spacing: 0; }
h2.fold-head:hover { color: #fff; }
/* The Library's folding: a group's heading, and a section within it, smaller and set in. */
.library-page h2.lib-sub { margin: 10px 0 6px 16px; font-size: 12px; }
.library-page .lib-sub-body { margin-left: 16px; }
.library-page .lib-explain { display: flex; align-items: center; gap: 12px; margin-left: 16px; }
.library-page .lib-explain > p { margin-right: auto; }
.plugin.open { background: rgba(181, 138, 60, 0.12); border-radius: var(--radius-small); }
.plugin.open > .plugin-row { border-bottom-color: transparent; }
.plugin.open > .plugin-row:hover { background: none; }
.plugin-detail { display: flex; flex-direction: column; gap: 8px; padding: 0 15px 12px; border-bottom: 1px solid var(--line); font-size: 16px; }
.plugin-detail p { margin: 0; }
.plugin-detail .desc, .plugin-detail .said { white-space: pre-wrap; overflow-wrap: anywhere; }
.plugin-detail .strip { gap: 2px 18px; }
/* A label and its value as the facts above have them: the value right after the label, at the same
   gap, wrapping under itself. */
.plugin-detail .said { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 7px; align-items: baseline; }
.plugin-detail .strip b, .plugin-detail .said b, .plugin-location b { font: 600 11px var(--display); letter-spacing: 0.14em; color: var(--gold); margin-right: 8px; }
.plugin-detail .said.warn b { color: var(--high); }
/* An open Local row's location: its label and the folder, as the lines above have them, and the
   folder's buttons at the line's end. */
.plugin-location { display: flex; align-items: center; gap: 7px; min-width: 0; }
.plugin-location > b { flex: none; }
.plugin-location .path { min-width: 0; overflow-wrap: anywhere; }
.plugin-location .btns { flex: none; flex-wrap: nowrap; margin-left: auto; padding-left: 8px; }
/* A section's empty line, at its rows' indent. */
.plugins-page .list > p.empty { margin: 6px 15px; }
.plugin-update { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.plugin-setting .sub { white-space: normal; }
/* Search and a new source's address: a compact line from the rows' names to their buttons. */
.plugin-line { display: flex; align-items: center; gap: 8px; margin: 0 15px 6px; }
.plugin-line .field { flex: 1; min-width: 0; }
.plugin-line.add { margin-top: 14px; }
/* The AC2 art pack's parts: one line that wraps whole labels on a narrow page. */
.look-parts { flex-wrap: wrap; gap: 6px 12px; }
.look-parts .check, .look-creatures .check { white-space: nowrap; }
/* The AC2 art pack's creatures: a heading that folds them, then their tick boxes in columns that
   wrap to the page's width. */
.look-fold { display: inline-flex; align-items: center; margin: 6px 15px 6px; color: var(--muted); font-size: 15px; cursor: pointer; }
.look-fold:hover { color: var(--text); }
.look-fold .fold { display: inline-block; width: 16px; color: var(--gold); }
.look-creatures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; margin: 0 15px 6px 31px; }
.plugin-confirm { display: flex; align-items: center; gap: 8px; margin: 4px 15px 0; font-size: 15px; }
.plugin-confirm > span { margin-right: 4px; }
/* Where the last plugin made went, with a button that shows it. */
.plugin-made { display: flex; align-items: center; gap: 8px; margin: 4px 15px 0; font-size: 15px; min-width: 0; }
.plugin-made > span { margin-right: 4px; min-width: 0; overflow-wrap: anywhere; }
.plugin-made > .btn { flex: none; }
/* A source on one compact line: its name, how many plugins it lists and its address. */
.row.source-row { min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
.row.source-row .line { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; min-width: 0; }
.row.source-row .line .name { font-size: 18px; flex: none; }
.row.source-row .line .addr { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
