/* Dark only (Fred, 10 Nov), whatever the device's own setting. */
:root { color-scheme: dark; --bg: #151517; --fg: #e8e8ea; --mute: #9a9aa0; --line: #333; --link: #8ab4f8;
        --card: #222226; --d1: #5fd17a; --d2: #f2cb2e; --d3: #ff6b6b;
        /* Every box shares these: a faint white edge, so a dark card reads as a box on the dark page, a lighter
           fill and edge under the pointer, and one corner radius. */
        --edge: rgba(255, 255, 255, 0.08); --edge-hi: rgba(255, 255, 255, 0.24); --card-hi: #2a2a30; --r: 10px; }
* { box-sizing: border-box; }
/* The gutter is kept on short pages too, so the column doesn't shift sideways between pages. */
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 system-ui, -apple-system, sans-serif;
       -webkit-font-smoothing: antialiased; }
.page { max-width: 960px; margin: 0 auto; padding: 16px; }
/* On a page shorter than the window the footer sits at the window's bottom edge (Fred, 10 Nov). */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
header nav { padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
/* The site's heading on every page but the home page (Fred's pick, 10 Nov): the logo and the site's name in
   bold, as the breadcrumb's first step. */
ol.crumbs { align-items: baseline; }
ol.crumbs li:first-child a { color: var(--fg); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em;
                             text-decoration: none; }
ol.crumbs li:first-child a::before { content: ""; display: inline-block; width: 38px; height: 44px; margin-right: 8px;
                                     vertical-align: -14px; background: url(/img/logo-96.png) center / contain no-repeat; }
@media (max-width: 480px) {
  ol.crumbs li:first-child a { font-size: 1.15rem; }
  ol.crumbs li:first-child a::before { width: 30px; height: 36px; vertical-align: -11px; margin-right: 6px; }
}
ol.crumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; row-gap: 4px; }
ol.crumbs li:not(:last-child)::after { content: "›"; content: "›" / ""; margin: 0 8px; color: var(--mute); }
ol.crumbs [aria-current] { color: var(--mute); }
/* A clearer step between the three levels than 1.6, 1.25, and 1.05 gave. */
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.9rem; margin: 20px 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; margin: 32px 0 8px; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 22px 0 6px; }
@media (max-width: 480px) { h1 { font-size: 1.6rem; } }
/* Boxes that are links or buttons answer the pointer. Only where there is one: on a phone a hover style sticks
   after a tap. */
ul.grid a, ul.sets a, ul.home a, ul.objects a, .pager a, a.button, ul.emoji button {
  border: 1px solid var(--edge); transition: background-color 0.12s, border-color 0.12s; }
@media (hover: hover) {
  ul.grid a:hover, ul.sets a:hover, ul.home a:hover, ul.objects a:hover, .pager a:hover, a.button:hover,
  ul.emoji button:hover {
    background: var(--card-hi); border-color: var(--edge-hi); }
  tr:hover > th[scope=row], tr:hover > th[scope=row] ~ td { background: rgba(255, 255, 255, 0.03); }   /* data rows only */
}
p.sub { color: var(--mute); margin-top: 0; }
/* A guide's pages as tabs under its heading (the Fantasy Theater's, and Finder's Fortune's): the page being read is
   underlined in the link colour and isn't a link. */
nav.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 10px 0 0; }
nav.tabs > * { display: flex; align-items: center; gap: 7px; padding: 6px 2px 7px; margin-bottom: -1px;
               border-bottom: 2px solid transparent; text-decoration: none; }
nav.tabs img { width: 28px; height: 28px; object-fit: contain; }
nav.tabs [aria-current] { border-bottom-color: var(--link); font-weight: 600; }
nav.tabs a:hover { border-bottom-color: var(--edge-hi); }
nav.tabs + p { margin-top: 16px; }   /* p.sub has no top margin, and sat against the tabs' line */
ul.grid { list-style: none; padding: 0; display: grid; gap: 12px;
          grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
ul.grid a { display: block; text-decoration: none; color: var(--fg); background: var(--card);
            border-radius: var(--r); overflow: hidden; }
ul.grid img { display: block; width: 100%; height: auto; aspect-ratio: 244 / 400; }
ul.grid span { display: block; padding: 7px 10px; font-weight: 600; font-size: 0.9375rem; line-height: 1.3; }
ul.sets { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
ul.sets a { display: block; padding: 12px; text-decoration: none; color: var(--fg); background: var(--card); border-radius: var(--r); }
ul.sets h2 { margin: 0 0 8px; color: var(--link); }
ul.sets .thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
ul.sets .thumbs + .thumbs { margin-top: 6px; }
ul.sets img { display: block; width: 100%; height: auto; aspect-ratio: 244 / 400; border-radius: 4px; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin: 10px 0; }
/* Drawn as buttons, for a bigger target than a bare link gives. */
.pager a, a.button { padding: 6px 14px; background: var(--card); border-radius: 999px; text-decoration: none; font-weight: 600;
           font-size: 0.9375rem; }
a.button { display: inline-block; }
.guide { display: block; width: 100%; height: auto; max-width: 1220px; aspect-ratio: 1220 / 2000;
         border-radius: var(--r); }
/* Tables (Fred, 10 Nov): rules only, no grid, and every table the full width of its column so their edges line
   up. The rules are white washes, so they show on the page and on a card alike. */
table { border-collapse: collapse; width: 100%; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 9px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
th:first-child, td:first-child { text-align: left; }
th[scope=col] { color: var(--mute); font-size: 0.875rem; font-weight: 600; vertical-align: bottom;
                border-bottom-color: rgba(255, 255, 255, 0.24); }
th[scope=row] { font-weight: normal; }
td.nw { white-space: nowrap; }   /* a range stays on one line: it would break at its dash */
/* An info box: a small table drawn as a card. */
table.card { border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--edge);
             border-radius: var(--r); margin: 0; height: 100%; }
table.card th[scope=col] { white-space: nowrap; height: 1px; }   /* one-line headings that don't share in the stretch */
table.card th, table.card td { padding: 7px 10px; }   /* at 12 px the four-column card ran 8 px past the column's edge */
table.card tr:last-child > * { border-bottom: 0; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 315px), 1fr)); align-items: stretch;   /* cards side by side are the same height */
         margin: 8px 0 14px; }
/* Reading pages: a narrower column, for shorter lines and tables that aren't stretched thin. */
.page.narrow { max-width: 700px; }
ul.home { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 12px;
          grid-template-columns: repeat(auto-fill, 160px); }
ul.home li { display: flex; }
ul.home a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px;
            text-decoration: none; color: var(--fg); background: var(--card); border-radius: var(--r);
            font-weight: 600; line-height: 1.3; text-align: center; }
ul.home img { width: min(120px, 100%); height: auto; aspect-ratio: 1; }
/* The home page's heading: the logo beside the site's name, "Kingshot guides" under the name. */
.brand { display: flex; align-items: center; gap: 14px; margin: 8px 0 18px; }
.brand img { height: 88px; width: auto; }
.brand p { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.brand h1 { margin: 4px 0 0; font-size: 1.1rem; font-weight: 500; letter-spacing: 0; color: var(--mute); }
/* The home page on a wide screen (Fred's pick of three drawn, 10 Nov): the heading and 200 px buttons centred in
   the window. A phone keeps the 160 px buttons, two to a row, from the top left. */
@media (min-width: 700px) {
  .page:has(ul.home) main { display: flex; flex-direction: column; align-items: center; justify-content: center;
                            padding-bottom: 8vh; }
  .brand { gap: 18px; margin: 0 0 26px; }
  .brand img { height: 120px; }
  .brand p { font-size: 2.6rem; }
  .brand h1 { font-size: 1.25rem; }
  ul.home { width: 100%; justify-content: center; gap: 16px; margin: 0;
            grid-template-columns: repeat(auto-fit, minmax(140px, 200px)); }
  ul.home a { padding: 20px 12px 16px; gap: 10px; font-size: 1.1rem; }
  ul.home img { width: min(150px, 100%); }
}
ul.objects { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.objects a { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--card);
                          text-decoration: none; font-weight: 600; }
/* The picture's link is a block, with its focus ring drawn inside: the box clips anything outside it. */
.scene > a { display: block; }
.scene > a:focus-visible { outline-offset: -3px; border-radius: var(--r); }
.scene { position: relative; max-width: 1220px; overflow: hidden; border-radius: var(--r); }
.mark { position: absolute; box-sizing: content-box; margin: -6px; padding: 3px; border: 3px solid #fff;
        border-radius: 10px; box-shadow: 0 0 0 2px #161616, 0 0 0 200vmax rgba(0, 0, 0, 0.45);
        pointer-events: none; animation: pulse 0.8s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .mark { animation: none; } }
ul.emoji { list-style: none; padding: 0; display: grid; gap: 8px;
           grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
ul.emoji li { display: flex; }
ul.emoji button { position: relative; width: 100%; min-height: 124px; display: grid; grid-template-rows: 56px 1fr;
                  justify-items: center; align-items: center; padding: 8px 6px 6px; font: inherit; color: var(--fg);
                  background: var(--card); border-radius: var(--r); cursor: pointer; }
ul.emoji button.done { border-color: var(--link); }
ul.emoji button.failed { border-color: var(--d3); }
ul.emoji img { width: 44px; height: 44px; object-fit: contain; }
ul.emoji .label { display: flex; flex-direction: column; align-items: center; }
ul.emoji .sub { font-size: 0.75rem; color: var(--mute); line-height: 1.2; }
ul.emoji .name { font-size: 0.8rem; font-weight: 600; line-height: 1.2; text-align: center; overflow: hidden;
                 display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
ul.emoji .state { position: absolute; top: 6px; left: 8px; font-size: 0.7rem; color: var(--mute); }
ul.emoji .warn::after, .warn-key { content: "!"; width: 18px; height: 18px; border-radius: 50%; background: #f2a33a;
                                    color: #151517; font-size: 12px; font-weight: 800; line-height: 18px; text-align: center; }
ul.emoji .warn::after { position: absolute; top: 6px; right: 6px; }
.warn-key { display: inline-block; margin-right: 6px; }
/* A note the reader mustn't miss: bold, in a red-outlined box. */
.alert { margin: 12px 0; padding: 10px 14px; background: var(--card); border: 1.5px solid var(--d3);
         border-radius: var(--r); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.offscreen { position: fixed; top: 0; left: 0; opacity: 0; font-size: 16px; pointer-events: none; }
.d1 { color: var(--d1); } .d2 { color: var(--d2); } .d3 { color: var(--d3); }
.wrap { overflow-x: auto; }
/* Stage tables (Fred, 10 Nov): columns on a regular grid, not sized by their headings, with each difficulty's count
   centred under its heading. On a phone the columns size themselves again: "Medium" doesn't fit a seventh of 343 px. */
th.d1, th.d2, th.d3, td.d1, td.d2, td.d3 { text-align: center; }
@media (min-width: 481px) {
  table.stages, table.team { table-layout: fixed; }
  table.stages thead th { width: 13%; }
  table.stages thead th:first-child { width: 22%; }
}
table.stages thead th { position: sticky; top: 0; z-index: 1; background: var(--bg); }
table.stages tr.chapter th { padding-top: 10px; background: var(--bg); font-size: 1rem; font-weight: 700; text-align: left; }
table.stages tbody { scroll-margin-top: 2em; }
table.stages tr.to-here td { text-align: left; font-size: 0.875rem; color: var(--mute); }
table.stages tr.chapter .bones { font-weight: normal; font-size: 0.875rem; color: var(--mute); }
p.jump a { display: inline-block; min-width: 1.6em; text-align: center; }
@media (max-width: 480px) { th, td, table.card th, table.card td { padding: 5px 4px; font-size: 0.8125rem; } }
footer { margin-top: 48px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--mute);
         font-size: 0.8125rem; }
.advice { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 8px 0 12px; }
/* A colour per choice, as outline and heading (Fred's pick, 10 Nov): the page's dark card on its dark background
   didn't read as a box. Blue and violet because neither says good or bad, as green, yellow, or red would. */
.advice section { --pick: var(--link); padding: 12px 14px; background: var(--card); border: 1.5px solid var(--pick);
                  border-radius: var(--r); }
.advice section + section { --pick: #c3a6f7; }
.advice h3 { margin: 0; font-size: 1.35rem; color: var(--pick); }
.advice p { margin: 0 0 6px; }
.advice p.who { margin-bottom: 10px; font-size: 0.875rem; color: var(--mute); }
.advice strong { font-size: 1.1rem; }
.advice ul { margin: 0; padding-left: 20px; }
details { margin: 8px 0; padding: 0 14px; background: var(--card); border: 1px solid var(--edge); border-radius: var(--r); }
details summary { margin: 0 -14px; padding: 10px 14px; border-radius: var(--r); font-weight: 600; cursor: pointer; }
@media (hover: hover) { details summary:hover { color: var(--link); } }
details[open] { padding-bottom: 8px; }
/* Finder's Way: each level's rewards one to a line, icon first. The Dogtective Agency has no icon, so its name
   keeps the icon's space and lines up with the rest. */
table.way td:last-child { text-align: left; }
table.way .item { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
table.way .item img, table.way .noicon { width: 28px; height: 28px; flex: none; }
table.way .n { color: var(--mute); white-space: nowrap; }
table.way th[scope=col]:last-child { text-align: left; }
/* Three tabs (Finder's Fortune) ran 2 px past a 375 px screen at the 22 px gap. */
@media (max-width: 400px) { nav.tabs { gap: 14px; } }
/* Finder's Way's skin levels (Fred, 11 Nov: they're special): a gold bar down the left and a warm wash. */
table.way tr.skin > * { background: rgba(242, 163, 58, 0.10); }
table.way tr.skin > th { box-shadow: inset 3px 0 0 #f2a33a; font-weight: 600; }
/* /release-notes */
table.updates th, table.updates td { text-align: left; vertical-align: top; }
table.updates th[scope=row] { white-space: nowrap; }
table.earlier { max-width: 420px; }
table.earlier td:last-child, table.earlier th:last-child { text-align: right; }
.update { scroll-margin-top: 1em; }
.update h2 .when { margin-left: 8px; font-size: 0.9375rem; font-weight: normal; letter-spacing: 0; color: var(--mute); }
.update ul { margin: 8px 0; padding-left: 20px; }
.update li + li { margin-top: 4px; }
.update .pics { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 4px; }
.update figure { margin: 0; }
.update figure .pic { height: 150px; display: flex; align-items: center; }   /* PICTURE_PX in build.py: captions line up */
.update figure img { display: block; border-radius: 6px; }
.update figcaption { margin-top: 4px; font-size: 0.8125rem; color: var(--mute); }
nav.contents { margin: 14px 0 6px; }   /* the release notes' contents: rules only, as the tables have */
nav.contents ul { list-style: none; margin: 0; padding: 0; }
nav.contents li { padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
nav.contents li span { display: block; color: var(--mute); font-size: 0.9375rem; }
/* The updates on a page: date, then the summary as the link. Subgrid keeps the dates one column wide. */
nav.entries ul { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; grid-template-columns: max-content 1fr;
                 column-gap: 16px; }
nav.entries li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline;
                 padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
nav.entries .when { color: var(--mute); font-size: 0.9375rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
nav.entries a { text-decoration: none; }
@media (hover: hover) { nav.entries a:hover { text-decoration: underline; } }
nav.entries .kind { display: inline-block; margin-right: 4px; padding: 0 7px; border: 1px solid #f2a33a;
                    border-radius: 999px; color: #f2a33a; font-size: 0.75rem; font-weight: 600; line-height: 1.6;
                    vertical-align: 1px; white-space: nowrap; }
/* App updates stand out in the list (Fred, 25 Nov). His pick of three: a gold bar down the left and a warm wash, as
   Finder's Way's skin levels have. The row reaches 10 px past the column each side, and its padding puts the text
   back in line with the other rows. */
nav.entries li.app { margin: 0 -10px; padding: 7px 10px; background: rgba(242, 163, 58, 0.10);
                     box-shadow: inset 3px 0 0 #f2a33a; }
/* Each update's heading stays at the top of the window while its notes scroll under it (Fred, 25 Nov). */
.update > h2 { position: sticky; top: 0; z-index: 2; margin-bottom: 0; padding: 10px 0 8px; background: var(--bg);
               border-bottom: 1px solid var(--line); }
.update > h2 + p.sub { margin-top: 8px; }
/* So a link that gets focus isn't left under the stuck heading. A jump to an update still puts it 1em from the top. */
html:has(.update > h2) { scroll-padding-top: 3.5rem; }
html:has(.update > h2) .update { scroll-margin-top: calc(1em - 3.5rem); }
/* lab.ksinfo.net (build.py's lab_site): violet links instead of blue, so a screenshot isn't taken for ksinfo.net,
   and the banner at the top of every page. */
.lab { --link: #c58af9; }
.lab-banner { margin: 0 0 12px; padding: 8px 12px; background: var(--card); border: 1.5px solid var(--link);
              border-radius: var(--r); font-size: 0.9375rem; }
