/* The two faces, hosted here (CA280): loading them from Google sent every visitor's address to Google. Both SIL OFL
   (assets/fonts/OFL-*.txt), from github.com/google/fonts, cut to Latin; Bricolage Grotesque pinned to width 100. */
@font-face { font-family: 'Bricolage Grotesque'; src: url(assets/fonts/bricolage-grotesque-latin.woff2) format('woff2'); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(assets/fonts/rubik-latin.woff2) format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }
/* b4block.org, the refreshed landing page: shared tokens and parts for the three layouts (landing-a/b/c.html).
   Dark first, as the site has always been; a light theme from the system or the theme button.
   Brand kept from the old page: its orange headings, the plum "How to join", the coral Ko-fi button, the pixel art. */
:root {
  --bg: #14110f; --surface: #1e1916; --surface-2: #29221d; --line: #3a3029; --ink: #f2ebe3; --soft: #b6a898;
  --accent: #ffa53a; --accent-ink: #241300; --plum: #6b2f4f; --plum-hi: #84405f; --coral: #ff7f50; --coral-hi: #ff6347;
  --ok: #3ccf6e; --warn: #e8c500; --bad: #ff4d4d; --ow: #3ccf6e; --nether: #ff5a5a; --end: #3fd4e6;
  --holder: #ffe14d; --focus: #8cc4ff; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --display: 'Bricolage Grotesque', 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif; --body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --r: 10px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eceff3; --surface: #ffffff; --surface-2: #f4f1ee; --line: #d6d9de; --ink: #1f1a16; --soft: #5e544b;
    --accent: #b35a08; --accent-ink: #ffffff; --ok: #1d8a45; --warn: #9a7a00; --bad: #c62828; --ow: #1d8a45;
    --nether: #c62828; --end: #0b8a99; --holder: #8a6a00; --focus: #1b64c4; --shadow: 0 8px 24px rgba(30, 40, 60, .12);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eceff3; --surface: #ffffff; --surface-2: #f4f1ee; --line: #d6d9de; --ink: #1f1a16; --soft: #5e544b;
  --accent: #b35a08; --accent-ink: #ffffff; --ok: #1d8a45; --warn: #9a7a00; --bad: #c62828; --ow: #1d8a45;
  --nether: #c62828; --end: #0b8a99; --holder: #8a6a00; --focus: #1b64c4; --shadow: 0 8px 24px rgba(30, 40, 60, .12);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--coral); }
/* One face, Rubik: the pixel face was hard to read (the owner, 26 November), and its 2 and 5 read as 8 and S. */
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; margin: 0; color: var(--accent); }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font: 600 .78rem/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.soft { color: var(--soft); }
.px { image-rendering: pixelated; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .7em 1.15em; border-radius: 8px; border: 0; font: 600 1rem/1 var(--body); text-decoration: none; cursor: pointer; transition: transform .12s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-join { background: var(--plum); color: #fff; }
.btn-join:hover { background: var(--plum-hi); color: #fff; }
.btn-lectern { background: var(--accent); color: var(--accent-ink); }
.btn-lectern:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.btn-kofi { background: var(--coral); color: #fff; }
.btn-kofi:hover { background: var(--coral-hi); color: #fff; }
.btn-kofi img { width: 26px; height: 26px; margin: -6px 0; }

/* The address, copied on a press */
.ip { display: inline-flex; align-items: center; gap: .6em; padding: .55em .7em .55em .9em; border-radius: 8px; background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--line); font: 600 1.05rem/1 var(--mono); color: var(--ink); cursor: pointer; border: 0; }
.ip:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.ip .copy-label { font: 600 .78rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); padding: .35em .55em; border-radius: 6px; background: var(--surface); }
.ip.copied .copy-label { color: var(--ok); }

/* Live status */
.status { display: inline-flex; align-items: center; gap: .5em; font-size: .92rem; color: var(--soft); }
.dot { width: .7em; height: .7em; border-radius: 2px; background: var(--soft); flex: none; }
.status.on .dot { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: beat 2.4s ease-out infinite; }
.status.off .dot { background: var(--bad); }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 .55em transparent; } }

/* Panels: set off only what stands apart */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 3vw, 24px); min-width: 0; }

/* Leaderboards */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bed-toggle { background: none; border: 0; padding: 4px; cursor: pointer; border-radius: 8px; display: grid; justify-items: center; gap: 2px; color: var(--soft); font: 500 .72rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; }
.bed-toggle img { width: 120px; height: auto; aspect-ratio: 215 / 64; image-rendering: pixelated; transition: transform .15s ease; }
.bed-toggle:hover img { transform: rotate(-3deg) scale(1.04); }
.bed-toggle.pop img { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.22, .82); } 65% { transform: scale(.92, 1.12); } 100% { transform: scale(1); } }
.sortby { display: inline-flex; margin-top: 10px; padding: 3px; gap: 2px; border-radius: 999px; background: var(--line); }
.sortby button { border: 0; border-radius: 999px; padding: 6px 14px; min-height: 32px; background: none; color: var(--soft); font: 600 .85rem/1 var(--body); cursor: pointer; }
.sortby button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .15); }
.board-total { margin-top: 4px; color: var(--soft); font-size: .92rem; }
.board-total strong { color: var(--accent); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.rows { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; }
.row { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.row:nth-child(-n+3) { background: var(--surface-2); }
.row .rank { display: grid; place-items: center; font: 600 .95rem/1 var(--body); font-variant-numeric: tabular-nums; color: var(--soft); }
.row .rank img { width: 22px; height: 22px; image-rendering: pixelated; }
.row .who { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.row .who small { display: block; color: var(--soft); font-size: .8rem; font-weight: 400; }
.row .n { font: 600 1rem/1 var(--body); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row .n .bed-ico { width: 18px; height: auto; vertical-align: -2px; margin-right: 6px; image-rendering: pixelated; }
.more { margin-top: 10px; background: none; border: 0; padding: 6px 0; color: var(--accent); font: 600 .92rem/1.2 var(--body); cursor: pointer; }
.board-fade { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: .2; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Past contest winners */
.wins { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.win { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 8px; background: var(--surface-2); }
.win img { width: 30px; height: 30px; image-rendering: pixelated; }
.win .prize { font: 600 1.05rem/1.25 var(--display); color: var(--accent); }
.win .meta { color: var(--soft); font-size: .88rem; }

/* The contest */
.contest .live { display: grid; gap: 14px; }
.contest .kv { display: grid; gap: 2px; }
.contest .kv span:first-child { font: 600 .74rem/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.realm { font-weight: 700; }
.realm.overworld { color: var(--ow); } .realm.nether { color: var(--nether); } .realm.end { color: var(--end); }
.coords { font-family: var(--mono); }
.holder { font: 700 1.25rem/1.2 var(--body); color: var(--holder); }
.holder.none { color: var(--soft); }
.timer { font: 700 clamp(2rem, 1.4rem + 3vw, 2.8rem)/1 var(--body); font-variant-numeric: tabular-nums; animation: tick 1s ease-in-out infinite; }
.timer.high { color: var(--ink); } .timer.medium { color: var(--warn); } .timer.low { color: var(--bad); }
@keyframes tick { 50% { opacity: .62; transform: scale(1.03); } }
.contest .quiet { display: grid; gap: 10px; }
.preview-note { margin-top: 12px; font-size: .82rem; color: var(--soft); }
.preview-note button { background: none; border: 0; padding: 0; color: var(--focus); font: inherit; cursor: pointer; text-decoration: underline; }

/* The Hoard: Lectern's own build behind a still of it, loaded on a press */
.hoard { margin: 0; display: grid; gap: 8px; }
.hoard-frame { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 10px; overflow: hidden; background: #16151c; box-shadow: var(--shadow); }
.hoard-frame img, .hoard-frame iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; object-position: 50% 70%; }
.hoard-go { position: absolute; left: 12px; bottom: 12px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.hoard-go:hover { transform: translateY(-2px); }
.hoard figcaption { font-size: .85rem; color: var(--soft); }
@media (max-width: 599px) { .hoard-frame { aspect-ratio: 1 / 1; } }

/* Modrinth */
.mods { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mods a { display: inline-block; padding: .35em .7em; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: .88rem; box-shadow: inset 0 0 0 1px var(--line); }
.mods a:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.mods a.req::after { content: " · required"; color: var(--soft); }

/* Folded licence, theme button */
details > summary { cursor: pointer; font-weight: 600; color: var(--soft); }
details[open] > summary { margin-bottom: 8px; }
.licence p { font-size: .85rem; color: var(--soft); margin-top: 8px; max-width: 75ch; }
.theme-btn { background: var(--surface-2); color: var(--ink); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: .5em .7em; cursor: pointer; font: 500 .85rem/1 var(--body); }
.theme-btn:hover { box-shadow: inset 0 0 0 1px var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* What has been built, in numbers */
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; }
.stat strong { font: 700 clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem)/1 var(--body); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { color: var(--soft); font-size: .9rem; }
/* Rules as pixel-marked lines */
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rules li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; align-items: start; }
.rules li::before { content: ""; width: 14px; height: 14px; margin-top: .35em; background: var(--k, var(--accent)); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .28), inset 3px 3px 0 rgba(255, 255, 255, .22); }
.rules li:nth-child(1) { --k: #d9ad2b; } .rules li:nth-child(2) { --k: #8a5a35; } .rules li:nth-child(3) { --k: #58c94f; }
.rules li:nth-child(4) { --k: #b8261d; } .rules li:nth-child(5) { --k: #4fc9e0; } .rules li:nth-child(6) { --k: #f2c12e; }
.rules b { display: block; }
.rules span { color: var(--soft); }

/* A running contest, at the top */
.cbar { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-bottom: 1px solid var(--line); }
.cbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding-block: 10px; min-height: 48px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.cbar-in:hover .cbar-go { text-decoration: underline; }
.cbar-live { display: inline-flex; align-items: center; gap: .5em; font-weight: 700; color: var(--accent); }
.cbar-live .dot { background: var(--ok); animation: beat 2.4s ease-out infinite; }
.cbar-left { font-variant-numeric: tabular-nums; font-weight: 600; }
.cbar-go { margin-left: auto; color: var(--accent); font-weight: 600; }
/* The Hoard, when it can't start */
.hoard-fail { height: 100%; display: grid; place-content: center; gap: 8px; padding: 20px; text-align: center; color: #e9e4f0; }
.hoard-fail a { color: #ffa53a; }
/* Both servers */
.servers { display: grid; gap: 12px; }
.srv { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.srv h3 { font-size: 1rem; color: var(--ink); }
.srv p { margin: 0; color: var(--soft); font-size: .92rem; }
.srv .tstat { display: inline-flex; align-items: center; gap: .5em; }
.srv.on .dot { background: var(--ok); }
.srv.off .dot { background: var(--bad); }

/* Hidden sections stay hidden even where a rule sets display (the empty video section left a gap) */
[hidden] { display: none !important; }
.mods .all a { background: none; box-shadow: none; color: var(--accent); }
