/* The readable pages -- /rules/, /about/, /privacy/. Static HTML from
   scripts/pages.mjs, so none of the app's stylesheet reaches them; this is the
   little they need, in the app's own colours. A page of prose on paper laid in
   the room, rather than white text on the felt: the rules are two thousand
   words, and dark ground is for glancing at cards, not for reading. */

:root {
  --room: #0f2b24;
  --g1: #144537;
  --g2: #123029;
  --line: rgba(255, 255, 255, 0.13);
  --text: #eef3ef;
  --muted: #8fa89e;
  --gold: #e0b558;
  --paper: #f3efe4;
  --ink: #1d2320;
  --ink-muted: #5d6a63;
  --rule: #d9d3c2;
  --link: #1f5a8a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--room);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---- header and footer, as the app's home draws them ---- */

.site-nav,
.site-foot {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 0.9rem clamp(1rem, 4vw, 2rem);
  font-size: 0.86rem;
}

.site-nav {
  border-bottom: 1px solid var(--line);
}

.site-mark {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-decoration: none;
  margin-right: auto;
}

.site-mark small {
  font-family: ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0;
  margin-left: 0.55rem;
}

.site-nav-links,
.site-foot-links {
  display: flex;
  gap: 1.1rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.85;
}

.site-nav a[aria-current] {
  color: var(--gold);
  opacity: 1;
}

.site-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

/* Nothing precedes them in the row -- see the footer in scripts/pages.mjs --
   so they start it. */
.site-foot-links {
  margin-left: 0;
}

.site-foot a {
  color: var(--text);
  opacity: 0.8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-nav a:focus-visible,
.site-foot a:focus-visible,
.paper a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- the page itself ---- */

.paper {
  width: min(46rem, calc(100% - 2rem));
  margin: 1.6rem auto 2rem;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8);
}

.paper h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.paper h2 {
  margin: 1.8rem 0 0.4rem;
  font-size: 1.15rem;
  line-height: 1.25;
}

.paper h3 {
  margin: 1.3rem 0 0.3rem;
  font-size: 1rem;
}

.paper p,
.paper li {
  max-width: 68ch;
}

.paper p {
  margin: 0 0 0.75rem;
}

.paper ul,
.paper ol {
  margin: 0 0 0.9rem;
  padding-left: 1.3rem;
}

.paper li {
  margin: 0.15rem 0;
}

.paper a {
  color: var(--link);
}

.paper code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0 0.3em;
  border-radius: 3px;
}

.paper table {
  border-collapse: collapse;
  margin: 0.4rem 0 1rem;
  font-size: 0.92rem;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.paper th,
.paper td {
  text-align: left;
  vertical-align: top;
  padding: 0.35rem 0.7rem 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}

.paper th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.paper hr {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 1.4rem 0;
}

@media (max-width: 40rem) {
  .site-nav,
  .site-foot {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
}
