/* Foundation */
:root {
  color-scheme: dark;
  --background: #101416;
  --surface: #1a2022;
  --surface-raised: #222a2c;
  --line: #384345;
  --text: #edf4f3;
  --muted: #b1c0be;
  --accent: #80cfc4;
  --accent-ink: #102724;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
::selection { color: var(--accent-ink); background: var(--accent); }
a { color: inherit; text-underline-offset: .22em; }
button { font: inherit; }
button, a, summary { touch-action: manipulation; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
.skip { position: absolute; top: -100px; left: 12px; z-index: 2; padding: 12px; background: var(--surface-raised); }
.skip:focus { top: 10px; }

/* Header and game navigation */
.site-header { background: #151b1d; border-bottom: 1px solid var(--line); }
.header-inner, .page { max-width: 1200px; margin: auto; }
.header-inner { min-height: 64px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.025em; text-decoration: none; }
.brand-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--accent-ink); background: var(--accent); font-size: 1rem; }
.brand-dot { color: var(--accent); }
.header-note { color: var(--muted); font-size: .85rem; }
.page { padding: 0 32px; }
.game-nav { border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-color: var(--line) transparent; }
.tabs button { position: relative; flex: 0 0 auto; min-height: 54px; padding: 0 16px; border: 0; background: transparent; color: var(--muted); font-weight: 650; cursor: pointer; }
.tabs button:first-child { padding-left: 0; }
.tabs button:hover, .tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.tab-short { margin-left: 4px; color: var(--muted); font-size: .8rem; font-weight: 400; }

/* Main content and builds */
.intro { padding: 28px 0 20px; }
h1 { margin-bottom: 4px; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -.035em; }
.lead { margin-bottom: 0; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.section-head h2, .sources-section h2 { margin-bottom: 3px; font-size: 1.15rem; letter-spacing: -.015em; }
.section-head p { margin: 0; color: var(--muted); font-size: .875rem; }
.build-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.build { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.build-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.build h3 { margin: 3px 0 0; font-size: 1.3rem; line-height: 1.2; overflow-wrap: anywhere; }
.category { margin: 6px 0 0; color: var(--muted); font-size: .8rem; font-weight: 400; }
.tag { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.creator { margin: 10px 0 16px; color: var(--muted); font-size: .82rem; }
details { border-top: 1px solid var(--line); }
summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: var(--accent); font-weight: 700; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: 0 0 8px; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 140ms ease-out; }
details[open] summary::after { transform: rotate(225deg); }
.attachments { display: grid; grid-template-columns: minmax(80px, .8fr) minmax(0, 1.2fr); gap: 0 12px; margin: 0 0 16px; font-size: .875rem; }
.attachments dt, .attachments dd { padding: 8px 0; border-top: 1px solid var(--line); }
.attachments dt { color: var(--muted); }
.attachments dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.tip, .variant { color: var(--muted); font-size: .875rem; }
.text-link, .primary-link { display: inline-flex; align-items: center; min-height: 48px; color: var(--accent); font-weight: 650; overflow-wrap: anywhere; }
.text-link:hover, .primary-link:hover { color: var(--text); }
.disclaimer { max-width: 85ch; margin: 16px 0 0; color: var(--muted); font-size: .85rem; }
.status { margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--text); font-size: .85rem; }
.status[data-state="stale"], .status[data-state="unknown"] { border-color: #bfa774; color: #f1dbaa; }

/* Sources, empty states, footer */
.sources-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sources-section p { color: var(--muted); font-size: .875rem; }
.source-heading { margin: 0 0 8px; font-size: .9rem; }
.source-list { margin: 0 0 14px; padding: 0; list-style: none; }
.source-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.source-list li span { color: var(--muted); font-size: .8rem; text-align: right; }
.source-list .text-link{min-height:48px}
.source-note { margin-bottom: 0; }
.empty { margin: 28px 0; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.empty .lead { max-width: 60ch; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 32px 0; color: var(--muted); font-size: .8rem; }
footer > span:first-child { color: var(--text); font-weight: 800; font-size: 1rem; }

@media (max-width: 850px) {
  .build-list { grid-template-columns: 1fr; }
  .sources-section { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 600px) {
  .header-inner, .page { padding-left: 16px; padding-right: 16px; }
  .header-inner { min-height: 56px; }
  .header-note { display: none; }
  .tabs button { min-height: 48px; padding: 0 12px; font-size: .875rem; white-space: nowrap; }
  .tab-short { display: none; }
  .intro { padding: 20px 0 16px; }
  .build { padding: 16px; }
  .sources-section, .empty { padding: 18px; }
  footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}