/* Follow the system theme unless the visitor chooses one. */
:root {
  color-scheme: light;
  --bg: #f6f3ea; --surface: #fffdf7; --text: #23251f; --muted: #645f52; --border: #e3dccb;
  --link: #25603b; --gold: #a87a22; --accent: #25603b; --accent-hover: #19492b;
  --shadow: 0 1px 2px rgb(60 50 20 / 6%), 0 8px 24px rgb(60 50 20 / 7%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111411; --surface: #191e1a; --text: #e6e3d7; --muted: #a8a596; --border: #2d352f;
    --link: #9fd3ae; --gold: #dfc999; --accent: #2f7a4b; --accent-hover: #3a8e59;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111411; --surface: #191e1a; --text: #e6e3d7; --muted: #a8a596; --border: #2d352f;
  --link: #9fd3ae; --gold: #dfc999; --accent: #2f7a4b; --accent-hover: #3a8e59;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; color: var(--text); background: var(--bg); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 760px; margin: 56px auto 70px; padding: 0 24px; }
h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.2; letter-spacing: -0.5px; }
h2 { margin: 44px 0 14px; font-size: 21px; letter-spacing: -0.2px; }
h3 { margin: 26px 0 8px; font-size: 16px; }
p { margin: 12px 0; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
ol, ul { margin: 0; padding-left: 22px; }
li { padding-left: 4px; margin: 10px 0; }
kbd {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  color: var(--text); background: var(--surface); font: 600 13px/1.5 inherit; white-space: nowrap;
}

/* Hero: always dark, in the colours of the game panel. */
.hero {
  color: #eee8d6;
  background:
    radial-gradient(900px 320px at 15% -10%, rgb(223 201 153 / 16%), transparent 70%),
    linear-gradient(160deg, #1b2e22, #263f31 55%, #1a2a20);
  border-bottom: 1px solid #3c5444;
}
.hero-inner { max-width: 760px; margin: 0 auto; padding: 64px 24px 56px; }
.hero h1 { display: flex; align-items: center; gap: 14px; font-size: 40px; color: #f4ecd6; }
.hero .logo { flex: none; border-radius: 12px; box-shadow: 0 0 0 1px rgb(223 201 153 / 35%), 0 6px 18px rgb(0 0 0 / 35%); }
.hero .lead { max-width: 34em; margin: 10px 0 0; color: #cfc8b3; font-size: 18px; }
.hero a { color: #dfc999; }
.download { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 14px; }
.install, .secondary {
  display: inline-block; padding: 11px 20px; border-radius: 8px; font-weight: 600; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.install { color: #1b2418; background: linear-gradient(#ecd9a8, #d4b678); box-shadow: 0 1px 0 rgb(255 255 255 / 35%) inset, 0 6px 16px rgb(0 0 0 / 30%); }
.hero .install { color: #1b2418; }
.install:hover { background: linear-gradient(#f3e4bb, #dcc08a); transform: translateY(-1px); }
.secondary { border: 1px solid rgb(223 201 153 / 45%); }
.hero .secondary { color: #eee8d6; }
.secondary:hover { border-color: #dfc999; background: rgb(223 201 153 / 10%); }
.version { margin: 0; color: #a9a58f; font-size: 14px; }

/* Screenshot and feature grid */
.preview { margin: -96px 0 0; position: relative; }
.preview img { display: block; margin: 0 auto; border: 1px solid #3c3a2e; border-radius: 10px; box-shadow: 0 20px 50px rgb(0 0 0 / 30%); }
.preview figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.hero:has(~ main .preview) .hero-inner { padding-bottom: 136px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 36px 0 0; padding: 0; list-style: none; }
.features li { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 14px; line-height: 1.5; }
.features b { display: block; margin-bottom: 4px; color: var(--text); font-size: 15px; }

/* Quick setup as numbered cards */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; margin: 0; padding: 46px 16px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 15px; line-height: 1.55; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; top: 14px; left: 16px; width: 24px; height: 24px; border-radius: 50%;
  color: #1b2418; background: #dfc999; font-weight: 700; font-size: 13px; line-height: 24px; text-align: center;
}
.controls { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; color: var(--muted); font-size: 14px; }

footer { display: flex; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--border); margin-top: 40px; padding-top: 18px; font-size: 14px; }
#theme-toggle { margin-left: auto; padding: 0; border: 0; color: var(--link); background: none; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#theme-toggle:hover { text-decoration: none; }

/* Patch notes */
#patch-notes { scroll-margin-top: 24px; }
.notes-intro, .release-note { color: var(--muted); font-size: 14px; }
.release { margin: 12px 0; padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.release:first-of-type { border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); box-shadow: var(--shadow); }
.release:first-of-type h3::before {
  content: "Latest"; display: inline-block; margin-right: 10px; padding: 1px 8px; border-radius: 999px;
  color: #1b2418; background: #dfc999; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; vertical-align: 2px;
}
.release h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.45; }
.release h3 a { color: var(--gold); font-variant-numeric: tabular-nums; text-decoration: none; }
.release h3 a:hover { text-decoration: underline; }
.release p { margin: 8px 0 0; }
.release ul { margin: 0; padding-left: 20px; }
.release li { margin: 6px 0; color: var(--text); font-size: 15px; }
.release li::marker { color: var(--gold); }
details { margin-top: 12px; }
summary { padding: 12px 16px; border: 1px dashed var(--border); border-radius: 10px; color: var(--link); cursor: pointer; }
summary:hover { background: var(--surface); }
details[open] summary { margin-bottom: 4px; }

/* Setup guide */
.back { margin: 0 0 18px; font-size: 14px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; font-size: 0; }
.toc a { padding: 5px 12px; font-size: 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; }
.toc a:hover { border-color: var(--link); }
h2[id] { scroll-margin-top: 20px; padding-top: 22px; border-top: 1px solid var(--border); }
.shot { display: block; max-width: 100%; height: auto; margin: 18px auto; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.note { margin: 16px 0; padding: 10px 14px; border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; background: var(--surface); color: var(--muted); font-size: 14px; }
table.messages { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; background: var(--surface); border-radius: 8px; overflow: hidden; }
table.messages th, table.messages td { padding: 8px 10px; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
table.messages th { color: var(--muted); font-weight: 600; }

@media (max-width: 720px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { margin: 40px auto 50px; padding: 0 16px; }
  .hero-inner { padding: 44px 16px 40px; }
  .hero h1 { font-size: 32px; }
  .hero .lead { font-size: 16px; }
  .preview { margin-top: -80px; }
  .hero:has(~ main .preview) .hero-inner { padding-bottom: 110px; }
  table.messages th, table.messages td { padding: 6px 4px; }
}
@media (max-width: 420px) { .features { grid-template-columns: 1fr; } }

/* Easy guide: pictures first, few words, big targets. */
.easy main { max-width: 620px; }
.easy h1 { font-size: 40px; }
.easy-lead { font-size: 20px; }
.ring-key { padding: 0 6px; border: 3px solid #ff3b30; border-radius: 8px; }
.easy-steps { padding: 0; list-style: none; counter-reset: easy; }
.easy-steps > li { position: relative; margin: 22px 0; padding: 22px 22px 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); counter-increment: easy; font-size: 20px; line-height: 1.5; }
.easy-steps > li::before {
  content: counter(easy); position: absolute; top: -14px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
  color: #1b2418; background: #dfc999; font-weight: 800; font-size: 20px; line-height: 40px; text-align: center; box-shadow: var(--shadow);
}
.easy-head { display: flex; align-items: center; gap: 14px; }
.easy-icon { font-size: 40px; line-height: 1; }
.easy-steps h2 { margin: 0; padding: 0; border: 0; font-size: 26px; }
.easy-steps p { margin: 14px 0 0; }
.big-button { display: inline-block; padding: 14px 26px; border-radius: 12px; color: #fff; background: var(--accent); font-weight: 700; font-size: 20px; text-decoration: none; }
.big-button:hover { background: var(--accent-hover); }
.big-button.gold { color: #1b2418; background: linear-gradient(#ecd9a8, #d4b678); }
.big-button.gold:hover { background: linear-gradient(#f3e4bb, #dcc08a); }
kbd.big-key { padding: 4px 14px; border-bottom-width: 4px; border-radius: 8px; font-size: 22px; }
.dot-num { display: inline-block; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #ff3b30; font-weight: 700; font-size: 17px; line-height: 26px; text-align: center; vertical-align: 2px; box-shadow: 0 0 0 1px #ff3b30; }
.easy-shot { display: block; width: 100%; max-width: 470px; height: auto; margin: 18px auto 0; border-radius: 10px; box-shadow: var(--shadow); }
.dots { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.dots span { display: inline-flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 20px; height: 20px; border-radius: 50%; }
.dot.green { background: #4caf50; } .dot.yellow { background: #f0b429; } .dot.red { background: #e5484d; }
.more { font-size: 18px; }
@media (max-width: 640px) { .easy-steps > li { padding: 20px 16px 22px; font-size: 18px; } .easy h1 { font-size: 34px; } }
