/* Shared styles for Tiertac's content pages (how to play, strategy, FAQ, about,
   support, privacy, 404). Same paper, panel and ink as the game itself. */
:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --panel: #fffdf8;
  --ink: #15171c;
  --muted: #535866;
  --line: #dcd6c8;
  --x: #be123c;
  --o: #1d4ed8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 650; }
.skip:focus { top: 8px; }
/* Wording that is true only inside the Android app. The app adds its own rules to this file as it serves it
   (see MainActivity.java): they show .app-only and hide .web-only. */
.app-only { display: none; }

/* ---------- header ---------- */
.site-head, .site-foot .wrap, main {
  width: min(880px, 100%);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.site-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 20px; padding-top: 16px; padding-bottom: 14px;
}
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand img { width: 30px; height: 30px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.site-nav a { display: inline-block; padding: 6px 0; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }

/* ---------- main card ---------- */
main { padding-bottom: 40px; }
.crumbs ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.card {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  padding: clamp(20px, 4.5vw, 44px);
  box-shadow: 6px 6px 0 var(--ink);
}
h1 { margin: 0 0 6px; font-size: clamp(28px, 6vw, 42px); line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
h2 { margin: 40px 0 8px; font-size: clamp(21px, 3.6vw, 25px); line-height: 1.25; letter-spacing: -0.015em; text-wrap: balance; }
h3 { margin: 26px 0 4px; font-size: 18px; line-height: 1.35; }
h2 + h3 { margin-top: 14px; }
p, ul, ol, dl, table, figure { margin: 10px 0; }
ul, ol { padding-left: 24px; }
li { margin: 5px 0; }
li > ul { margin: 4px 0; }
.lead { font-size: 19px; line-height: 1.55; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.muted { color: var(--muted); }
kbd { font: 600 14px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 6px; padding: 2px 6px; background: #fff; }
code { font: 600 0.92em ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: #f1ede3; border-radius: 4px; padding: 1px 5px; }

.note { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 18px; margin: 18px 0; }
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }
.answer { font-weight: 600; }

.table-wrap { overflow-x: auto; margin: 14px 0; border: 1.5px solid var(--ink); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; margin: 0; font-variant-numeric: tabular-nums; font-size: 16px; }
caption { text-align: left; padding: 10px 14px 0; font-weight: 700; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { border-bottom: 1.5px solid var(--ink); font-size: 14px; }
tbody tr:last-child > * { border-bottom: 0; }
/* Wide tables become one block per row on narrow screens, each value labelled. */
@media (max-width: 560px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack, table.stack caption, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; }
  table.stack caption { padding-bottom: 4px; }
  table.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack th[scope="row"] { padding: 0 0 4px; border: 0; font-size: 17px; }
  table.stack td { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px; padding: 2px 0; border: 0; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 14px; font-weight: 600; padding-top: 1px; }
}

/* the four kinds of winning line, each a picture with its description */
.lines-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 16px 0; }
@media (min-width: 560px) { .lines-grid { grid-template-columns: 1fr 1fr; } }
.line-card { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px 6px; background: #fff; }
.line-card img { display: block; width: 168px; margin: 0 auto 2px; }
.line-card h3 { margin: 4px 0 2px; }
.line-card p { margin: 4px 0 8px; font-size: 16px; }

.btn {
  display: inline-block; text-decoration: none; color: var(--ink);
  border: 1.5px solid var(--ink); background: var(--panel);
  border-radius: 999px; padding: 9px 20px; font-weight: 700; line-height: 1.4;
}
.btn:hover { background: #fff; box-shadow: 0 2px 0 var(--ink); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 4px; }

.toc { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 18px; margin: 20px 0; }
.toc h2 { margin: 4px 0; font-size: 16px; }
.toc ul { margin: 4px 0; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 15px; color: var(--muted); }
.site-foot ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-foot a { color: var(--ink); display: inline-block; padding: 3px 0; }
.site-foot p { margin: 4px 0; }

@media (max-width: 520px) {
  /* six links in two tidy rows of three rather than five and a straggler */
  .site-nav { width: 100%; }
  .site-nav ul { display: grid; grid-template-columns: repeat(3, max-content); gap: 0 22px; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
  .lead { font-size: 17px; }
  th, td { padding: 8px 10px; }
}
@media print {
  .site-nav, .site-foot ul, .skip, .cta { display: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
