/* Shared page chrome for every game's marketing + legal site.
 *
 * Covers the two layouts every game needs and neither game's landing page:
 *   .doc   — the legal / support "stack of cards" pages (privacy, terms,
 *            support, delete-account)
 *   .panel — the single centred utility pages (404, /invite, /get)
 *
 * The LANDING page is deliberately NOT here. A word game and a backgammon game
 * have no business sharing a hero; forcing them into one stylesheet would buy a
 * few hundred bytes and cost every future game a fight with it. What IS shared
 * is the boring surface a store reviewer reads, where consistency is free and
 * divergence is just drift.
 *
 * Everything colour- or type-shaped is a custom property, overridden by the
 * game in `assets/theme.css` (loaded AFTER this file). The DEFAULTS below are
 * the incumbent's exact current literals, not invented neutrals, so Word Clash
 * renders byte-identically after the extraction and any regression is a real
 * one rather than a palette change. Same discipline as an optional theme token
 * in the mobile shell (`03-mobile-rules.md`): convert a literal to a token
 * whose default IS that literal, and let a second game supply its own.
 */

:root {
  --wc-ink: #37474F;
  --wc-muted: #607D8B;
  --wc-accent: #0288D1;
  --wc-page-bg: linear-gradient(160deg, #E8F5FD 0%, #D4EDFC 45%, #C5E4F7 100%);
  --wc-card-bg: #ffffff;
  --wc-card-border: #D4E8F5;
  --wc-card-radius: 18px;
  --wc-rule: #E3EFF7;
  --wc-badge-bg: #263238;
  --wc-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wc-font-display: var(--wc-font-body);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--wc-font-body);
  color: var(--wc-ink);
  background: var(--wc-page-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--wc-accent); }
img { display: block; max-width: 100%; }

/* ---------- .doc — legal / support pages ---------- */
.doc .wrap { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }
.doc a.back { color: var(--wc-accent); text-decoration: none; font-weight: 600; }
.doc h1 { font-family: var(--wc-font-display); font-size: 30px; margin: 16px 0 4px; }
.doc .sub, .doc .updated { color: var(--wc-muted); margin: 0 0 28px; }
.doc .card {
  background: var(--wc-card-bg);
  border: 2px solid var(--wc-card-border);
  border-radius: var(--wc-card-radius);
  padding: 22px 28px;
  box-shadow: 0 2px 0 var(--wc-card-border);
  margin-bottom: 18px;
}
.doc .card:last-of-type { margin-bottom: 0; }
.doc h2 { font-family: var(--wc-font-display); font-size: 19px; margin: 28px 0 8px; }
.doc h2:first-of-type { margin-top: 4px; }
.doc p, .doc li { line-height: 1.7; }
.doc ol, .doc ul { padding-left: 22px; }
.doc .muted { color: var(--wc-muted); }
.doc .contact { font-size: 18px; }
.doc .contact a { font-weight: 700; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.doc th, .doc td {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--wc-rule);
  vertical-align: top; font-size: 15px;
}
.doc th { color: var(--wc-muted); font-weight: 700; }

/* Tables are the one element that cannot reflow: a three-column policy table
   at 360px either scrolls or truncates, and truncating a disclosure a store
   reviewer is reading is the worse of the two. */
.doc .table-scroll { overflow-x: auto; }

.doc footer { text-align: center; margin-top: 36px; color: var(--wc-muted); font-size: 14px; }
.doc footer a { color: var(--wc-accent); text-decoration: none; font-weight: 600; }

/* ---------- .panel — 404 / invite / get ---------- */
.panel {
  display: flex; align-items: center; justify-content: center;
  text-align: center; min-height: 100vh;
}
.panel .box { padding: 32px; max-width: 440px; }
.panel .logo { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto; }
.panel h1 {
  font-family: var(--wc-font-display);
  font-size: 28px; font-weight: 800; color: var(--wc-accent); margin: 20px 0 8px;
}
.panel .code { font-family: var(--wc-font-display); font-size: 64px; font-weight: 800; color: var(--wc-accent); }
.panel p { color: var(--wc-muted); font-size: 17px; line-height: 1.5; margin: 0 0 24px; }
.panel .home { margin-top: 28px; font-size: 15px; }
.panel .home a { color: var(--wc-accent); text-decoration: none; font-weight: 700; }
.panel .open-app {
  display: none; margin: 0 auto 28px; padding: 14px 36px; border-radius: 12px;
  background: #43A047; color: #fff; font-size: 17px; font-weight: 700; text-decoration: none;
}
.panel .open-app.visible { display: inline-block; }

/* ---------- Store badges (shared by .panel and landing pages) ---------- */
.badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px;
  background: var(--wc-badge-bg); color: #fff; border-radius: 10px;
  text-decoration: none; text-align: left;
}
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge .bl { font-size: 11px; opacity: 0.8; }
.store-badge .bb { font-size: 16px; font-weight: 700; }

/* Revealed by wcWireStoreLinks() when the game is on neither store yet. */
[data-store-empty][hidden] { display: none; }
