/* ================================================================
   LEGAL PAGES, the shared page chrome.

   The seven legal pages other than /privacy (terms, cookies, refunds,
   community guidelines, copyright, legal, accessibility) are thin shells:
   each one sets its own <title> and meta description, names which document
   it is, and links this file plus css/privacy.css for the document body.

   This is a COPY of the chrome that is inlined in privacy.html, so all eight
   pages read as one site. privacy.html keeps its inline copy on purpose:
   test_privacy_policy.js asserts its responsive and print rules live in that
   file. If you restyle one, restyle both.
   ================================================================ */

  /* ================================================================
     PRIVACY POLICY, the published page.

     Served at /privacy from BOTH hosts: the marketing site (Vercel, which
     rewrites /css and /js onto multiplayer/client) and the game server
     (Render, which serves those paths natively). So every asset here is
     referenced by its absolute game-client path and the page is otherwise
     self-contained, it must never depend on the marketing site's
     styles.css or on the game's preview.css.

     Palette and type match /rules and /about so the three published pages
     read as one site.
     ================================================================ */
  :root {
    /* The game's table palette (--cr-* in css/preview.css). Names kept from
       the sea-glass original so the rules below did not have to change; only
       the values moved. See the header for the measured contrast of each. */
    --sea-deep:        #1a2d5a;
    --sea-night:       #15325c;

    --brand-cyan:      #8a5c00;
    --brand-cyan-deep: #8a5c00;
    --brand-cyan-soft: rgba(232, 179, 74, 0.22);
    --brand-teal-deep: #2c5a8a;
    --brand-mint:      #c89320;

    --ink:             #15325c;
    --ink-deep:        #15325c;
    --muted:           #4a6f94;
    --muted-strong:    #2c5a8a;
    --line:            rgba(200, 147, 32, 0.30);
    --line-strong:     rgba(200, 147, 32, 0.52);
    --paper:           #fef5e6;

    /* Navy on gold, because white on gold is a 1.91:1 failure. */
    --grad-mint-btn:   linear-gradient(180deg, #e8b34a 0%, #c89320 100%);
    --cta-ink:         #15325c;

    --shadow-sm:       0 2px 8px rgba(21, 50, 92, 0.07);
    --shadow-lg:       0 10px 30px rgba(21, 50, 92, 0.16);

    --r-md:   12px;
    --r-lg:   14px;
    --r-xl:   18px;
    --r-pill: 999px;

    --font-display: "Space Grotesk", "Avenir Next", "Trebuchet MS", sans-serif;
    --font-body:    "Manrope", "Avenir Next", "Trebuchet MS", sans-serif;
    --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  img { max-width: 100%; display: block; }
  a { color: inherit; }
  button { font-family: inherit; }

  .wrap { width: min(1120px, calc(100vw - 40px)); margin: 0 auto; }

  /* ── Top bar ──────────────────────────────────────────────────── */
  .topbar {
    position: sticky; top: 0; z-index: 70;
    background: rgba(247, 251, 255, 0.86);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(191, 216, 234, 0.75);
  }
  .topbar-in {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 0; min-height: 58px;
  }
  .tb-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; margin-right: auto; }
  .tb-brand img { width: 26px; height: 26px; border-radius: 7px; box-shadow: var(--shadow-sm); }
  .tb-brand b {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    color: var(--ink-deep); letter-spacing: -0.2px; white-space: nowrap;
  }
  .tb-links { display: flex; gap: 2px; }
  .tb-links a {
    text-decoration: none; color: var(--muted-strong);
    font-size: 12.5px; font-weight: 700; padding: 7px 11px;
    border-radius: var(--r-pill); white-space: nowrap;
    transition: background 170ms var(--ease-out), color 170ms var(--ease-out);
  }
  .tb-links a:hover { background: rgba(10, 100, 140, 0.09); color: var(--ink-deep); }
  .tb-cta {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--grad-mint-btn); color: var(--cta-ink); text-decoration: none;
    font-weight: 800; font-size: 12.5px; padding: 8px 14px;
    border-radius: var(--r-pill); box-shadow: 0 2px 10px rgba(200, 147, 32, 0.38);
    white-space: nowrap; transition: transform 170ms var(--ease-out);
  }
  .tb-cta:hover { transform: translateY(-1px); }
  @media (max-width: 860px) { .tb-links { display: none; } }
  @media (max-width: 400px) { .tb-brand b { display: none; } }

  /* ── Hero ─────────────────────────────────────────────────────── */
  .hero {
    position: relative; overflow: hidden;
    padding: 48px 0 36px; text-align: center;
    background:
      radial-gradient(900px 420px at 12% -20%, rgba(188, 221, 230, 0.70) 0%, transparent 62%),
      radial-gradient(760px 380px at 92% -10%, rgba(232, 179, 74, 0.30) 0%, transparent 60%),
      linear-gradient(180deg, #e7f1f3 0%, #f7eeda 58%, var(--paper) 100%);
  }
  .hero::after {
    content: ""; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 46px;
    background: radial-gradient(60% 100% at 50% 100%, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
    pointer-events: none;
  }
  .hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--brand-cyan-soft); border: 1px solid rgba(200, 147, 32, 0.45);
    /* Navy, not gold-ink: at 11px bold this chip does NOT qualify for the
       large-text allowance, and gold-ink on the gold wash measured 4.41:1
       against the 4.5:1 it needs. Navy on gold is also how the game pairs
       them on the seat pill. */
    color: var(--ink); padding: 6px 14px; border-radius: var(--r-pill);
    font-size: 11px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
    margin-bottom: 16px;
  }
  .hero h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 5.4vw, 54px); font-weight: 700; line-height: 1.04;
    letter-spacing: -1.3px; color: var(--ink-deep); margin: 0 0 14px; text-wrap: balance;
  }
  .hero p {
    font-size: 17px; line-height: 1.6; color: var(--muted-strong);
    max-width: 640px; margin: 0 auto; text-wrap: pretty;
  }

  /* ── Layout: sticky contents + the document ───────────────────── */
  main { padding: 34px 0 10px; }
  .cols {
    display: grid; grid-template-columns: 250px minmax(0, 1fr);
    gap: 34px; align-items: start;
  }

  /* Contents rail (desktop) */
  .toc {
    position: sticky; top: 78px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: 14px 12px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
  .toc-head {
    font-size: 11px; font-weight: 800; letter-spacing: 0.8px;
    text-transform: uppercase; color: var(--brand-cyan-deep);
    padding: 2px 8px 9px;
  }
  .toc a {
    display: flex; gap: 8px; align-items: baseline;
    text-decoration: none; color: var(--muted-strong);
    font-size: 12.5px; line-height: 1.35; font-weight: 600;
    padding: 6px 9px; border-radius: 9px;
    transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
  }
  .toc a:hover { background: rgba(10, 100, 140, 0.08); color: var(--ink-deep); }
  .toc a.on { background: var(--brand-cyan-soft); color: var(--brand-cyan-deep); font-weight: 800; }
  .toc a i { color: var(--brand-cyan-deep); }
  .toc a i {
    font-style: normal; font-variant-numeric: tabular-nums;
    color: var(--brand-cyan); font-weight: 800; min-width: 15px;
  }

  /* Contents (mobile), the same list, folded into a disclosure. */
  .toc-m { display: none; margin-bottom: 20px; }
  .toc-m > summary {
    cursor: pointer; list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1px solid var(--line-strong); background: #fff;
    border-radius: var(--r-lg); padding: 12px 16px;
    font-weight: 800; font-size: 14px; color: var(--ink-deep);
    box-shadow: var(--shadow-sm);
  }
  .toc-m > summary::-webkit-details-marker { display: none; }
  .toc-m > summary::after { content: "▾"; color: var(--brand-cyan); font-size: 13px; }
  .toc-m[open] > summary::after { content: "▴"; }
  .toc-m .toc-m-list {
    border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
  }

  /* The document card */
  .doc {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 30px 34px 26px;
  }

  /* Quick answers, the three things people actually open this page for. */
  .quick {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px; margin: 0 0 26px;
  }
  .quick-card {
    border: 1px solid var(--line); border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(245, 232, 208, 0.85), rgba(254, 245, 230, 0.65));
    padding: 13px 15px;
  }
  .quick-card b {
    display: block; font-size: 12.5px; font-weight: 800;
    color: var(--brand-cyan-deep); margin-bottom: 4px;
  }
  .quick-card span { font-size: 13px; line-height: 1.5; color: var(--muted-strong); }

  /* Back-to-top pill, appears once you're past the hero. */
  .totop {
    position: fixed; right: 18px; bottom: 18px; z-index: 80;
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.94);
    color: var(--ink-deep); font-weight: 800; font-size: 12.5px;
    padding: 9px 15px; border-radius: var(--r-pill); cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; transform: translateY(8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  }
  .totop.show { opacity: 1; pointer-events: auto; transform: none; }

  /* ── Footer ───────────────────────────────────────────────────── */
  .foot {
    margin-top: 40px;
    background: linear-gradient(180deg, var(--sea-deep) 0%, var(--sea-night) 100%);
    color: rgba(255, 255, 255, 0.72); padding: 40px 0 26px;
  }
  .foot-in { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
  .foot-brand { display: flex; align-items: center; gap: 10px; }
  .foot-brand img { width: 30px; height: 30px; border-radius: 8px; }
  .foot-brand b { font-family: var(--font-display); font-size: 16px; color: #fff; }
  .foot-links { display: flex; flex-wrap: wrap; gap: 6px; }
  .foot-links a {
    text-decoration: none; color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 700;
    padding: 7px 12px; border-radius: var(--r-pill); border: 1px solid rgba(255, 255, 255, 0.16);
    transition: background 170ms var(--ease-out), color 170ms var(--ease-out);
  }
  .foot-links a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
  .foot-bottom {
    margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12.5px; color: rgba(255, 255, 255, 0.55); text-align: center;
  }

  /* ── Responsive: three real layouts, not one that stretches ─────
     >=1024px   desktop and iPad LANDSCAPE: the full 250px contents rail
     700-1023   EVERY iPad in portrait, mini included: a narrower rail.
                This used to fall through to the phone layout at 900px,
                which threw away half of an iPad's screen and pushed a
                nineteen-section document into one column with no contents
                visible at all. The floor is 700 and not 768 because the
                iPad mini is only 744pt wide in portrait, and no phone in
                portrait is wider than 430pt.
     <=699px    phones: one column, and the contents become a bottom bar
                and sheet your thumb can actually reach (js/legal-mobile.js)
     <=430px    iPhone-sized: tightest gutters, tighter display type

     Width is only half of the problem. (pointer: coarse) sizes every
     target for a finger at any width, and the safe-area insets keep text
     out from under the notch and the home indicator. */

  /* iPad portrait, and big phones held sideways. Keep the rail, shrink it. */
  @media (min-width: 700px) and (max-width: 1023px) {
    .wrap { width: min(1120px, calc(100vw - 32px)); }
    .cols { grid-template-columns: 208px minmax(0, 1fr); gap: 22px; }
    .toc { top: 70px; padding: 12px 9px; max-height: calc(100vh - 92px); }
    .toc a { font-size: 12px; padding: 7px 8px; }
    .toc-head { padding: 2px 7px 8px; }
    .doc { padding: 26px 24px 22px; }
    .hero { padding: 42px 0 32px; }
  }

  /* Phones. */
  @media (max-width: 699px) {
    .cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .toc { display: none; }
    .toc-m { display: block; }
    main { padding: 26px 0 10px; }
    .hero { padding: 38px 0 28px; }
    .doc { padding: 22px 18px 18px; border-radius: 16px; }
    .totop { right: 12px; bottom: 12px; }
  }

  /* iPhone-sized. */
  @media (max-width: 430px) {
    .wrap { width: calc(100vw - 26px); }
    .hero { padding: 30px 0 24px; }
    .hero h1 { font-size: clamp(26px, 8.2vw, 34px); letter-spacing: -0.7px; }
    .hero p { font-size: 15.5px; }
    .hero-eyebrow { font-size: 10.5px; padding: 5px 12px; margin-bottom: 13px; }
    .doc { padding: 18px 15px 15px; border-radius: 14px; }
    .quick { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .foot { padding: 32px 0 22px; }
    .foot-in { gap: 16px 20px; }
  }

  /* A finger is not a cursor: 44px is the smallest comfortable target. */
  @media (pointer: coarse) {
    .tb-links a, .foot-links a { min-height: 44px; display: inline-flex; align-items: center; }
    .tb-cta { min-height: 44px; }
    .toc a, .toc-m-list a { min-height: 44px; align-items: center; }
    .toc-m > summary { min-height: 52px; }
    .totop { min-height: 48px; padding: 13px 18px; }
  }

  /* Keep text clear of the notch, and the floating pill clear of the home
     indicator. max() so a browser without insets still gets the old value. */
  @supports (padding: max(0px)) {
    .wrap {
      padding-left: max(0px, env(safe-area-inset-left));
      padding-right: max(0px, env(safe-area-inset-right));
    }
    .totop { bottom: max(12px, env(safe-area-inset-bottom)); }
  }

  /* ── The phone reading bar (built by js/legal-mobile.js) ─────────
     One fixed bar at the bottom of a phone screen doing three jobs: it
     says where you are in the document, it opens the contents, and it
     takes you back to the top. It is at the BOTTOM because that is where
     a thumb is on a 6-inch phone, and because a long policy is read with
     one hand. html.lm-on marks that the script is running, so the
     no-script <details> contents stay as the fallback. */
  .lm-bar, .lm-sheet, .lm-scrim { display: none; }

  html.lm-on .toc-m { display: none; }
  html.lm-on .totop { display: none; }

  @media (max-width: 699px) {
    html.lm-on body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }

    html.lm-on .lm-bar {
      display: flex; align-items: stretch; gap: 0;
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
      background: rgba(254, 245, 230, 0.96);
      backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
      border-top: 1px solid var(--line-strong);
      box-shadow: 0 -6px 20px rgba(21, 50, 92, 0.10);
      padding-bottom: env(safe-area-inset-bottom, 0px);
      padding-left: env(safe-area-inset-left, 0px);
      padding-right: env(safe-area-inset-right, 0px);
    }
    /* The reading-progress hairline sits on the bar's top edge. */
    html.lm-on .lm-prog {
      position: absolute; left: 0; top: -1px; height: 2px;
      background: linear-gradient(90deg, #e8b34a 0%, #c89320 100%);
      width: 0; transition: width 120ms linear; pointer-events: none;
    }
    html.lm-on .lm-where {
      flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
      justify-content: center; gap: 1px; text-align: left;
      background: none; border: 0; cursor: pointer;
      padding: 11px 14px; min-height: 60px; font-family: inherit;
      color: var(--ink);
    }
    html.lm-on .lm-count {
      font-size: 10.5px; font-weight: 800; letter-spacing: 0.7px;
      text-transform: uppercase; color: var(--brand-cyan-deep);
    }
    html.lm-on .lm-title {
      font-size: 13.5px; font-weight: 800; line-height: 1.25;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    html.lm-on .lm-where::after {
      content: "\2630"; position: absolute; right: 62px;
      align-self: center; color: var(--brand-cyan-deep); font-size: 15px;
    }
    html.lm-on .lm-top {
      flex: 0 0 auto; width: 56px; min-height: 60px;
      background: none; border: 0; border-left: 1px solid var(--line);
      cursor: pointer; color: var(--ink); font-size: 17px; font-weight: 800;
      font-family: inherit;
    }

    /* The contents sheet. */
    html.lm-on .lm-scrim {
      display: block; position: fixed; inset: 0; z-index: 95;
      background: rgba(21, 50, 92, 0.42);
      opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease-out);
    }
    html.lm-on .lm-scrim.open { opacity: 1; pointer-events: auto; }

    html.lm-on .lm-sheet {
      display: flex; flex-direction: column;
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 96;
      max-height: 76vh;
      background: var(--paper);
      border-top-left-radius: 20px; border-top-right-radius: 20px;
      border-top: 1px solid var(--line-strong);
      box-shadow: 0 -14px 40px rgba(21, 50, 92, 0.26);
      transform: translateY(101%);
      transition: transform 240ms var(--ease-out);
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    html.lm-on .lm-sheet.open { transform: none; }
    html.lm-on .lm-sheet-head {
      display: flex; align-items: center; justify-content: space-between;
      gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
    }
    html.lm-on .lm-sheet-head b {
      font-family: var(--font-display); font-size: 15px; color: var(--ink-deep);
    }
    html.lm-on .lm-close {
      background: none; border: 1px solid var(--line-strong);
      border-radius: var(--r-pill); color: var(--ink);
      font-family: inherit; font-size: 13px; font-weight: 800;
      min-height: 44px; padding: 0 16px; cursor: pointer;
    }
    html.lm-on .lm-sheet-list { overflow-y: auto; padding: 8px 10px 16px; -webkit-overflow-scrolling: touch; }
    html.lm-on .lm-sheet-list a {
      display: flex; gap: 10px; align-items: center; min-height: 48px;
      padding: 8px 10px; border-radius: 11px;
      text-decoration: none; color: var(--muted-strong);
      font-size: 14px; font-weight: 700; line-height: 1.3;
    }
    html.lm-on .lm-sheet-list a i {
      font-style: normal; font-variant-numeric: tabular-nums;
      color: var(--brand-cyan-deep); font-weight: 800; min-width: 20px;
    }
    html.lm-on .lm-sheet-list a.on { background: var(--brand-cyan-soft); color: var(--ink-deep); }

    /* A jumped-to section has to clear the sticky top bar. The script sets
       --lm-sticky from the real measured height. */
    html.lm-on .pp-sec { scroll-margin-top: calc(var(--lm-sticky, 62px) + 14px); }
  }

  @media (prefers-reduced-motion: reduce) {
    .lm-sheet, .lm-scrim, .lm-prog { transition: none !important; }
    /* html { scroll-behavior: smooth } is set at the top of this file, and it
       also governs anchor jumps and any scrollTo with behavior "auto". Somebody
       who asked for less motion should get an instant jump from the contents. */
    html { scroll-behavior: auto; }
  }

  @media print {
    .topbar, .toc, .toc-m, .totop, .foot, .hero-eyebrow, .quick { display: none !important; }
    .doc { border: 0; box-shadow: none; padding: 0; background: none; }
    body { background: #fff; }
  }

  /* Nothing to read means the one script failed; say so instead of
     showing an empty white card. */
  .doc-fallback {
    border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
    padding: 22px; text-align: center; color: var(--muted);
    font-weight: 600;
  }


  /* ================================================================
     KEYBOARD: WHERE YOU ARE, AND GETTING PAST THE NAV
     ----------------------------------------------------------------
     The Accessibility Statement used to admit both of these as gaps:
     there was no skip link on any page, and no custom :focus style
     anywhere, so focus visibility was whatever ring the browser drew.
     On this palette, cream paper with gold rules, the default ring is a
     thin dark line that is genuinely hard to find.

     NAVY, not gold. Gold on cream is the one pairing this palette
     cannot use for a thin line: #c89320 on #fef5e6 is about 2.4:1,
     which is below the 3:1 that WCAG 2.1 asks of a focus indicator.
     Navy #15325c on the same paper is about 11.8:1.

     3px and offset, so the ring reads as a ring rather than as a
     border the element always had.
     ================================================================ */
  .skip-link {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: 0 0 10px 10px;
    background: var(--paper, #fef5e6);
    color: var(--ink-deep, #15325c);
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(21, 50, 92, 0.28);
    /* Out of sight, still in the tab order. Not display:none, which would
       take it out of the tab order and make it useless. */
    transform: translateY(calc(-100% - 12px));
    transition: transform .14s ease-out;
  }
  .skip-link:focus,
  .skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--ink-deep, #15325c);
    outline-offset: 2px;
  }
  @media (prefers-reduced-motion: reduce) {
    .skip-link { transition: none; }
  }

  /* Every interactive thing on these pages. Listed rather than using a bare
     :focus-visible so the ring cannot land on the <main> that the skip link
     moves focus to: that target carries tabindex="-1" purely to receive
     focus, and ringing the whole document would look like a rendering bug. */
  a:focus-visible,
  button:focus-visible,
  summary:focus-visible,
  [tabindex="0"]:focus-visible {
    outline: 3px solid var(--ink-deep, #15325c);
    outline-offset: 2px;
    border-radius: 3px;
  }
  /* The one exception: inside the dark top bar and footer, navy on navy is
     invisible, so the ring is the paper colour there. */
  .topbar a:focus-visible,
  .topbar button:focus-visible,
  .foot a:focus-visible,
  .foot button:focus-visible {
    outline-color: var(--paper, #fef5e6);
  }
  /* The skip target needs no override: a browser does not match
     :focus-visible on a non-interactive tabindex="-1" element that was
     focused programmatically, so moving focus to #doc draws nothing. Adding
     `outline: none` here would be the one rule on these pages that takes a
     focus ring away, and it is not needed. */
