/* mahjdragon.okbyus.com: one stylesheet for every page.
   The colours are the app's own (source/Jade/Design/Theme.swift): lacquer black,
   rosewood, imperial jade, temple gold, imperial red, and the ivory of a tile's face.
   Light pages are the tile's face with jade and red ink; dark pages are the lacquer
   table. The hero band is lacquer in both, because the app's pictures are night rooms.
   Lettering: Cormorant Garamond for headings and Cinzel for carved capitals, both SIL
   Open Font License faces from Google Fonts (the privacy page says the site loads them);
   body text in the system's own sans-serif. */
:root {
  --ground: #f6f1e6;          /* Theme.tileFace, ivory */
  --panel: #fffdf8;
  --panel-2: #efe7d6;
  --ink: #1b1413;             /* Theme.surface, rosewood */
  --ink-soft: #5b4b3c;
  --rule: #ddd1ba;            /* Theme.tileEdge, aged */
  --jade: #166a3e;            /* Theme.tileInkGreen: the bamboo ink, readable on ivory */
  --jade-soft: #e1efe5;
  --gold: #8a6410;            /* temple gold, darkened for ivory */
  --red: #b22222;             /* Theme.red */
  --link: #166a3e;
  --shadow: rgba(27, 20, 19, .10);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --caps: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e0b0b;        /* Theme.background, lacquer black */
    --panel: #1b1413;         /* Theme.surface, rosewood */
    --panel-2: #261b19;       /* Theme.surface2 */
    --ink: #f2eadd;           /* Theme.text, rice paper */
    --ink-soft: #afa08c;      /* Theme.textSoft */
    --rule: #3a2c27;
    --jade: #19b87a;          /* Theme.jade, a touch lighter for small text */
    --jade-soft: #0f2a1f;
    --gold: #daa520;          /* Theme.gold */
    --red: #e05a4c;
    --link: #daa520;
    --shadow: rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --ground: #0e0b0b; --panel: #1b1413; --panel-2: #261b19;
  --ink: #f2eadd; --ink-soft: #afa08c; --rule: #3a2c27;
  --jade: #19b87a; --jade-soft: #0f2a1f; --gold: #daa520; --red: #e05a4c;
  --link: #daa520; --shadow: rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  overflow-x: hidden;
}
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; height: auto; }

.eyebrow {
  font: 600 .78rem/1.2 var(--caps);
  letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin: 0 0 .9rem;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 700; text-wrap: balance; }

/* ---------- Text pages: support, privacy, press, 404, guides ---------- */
.wrap { max-width: 44rem; margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) 16px 5rem; }
.wrap.wide { max-width: 62rem; }
.home {
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: 2.2rem;
  color: var(--ink); text-decoration: none;
}
.home img { width: 36px; height: 36px; border-radius: 9px; }
.home span { font: 600 .95rem/1 var(--caps); letter-spacing: .14em; text-transform: uppercase; }
.wrap h1 { font-size: clamp(2.2rem, 6.5vw, 3.2rem); line-height: 1.05; margin: 0 0 .8rem; }
.lede { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 2.2rem; }
.updated { color: var(--ink-soft); font-size: .93rem; margin: 0 0 2.4rem; }
.wrap h2 { font-size: 1.65rem; line-height: 1.2; margin: 2.6rem 0 .6rem; }
.wrap h3 { font-size: 1.3rem; margin: 1.7rem 0 .35rem; }
.wrap ul, .wrap ol { padding-left: 1.25rem; }
.wrap li { margin: .35rem 0; }
.note {
  background: var(--jade-soft); border-left: 4px solid var(--jade);
  padding: .9rem 1.1rem; border-radius: 8px; margin: 1.6rem 0;
}
.note p { margin: 0; }
kbd, .key {
  font: 600 .78em/1 var(--caps); letter-spacing: .08em; white-space: nowrap;
  border: 1px solid var(--rule); border-bottom-width: 3px; border-radius: 6px;
  padding: .18em .45em; background: var(--panel); color: var(--ink);
}
dl.facts { display: grid; grid-template-columns: 11rem 1fr; gap: .55rem 1.2rem; margin: 0; }
dl.facts dt { font-weight: 700; }
dl.facts dd { margin: 0; color: var(--ink-soft); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.shots figure { margin: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.shots img { width: 100%; height: 15rem; object-fit: cover; object-position: top; background: #0e0b0b; }
.shots figcaption { padding: .6rem .8rem; font-size: .88rem; color: var(--ink-soft); }
.figure { margin: 1.6rem 0; }
.figure img { border-radius: 12px; border: 1px solid var(--rule); }
.figure figcaption { font-size: .88rem; color: var(--ink-soft); padding-top: .5rem; }
table.card { width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem; font-size: .95rem; }
table.card th, table.card td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.card th { font: 600 .74rem/1.2 var(--caps); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
table.card td.pattern { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: nowrap; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Guides list (filled in by functions/_middleware.js) ---------- */
.guide-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.guide-list:empty::before { content: "The first guides are on their way."; color: var(--ink-soft); }
.guide-list li { padding: .85rem 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: .2rem 1rem; justify-content: space-between; align-items: baseline; }
.guide-list li:last-child { border-bottom: 1px solid var(--rule); }
.guide-list a { color: var(--ink); font-weight: 700; text-decoration: none; }
.guide-list a:hover { color: var(--jade); }
.guide-list .when { color: var(--ink-soft); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Footer, every page ---------- */
footer { border-top: 1px solid var(--rule); }
footer .inner {
  max-width: 64rem; margin: 0 auto; padding: 1.6rem 16px 2.4rem;
  display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; align-items: center; justify-content: space-between;
  font-size: .92rem; color: var(--ink-soft);
}
footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }
footer a { color: var(--ink); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .credit { flex-basis: 100%; font-size: .82rem; }

@media (max-width: 34rem) {
  dl.facts { grid-template-columns: 1fr; gap: .1rem; }
  dl.facts dd { margin-bottom: .7rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
