/* Legal - the privacy and terms pages (web/screens/legal.js) - 4.0, T5-014.

   One readable column (760 px at most): a bar with the Back link and the
   Privacy / Terms switch, the page as one card of plain prose, and the Supercell
   notice under it. Phone first - the bar is one row at 320 px (Back + two short
   chips) and wraps rather than overflowing if a font runs wide; long words and
   addresses wrap inside the card.

   Load order (web/index.html): tokens -> components -> shell -> per-screen, this
   file among the five 4.0 screens that load last - so a rule here may override
   shell.css and components.css, never the other way round. Every var() used here
   is defined in tokens.css (tests/test_web.py). The switch reuses .chip / .chip.on
   from components.css. */

.legal {
  display: flex; flex-direction: column; gap: 14px;
  width: 100%; max-width: 760px; min-width: 0; margin: 0 auto;
}

/* While a legal page is the screen on show, the public pane's column (and so the
   brand header over it) narrows from 1040 px to the page's own 760 px: the brand,
   Back and the card then start at one left edge (SA22). Without :has() support
   the header simply stays wide - no layout breaks. */
.public-wrap:has(> .screen.on .legal) { max-width: 760px; }

/* ---------- bar: Back, and the switch between the two pages ---------- */

.legal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.legal-back {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 44px; padding-right: 8px;
  font-weight: 700; color: var(--gold);
}
.legal-switch { display: inline-flex; gap: 6px; }
.legal-switch .chip { text-decoration: none; }

/* ---------- the page ---------- */

.legal-page { padding: 20px 18px 14px; overflow-wrap: break-word; }
.legal-title {
  margin: 0 0 6px;
  font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em;
}
.legal-updated { margin: 0 0 16px; }
.legal-page h2 {
  margin: 24px 0 8px;
  font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.2; letter-spacing: -0.01em;
  color: var(--ink);
}
.legal-page p,
.legal-page li { line-height: 1.6; color: var(--ink-2); }
.legal-page p { margin: 0 0 10px; }
.legal-page ul { margin: 0 0 10px; padding-left: 20px; }
.legal-page li + li { margin-top: 6px; }
.legal-page a { text-decoration: underline; text-underline-offset: 2px; }

.legal-notice { margin: 0; padding: 0 4px 8px; max-width: 70ch; line-height: 1.5; }

@media (min-width: 768px) {
  .legal-page { padding: 32px 36px 22px; }
  .legal-title { font-size: 32px; }
}
