/* RCT-K's site (rctk.5310s.com): one stylesheet, no fonts or files from elsewhere. */
:root {
  --sky-top: #8fd0f0;
  --sky-low: #dff3fb;
  --grass: #4c9a3c;
  --grass-dark: #2f6e27;
  --track: #d23b2a;
  --track-dark: #9c2418;
  --sun: #f6c544;
  --wood: #8a5a2b;
  --paper: #fffdf7;
  --panel: #ffffff;
  --ink: #1e2a22;
  --muted: #56645a;
  --line: #d9e2d6;
  --link: #1f6fb2;
  --good: #2f8a3a;
  --bad: #b3261e;
  --chip: #eef5ea;
  --shadow: 0 1px 2px rgba(20, 40, 20, 0.08), 0 6px 18px rgba(20, 40, 20, 0.08);
  --radius: 10px;
  --accent: #9c2418;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sky-top: #0f2a44;
    --sky-low: #183c55;
    --grass: #3d7f31;
    --grass-dark: #275a20;
    --paper: #121815;
    --panel: #1a221d;
    --ink: #e8efe6;
    --muted: #a8b6aa;
    --line: #2d3a31;
    --link: #7cc0ff;
    --good: #6fcf7a;
    --bad: #ff8a80;
    --chip: #223027;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
    --accent: #ff9b8c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
code, kbd, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace; font-size: 0.92em; }
code { background: var(--chip); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; }
pre { background: var(--chip); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
p { margin: 0 0 14px; }
figure { margin: 0; }
h2 small { font-size: 0.85rem; font-weight: 400; margin-left: 6px; }
.spaced { margin-top: 32px; }
.wrap { width: min(1100px, 100%); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--panel); padding: 6px 10px; z-index: 10; }

/* ---- Top bar ---- */
.top { background: var(--grass-dark); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.02em; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); }

/* ---- The hero: sky, hills, a coaster ---- */
.hero { background: linear-gradient(var(--sky-top), var(--sky-low)); position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; padding-top: 48px; padding-bottom: 185px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin: 0 0 12px; }
.hero .lead { font-size: 1.15rem; color: var(--ink); max-width: 36em; }
.hero .art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 170px; z-index: 0; }
.hero.small .wrap { padding-top: 32px; padding-bottom: 135px; grid-template-columns: minmax(0, 1fr); }
.hero.small .art { height: 120px; }
.hero.small h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.shot { border-radius: var(--radius); box-shadow: var(--shadow); border: 3px solid #fff; display: block; image-rendering: auto; }
.shot-caption { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; background: var(--sun); color: #3b2a00; vertical-align: middle; }
.badge.test { background: #ffe1a8; }

/* ---- Buttons ---- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; font-weight: 700; text-decoration: none; border: 2px solid var(--accent); color: var(--accent); background: var(--panel); cursor: pointer; font-size: 1rem; font-family: inherit; }
.btn:hover { background: var(--chip); }
.btn.primary { background: var(--track); border-color: var(--track-dark); color: #fff; }
.btn.primary:hover { background: var(--track-dark); }
.btn[aria-disabled="true"] { background: #c9d1c6; border-color: #aab4a7; color: #46524a; cursor: default; }
.btn .soon { font-size: 0.75rem; font-weight: 700; background: rgba(0, 0, 0, 0.1); border-radius: 999px; padding: 1px 8px; }
.note { font-size: 0.9rem; color: var(--muted); }

/* ---- Sections ---- */
.section { padding: 44px 0; }
.section.alt { background: var(--chip); }
.section > .wrap > p.intro { color: var(--muted); max-width: 46em; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card h3 img { width: 30px; height: 30px; flex-shrink: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card ul { padding-left: 20px; margin: 0 0 12px; }
.two { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.live-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.live-head h3 { margin: 0; }
.updated { font-size: 0.8rem; color: var(--muted); }
.updated.error, .error { color: var(--bad); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td .sub { display: block; font-size: 0.82rem; color: var(--muted); }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.12em; font-weight: 700; }
.empty { color: var(--muted); padding: 14px 12px; margin: 0; }
.empty.error { color: var(--bad); }
.address { font-family: ui-monospace, Consolas, monospace; font-size: 0.88rem; overflow-wrap: anywhere; }
td .narrow-only { display: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: 1px; }
.chip { display: inline-block; border: 1px solid var(--line); background: var(--chip); border-radius: 999px; padding: 0 9px; font-size: 0.8rem; margin: 0 4px 4px 0; color: var(--muted); text-decoration: none; }
a.chip:hover { border-color: var(--link); color: var(--link); }

/* ---- Results ---- */
.results { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.match { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.match-name { font-weight: 700; overflow-wrap: anywhere; }
.match-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }
.podium { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 0.92rem; }
.podium li { display: flex; justify-content: space-between; gap: 12px; }
.podium .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.podium .num { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.podium li:first-child .who { font-weight: 700; }
.podium li:first-child .who::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sun); margin-right: 6px; vertical-align: 0; border: 1px solid #c79a1c; }

/* ---- Steps, facts ---- */
ol.steps { padding-left: 22px; margin: 0 0 14px; }
ol.steps li { margin-bottom: 6px; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0 0 14px; }
dl.facts dt { color: var(--muted); font-size: 0.9rem; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--panel); font-size: 0.9rem; }
.doc h2 { margin-top: 34px; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin-top: 22px; }
.doc ul { padding-left: 22px; }
.callout { border-left: 4px solid var(--sun); background: var(--panel); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 16px; }

/* ---- Workshop ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button, .filters button, .pager button { font: inherit; font-size: 0.92rem; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.tabs button.on { background: var(--grass-dark); border-color: var(--grass-dark); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters select, .filters input { font: inherit; font-size: 0.95rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-width: 0; }
.filters input { flex: 1 1 200px; }
.items { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
a.item { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; min-width: 0; }
a.item:hover { border-color: var(--link); }
.thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--chip); image-rendering: pixelated; }
.thumb.none { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; }
.item-body { display: block; padding: 10px 12px; }
.item-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.item-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.stars { color: #b07b00; white-space: nowrap; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); font-size: 0.9rem; }
.pager button:disabled { opacity: 0.4; cursor: default; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.page-title { font-size: 1.5rem; font-weight: 800; overflow-wrap: anywhere; }
.shots { margin: 12px 0; }
.shot-big { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); image-rendering: pixelated; }
.shot-strip { display: flex; gap: 6px; overflow-x: auto; margin-top: 6px; }
.shot-strip img { height: 64px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; image-rendering: pixelated; }
.shot-strip img.on { border-color: var(--link); }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Footer ---- */
.foot { background: var(--grass-dark); color: #e9f3e6; font-size: 0.88rem; padding: 26px 0 30px; margin-top: 0; }
.foot a { color: #fff; }
.foot .wrap { display: grid; gap: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot p { margin: 0; }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 32px; padding-bottom: 140px; }
  .hero .art { height: 130px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 34px 0; }
}
@media (max-width: 620px) {
  .wide-only { display: none; }
  td span.narrow-only { display: block; }
}
@media (max-width: 520px) {
  .nav a { padding: 4px 7px; font-size: 0.88rem; }
  th, td { padding: 8px 9px; }
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dd { margin-bottom: 6px; }
}
