/* Baida 百搭麻雀 — public site styles.
   Tokens follow the game's V3 visual system (.design/handoffs/00-visual-system.md):
   dark felt, gold primary, jade accents, warm-white text, Noto Sans TC (UI) + Noto Serif TC Bold (headings). */

/* Self-hosted OFL font subsets (tools/web/subset_site_fonts.py; licence: /assets/fonts/OFL.txt). No third parties. */
@font-face {
  font-family: "Noto Sans TC";
  src: url("/assets/fonts/noto-sans-tc.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif TC";
  src: url("/assets/fonts/noto-serif-tc.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #16140f;            /* bg_app */
  --bg-raise: #1e1b15;
  --felt: #0f3324;          /* app icon felt */
  --felt-deep: #081a12;
  --gold: #c8a24a;          /* primary */
  --gold-soft: #e2c47a;
  --gold-ink: #1a1408;      /* ink on gold */
  --jade: #4f9468;
  --jade-text: #7cc596;     /* jade, lifted for text contrast on dark */
  --red: #b23b3b;           /* red dragon */
  --text: #ece7dc;
  --text-dim: #b8b2a6;      /* >= 4.5:1 on --bg and on cards */
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.09);
  --hairline: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.14);
  --tile-face: #f4efe6;
  --seat-e: #4a73b8;
  --seat-s: #c0605a;
  --seat-w: #4f9468;
  --seat-n: #d39450;

  --sans: "Noto Sans TC", "PingFang TC", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --radius: 12px;
  --gutter: 16px;
  --max: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--gold-soft); text-underline-offset: 3px; }
a:hover { color: #f1d999; }

:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

p { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 10;
  background: var(--gold);
  color: var(--gold-ink);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 8px; color: var(--gold-ink); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--hairline);
  background: rgba(22, 20, 15, 0.92);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover { color: var(--text); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.1; white-space: nowrap; }
.brand-name small { display: block; font-family: var(--sans); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.16em; color: var(--text-dim); text-transform: uppercase; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 8px;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--card); color: #fff; }
.site-nav a[aria-current="page"] { color: var(--gold-soft); }
.site-nav .lang-switch {
  margin-left: 6px;
  border: 1px solid var(--border);
  padding: 0 12px;
  font-weight: 500;
}
.site-nav .lang-switch .globe { width: 16px; height: 16px; margin-right: 6px; flex: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(40, 110, 72, 0.32) 0%, rgba(15, 51, 36, 0.0) 60%),
    radial-gradient(90% 70% at 85% 100%, rgba(200, 162, 74, 0.10) 0%, rgba(200, 162, 74, 0) 60%),
    linear-gradient(180deg, var(--felt) 0%, var(--bg) 92%);
  border-bottom: 1px solid var(--hairline);
}
.hero .wrap {
  display: grid;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 48px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  margin: 0 0 12px;
}
.hero h1 {
  font-size: clamp(2.6rem, 11vw, 4.4rem);
  margin: 0 0 4px;
  color: #fff;
  letter-spacing: 0.04em;
}
.hero .h1-sub {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.6vw, 1.6rem);
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}
.hero .pitch {
  font-size: 1.08rem;
  max-width: 34em;
  color: var(--text);
}
.hero .pills { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .pills li {
  font-size: 0.85rem;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
}

/* App Store "coming soon" badge — not a link until the store page exists */
.store-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 18px 8px 14px;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge span { display: flex; flex-direction: column; line-height: 1.2; }
.store-badge small { font-size: 0.72rem; letter-spacing: 0.04em; color: #e8e8e8; }
.store-badge strong { font-size: 1.15rem; font-weight: 700; }
.store-note { font-size: 0.9rem; color: var(--text-dim); margin: 0; }

/* hero tile art */
.hero-art { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 18px 14px 16px;
  border-radius: 16px;
  background: radial-gradient(100% 120% at 50% 0%, #1b4a33 0%, #0e2c1f 70%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hand .meld { display: flex; gap: 3px; }
.hand .meld + .meld { margin-left: 12px; }
.tile {
  flex: none;
  width: clamp(38px, 12vw, 66px);
  aspect-ratio: 3 / 4;
  border-radius: 7px;
  box-shadow: 0 3px 0 #c9bfab, 0 6px 12px rgba(0, 0, 0, 0.35);
}
.tile.joker {
  transform: translateY(-10px);
  box-shadow: 0 3px 0 #c9bfab, 0 0 0 2px var(--gold), 0 0 22px rgba(226, 196, 122, 0.55);
}
.hand-caption {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: center;
}
.hand-caption b { color: var(--gold-soft); font-weight: 700; }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--hairline); }
.section-head { max-width: 40em; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
.section-head p { color: var(--text-dim); margin: 0; }

.features {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
}
.feature {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 22px 20px 20px 22px;
  overflow: hidden;
}
.feature::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent, var(--gold));
}
.feature h3 { font-size: 1.3rem; margin-bottom: 8px; }
.feature p { color: var(--text-dim); margin: 0; }
.feature .tiles { display: flex; gap: 6px; margin-bottom: 16px; }
.feature .tiles img { width: 42px; aspect-ratio: 3 / 4; border-radius: 5px; box-shadow: 0 2px 0 #c9bfab, 0 4px 8px rgba(0, 0, 0, 0.3); }
.feature--fan { --accent: var(--red); }
.feature--joker { --accent: var(--gold); }
.feature--play { --accent: var(--seat-e); }
.feature--fair { --accent: var(--jade); }

/* cosmetics showcase */
.table-shot {
  margin: 0 0 18px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-shot img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.table-shot figcaption { padding: 12px 16px 14px; font-size: 0.95rem; }
.table-shot figcaption .name { font-family: var(--serif); font-weight: 700; }
.table-shot small { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--text-dim); line-height: 1.5; }
.badge {
  display: inline-block;
  vertical-align: 1px;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
  background: var(--gold);
  color: var(--gold-ink);
}
.badge--coins { background: transparent; color: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(226, 196, 122, 0.6); }
.showcase {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
}
.showcase li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 16px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  text-align: center;
}
.set-hand { display: flex; gap: 4px; justify-content: center; }
.set-hand img { width: 52px; aspect-ratio: 3 / 4; border-radius: 6px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), 0 6px 12px rgba(0, 0, 0, 0.35); }
.showcase .name { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.showcase .kind { font-size: 0.82rem; color: var(--text-dim); line-height: 1.4; }
.frame-row { display: flex; gap: 18px; justify-content: center; }
.frame-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.frame-item .name { font-size: 0.98rem; }
.avatar {
  position: relative;
  width: 86px;
  height: 86px;
}
.avatar .face {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  color: #fff;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fair-note {
  margin: 22px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(79, 148, 104, 0.45);
  background: rgba(79, 148, 104, 0.10);
  font-size: 0.95rem;
}

/* ---------- inner pages ---------- */
.page-head {
  background: linear-gradient(180deg, var(--felt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--hairline);
}
.page-head .wrap { padding-top: 40px; padding-bottom: 32px; }
.page-head h1 { font-size: clamp(2rem, 8vw, 2.8rem); color: #fff; margin-bottom: 8px; }
.page-head p { color: var(--text-dim); margin: 0; max-width: 40em; }

.prose, .page-head .wrap { max-width: calc(46em + 2 * var(--gutter)); }
.prose h2 { font-size: 1.5rem; margin-top: 8px; }

.contact-card {
  display: grid;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 40px;
}
.contact-card h2 { font-size: 1.25rem; margin: 0; }
.contact-card p { margin: 0; color: var(--text-dim); }
.mail-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.15rem;
  font-weight: 700;
  word-break: break-all;
}

.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.faq details[open] { background: var(--card-strong); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 1.02rem;
  border-radius: var(--radius);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid var(--gold-soft);
  border-bottom: 2px solid var(--gold-soft);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(225deg) translateY(-3px); }
.faq .answer { padding: 0 18px 16px; color: var(--text); }
/* inline links in running text: a 44 px tall hit box without changing the line box */
.faq .answer a, .fair-note a {
  display: inline-block;
  padding: 11px 0;
  margin: -11px 0;
  line-height: 22px;
}
.faq .answer p, .faq .answer li { color: #d9d3c7; }
.faq .answer ul { padding-left: 1.2em; margin: 0 0 1em; }
.faq .answer li { margin-bottom: 4px; }
.faq .answer :last-child { margin-bottom: 0; }
.path {
  display: inline;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(200, 162, 74, 0.14);
  color: var(--gold-soft);
  font-weight: 500;
  white-space: nowrap;
}
.subhead { font-family: var(--sans); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; color: var(--gold-soft); margin: 14px 0 6px; }

.notice {
  border: 1px dashed rgba(226, 196, 122, 0.6);
  background: rgba(200, 162, 74, 0.08);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}
.notice .tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-ink);
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 10px;
}
.notice p { font-size: 1.1rem; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: #d4b25f; color: var(--gold-ink); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: #12100c;
  padding: 32px 0 40px;
  font-size: 0.92rem;
}
.site-footer .wrap { display: grid; gap: 18px; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.site-footer nav ul { gap: 0 18px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0; color: var(--text); }
.site-footer .legal { color: var(--text-dim); margin: 0; }
.site-footer .legal + .legal { font-size: 0.82rem; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 72px 0; }
.notfound .tile { margin: 0 auto 24px; width: 72px; }
.notfound h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
.notfound p { color: var(--text-dim); }
.notfound .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.notfound hr { border: 0; border-top: 1px solid var(--hairline); margin: 32px auto; max-width: 320px; }

.lang-short { display: none; }

/* ---------- small phones ---------- */
@media (max-width: 420px) {
  .site-header .wrap { gap: 8px; }
  .site-nav a { padding: 0 8px; }
  .site-nav .lang-switch { padding: 0 10px; margin-left: 2px; }
  .site-nav .lang-switch .globe { display: none; }
  .lang-long { display: none; }
  .lang-short { display: inline; }
}

/* ---------- larger screens ---------- */

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .showcase { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  :root { --gutter: 32px; }
  .hero .wrap {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    padding-top: 72px;
    padding-bottom: 88px;
  }
  .tile { width: 62px; }
  .section { padding: 80px 0; }
  .features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .feature { padding: 26px 22px 24px 26px; }
  .showcase { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; }
  .site-footer .legal-block { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* seat colours for the sample avatars (no inline styles: the CSP forbids them) */
.face--e { background: var(--seat-e); }
.face--s { background: var(--seat-s); }
.face--w { background: var(--seat-w); }
.face--n { background: var(--seat-n); color: var(--gold-ink); }

/* ---------- privacy policy (/privacy/, /en/privacy/), generated by tools/legal/build_privacy_html.py ---------- */
.policy { color: #d9d3c7; }
.policy h2 { font-size: 1.4rem; color: var(--text); margin-top: 44px; padding-top: 4px; scroll-margin-top: 16px; }
.policy h3 { font-size: 1.1rem; color: var(--gold-soft); margin-top: 26px; }
.policy ul { padding-left: 1.25em; margin: 0 0 1em; }
.policy li { margin-bottom: 6px; }
.policy li ul { margin: 6px 0 0; }
.policy strong { color: var(--text); }
.policy a { overflow-wrap: anywhere; }
.policy-small { font-size: 0.85rem; color: var(--text-dim); }
.policy-callout {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--jade);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 1.2em;
}
.policy-callout p:last-child { margin-bottom: 0; }
.policy-toc {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 20px 12px;
  margin: 8px 0 12px;
}
.policy-toc h2 { font-size: 1.05rem; margin: 0 0 6px; padding: 0; }
.policy-toc ul { list-style: none; margin: 0; padding: 0; }
.policy-toc li { margin: 0; break-inside: avoid; }
.policy-toc a { display: inline-block; padding: 10px 0; line-height: 24px; }
mark.ph {
  background: rgba(200, 162, 74, 0.22);
  color: #f1d999;
  border: 1px dashed rgba(226, 196, 122, 0.7);
  border-radius: 4px;
  padding: 0 4px;
}
.policy-table { margin: 8px 0 20px; }
.policy-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.policy-table th, .policy-table td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--border); }
.policy-table th { background: var(--card-strong); color: var(--text); font-weight: 700; }
.policy-table td { background: var(--card); }
@media (max-width: 639px) {
  .policy-table table, .policy-table thead, .policy-table tbody, .policy-table tr, .policy-table th, .policy-table td { display: block; }
  .policy-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .policy-table tr { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 10px; padding: 8px 14px; }
  .policy-table td { border: 0; background: transparent; padding: 6px 0; }
  .policy-table td::before { content: attr(data-label); display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; color: var(--gold-soft); }
}
@media (min-width: 640px) {
  .policy-toc ul { columns: 2; column-gap: 28px; }
}
