/* ═══════════════════════════════════════════════════════════════════════
 * legal.css — privacy.html + terms.html, in the game's own look (#4501).
 *
 * Wray, 2026-10-27: "terms and privacy too also in old style. dont need to
 * be pixel font but at least to colour scheme and no glass." Take B of the
 * mock in PR #4590 (picked 2026-10-30): kit B's slate window with its red
 * title ribbon, cards with the gold lip's dark rim, the studded plate along
 * the top, the same pieces world-home.css draws. No glass: every surface is
 * solid, nothing is see-through, no backdrop blur. The body is a reading
 * face (Alegreya Sans) because this is long prose; the pixel faces carry
 * only the headings.
 *
 * It styles the markup the pages already had (.main, .legal-head,
 * .legal-title, .legal-updated, .tldr, .section-label, .legal-card,
 * .data-table, .legal-foot) plus the top plate (.lg-top), so the restyle
 * moved no word of the legal text. Self-contained: the two pages no longer
 * load variables-v2.css or components-v2.css.
 * ═══════════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'New Rocker';
  src: url('/assets/fonts/NewRocker-Regular.ttf?v=2026-10-04a') format('truetype');
  font-display: swap;
}
:root {
  --ink: #efe3c8;
  --ink-2: #d9cdb2;
  --dim: #b4bfcc;
  --gold: #e3c79a;
  --gold-hi: #f3d79a;
  --gold-btn: #dda52c;
  --slate: #3a4760;
  --card: #2a3345;
  --well: #1c2330;
  --line: #0b0f15;
  --night: #121822;
  --f-px: 'Press Start 2P', ui-monospace, monospace;
  --f-tome: 'New Rocker', 'Press Start 2P', serif;
  --f-read: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --lip: inset 0 0 0 2px var(--line), inset 0 0 0 4px #7e6440;
  --lip-gold: inset 0 0 0 2px var(--line), inset 0 0 0 4px #b8903f, inset 0 5px 0 2px var(--gold);
  --k: 2px; /* one art pixel: 2 CSS px on a laptop, 1.5 on a phone */
}
@media (max-width: 900px), (max-height: 500px) { :root { --k: 1.5px; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--night); }
body.lg {
  min-height: 100vh;
  isolation: isolate;
  color: var(--ink);
  font-family: var(--f-read);
  font-size: 17px;
  line-height: 1.55;
  background:
    linear-gradient(180deg, rgba(18, 24, 34, .55), var(--night) 340px),
    url('/assets/onboarding/backdrop-3-wide.jpg') center top / 100% auto no-repeat,
    var(--night);
}
/* Home's print dots, thinning down the page */
body.lg::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(227, 199, 154, .10) 1.4px, transparent 1.8px) 0 0 / 7px 7px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}
a { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #fff1d6; }

/* ── the top plate: the slate plate with its gold studs ── */
.lg-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 10px;
  border: calc(6 * var(--k)) solid transparent;
  border-image: url('/assets/ui/kitb/panel.png?v=2026-09-24a') 12 fill / calc(6 * var(--k)) stretch;
  image-rendering: pixelated;
}
.lg-brand {
  font: 400 24px/1 var(--f-tome);
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 2px 0 var(--line);
  white-space: nowrap;
}
.lg-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lg-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 12px;
  border-style: solid;
  border-width: calc(1.5 * var(--k)) calc(1.5 * var(--k)) calc(2.5 * var(--k));
  border-image: url('/assets/ui/kitb/btn.png?v=2026-09-24a') 3 3 5 3 fill / calc(1.5 * var(--k)) calc(1.5 * var(--k)) calc(2.5 * var(--k)) stretch;
  image-rendering: pixelated;
  font: 400 10px/1.3 var(--f-px);
  color: var(--ink);
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
  white-space: nowrap;
}
.lg-btn:hover { filter: brightness(1.15); color: #fff3d6; }
.lg-btn.is-gold { border-image-source: url('/assets/ui/kitb/btngold.png?v=2026-09-24a'); color: #2a1c0c; text-shadow: 0 1px 0 rgba(255, 240, 200, .5); }

/* ── the page: one slate window ── */
.main {
  position: relative;
  max-width: 880px;
  margin: 58px auto 40px;
  padding: 34px 30px 28px;
  border: calc(9 * var(--k)) solid transparent;
  border-image: url('/assets/ui/kitb/slate-window.png?v=2026-09-24a') 18 fill / calc(9 * var(--k)) stretch;
  image-rendering: pixelated;
  background-color: var(--slate);
  background-clip: padding-box;
}
.main > * { image-rendering: auto; }

/* the title, on the red ribbon straddling the window's top edge */
.legal-head { text-align: center; padding: 0 0 6px; }
.legal-title {
  position: absolute;
  top: calc(-9 * var(--k) - 22px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  height: 46px;
  padding: 7px 44px 0;
  border-style: solid;
  border-width: 2px 36px 14px;
  border-image: url('/assets/ui/kitb/title.png?v=2026-09-24a') 2 24 9 24 fill / 2px 36px 14px stretch;
  image-rendering: pixelated;
  font: 400 24px/1 var(--f-tome);
  color: #f7e6c4;
  text-shadow: 0 2px 0 #5e1414;
  white-space: nowrap;
}
.legal-updated { font: 400 9px/1.6 var(--f-px); color: var(--dim); letter-spacing: .02em; }

/* ── section headings: pixel caps in gold over a dark rule ── */
.section-label { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; scroll-margin-top: 80px; }
.section-label__text { font: 400 10px/1.5 var(--f-px); color: var(--gold); letter-spacing: .03em; text-shadow: 0 2px 0 var(--line); }
.section-label__line { flex: 1; height: 4px; background: var(--line); box-shadow: inset 0 -1px 0 #7e6440; }

/* ── a section: a card in the window, with the gold lip's dark rim ── */
.legal-card {
  background: var(--card);
  box-shadow: var(--lip);
  padding: 16px 20px;
  margin-bottom: 8px;
  scroll-margin-top: 80px;
}
.legal-card p { color: var(--ink-2); }
/* prose resuming after a list needs the same break as p + p, or the closing
   sentence reads as the last bullet's continuation */
.legal-card p + p,
.legal-card ul + p,
.legal-card ol + p { margin-top: 10px; }
.legal-card strong { color: var(--ink); font-weight: 700; }
.legal-card h4 { font: 400 10px/1.5 var(--f-px); color: var(--gold); margin: 18px 0 8px; }
.legal-card h4:first-child { margin-top: 0; }
.legal-card ul, .legal-card ol { margin: 10px 0 0 22px; color: var(--ink-2); }
.legal-card ul + h4, .legal-card ol + h4 { margin-top: 18px; }
.legal-card li + li { margin-top: 6px; }
.legal-card li::marker { color: var(--gold-btn); }

/* ── the TL;DR and the closing line: the gold-lipped card ── */
.tldr { background: #33405a; box-shadow: var(--lip-gold); padding: 16px 20px 14px; margin: 18px 0 6px; }
.tldr p { color: var(--ink); }
.tldr strong { color: var(--gold-hi); }

/* ── a data table sits in the inset well, scrolling on its own so the page
   never scrolls sideways ── */
.table-scroll { overflow-x: auto; margin: 12px 0; background: var(--well); box-shadow: inset 0 0 0 2px var(--line); padding: 4px 12px; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th { font: 400 9px/1.5 var(--f-px); color: var(--gold); text-align: left; padding: 10px 12px 8px 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
.data-table td { color: var(--ink-2); padding: 9px 12px 9px 0; border-bottom: 1px solid #2f394c; vertical-align: top; }
.data-table td:first-child { color: var(--ink); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }

.legal-foot { text-align: center; margin-top: 24px; font: 400 9px/2 var(--f-px); color: var(--dim); }

/* ── a landscape phone (844 x 390): the window goes edge to edge ── */
@media (max-width: 900px), (max-height: 500px) {
  body.lg { font-size: 16px; line-height: 1.5; }
  .lg-top { padding: 0 6px; position: static; } /* 390 tall: the plate scrolls away */
  .lg-brand { font-size: 19px; }
  .lg-btn { min-height: 34px; font-size: 8px; padding: 2px 8px; }
  .main { margin: 40px 8px 24px; padding: 26px 14px 18px; }
  .legal-title { font-size: 19px; height: 38px; min-width: 210px; padding-top: 5px; top: calc(-9 * var(--k) - 18px); }
  .legal-card, .tldr { padding: 12px 14px; }
  .section-label { margin: 20px 0 8px; }
}
