/*
 * The pages outside the game (404, privacy, terms, legal notice, licenses): a photocopied sheet taped to
 * a raw-concrete wall at the blue hour, like the flyer at the door. Tokens match src/ui/theme.css.
 */
:root {
  --blue-hour: #1d2638;
  --blue-hour-deep: #121a2b;
  --photocopy: #d9d9d3;
  --toner: #000000;
  --afterblue: #2f55d4;
  --neon: #8fa6ff;
  --sodium: #ff8a2a;
  --fluoro: #e6fff1;
  --font-display: 'Big Shoulders Stencil', 'Arial Narrow', Impact, sans-serif;
  --font-body: 'Archivo', system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.page {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 400 1.0625rem / 1.6 var(--font-body);
  color: var(--fluoro);
  background-color: var(--blue-hour-deep);
  /* Béton brut: the tie holes and board lines of the formwork, over a noisy concrete grain. */
  background-image:
    radial-gradient(circle at 50% 50%, rgb(0 0 0 / 0.5) 0 2.5px, rgb(255 255 255 / 0.05) 3px, transparent 4px),
    repeating-linear-gradient(180deg, transparent 0 59px, rgb(0 0 0 / 0.22) 59px 60px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.6 0 0 0 0 0.75 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--blue-hour) 0%, var(--blue-hour-deep) 70%);
  background-size: 120px 60px, 100% 60px, 220px 220px, 100% 100%;
  background-position: 60px 30px, 0 0, 0 0, 0 0;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--sodium); outline-offset: 3px; }

.page-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: calc(var(--gutter) * 0.75) var(--gutter) 0;
}
.page-brand {
  font: 900 1.6rem / 1 var(--font-display); color: var(--neon); text-decoration: none; letter-spacing: 0.01em;
}
.page-back { font-weight: 600; color: var(--fluoro); text-decoration-color: var(--sodium); text-decoration-thickness: 2px; }

/* The sheet: a straight photocopy (crooked only on the door flyer), taped at both top corners. */
.sheet {
  color-scheme: light;
  position: relative;
  width: min(100% - 2 * var(--gutter), 46rem);
  margin: clamp(28px, 5vw, 56px) auto clamp(32px, 6vw, 64px);
  padding: clamp(28px, 6vw, 64px) clamp(20px, 6vw, 64px) clamp(28px, 5vw, 48px);
  background-color: var(--photocopy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--toner);
  box-shadow: 0 22px 60px rgb(0 0 0 / 0.5);
}
.sheet::before, .sheet::after {
  content: ''; position: absolute; top: -12px; width: 96px; height: 28px;
  background: rgb(240 240 232 / 0.55);
}
.sheet::before { left: 22px; transform: rotate(-5deg); }
.sheet::after { right: 22px; transform: rotate(4deg); }

.sheet > * { max-width: 66ch; }
.sheet h1 {
  margin: 0 0 0.3em;
  font: 900 clamp(3rem, 10vw, 4.6rem) / 0.88 var(--font-display);
  letter-spacing: -0.01em;
}
.sheet h2 {
  margin: 2.2em 0 0.4em;
  font: 800 clamp(1.6rem, 4vw, 2.1rem) / 1 var(--font-display);
}
.sheet h3 { margin: 1.6em 0 0.3em; font-size: 1.0625rem; font-weight: 700; font-stretch: 112%; }
.sheet p, .sheet ul, .sheet ol { margin: 0 0 1em; }
.sheet ul, .sheet ol { padding-left: 1.2em; }
.sheet li { margin-bottom: 0.4em; }
.sheet a { color: var(--afterblue); font-weight: 600; }
.sheet strong { font-weight: 700; }
.sheet .updated { margin: 0 0 1.8em; font-weight: 600; font-stretch: 125%; font-size: 0.875rem; }
.sheet .lede { font-size: 1.2rem; line-height: 1.5; }

/* What we process, why, for how long: scrolls sideways on a phone rather than squeezing. */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; max-width: 100%; }
.sheet table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.9375rem; line-height: 1.45; }
.sheet th, .sheet td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-top: 2px solid var(--toner); }
.sheet th { font-weight: 700; font-stretch: 112%; }
.sheet thead th { border-top: 0; font-size: 0.875rem; }
/* On a phone, each row becomes a block: what, then why / legal basis / kept for, labelled. */
@media (max-width: 40rem) {
  .sheet table { min-width: 0; }
  .sheet thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet tr, .sheet tbody th, .sheet td { display: block; }
  .sheet tbody th { padding-bottom: 4px; }
  .sheet td { border-top: 0; padding: 2px 0 8px; }
  .sheet td::before { content: attr(data-label) ': '; font-weight: 700; font-stretch: 112%; }
}

/* Read this first: the photosensitivity warning, the music choice. Thick toner frame, nothing else. */
.notice { border: 3px solid var(--toner); padding: 16px 18px 4px; margin: 0 0 1.4em; }
.notice h2, .notice h3 { margin-top: 0; }

.contact { font-size: 1.2rem; font-weight: 700; }
address { font-style: normal; }

.licence { border-top: 2px solid var(--toner); padding: 10px 0; }
.licence summary { cursor: pointer; font-weight: 700; }
.licence-version, .licence-id { font-weight: 400; font-stretch: 112%; }
.licence-id::before { content: '('; }
.licence-id::after { content: ')'; }
.licence pre {
  white-space: pre-wrap; overflow-wrap: anywhere; font: 0.8125rem / 1.5 ui-monospace, 'SF Mono', Menlo, monospace;
  margin: 10px 0 4px; max-width: 100%;
}

.page-foot {
  margin-top: auto;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  padding: 0 var(--gutter) calc(var(--gutter) * 0.75 + env(safe-area-inset-bottom, 0px));
  font-size: 0.875rem;
}
.page-foot nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.page-foot nav a { display: inline-block; padding: 12px 0; }
.page-foot p { margin: 0; color: rgb(230 255 241 / 0.7); }

/* ---- 404: the flyer, crooked again, under a sodium street lamp. ---- */
body.page.lost {
  padding-top: clamp(16px, 4vw, 48px);
  background-image:
    radial-gradient(ellipse 60% 55% at 50% 38%, rgb(255 138 42 / 0.22), transparent 70%),
    radial-gradient(circle at 50% 50%, rgb(0 0 0 / 0.5) 0 2.5px, rgb(255 255 255 / 0.05) 3px, transparent 4px),
    repeating-linear-gradient(180deg, transparent 0 59px, rgb(0 0 0 / 0.22) 59px 60px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.6 0 0 0 0 0.75 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--blue-hour) 0%, var(--blue-hour-deep) 70%);
  background-size: 100% 100%, 120px 60px, 100% 60px, 220px 220px, 100% 100%;
  background-position: 0 0, 60px 30px, 0 0, 0 0, 0 0;
}
.lost .sheet {
  width: min(100% - 2 * var(--gutter), 27rem);
  margin-block: auto;
  padding: 30px 28px 24px;
  transform: rotate(-1.5deg);
}
.lost-club { margin: 0 0 4px; font: 900 1.44rem / 1 var(--font-display); color: var(--afterblue); }
.lost-code { margin: 0 0 8px; font-weight: 600; font-stretch: 125%; }
.lost .sheet h1 { margin-bottom: 18px; font-size: clamp(3.4rem, 14vw, 5rem); }
.sheet .lost-go {
  display: block; margin-top: 22px; text-align: center; text-decoration: none;
  background: var(--sodium); color: var(--toner);
  font: 900 2.074rem / 1 var(--font-display); padding: 14px 16px 12px;
}
.sheet .lost-go:active { transform: translateY(1px); }

@media print {
  body.page { background: #fff; color: #000; }
  .page-top, .page-foot { display: none; }
  .sheet { box-shadow: none; margin: 0; width: auto; padding: 0; background: none; }
  .sheet::before, .sheet::after { display: none; }
}
