/* The terms and privacy pages (src/services/legalPages.js). The campaign's
   palette and type from styles.css, set for reading at length rather than
   for play: a measure of about 70 characters, generous leading, tables that
   scroll sideways on a phone rather than squeeze, and a plain print layout
   for anyone reviewing on paper. */
@font-face { font-family: "Bauhaus Desk Display"; src: url("/fonts/BauhausDeskDisplay-Bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }

:root {
  --bg: #030B30;
  --panel: #0A1438;
  --text: #F5F7FF;
  --text-soft: #D9E8FF;
  --muted: #A9B8D6;
  --accent: #70CFFF;
  --amber: #FFD599;
  --line: rgba(255, 255, 255, .14);
  --display: "Bauhaus Desk Display", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: #0A1A5C;
  color: var(--text-soft);
  font: 400 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* The start page's world, held still behind the page: the campaign
   photograph, and the lava breaking through at the foot of the window. */
.world { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.world-plate { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 100%; }
.world-lava { position: absolute; left: 50%; bottom: -2vh; width: max(110vw, 900px); height: auto; translate: -50% 0; opacity: .95; }

/* The reading surface: the start card's glass, darker, so long text holds its contrast over the photograph. */
.sheet {
  padding: clamp(24px, 4vw, 48px);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(20, 30, 80, .82) 0%, rgba(8, 14, 44, .86) 60%, rgba(8, 14, 40, .9) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 24px 60px rgba(0, 0, 0, .35), 0 0 70px rgba(112, 207, 255, .14);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: 16px; top: -48px; padding: .5em 1em; background: var(--accent); color: var(--bg); font-weight: 600; z-index: 10; border-radius: 6px; }
.skip:focus { top: 12px; }

/* The same header as the leaderboard page (styles.css, .page-head): the
   mark, the campaign line, and plain links to Play, Leaderboard, Terms and
   Privacy. It stays at the top while a long document scrolls. */
.masthead { position: sticky; top: 0; z-index: 5; background: linear-gradient(rgba(3, 11, 48, .85), rgba(3, 11, 48, .55)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.page-head { display: flex; align-items: center; gap: 16px; padding: max(14px, env(safe-area-inset-top)) 16px 10px; }
.start-logo { display: block; width: 124px; height: auto; filter: brightness(0) invert(1); }
.start-tag { font: 700 13px var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.page-head nav { display: flex; gap: 14px; margin-left: auto; font-weight: 600; font-size: 14px; }
.page-head nav a { color: var(--text-soft); text-underline-offset: .25em; }
.page-head nav a[aria-current] { color: var(--accent); }
@media (min-width: 900px) {
  .page-head { padding: 22px 40px; }
  .start-logo { width: 150px; }
}
@media (max-width: 640px) {
  .page-head .start-tag { display: none; }
  .page-head nav { gap: 12px; font-size: 13px; }
  .start-logo { width: 110px; }
}

.draft-banner {
  margin: 0; padding: .8em max(16px, calc((100% - 960px) / 2));
  background: #3A2A10; color: var(--amber); border-bottom: 1px solid rgba(255, 213, 153, .35);
  font-size: .92rem;
}

main { max-width: 1000px; margin: 0 auto; padding: 36px 16px 120px; }
.eyebrow { margin: 0 0 .4em; color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0 0 1.2em; color: var(--text); font: 800 clamp(1.8rem, 5vw, 2.8rem)/1.1 var(--display); letter-spacing: .01em; }
h2 { margin: 2.4em 0 .7em; padding-top: .9em; border-top: 1px solid var(--line); color: var(--text); font: 700 1.35rem/1.25 var(--display); }
h3, h4 { margin: 1.8em 0 .5em; color: var(--text); font-weight: 600; }

.contents { margin: 0 0 2.5em; padding: 18px 22px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 14px; }
.contents ul { margin: 0; padding: 0; list-style: none; columns: 2 18em; column-gap: 2.5em; }
.contents li { margin: .2em 0; break-inside: avoid; }
.contents a { color: var(--text-soft); text-decoration: none; }
.contents a:hover { color: var(--accent); text-decoration: underline; }

.doc { max-width: 72ch; }
.doc p, .doc ul, .doc ol { margin: 0 0 1em; }
.doc li { margin: .3em 0; }
.doc strong { color: var(--text); font-weight: 600; }
.doc code { font-size: .9em; padding: .05em .3em; background: rgba(255, 255, 255, .08); border-radius: 4px; }
.clause { display: inline-block; min-width: 2.6em; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
mark.review { background: rgba(255, 213, 153, .16); color: var(--amber); font-weight: 600; padding: .05em .3em; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Tables scroll sideways inside their own box, never the page. */
.table { max-width: 100%; overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .92rem; line-height: 1.5; }
th, td { padding: .7em .9em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--text); background: rgba(255, 255, 255, .07); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.other { margin-top: 3em; color: var(--muted); }
.back { margin-top: 1.5em; }
.btn { display: inline-block; padding: .75em 1.6em; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--accent); color: var(--bg); }

@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding-top: 28px; }
}

@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  .masthead, .skip, .back, .contents, .world { display: none; }
  .sheet { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .draft-banner { background: none; color: #7a4b00; border: 1px solid #c90; padding: .5em; }
  h1, h2, h3, h4, .doc strong { color: #000; }
  h2 { border-color: #ccc; break-after: avoid; }
  a { color: #000; }
  .clause { color: #000; }
  mark.review { background: #fff1c2; color: #000; }
  .table { overflow: visible; border-color: #ccc; }
  table { min-width: 0; }
  th { background: #f2f2f2; color: #000; }
  th, td { border-color: #ccc; }
  tr { break-inside: avoid; }
}

/* ---------- The page foot ----------
   Terms and privacy, pinned to the bottom of every page but the game: the
   start page, the leaderboard, and the two documents. */
.site-foot { flex: none; margin-top: auto; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); text-align: center; }
.site-foot .legal-links { margin: 0; font: 600 13px/1.4 var(--body); letter-spacing: .02em; color: var(--muted); text-shadow: 0 1px 8px rgba(3, 8, 30, .9); }
.site-foot a { color: var(--text-soft); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.site-foot a:hover, .site-foot a[aria-current] { color: var(--accent); }
.site-foot a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
