/* ==== The public web site's look ====================================================================================

   This one file styles every public page. The admin has its own, so changing this never changes the admin.

   0. Colours      every colour, light mode then dark mode
   1. Sizes        change these to make the whole site bigger, smaller or roomier
   2. Fonts
   3. Basics       the page, links, headings
   4. Layout       top bar, menu, page, footer
   5. Parts        cards, notices, tables, forms, buttons
   6. The look     coloured card boxes, pills, the Door Zone
   7. Extras       chat rooms, message text, ANSI art, small helpers

   Sizes use clamp(smallest, growing, largest): they grow with the window between a phone and a big screen. */


/* ---- 0. Colours ---------------------------------------------------------------------------------------------------- */
/* Each colour is named for its job, not for what colour it is, so any of them can be any colour.
   Anything that sets a background ends in _bg. Change a colour in both blocks: light mode first, then dark mode.
   js/theme.js picks the mode: the visitor's own choice from the switch in the header, or else their computer's. */
:root {
  color-scheme: light;

  /* page basics */
  --page_bg: #f3f4ef;          /* the page behind everything */
  --card_bg: #ffffff;          /* cards, boxes, form panels */
  --header_bg: #ffffff;        /* the top bar and menu */
  --text: #1b211c;             /* normal writing */
  --heading: #111111;          /* page titles */
  --muted: #58625a;            /* quieter text, labels, dates */
  --border: #dde2d9;           /* lines and edges */

  /* main colours */
  --primary: #57871d;          /* links, main buttons, tabs, the SysOp's chat bubble */
  --secondary: #770973;        /* the Go Retro / Go Modern switch */
  --current: #b23b2e;          /* the zone you are in, on the menu */

  /* messages and states */
  --info: #b88d00;             /* counts of new messages */
  --success: #57871d;          /* done and saved notices */
  --warning: #b88d00;          /* warning notices */
  --danger: #b23b2e;           /* errors, required field stars, delete buttons */

  /* card colours: the site takes turns through these, card by card (class card_1 ... card_6) */
  --card_1: #57871d;
  --card_2: #770973;
  --card_3: #0d8a8c;
  --card_4: #b88d00;
  --card_5: #17637d;
  --card_6: #b23b2e;

  /* chat name colours: one for each person in a chat room */
  --chat_1: #c026d3;
  --chat_2: #0891b2;
  --chat_3: #ca8a04;
  --chat_4: #2563eb;
  --chat_5: #dc2626;
  --chat_6: #78716c;

  /* worked out from the colours above: no need to change these */
  --on_colour: #ffffff;        /* text on a solid coloured button */
  --glow: 0;                   /* 0 in light mode, 1 in dark mode: the glow around cards */
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* page basics */
  --page_bg: #0a0f0b;
  --card_bg: #111a13;
  --header_bg: #000000;
  --text: #d6e0d8;
  --heading: #ffffff;
  --muted: #93a597;
  --border: #1f2c22;

  /* main colours */
  --primary: #a0df2a;
  --secondary: #ce50fb;
  --current: #fb5656;

  /* messages and states */
  --info: #ead35e;
  --success: #a0df2a;
  --warning: #ead35e;
  --danger: #fb5656;

  /* card colours */
  --card_1: #a0df2a;
  --card_2: #ce50fb;
  --card_3: #5ad6e0;
  --card_4: #ead35e;
  --card_5: #558fec;
  --card_6: #fb5656;

  /* chat name colours */
  --chat_1: #c026d3;
  --chat_2: #0891b2;
  --chat_3: #ca8a04;
  --chat_4: #2563eb;
  --chat_5: #dc2626;
  --chat_6: #78716c;

  /* worked out from the colours above */
  --on_colour: var(--page_bg);
  --glow: 1;
}

/* soft tints behind tabs, tags and notices, made from the colours above in either mode */
:root {
  --primary_soft_bg: color-mix(in srgb, var(--primary) 14%, var(--card_bg));
  --success_soft_bg: color-mix(in srgb, var(--success) 14%, var(--card_bg));
  --warning_soft_bg: color-mix(in srgb, var(--warning) 16%, var(--card_bg));
  --danger_soft_bg: color-mix(in srgb, var(--danger) 14%, var(--card_bg));
  --notice_bg: #5ad6e0;                /* the bar that drops down when someone goes into a chat room */
  --on_notice: #062a2c;                /* its text: dark, as white does not show on the light cyan */
}


/* ---- 1. Sizes ------------------------------------------------------------------------------------------------------ */
:root {
  /* text */
  --text-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --text-s: clamp(0.82rem, 0.8rem + 0.1vw, 0.9rem);
  --text-m: clamp(0.95rem, 0.92rem + 0.15vw, 1.02rem);
  --text-l: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);

  /* headings */
  --head-s: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  --head-m: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --head-l: clamp(1.35rem, 1.2rem + 0.8vw, 1.8rem);
  --head-xl: clamp(1.6rem, 1.35rem + 1.3vw, 2.2rem);
  --head-2xl: clamp(1.8rem, 1.45rem + 1.8vw, 2.5rem);

  /* space between and inside things */
  --space-3xs: 0.15rem;
  --space-2xs: 0.3rem;
  --space-xs: 0.5rem;
  --space-s: 0.75rem;
  --space-m: 1rem;
  --space-l: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  --space-xl: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  --space-2xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);

  /* corners and widths */
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --page-width: 1600px;
  --bar-width: 1600px;
}


/* ---- 2. Fonts ------------------------------------------------------------------------------------------------------ */
/* The heading font, Jersey 10 (SIL Open Font Licence, fonts/OFL.txt), served from this theme's fonts folder.
   To use another font: put its .woff2 in fonts/, change the url() lines and --font-head, then set the three
   --head- values to suit it (Space Grotesk, the old one, wants 700, 1 and -0.02em). */
@font-face { font-family: "Jersey 10"; font-style: normal; font-weight: 400; font-display: block;
  src: url("../fonts/Jersey10-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jersey 10"; font-style: normal; font-weight: 400; font-display: block;
  src: url("../fonts/Jersey10-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --font-head: "Jersey 10", "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --head-weight: 400;                        /* Jersey 10 has one weight: a bold one would be faked */
  --head-zoom: 1.35;                         /* Jersey 10 looks small for its size, so headings are drawn this much bigger */
  --head-spacing: 0.02em;                    /* the gap between letters in headings */
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --c: var(--primary);                       /* the colour of the box or pill being drawn */
}


/* ---- 3. Basics ----------------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
body { margin: 0; background: var(--page_bg); color: var(--text); font-family: var(--font-body); font-size: var(--text-m); line-height: 1.5; }
a { color: var(--primary); }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); line-height: 1.2; margin: 0 0 var(--space-xs); }
h1 { font-size: calc(var(--head-xl) * var(--head-zoom)); color: var(--heading); }
h1 em { font-style: normal; color: var(--primary); text-shadow: 0 0 18px color-mix(in srgb, var(--primary) calc(var(--glow) * 35%), transparent); }
h2 { font-size: calc(var(--head-s) * var(--head-zoom)); }
h3 { font-size: calc(var(--text-l) * var(--head-zoom)); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--primary_soft_bg); padding: 0.1em 0.35em; border-radius: 4px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }


/* ---- 4. Layout ----------------------------------------------------------------------------------------------------- */
/* The header: two rows. Row 1 the name and the account links, row 2 the zones and the terminal switch.
   It stays at the top while the page scrolls, and js/theme.js adds top--small once scrolled, which shrinks it. */
.top { position: sticky; top: 0; z-index: 30; background: var(--header_bg); border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--primary) calc(100% - var(--glow) * 45%), transparent); }
.top__row { max-width: var(--bar-width); margin: 0 auto; padding: 4px var(--space-l);
  display: flex; align-items: center; gap: var(--space-m); flex-wrap: wrap; }
.top__row--brand { padding-top: var(--space-2xs); transition: padding .2s; }
.top__row--menus { padding-bottom: var(--space-xs); }
.brand { font-family: var(--font-head); font-size: calc(var(--head-2xl) * var(--head-zoom)); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); line-height: 1.1;
  color: var(--primary); text-decoration: none; text-shadow: 0 0 12px color-mix(in srgb, var(--primary) calc(var(--glow) * 40%), transparent);
  transition: font-size .2s; }
.top__links { display: flex; align-items: center; gap: var(--space-xs); margin-left: auto; color: var(--muted); font-size: var(--text-s); }
/* the top bar's buttons, each its own colour: Members (cyan), your name (blue), Admin (green), Sign out (red); signed out: Sign in (blue), Join (yellow).
   An icon sits left of the text; on phones only the icon shows (see the phone layout below). The open page's button is filled in. */
.top__members { --c: var(--card_3); }  .top__me, .top__in { --c: var(--card_5); }  .top__admin { --c: var(--card_1); }
.top__out { --c: var(--danger); }  .top__join { --c: var(--card_4); }  .top__install { --c: var(--secondary); }
.btn.top__btn { display: inline-flex; align-items: center; gap: .45em; white-space: nowrap; line-height: 1.2; }
.top__icon { display: block; }
.btn.top__btn[hidden] { display: none; }
.top__icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top__links .btn[aria-current] { background: color-mix(in srgb, var(--c) 26%, var(--card_bg)); border-color: var(--c);
  box-shadow: 0 0 12px -3px color-mix(in srgb, var(--c) calc(var(--glow) * 70%), transparent); }
.top--small .top__row--brand { padding-top: var(--space-2xs); }
.top--small .brand { font-size: calc(var(--head-m) * var(--head-zoom)); }

/* the zone menu */
.nav { display: flex; gap: var(--space-3xs); flex: 1; flex-wrap: wrap; align-items: center; color: var(--muted); }
.nav__label { font-family: var(--mono); font-size: var(--text-s); margin-right: var(--space-2xs); }
.nav a { font-family: var(--mono); font-size: var(--text-s); color: var(--muted); text-decoration: none;
  padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius); border: 1px solid transparent; }
.nav a:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.nav a[aria-current="page"] { color: var(--current); font-weight: 600; background: color-mix(in srgb, var(--current) 14%, var(--header_bg));
  border-color: color-mix(in srgb, var(--current) 40%, transparent); }
.btn.nav__switch { font-family: var(--mono); font-weight: 700; white-space: nowrap; color: var(--secondary);
  border-color: color-mix(in srgb, var(--secondary) 55%, transparent); background: color-mix(in srgb, var(--secondary) 10%, transparent); }
.btn.nav__switch:hover { background: color-mix(in srgb, var(--secondary) 20%, transparent); }

/* the light and dark switch (js/theme.js adds it to row 1, after the account links) */
.themebtn { display: inline-flex; align-items: center; line-height: 1; padding: var(--space-2xs); border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--muted); cursor: pointer; }
.themebtn:hover, .themebtn:focus-visible { color: var(--text); background: color-mix(in srgb, var(--muted) 18%, transparent); }
.themebtn svg { display: block; }

/* the menu button for phones (three lines, an X while open); js/theme.js opens and closes the menu */
.burger { display: none; position: relative; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text); cursor: pointer; }
.burger span, .burger span::before, .burger span::after { position: absolute; left: 25%; width: 50%; height: 2px; background: currentColor;
  border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger span { top: calc(50% - 1px); }
.burger span::before, .burger span::after { content: ""; left: 0; width: 100%; }
.burger span::before { transform: translateY(-6px); }
.burger span::after { transform: translateY(6px); }
.top--open .burger span { background: transparent; }
.top--open .burger span::before { transform: rotate(45deg); background: var(--text); }
.top--open .burger span::after { transform: rotate(-45deg); background: var(--text); }
.top__row--bar { display: none; }

/* Phones: Go Retro and the account links move to a small bar across the top (js/theme.js moves them), and row 2 hides behind
   the menu button and pops out under the header. Change 760px here to switch to the phone layout at another width. */
@media (max-width: 760px) {
  .top__row--bar { display: flex; align-items: center; gap: var(--space-xs); padding-top: var(--space-3xs); padding-bottom: var(--space-3xs);
    border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--text) 4%, var(--header_bg)); }
  .top__row--bar .top__links { gap: var(--space-xs); font-size: var(--text-xs); }
  .top__row--bar .btn--small { padding: var(--space-3xs) var(--space-xs); font-size: var(--text-xs); }
  .top__row--bar .top__links { flex-wrap: nowrap; }
  .top__row--bar .top__btn { justify-content: center; min-width: 2.5rem; min-height: 2.5rem; padding: var(--space-2xs); font-size: var(--text-m); }
  .top__row--bar .btn.nav__switch { display: inline-flex; align-items: center; min-height: 2.5rem; padding: var(--space-2xs) var(--space-s); font-size: var(--text-s); }
  .top__row--bar { padding-top: var(--space-2xs); padding-bottom: var(--space-2xs); }
  .top__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* still read out */
  .top__row--brand { padding-bottom: var(--space-xs); }
  .top__row--brand .themebtn { margin-left: auto; }
  .burger { display: inline-block; }
  .top__row--menus { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    gap: var(--space-s); padding: var(--space-s) var(--space-m) var(--space-m); background: var(--header_bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(0,0,0,.35); max-height: calc(100dvh - 4.5rem); overflow-y: auto; }
  .top--open .top__row--menus { display: flex; }
  .nav { flex-direction: column; flex-wrap: nowrap; align-items: stretch; flex: none; }   /* nowrap: a tall menu scrolls, never splits */
  .nav__label { display: none; }
  .nav a { font-size: var(--text-m); padding: var(--space-xs) var(--space-s); }
}

/* the page and the footer */
.page { max-width: var(--page-width); margin: 0 auto; padding: var(--space-l) var(--space-m) var(--space-2xl); }
.foot { max-width: var(--page-width); margin: 0 auto; padding: 0 var(--space-m) var(--space-xl); color: var(--muted); font-family: var(--mono); font-size: var(--text-xs); }

/* a title row with buttons beside it */
.bar { display: flex; align-items: center; gap: var(--space-m); margin-bottom: var(--space-m); flex-wrap: wrap; }
.bar h1, .bar h2 { margin: 0 auto 0 0; }           /* the title on the left, its buttons on the right, lined up */
.count { font-size: var(--text-s); color: var(--muted); font-weight: 400; margin-left: var(--space-2xs); }
.lead { color: var(--muted); max-width: 46rem; margin: 0 0 var(--space-m); }
.stack > * + * { margin-top: var(--space-m); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space-s) var(--space-l); align-items: start; }
.actions { display: flex; gap: var(--space-s); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-m); }
.actions .btn { white-space: nowrap; }
.actions__form { display: inline-flex; align-items: center; gap: var(--space-xs); }
.actions__form input { width: 12rem; padding: var(--space-2xs) var(--space-xs); }
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
.actions form.inline, form.inline { display: inline; }


/* ---- 5. Parts ------------------------------------------------------------------------------------------------------ */
/* cards */
/* A card has a coloured top edge and a soft glow in its colour (--c): primary, or a card_1 ... card_6 class on it.
   Tables, headings and buttons inside take the same colour. */
:where(.card, fieldset) { --c: var(--primary); }
.card { background: var(--card_bg); border-radius: var(--radius-l); padding: var(--space-l); margin-bottom: var(--space-m);
  border: 1px solid color-mix(in srgb, var(--c) calc(15% + var(--glow) * 25%), var(--border));
  border-top: 3px solid color-mix(in srgb, var(--c) calc(70% + (1 - var(--glow)) * 30%), var(--border));
  box-shadow: 0 0 24px -8px color-mix(in srgb, var(--c) calc(var(--glow) * 35%), transparent),
              0 1px 2px rgba(0, 0, 0, calc((1 - var(--glow)) * 0.05)), 0 10px 24px -16px color-mix(in srgb, var(--c) calc((1 - var(--glow)) * 45%), transparent); }
.card.narrow { max-width: 26rem; margin: var(--space-2xl) auto; }
.card.flush { padding: 0; overflow: hidden; }

/* notices: good, warn, bad */
.notice { padding: var(--space-s) var(--space-m); border-radius: var(--radius); margin-bottom: var(--space-m); border: 1px solid var(--border); }
.notice--good { background: var(--success_soft_bg); }
.notice--warn { background: var(--warning_soft_bg); }
.notice--danger { background: var(--danger_soft_bg); border-color: var(--danger); }

/* tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: var(--space-xs) var(--space-s); border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--c, var(--primary));
  background: color-mix(in srgb, var(--c, var(--primary)) 10%, var(--card_bg)); border-bottom-color: color-mix(in srgb, var(--c, var(--primary)) 30%, var(--border)); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--c, var(--primary)) 8%, var(--card_bg)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2xs) var(--space-m); margin: 0; }
.kv dt { font-family: var(--mono); color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2xs); margin-top: var(--space-m); }
.pages .btn { --c: var(--card_4); }
.pages__n { min-width: 2.2em; text-align: center; padding: var(--space-3xs) var(--space-2xs); border-radius: var(--radius-s); text-decoration: none;
  border: 1px solid var(--border); color: var(--text); }
.pages__n:hover { border-color: var(--primary); }
.pages__n--on { background: var(--primary_soft_bg); border-color: var(--primary); color: var(--primary); font-weight: 700; }
.pages__gap { color: var(--muted); padding: 0 var(--space-3xs); }
.pages__jump { display: inline-flex; align-items: center; gap: var(--space-2xs); margin-left: var(--space-s); color: var(--muted); font-size: var(--text-s); }
.pages__jump label { display: inline-flex; align-items: center; gap: var(--space-2xs); margin: 0; font-weight: 400; }
.pages__jump input { width: 5em; margin: 0; }
/* a message area's head: the count on the left, its search on the right */
.areahead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2xs) var(--space-s);
  margin-bottom: var(--space-s); }
.areahead .trail { margin: 0; }
.areahead .pill { margin-left: var(--space-2xs); }
.areahead__help, .areahead__found { margin: 0 0 var(--space-s); }
.bar--tight { margin-bottom: var(--space-2xs); }
.search.search--small { align-items: center; }
.search.search--small input, .search.search--small .btn { box-sizing: border-box; height: 1.75rem; padding: 0 var(--space-xs);
  font-size: var(--text-s); line-height: 1; }
.search.search--small input { min-width: 0; width: 13rem; }
.sortby { color: inherit; text-decoration: none; }
.sortby:hover, .sortby--on { text-decoration: underline; }
/* a message list: each row is one link (the whole row lights up, so all of it clicks) */
.msglist__head, .msglist__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, 14rem) 9.5rem; gap: var(--space-s);
  align-items: center; padding: var(--space-2xs) var(--space-s);
  border-bottom: 1px solid color-mix(in srgb, var(--secondary) 22%, transparent); }
.msglist { --c: var(--secondary); background: var(--page_bg);     /* the Go Retro magenta round it, the page's black inside */
  border-color: color-mix(in srgb, var(--secondary) 55%, transparent); }
.msglist__head { padding-block: var(--space-xs); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  color: var(--heading); background: color-mix(in srgb, var(--secondary) 32%, var(--card_bg));
  border-bottom: 2px solid color-mix(in srgb, var(--secondary) 75%, transparent); }   /* the headings: plainly not a message */
.msglist__row { color: var(--text); text-decoration: none; }
.msglist__row:last-child { border-bottom: 0; }
.msglist__row:hover, .msglist__row:focus-visible { background: color-mix(in srgb, var(--secondary) 20%, var(--card_bg)); }
.msglist__row:hover .msglist__text { text-decoration: underline; }
.msglist__title { display: flex; align-items: baseline; gap: var(--space-2xs); min-width: 0; }
.msglist__title .tag { margin-left: 0; }
.msglist__text { color: var(--primary); overflow-wrap: anywhere; }
.msglist__from { overflow-wrap: anywhere; }
.msglist__date { white-space: nowrap; }
.msglist__none { margin: 0; padding: var(--space-s); }
.msglist__subject { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); }
.msglist__subject .btn { text-transform: none; letter-spacing: 0; }
.btn.btn--icon { display: inline-flex; align-items: center; justify-content: center; padding: var(--space-3xs) var(--space-2xs); line-height: 1; }
.btn--icon svg { display: block; width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) {                   /* phones: the subject on its own line, who and when under it */
  .msglist__head, .msglist__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
  .msglist__title { grid-column: 1 / -1; }
  .msglist__from, .msglist__date { font-size: var(--text-s); color: var(--muted); }
  .msglist__head .msglist__subject { grid-column: 1 / -1; }
}
.pager { display: flex; align-items: center; justify-content: center; gap: var(--space-m); margin-top: var(--space-m); color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-bottom: var(--space-s); }
.tabs [aria-current="page"] { background: var(--primary_soft_bg); border-color: var(--primary); color: var(--primary); }

/* forms */
fieldset { border: 1px solid color-mix(in srgb, var(--c) calc(25% + var(--glow) * 15%), var(--border)); border-radius: var(--radius); background: var(--card_bg); padding: var(--space-m) var(--space-l) var(--space-l); margin: 0 0 var(--space-m); min-width: 0; }
legend { padding: 0 var(--space-xs); font-weight: 600; font-size: var(--text-s); color: var(--c); }
.field label, .field .stat__l { display: block; font-size: var(--text-s); font-weight: 600; margin-bottom: var(--space-2xs); }
.field + .field, .grid + .field { margin-top: var(--space-s); }
.grid > .field { margin-top: 0; }
.field--danger input, .field--danger select, .field--danger textarea { border-color: var(--danger); }
.field--stat .stat__v { display: block; padding: var(--space-3xs) 0; font-variant-numeric: tabular-nums; }
.field__spacer { display: block; font-size: var(--text-s); margin-bottom: var(--space-2xs); }
.field__notes:empty { display: none; }
/* fields made from the user record line up in three rows (label, box, notes), so a row of fields never staggers */
.grid--rows { row-gap: 0; align-items: stretch; }
.grid--rows > .field--row { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; padding-bottom: var(--space-s); }
.field--row .check { margin: 0; min-height: 2.65rem; }
.field--row .check input { flex: none; }
@supports not (grid-template-rows: subgrid) {
  .grid--rows { row-gap: var(--space-s); }
  .grid--rows > .field--row { display: block; grid-row: auto; padding-bottom: 0; }
}
input[type=text], input[type=email], input[type=number], input[type=password], input[type=search], input[type=date], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--page_bg); border: 1px solid var(--border); border-radius: var(--radius-s); padding: var(--space-xs) var(--space-s); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.65; }
/* a small one-line form above a list (find, filter, sort): labels sit beside their boxes, it wraps on phones */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-m); margin-bottom: var(--space-m); font-size: var(--text-s); }
.filters label { display: flex; align-items: center; gap: var(--space-xs); color: var(--muted); }
.filters input, .filters select { width: auto; font-size: var(--text-s); padding: var(--space-3xs) var(--space-xs); }
.filters input[type=search] { width: 12rem; max-width: 100%; }
textarea { resize: vertical; }
input.colour { width: 4.5rem; height: 2.4rem; padding: var(--space-3xs); cursor: pointer; }
.check { display: flex; align-items: center; gap: var(--space-xs); margin: var(--space-2xs) 0; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }
.check label { margin: 0; font-weight: 500; }
.help { margin: var(--space-2xs) 0 0; color: var(--muted); font-size: var(--text-s); }
.error { margin: var(--space-2xs) 0 0; color: var(--danger); font-size: var(--text-s); font-weight: 600; }
.req { color: var(--danger); }
.level-note { color: var(--primary); }
.search { display: flex; gap: var(--space-2xs); }
.search input { min-width: 14rem; }
.trap { position: absolute; left: -9999px; }               /* a field only robots fill in */

/* buttons */
/* A plain button is tinted with the colour of the card it is in (--c), else primary; .btn--primary is solid. */
.btn { display: inline-block; font: inherit; font-size: var(--text-s); font-weight: 600; cursor: pointer; text-decoration: none;
  color: color-mix(in srgb, var(--c, var(--primary)) calc(70% + var(--glow) * 30%), var(--text));
  background: color-mix(in srgb, var(--c, var(--primary)) 10%, var(--card_bg));
  border: 1px solid color-mix(in srgb, var(--c, var(--primary)) 45%, var(--border)); border-radius: var(--radius); padding: var(--space-xs) var(--space-m);
  transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:not(.btn--primary, .btn--c, .btn--danger, .nav__switch):hover { background: color-mix(in srgb, var(--c, var(--primary)) 20%, var(--card_bg)); border-color: var(--c, var(--primary));
  box-shadow: 0 0 14px -4px color-mix(in srgb, var(--c, var(--primary)) calc(var(--glow) * 60%), transparent); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn--small { padding: var(--space-3xs) var(--space-xs); font-size: var(--text-s); }
.btn--primary { font-weight: 600; background: color-mix(in srgb, var(--primary) calc(100% - var(--glow) * 82%), var(--card_bg));
  color: color-mix(in srgb, var(--primary) calc(var(--glow) * 100%), var(--on_colour)); border-color: color-mix(in srgb, var(--primary) calc(100% - var(--glow) * 40%), transparent); }
.btn--danger { color: var(--danger); border-color: var(--danger); background: var(--danger_soft_bg); }
.btn--danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 22%, var(--card_bg)); }
.btn--c { font-family: var(--mono); font-weight: 700; background: color-mix(in srgb, var(--c) calc(100% - var(--glow) * 82%), var(--card_bg));
  color: color-mix(in srgb, var(--c) calc(var(--glow) * 100%), var(--on_colour)); border-color: color-mix(in srgb, var(--c) calc(100% - var(--glow) * 40%), transparent); }
.btn--primary:hover, .btn--c:hover { filter: brightness(1.12); }

/* small labels */
.tag { display: inline-block; white-space: nowrap; font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.05rem var(--space-2xs); border-radius: 4px; background: var(--primary_soft_bg); color: var(--primary); margin-left: var(--space-2xs); }


/* ---- 6. The look: coloured card boxes ----------------------------------------------------------------------------- */
/* .card_1 ... .card_6 pick a card colour (--c, from section 0) for a box, pill or .btn--c inside them.
   --glow is 1 in dark mode and 0 in light, so color-mix(... calc(var(--glow) * 30%) ...) is 30% in dark and nothing in light. */
.card_1 { --c: var(--card_1); }  .card_2 { --c: var(--card_2); }  .card_3 { --c: var(--card_3); }
.card_4 { --c: var(--card_4); }  .card_5 { --c: var(--card_5); }  .card_6 { --c: var(--card_6); }

.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: var(--space-l); align-items: start; }
.boxes--even { align-items: stretch; }
.boxes--even .box { display: flex; flex-direction: column; }
.boxes--even .box__body { flex: 1; margin: 0; }
.picks { margin-bottom: var(--space-xl); }
.box { background: var(--card_bg); border-radius: var(--radius-l); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) calc(var(--glow) * 50%), var(--border));
  border-top: calc(1px + (1 - var(--glow)) * 3px) solid color-mix(in srgb, var(--c) calc(50% + (1 - var(--glow)) * 50%), var(--border));
  box-shadow: 0 0 24px -6px color-mix(in srgb, var(--c) calc(var(--glow) * 30%), transparent),
              0 1px 2px rgba(0, 0, 0, calc((1 - var(--glow)) * 0.05)), 0 10px 24px -14px color-mix(in srgb, var(--c) calc((1 - var(--glow)) * 45%), transparent); }
.box__head { margin: 0; padding: var(--space-s) var(--space-l); font-family: var(--font-head); font-size: calc(var(--text-l) * var(--head-zoom)); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); color: var(--c);
  background: color-mix(in srgb, var(--c) 7%, var(--card_bg)); border-bottom: 1px solid var(--border); }
.box__head small { display: block; margin-top: var(--space-3xs); font-family: var(--font-body); font-size: var(--text-s); font-weight: 400; letter-spacing: normal; color: var(--muted); }
.box__head .pill { vertical-align: middle; margin-left: var(--space-2xs); }
.box__head--bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); }
.box__head--bar .btn { flex: none; letter-spacing: normal; }
.box__body { padding: var(--space-m) var(--space-l); }
.box__row { display: flex; align-items: center; gap: var(--space-s); padding: var(--space-s) var(--space-l); color: var(--text); text-decoration: none; border-top: 1px solid var(--border); }
.box__head + .box__row { border-top: 0; }
.box__row:hover { background: color-mix(in srgb, var(--c) 7%, var(--card_bg)); }
.box__name { flex: 1; min-width: 0; font-weight: 600; }
.box__name small { display: block; font-weight: 400; font-size: var(--text-s); color: var(--muted); }
.box__count { font-family: var(--mono); font-size: var(--text-s); color: var(--muted); white-space: nowrap; }

.pill { display: inline-block; font-family: var(--mono); font-size: var(--text-xs); font-weight: 700; white-space: nowrap; padding: var(--space-3xs) var(--space-xs); border-radius: 999px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card_bg)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.pill--new { --c: var(--info); }
.pill--private { --c: var(--warning); }
.pill--public { --c: var(--success); }
.box__side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3xs); flex: none; }
.countdot { display: inline-block; min-width: 1.6em; height: 1.6em; padding: 0 .45em; box-sizing: border-box; border-radius: 999px; vertical-align: middle;
  font-family: var(--mono); font-size: var(--text-xs); font-weight: 700; line-height: 1.6em; text-align: center; color: var(--page_bg); background: var(--c); }

/* the Door Zone: a box for each door */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: var(--space-l); }
.game { display: flex; flex-direction: column; }
.game__shot { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; image-rendering: pixelated; }
.game__shot--none { display: flex; align-items: center; justify-content: center; padding: var(--space-m); text-align: center;
  background: repeating-linear-gradient(0deg, #000 0 3px, #060c08 3px 4px); color: #55ff55;
  font-family: var(--mono); font-size: var(--head-m); font-weight: 700; line-height: 1.2; text-shadow: 0 0 8px rgba(85, 255, 85, 0.5); }
.game__body { padding: var(--space-s) var(--space-l) var(--space-2xs); flex: 1; }
.game__title { margin: 0 0 var(--space-2xs); font-size: calc(var(--text-l) * var(--head-zoom)); color: var(--c); }
.game__about { margin: 0; color: var(--muted); font-size: var(--text-s); white-space: pre-line; }
.game__busy { margin: var(--space-xs) 0 0; font-size: var(--text-s); color: var(--muted); }
.game__play { display: flex; align-items: center; gap: var(--space-s); padding: var(--space-2xs) var(--space-l) var(--space-l); flex-wrap: wrap; }
.game__signin { font-size: var(--text-s); }
/* the Door Zone's category cards: a little picture of each game (not a link), and a View Games button */
.shelf { list-style: none; margin: var(--space-s) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-s); }
.shelf li { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; font-size: var(--text-s); text-align: center; overflow-wrap: anywhere; }
.shelf__thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; background: #000; }
.box__body > p:first-child { margin-top: 0; }
.box__foot { padding: 0 var(--space-l) var(--space-l); }


/* ---- 7. Extras ----------------------------------------------------------------------------------------------------- */
/* message text */
.mono, .msgbody { font-family: var(--mono); }
.msgbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s); padding-bottom: var(--space-s);
  margin-bottom: var(--space-s); border-bottom: 1px solid var(--border); }      /* a message's buttons, above it */
.msgpage__replies h2 { margin-top: var(--space-l); }
.replylist { list-style: none; margin: 0; padding: var(--space-2xs) var(--space-s); }
.replylist li { display: flex; flex-direction: column; padding: var(--space-xs) 0; border-bottom: 1px solid var(--border); }
.replylist li:last-child { border-bottom: 0; }
.replylist .muted { font-size: var(--text-s); }
@media (min-width: 1100px) {                  /* wide screens: the replies in a column on the right of the message */
  .msgpage--replies { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-l); align-items: start; }
  .msgpage--replies .msgpage__replies h2 { margin-top: 0; }
}
/* an area's page: the message list, and beside it on wide screens (below it on narrow ones) the area's side boxes */
.areaside .box { margin-bottom: var(--space-m); }
.areaside .box__head { font-size: calc(var(--text-m) * var(--head-zoom)); }
@media (min-width: 1100px) {
  .areapage--side { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: var(--space-l); align-items: start; }
}
.spark { display: flex; align-items: flex-end; gap: 3px; height: 4.5rem; }           /* messages a month, as bars */
.spark__bar { flex: 1; height: max(var(--h), 2px); background: var(--c); border-radius: 2px 2px 0 0; opacity: .8; }
.spark__bar:hover { opacity: 1; }
.spark__axis { display: flex; justify-content: space-between; margin: var(--space-2xs) 0 0; font-family: var(--mono);
  font-size: var(--text-s); color: var(--muted); }
.areaside__facts { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3xs) var(--space-s); margin: var(--space-s) 0 0;
  padding-top: var(--space-s); border-top: 1px solid var(--border); font-size: var(--text-s); }
.areaside__facts dt { color: var(--muted); }
.areaside__facts dd { margin: 0; font-family: var(--mono); text-align: right; color: var(--c); }
.posters { list-style: none; margin: 0; padding: var(--space-2xs) 0; }
.poster { position: relative; display: flex; gap: var(--space-s); padding: var(--space-xs) var(--space-l); }
.poster__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poster__bar { position: absolute; left: var(--space-l); bottom: 2px; height: 2px; width: calc((100% - 2 * var(--space-l)) * var(--w) / 100);
  background: color-mix(in srgb, var(--c) 70%, transparent); border-radius: 1px; }
.msgbar__end { display: flex; gap: var(--space-s); align-items: center; margin-left: auto; }
.msgbody { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; line-height: 1.15; }   /* tight, so line drawing joins up */
.pre { white-space: pre-wrap; }
.thread { color: var(--muted); }

/* ANSI colour in areas that allow it: the sixteen DOS colours on black */
.msgbody--ansi { background: #000; color: #aaa; padding: var(--space-s) var(--space-m); border-radius: 4px; white-space: pre; overflow-x: auto; overflow-wrap: normal; }
.afg0{color:#000}.afg1{color:#a00}.afg2{color:#0a0}.afg3{color:#a50}.afg4{color:#00a}.afg5{color:#a0a}.afg6{color:#0aa}.afg7{color:#aaa}
.afg8{color:#555}.afg9{color:#f55}.afg10{color:#5f5}.afg11{color:#ff5}.afg12{color:#55f}.afg13{color:#f5f}.afg14{color:#5ff}.afg15{color:#fff}
.abg0{background:#000}.abg1{background:#a00}.abg2{background:#0a0}.abg3{background:#a50}.abg4{background:#00a}.abg5{background:#a0a}.abg6{background:#0aa}.abg7{background:#aaa}
.abg8{background:#555}.abg9{background:#f55}.abg10{background:#5f5}.abg11{background:#ff5}.abg12{background:#55f}.abg13{background:#f5f}.abg14{background:#5ff}.abg15{background:#fff}
.ab{color:#fff}.arev{filter:invert(1)}

/* two-step sign in: the key and the recovery codes */
.codes { font-family: var(--mono); font-size: var(--text-l); line-height: 1.6; letter-spacing: 0.05em; padding: var(--space-xs) var(--space-s); border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--text) 8%, transparent); white-space: pre-wrap; }

/* chat rooms */
.roomhead h2 { margin: 0; }
.roomhead p { margin: var(--space-3xs) 0; }
.roomlog { height: clamp(10rem, calc(100dvh - 31rem), 20rem); overflow-y: auto; padding: var(--space-s) 0; display: flex; flex-direction: column; gap: var(--space-2xs);
  border-top: 1px solid var(--border); margin-top: var(--space-xs); }
.roomnote { align-self: center; color: var(--muted); font-size: var(--text-s); overflow-wrap: anywhere; text-align: center; }
.roomnote--emote { font-style: italic; color: var(--text); }
.roommod { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); margin: var(--space-xs) 0; padding: var(--space-xs) var(--space-s); background: var(--primary_soft_bg); border-radius: var(--radius); }
.roommod__who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); width: 100%; padding-top: var(--space-2xs); border-top: 1px solid var(--border); }
.rosterbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline dotted; }
.bubble { max-width: 80%; padding: var(--space-2xs) var(--space-s); border-radius: 12px; background: var(--page_bg); border: 1px solid var(--border); align-self: flex-start; overflow-wrap: anywhere; }
.bubble--sysop { align-self: flex-end; background: color-mix(in srgb, var(--primary) 22%, var(--page_bg)); border-color: var(--primary); }
.bubble--emote .bubble__text { font-style: italic; }
.bubble__meta { display: block; font-size: var(--text-xs); color: var(--muted); }
.bubble__del { margin-left: var(--space-2xs); }
.chattyping { min-height: 1.3rem; color: var(--muted); font-size: var(--text-s); }
.chatform { display: flex; gap: var(--space-xs); }
.chatform input { flex: 1; }
/* each chatter keeps one outline colour, single or double, as on the phone line */
.chatter--0 { --chatter: var(--chat_1); }  .chatter--1 { --chatter: var(--chat_2); }  .chatter--2 { --chatter: var(--chat_3); }
.chatter--3 { --chatter: var(--chat_4); }  .chatter--4 { --chatter: var(--chat_5); }  .chatter--5 { --chatter: var(--chat_6); }
.bubble[class*="chatter--"] { border-color: var(--chatter); border-width: 2px; }
.bubble.chatter--double { border-style: double; border-width: 4px; }
.bubble[class*="chatter--"] .bubble__meta { color: var(--chatter); font-weight: 600; }
.roomnote--emote[class*="chatter--"], .chatter-name[class*="chatter--"] { color: var(--chatter); font-weight: 600; }

/* small helpers */
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones: tables with column headings become one card per row. The first column is the card's title, the others show
   as "label  value" lines (js/theme.js copies each column's heading onto its cells). Cells marked phone-hide are left out. */
@media (max-width: 760px) {
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; }
  table.cards thead { display: none; }
  table.cards tr { padding: var(--space-s) var(--space-m); border-bottom: 1px solid var(--border); }
  table.cards tbody tr:last-child { border-bottom: 0; }
  table.cards td { border: 0; padding: var(--space-3xs) 0; text-align: left; overflow-wrap: anywhere; }
  table.cards td[data-label] { display: grid; grid-template-columns: 7rem 1fr; gap: var(--space-xs); }
  table.cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; padding-top: .15em; }
  table.cards td:first-child { display: block; font-weight: 600; font-size: var(--text-m); padding-bottom: var(--space-2xs); }
  table.cards td:first-child::before { content: none; }
  table.cards td:empty { display: none; }
  .phone-hide { display: none !important; }
}

/* phones */
@media (max-width: 600px) {
  .search { flex: 1 1 100%; order: 3; }
  .search input { min-width: 0; flex: 1; }
}

/* File Zone: a category inside a category folds open (Aminet / game / ...) */
.box__fold > summary { cursor: pointer; list-style: none; }
.box__fold > summary::-webkit-details-marker { display: none; }
.box__row--fold .box__name::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--c); transition: transform .15s; }
.box__fold[open] > .box__row--fold .box__name::before { transform: rotate(90deg); }
.box__inner { margin-left: var(--space-l); border-left: 2px solid color-mix(in srgb, var(--c) 30%, transparent); }
.box__inner > .box__row, .box__inner > .box__fold > summary { padding-left: var(--space-m); }

/* File Zone: a card per area at this level; the whole card is the link */
.trail { margin: 0 0 var(--space-m); font-size: var(--text-s); color: var(--muted); }
.trail a { color: var(--primary); }
.areacards { margin-bottom: var(--space-l); }
.areacard { display: flex; flex-direction: column; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.areacard:hover, .areacard:focus-visible { border-color: var(--c); transform: translateY(-2px); }
.areacard .box__body { flex: 1; margin: 0; }
.areacard__counts { display: flex; gap: var(--space-m); margin: 0; padding: var(--space-s) var(--space-l); font-family: var(--mono); font-size: var(--text-s); color: var(--c); border-top: 1px solid var(--border); }
.files__head { margin: var(--space-l) 0 var(--space-s); font-size: var(--text-l); }
.trail a { text-decoration: none; }
.trail a:hover { text-decoration: underline; }
.trail__note { margin-left: var(--space-2xs); font-family: var(--mono); color: var(--muted); white-space: nowrap; }
/* A file's type icon or a small picture of it (_fileicon.html): lists use the small one, a file's page the large one.
   Each kind of file has a colour from section 0. */
.ficon { --k: var(--muted); position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 2.25rem; height: 2.25rem; border-radius: var(--radius-s); color: var(--k);
  background: color-mix(in srgb, var(--k) 14%, var(--card_bg)); border: 1px solid color-mix(in srgb, var(--k) 40%, var(--border)); }
.ficon svg { width: 60%; height: 60%; }
.ficon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card_bg); }
.ficon--l { width: clamp(6rem, 22vw, 16rem); height: auto; aspect-ratio: 1; border-radius: var(--radius-l); }
.ficon--l svg { width: 45%; height: 45%; }
.ficon--l img { object-fit: contain; }
.ficon--image { --k: var(--card_2); }  .ficon--archive { --k: var(--card_4); }  .ficon--disk { --k: var(--card_3); }
.ficon--text { --k: var(--card_1); }   .ficon--audio { --k: var(--card_5); }    .ficon--video { --k: var(--card_6); }
.ficon--program { --k: var(--card_6); } .ficon--document { --k: var(--card_5); }
.fname { display: flex; align-items: center; gap: var(--space-s); min-width: 0; }
.fname__text { min-width: 0; overflow-wrap: anywhere; }
.fname a { font-weight: 600; }
.fpath { font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-3xs); }
.fpath a { font-weight: 400; color: var(--muted); }
.fpath a:hover { color: var(--primary); }
.filehead { display: flex; gap: var(--space-l); align-items: flex-start; flex-wrap: wrap; }
.filehead__info { flex: 1 1 20rem; min-width: 0; }
.bar .actions { margin-bottom: 0; }
.bar--sub .trail { flex: 1; margin: 0; }
/* The home page: wide sections on the left, a column of cards on the right; on phones the cards come first */
.home { display: grid; grid-template-columns: minmax(0, 1fr) clamp(18rem, 28%, 26rem); gap: var(--space-xl); align-items: start; }
.home__side { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: var(--space-l); min-width: 0; }
.home__main { grid-column: 1; grid-row: 1; min-width: 0; }
.home .search input { min-width: 0; flex: 1; }
.home__search { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-l); margin-bottom: var(--space-xl); }   /* file and message search, half each */
@media (max-width: 640px) { .home__search { grid-template-columns: minmax(0, 1fr); } }
.home__main .games { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }   /* the three games share the width */
.homehead { margin-top: var(--space-xl); }
@media (max-width: 960px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home__side, .home__main { grid-column: 1; grid-row: auto; }
}
/* BBS Connection details: the card that stands out */
.connect { border-width: 2px; border-color: var(--c);
  box-shadow: 0 0 32px -4px color-mix(in srgb, var(--c) calc(25% + var(--glow) * 30%), transparent); }
.connect .box__head { background: color-mix(in srgb, var(--c) calc(18% + var(--glow) * 6%), var(--card_bg)); font-size: calc(var(--head-s) * var(--head-zoom)); }
.connect__by { margin: 0 0 var(--space-s); }
.connect__list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-xs) var(--space-s); margin: 0; align-items: baseline; }
.connect__list dt { font-family: var(--mono); font-size: var(--text-s); font-weight: 700; color: var(--c); }
.connect__list dd { margin: 0; overflow-wrap: anywhere; }
.connect__list dd small { display: block; color: var(--muted); font-size: var(--text-xs); }
.connect__join { margin: var(--space-m) 0 0; }
/* Someone went into a chat room (js/roomnotice.js): a bar that drops down under the header for 5 seconds */
.joinbar { position: absolute; left: 0; right: 0; top: 100%; z-index: -1; overflow: hidden; pointer-events: none; }
.joinbar__in { display: flex; align-items: center; justify-content: center; gap: var(--space-m); flex-wrap: wrap;
  padding: var(--space-xs) var(--space-m); background: var(--notice_bg); color: var(--on_notice); font-weight: 600;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--notice_bg) 70%, transparent);
  transform: translateY(-100%); transition: transform .35s ease; }
.joinbar--open { pointer-events: auto; }
.joinbar--open .joinbar__in { transform: translateY(0); }
.joinbar__join { color: var(--notice_bg); background: var(--on_notice); text-decoration: none; font-size: var(--text-s); font-weight: 700;
  padding: var(--space-3xs) var(--space-s); border-radius: var(--radius); white-space: nowrap; }
.joinbar__join:hover { filter: brightness(.92); }
@media (prefers-reduced-motion: reduce) { .joinbar__in { transition: none; } }
/* The members list (members.html): your own row stands out, a name opens its details. */
.members__you td { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.members summary { cursor: pointer; }
.members__card { margin: var(--space-xs) 0 0; font-size: var(--text-s); }
