/* The player manual (tools/site-build.mjs, docsLayout). The home page and privacy page use landing.css. */
:root {
  --bg: #f5f2eb; --stone: #ebe5da; --forest: #222c29; --forest-deep: #18211e; --ink: #26312e; --muted: #4f5852;
  --line: #d8d3c9; --gold: #f2b134; --gold-hover: #f7c25a; --rust: #a8481f; --light: #f8f5ee;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 1360px; --gutter: 28px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px / 1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.15; text-wrap: balance; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 2px; border-radius: 4px; }
.bar :focus-visible, .site-foot :focus-visible { outline-color: var(--gold); }

/* top bar */
.bar { background: var(--forest); color: var(--light); }
.bar-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: 24px; }
.bar a { text-decoration: none; font-weight: 500; font-size: 1rem; }
.bar a:hover { text-decoration: underline; }
.bar-logo { display: block; flex: none; }
.bar-logo img { width: 190px; }
.bar-end { margin-left: 0; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; height: 44px; border-radius: 8px; border: 1px solid #5b6963; background: var(--forest-deep); color: var(--light); padding: 0 14px; font: inherit; font-size: 1rem; }
.search input::placeholder { color: #b9c2bd; opacity: 1; }
.q-results { position: absolute; z-index: 20; left: 0; right: 0; top: 50px; margin: 0; padding: 6px; list-style: none; max-height: 70vh; overflow-y: auto; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.q-results[hidden] { display: none; }
.bar .q-results a { display: block; padding: 8px 10px; border-radius: 6px; font-weight: 400; text-decoration: none; color: var(--ink); }
.bar .q-results a:hover, .bar .q-results a[aria-selected="true"] { background: var(--stone); text-decoration: none; }
.q-results b { display: block; font-weight: 600; }
.q-results small { display: block; font-size: 0.8125rem; color: var(--muted); }
.q-results span { display: block; font-size: 0.875rem; color: var(--muted); }
.q-none { padding: 10px; color: var(--muted); }
.btn-play { display: inline-flex; align-items: center; min-height: 44px; padding: 0 24px; border-radius: 999px; background: var(--gold); color: var(--forest-deep) !important; font-weight: 700; box-shadow: 0 3px 0 #b9811a; text-decoration: none; }
.bar a.btn-play:hover { background: var(--gold-hover); text-decoration: none; }
.btn-play.is-disabled { cursor: default; }

/* photo band */
.band { position: relative; min-height: 260px; display: flex; align-items: flex-end; color: #fff; background: var(--forest-deep); }
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15, 22, 20, 0.85), rgba(15, 22, 20, 0.1)); }
.band-in { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 32px; width: 100%; }
.band-title { font-weight: 800; font-size: 44px; line-height: 1; }

/* three columns */
.layout { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 48px; }
.side { padding: 32px 0; font-size: 1rem; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side-title { margin: 22px 0 6px; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rust); }
.side ul:first-of-type + .side-title { margin-top: 22px; }
.side a { display: block; padding: 6px 10px; min-height: 32px; border-radius: 6px; text-decoration: none; }
.side a:hover { background: var(--stone); }
.side a[aria-current="page"] { background: var(--stone); font-weight: 600; box-shadow: inset 3px 0 0 var(--rust); }
.side-fold > summary { display: none; }
.art { padding: 40px 0 64px; max-width: 860px; min-width: 0; }
.crumb { margin-bottom: 12px; font-size: 0.9375rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.art h1 { font-size: 56px; }
.art h2 { font-size: 32px; margin: 44px 0 12px; }
.art h3 { font-size: 22px; margin: 28px 0 8px; }
.art p { margin-bottom: 14px; max-width: 70ch; }
.art .lede { font-size: 21px; margin-top: 14px; margin-bottom: 18px; }
.art a { text-decoration-color: var(--rust); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.art a:hover { color: var(--rust); }
.art ul { margin: 0 0 14px; padding-left: 1.25rem; }
.art li { margin-top: 6px; max-width: 70ch; }
.art strong { font-weight: 700; }
.art code { padding: 0.1em 0.35em; background: var(--stone); border-radius: 4px; font-size: 0.92em; }
.art > img, .art p > img { width: 100%; max-width: 720px; margin: 20px 0; border-radius: 12px; }
.art em { font-style: italic; }

/* numbered steps */
.art ol { list-style: none; counter-reset: s; margin: 0 0 14px; padding: 0; }
.art ol li { counter-increment: s; position: relative; margin: 0; max-width: none; padding: 14px 0 14px 58px; border-bottom: 1px solid var(--line); }
.art ol li::before { content: counter(s); position: absolute; left: 0; top: 12px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--forest-deep); font-size: 22px; font-weight: 800; line-height: 1; }

/* tables */
.table-wrap { margin: 18px 0; overflow-x: auto; border: 1px solid var(--line); background: #fff; }
.art table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.art th, .art td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.art th { background: var(--stone); font-weight: 600; }
.art tr:last-child td { border-bottom: 0; }

/* gamepad and keyboard cards */
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 20px 0 22px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 20px 22px 22px; }
.opt.best { border-color: var(--forest-deep); background: var(--gold); box-shadow: 6px 6px 0 var(--forest-deep); }
.opt h3 { font-size: 36px; margin: 8px 0 10px; }
.opt ul { margin: 0; padding: 0; list-style: none; font-size: 1.0625rem; }
.opt li { padding: 5px 0; margin: 0; }
.opt .why { margin: 12px 0 0; font-size: 1rem; color: var(--muted); }
.rec { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--forest-deep); color: #fff; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.rec-n { background: var(--stone); color: #4a2f12; border: 1px solid #bfae95; }
kbd { display: inline-block; margin: 0 2px; padding: 0 9px; border-radius: 6px; background: var(--bg); color: var(--forest-deep); box-shadow: 0 3px 0 #8d8678, 0 4px 0 var(--forest-deep); font: 800 1.1875rem / 1.3 var(--font); }

/* on this page */
.toc { position: sticky; top: 24px; align-self: start; padding: 40px 0; font-size: 0.9375rem; }
.toc-title { margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; min-height: 32px; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); text-decoration: none; }
.toc a:hover { border-left-color: var(--rust); }

/* previous and next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pn a { display: block; padding: 16px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; }
.pn a:hover { border-color: var(--rust); }
.pn small { display: block; font-size: 0.875rem; color: var(--muted); }
.pn b { font-size: 1.5rem; }
.pn-next { text-align: right; grid-column: 2; }

/* footer */
.site-foot { background: var(--forest-deep); color: rgba(248, 245, 238, 0.82); padding: 40px 0 32px; font-size: 0.9375rem; }
.site-foot .wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.foot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }
.foot-brand img { width: 170px; }
.foot-brand p { margin-top: 14px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; list-style: none; padding: 0; margin: 0; }
.foot-nav a { display: inline-block; padding: 6px 0; color: var(--light); text-decoration: none; }
.foot-nav a:hover { text-decoration: underline; }
.foot-rule { border: 0; border-top: 1px solid rgba(248, 245, 238, 0.16); margin: 32px 0 20px; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-bottom a { color: var(--light); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .toc { display: none; }
}
@media (max-width: 859px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { padding: 20px 0; border-bottom: 1px solid var(--line); }
  .side-fold > summary { display: block; cursor: pointer; padding: 10px 0; font-weight: 700; }
  .side-fold[open] > summary { margin-bottom: 8px; }
  .art { padding: 28px 0 48px; }
}
@media (max-width: 759px) {
  :root { --gutter: 20px; }
  .bar-logo img { width: 150px; }
  .bar-in { height: auto; flex-wrap: wrap; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
  .bar-end { margin-left: auto; }
  .search { order: 5; flex: 1 0 100%; max-width: none; margin-left: 0; }
  .band { min-height: 180px; }
  .band-title { font-size: 34px; }
  .art h1 { font-size: 42px; }
  .art h2 { font-size: 28px; }
  .opt h3 { font-size: 30px; }
  .pn { grid-template-columns: 1fr; }
  .pn-next { grid-column: auto; }
}
