/* ------------------------------------------------------------------
 * legal.css — the documents.
 *
 * Loaded after the app's own stylesheet so the tokens are already
 * defined, and so these pages look like the same product rather than
 * like a lawyer's attachment. The app sets `overflow: hidden` on html
 * and body for the game; a document has to undo that or it cannot be
 * read past the first screen.
 * ---------------------------------------------------------------- */

html, body.legal {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

body.legal {
  background:
    radial-gradient(120% 80% at 20% -10%, rgba(154, 124, 255, 0.16), transparent 60%),
    radial-gradient(100% 70% at 90% 0%, rgba(77, 166, 255, 0.14), transparent 55%),
    var(--bg-0);
  padding: 0 20px 80px;
}

/* ---- chrome ---- */

.lg-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 760px; margin: 0 auto; padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
}
.lg-home {
  font-family: var(--font-display); font-weight: 800; font-size: 17px;
  letter-spacing: 0.08em; color: var(--ink); text-decoration: none;
}
.lg-langs { margin-left: auto; display: flex; gap: 4px; }
.lg-langs a {
  font-size: 12px; font-weight: 600; color: var(--ink-faint);
  padding: 5px 10px; border-radius: 8px; text-decoration: none;
  transition: 0.18s var(--ease);
}
.lg-langs a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.lg-langs a.on { color: #06121f; background: linear-gradient(100deg, #7cc4ff, #a89bff); }

/* ---- the document ---- */

.lg-doc { max-width: 760px; margin: 0 auto; padding-top: 34px; }

.lg-doc h1 {
  font-size: clamp(28px, 5vw, 38px); line-height: 1.15; margin-bottom: 10px;
}
.lg-doc h2 {
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  margin: 40px 0 12px; padding-top: 22px; border-top: 1px solid var(--line);
}
.lg-doc section:first-of-type h2 { border-top: 0; padding-top: 0; margin-top: 30px; }

.lg-doc p, .lg-doc li, .lg-doc dd { font-size: 15px; line-height: 1.68; color: var(--ink-dim); }
.lg-doc p { margin: 0 0 14px; }
.lg-doc strong { color: var(--ink); font-weight: 600; }
.lg-doc a { color: var(--accent); }
.lg-doc ul, .lg-doc ol { margin: 0 0 16px; padding-left: 22px; }
.lg-doc li { margin-bottom: 7px; }
.lg-doc code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; background: rgba(0, 0, 0, 0.35);
  padding: 2px 6px; border-radius: 6px; color: var(--ink);
}

.lg-meta {
  font-size: 12px !important; color: var(--ink-faint) !important;
  text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 22px !important;
}
.lg-lead { font-size: 17px !important; line-height: 1.62 !important; color: var(--ink) !important; }
.lg-big { font-size: 20px !important; line-height: 1.5 !important; color: var(--ink) !important; }
.lg-note { font-size: 13px !important; color: var(--ink-faint) !important; }

/* A decision the operator still has to make, marked so it cannot be
   mistaken for settled text — and so it is obvious in a screenshot. */
.lg-doc strong:first-child:last-child,
.lg-doc p > strong:only-child {
  display: block; padding: 12px 14px; border-radius: 10px;
  background: rgba(255, 209, 102, 0.10);
  border: 1px solid rgba(255, 209, 102, 0.32);
  color: var(--gold); font-weight: 600; font-size: 14px; line-height: 1.55;
}

/* ---- the support call-out on the credits page ---- */

.lg-support {
  font-size: 16px !important; color: var(--ink) !important;
  padding: 16px 18px; border-radius: 13px; margin: 22px 0 18px !important;
  background: linear-gradient(140deg, rgba(154, 124, 255, 0.14), rgba(77, 166, 255, 0.10));
  border: 1px solid var(--line-strong);
}
.lg-cta {
  display: inline-block; text-decoration: none;
  padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: 15px;
  background: linear-gradient(100deg, #3f8fe8, #8a6ff0); color: #fff !important;
  box-shadow: 0 6px 22px rgba(70, 130, 240, 0.4);
  transition: 0.18s var(--ease);
}
.lg-cta:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(70, 130, 240, 0.55); }

/* ---- tables and definition lists ---- */

/* Wide tables scroll inside themselves rather than making the page
   scroll sideways, which on a phone is the difference between a
   readable document and an unusable one. */
.lg-doc table {
  display: block; overflow-x: auto; width: 100%;
  border-collapse: collapse; margin: 0 0 20px; font-size: 13.5px;
}
.lg-doc th, .lg-doc td {
  text-align: left; vertical-align: top; padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.lg-doc th {
  color: var(--ink); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom-color: var(--line-strong); white-space: nowrap;
}
.lg-doc td { color: var(--ink-dim); line-height: 1.5; }
.lg-doc tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.022); }

.lg-dl { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 8px 20px; margin: 0 0 18px; }
.lg-dl dt { font-size: 12px; font-weight: 600; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.06em; padding-top: 3px; }
.lg-dl dd { margin: 0; }

/* ---- foot ---- */

.lg-foot {
  max-width: 760px; margin: 60px auto 0; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.lg-foot nav { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; }
.lg-foot nav a { color: var(--ink-dim); text-decoration: none; }
.lg-foot nav a:hover { color: var(--accent); }
.lg-foot p { font-size: 12px; color: var(--ink-faint); margin: 14px 0 0; }

@media (max-width: 560px) {
  .lg-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .lg-dl dd { margin-bottom: 12px; }
}
