/* Quasarball: quasarball.com
   Palette: the game's own UiKit colours (ui/ui_kit.gd) and the brick and ball
   colours measured out of the original sprite sheet for icon.svg. */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/OpenSans-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  /* UiKit */
  --bg: #0b0d14;
  --field: #121428;
  --field-violet: #241a44;
  --panel: #151926;
  --panel-2: #1b2033;
  --text: #e8eaf2;
  --muted: #a3a9bd;
  --accent: #b040f0;
  --accent-2: #ee70b1;
  --hilite: #ffad00;
  /* bricks: face / lit */
  --blue: #3274b8;   --blue-lit: #70b0ee;
  --green: #9ac53d;  --green-lit: #d0f080;
  --pink: #aa2e74;   --pink-lit: #ee70b1;
  --purple: #8a20cc; --purple-lit: #c77af5;
  /* ball */
  --ball-1: #fff956; --ball-2: #ffcb00; --ball-3: #ff8900; --ball-4: #ff6600;

  --line: rgba(176, 64, 240, 0.22);
  --line-soft: rgba(232, 234, 242, 0.08);
  --radius: 14px;
  --radius-lg: 20px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
img, svg, picture { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--blue-lit); text-underline-offset: 3px; }
a:hover { color: var(--ball-1); }
code { font-family: var(--mono); font-size: 0.88em; }
strong { font-weight: 700; color: #fff; }

:focus-visible {
  outline: 3px solid var(--ball-1);
  outline-offset: 3px;
  border-radius: 6px;
}

.container { width: 100%; max-width: 1248px; margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--ball-1); color: var(--bg); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 10px 22px;
  border: 0; border-radius: 999px;
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn--primary {
  color: #120a00;
  background: linear-gradient(180deg, var(--ball-1) 0%, var(--ball-2) 45%, var(--ball-3) 100%);
  box-shadow: 0 0 0 1px rgba(255, 173, 0, 0.5), 0 8px 28px -8px rgba(255, 137, 0, 0.7);
}
.btn--primary:hover { color: #120a00; transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 0 0 1px rgba(255, 203, 0, 0.8), 0 12px 36px -8px rgba(255, 137, 0, 0.85); }
.btn--primary:active { transform: translateY(0); }
.btn--small { min-height: 38px; padding: 7px 16px; font-size: 0.9rem; }
.btn--large { min-height: 60px; padding: 14px 34px; font-size: 1.2rem; }
.btn__icon { width: 22px; height: 22px; flex: none; }
@media (max-width: 480px) { .btn--large { min-height: 56px; padding: 12px 26px; font-size: 1.1rem; } }
.btn[aria-disabled="true"] {
  color: var(--muted); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-soft);
  cursor: not-allowed; transform: none; filter: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 20, 0.78);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: 0.02em; }
.brand img { border-radius: 8px; }
.brand:hover { color: #fff; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 0.95rem; font-weight: 600; text-decoration: none; }
.site-nav a:hover { color: var(--text); background: var(--line-soft); }
@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-header__inner > .btn { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(48px, 8vw, 96px) clamp(48px, 7vw, 88px);
  background:
    radial-gradient(60% 50% at 50% 12%, rgba(176, 64, 240, 0.28), transparent 70%),
    radial-gradient(40% 35% at 18% 38%, rgba(50, 116, 184, 0.22), transparent 70%),
    radial-gradient(40% 35% at 82% 40%, rgba(238, 112, 177, 0.16), transparent 70%),
    linear-gradient(180deg, var(--field-violet) 0%, var(--field) 42%, var(--bg) 100%);
}
.hero::before { /* star field */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 8% 14%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 23% 62%, #fffcaa 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 37% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 9%, #70b0ee 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 48%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 18%, #ee70b1 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 71%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 83%, #d0f080 50%, transparent 51%),
    radial-gradient(1px 1px at 14% 88%, #fff 50%, transparent 51%);
  background-size: 520px 520px;
}
.hero > * { position: relative; }
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero__mark {
  width: clamp(84px, 11vw, 112px); height: auto; margin-bottom: 18px;
  filter: drop-shadow(0 0 32px rgba(255, 173, 0, 0.35)) drop-shadow(0 0 60px rgba(176, 64, 240, 0.35));
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse {
  50% { filter: drop-shadow(0 0 44px rgba(255, 173, 0, 0.5)) drop-shadow(0 0 80px rgba(176, 64, 240, 0.45)); }
}
.hero__title {
  font-size: clamp(2.9rem, 9vw, 5.6rem); font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent-2);
  background: linear-gradient(180deg, #ffd1e8 0%, var(--accent-2) 55%, #d25aa0 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 24px rgba(238, 112, 177, 0.35));
}
.hero__pitch { max-width: 50ch; margin: 18px 0 30px; font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: #d4d8e6; }
.hero__pitch strong { color: #fff; }
.hero__cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero__meta { margin: 2px 0 0; font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hero__note {
  max-width: 44ch; margin: 4px 0 0; padding: 10px 14px; border-radius: 10px;
  font-size: 0.9rem; color: #f3e4c8; background: rgba(255, 173, 0, 0.08); border: 1px solid rgba(255, 173, 0, 0.3);
}
.hero__others { margin: 4px 0 0; font-size: 0.95rem; color: var(--muted); }
.hero__shot { margin: clamp(40px, 6vw, 64px) 0 0; }

.frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(176, 64, 240, 0.35), 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 120px -30px rgba(176, 64, 240, 0.55);
}
.frame img { width: 100%; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 7vw, 96px); }
.section--alt {
  background: linear-gradient(180deg, rgba(21, 25, 38, 0.65), rgba(21, 25, 38, 0.3));
  border-block: 1px solid var(--line-soft);
}
.section__head { max-width: 720px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.section__head h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }
.section__lede { margin: 16px 0 0; color: var(--muted); font-size: 1.1rem; }
.fine { margin: 24px auto 0; max-width: 72ch; text-align: center; font-size: 0.9rem; color: var(--muted); }

/* ---------- Presentations ---------- */
.duo { display: grid; gap: clamp(20px, 3vw, 32px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.duo__card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--panel);
  box-shadow: 0 0 0 1px var(--line-soft), 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}
.duo__card picture { border-bottom: 1px solid var(--line-soft); }
/* Captures come in 16:9 and 1.59:1. A shared 16:9 frame keeps cards and
   thumbnails level; `contain` never crops a HUD edge, and the narrower older
   captures sit on the game's own background colour. */
.duo__card img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--bg); }
.duo__body { padding: clamp(20px, 3vw, 32px); }
.duo__body h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; font-size: 1.75rem; font-weight: 800; }
.duo__body h3 span { font-size: 0.95rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.duo__card--modern { box-shadow: 0 0 0 1px rgba(112, 176, 238, 0.28), 0 24px 60px -30px rgba(0, 0, 0, 0.9); }
.duo__card--modern h3 { color: var(--blue-lit); }
.duo__card--classic { box-shadow: 0 0 0 1px rgba(208, 240, 128, 0.22), 0 24px 60px -30px rgba(0, 0, 0, 0.9); }
.duo__card--classic h3 { color: var(--green-lit); }

.ticks { margin: 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 26px; margin-top: 8px; color: #d4d8e6; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em; width: 12px; height: 7px;
  border-radius: 2px; background: currentColor;
}
.duo__card--modern .ticks li::before { background: linear-gradient(180deg, var(--blue-lit) 0 35%, var(--blue) 35%); }
.duo__card--classic .ticks li::before { background: linear-gradient(180deg, var(--green-lit) 0 35%, var(--green) 35%); }

/* ---------- Features ---------- */
.pieces {
  display: grid; grid-template-columns: repeat(7, auto); justify-content: center; gap: clamp(8px, 1.4vw, 16px);
  margin: 0 auto clamp(32px, 5vw, 48px);
}
@media (min-width: 1000px) { .pieces { grid-template-columns: repeat(14, auto); } }
.pieces img { width: clamp(44px, 6vw, 64px); height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); }

.features { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feature {
  position: relative; padding: 26px 24px 22px; border-radius: var(--radius);
  background: var(--panel); box-shadow: 0 0 0 1px var(--line-soft);
}
.feature::before { /* a brick along the top edge */
  content: ""; position: absolute; left: 24px; top: 0; width: 44px; height: 6px; border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, var(--lit) 0 40%, var(--face) 40%);
}
.feature h3 { margin-bottom: 10px; font-size: 1.2rem; font-weight: 700; }
.feature p { margin: 0; color: var(--muted); }
.feature em { font-style: normal; font-weight: 600; color: var(--text); }
.feature--blue   { --face: var(--blue);   --lit: var(--blue-lit); }
.feature--green  { --face: var(--green);  --lit: var(--green-lit); }
.feature--pink   { --face: var(--pink);   --lit: var(--pink-lit); }
.feature--purple { --face: var(--purple); --lit: var(--purple-lit); }
.feature--orange { --face: var(--ball-4); --lit: var(--ball-2); }

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: clamp(10px, 1.6vw, 18px); margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 960px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.shot {
  display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: var(--panel); cursor: zoom-in;
  box-shadow: 0 0 0 1px var(--line-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--bg); transition: transform 0.35s ease; }
.shot:hover, .shot:focus-visible { box-shadow: 0 0 0 2px var(--accent), 0 16px 40px -16px rgba(176, 64, 240, 0.6); }
.shot:hover img { transform: scale(1.03); }
.shot:focus-visible { outline-offset: 4px; }

.lightbox {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--text); overflow: hidden;
}
.lightbox::backdrop { background: rgba(5, 6, 12, 0.92); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox__figure { margin: 0; padding: 56px 72px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.lightbox__figure img { max-width: min(1600px, 100%); max-height: calc(100vh - 200px); width: auto; border-radius: 10px; box-shadow: 0 0 0 1px rgba(176, 64, 240, 0.35); }
.lightbox figcaption { max-width: 80ch; text-align: center; color: #d4d8e6; font-size: 0.98rem; }
.lightbox__count { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lightbox__btn {
  position: fixed; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  color: var(--text); background: rgba(27, 32, 51, 0.9); box-shadow: 0 0 0 1px var(--line);
}
.lightbox__btn svg { width: 24px; height: 24px; }
.lightbox__btn:hover { background: var(--accent); color: #fff; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox__figure { padding: 72px 12px 88px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; transform: none; }
  .lightbox__prev { left: calc(50% - 60px); }
  .lightbox__next { right: calc(50% - 60px); }
}

/* ---------- Requirements ---------- */
.reqs { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.req { padding: 24px; border-radius: var(--radius); background: var(--panel); box-shadow: 0 0 0 1px var(--line-soft); }
.req h3 { margin-bottom: 14px; font-size: 1.3rem; font-weight: 800; }
.req dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.req dt { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 0.2em; }
.req dd { margin: 0; color: #d4d8e6; }

/* ---------- Downloads ---------- */
.downloads { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.dl {
  display: flex; flex-direction: column; gap: 12px; padding: 26px 24px;
  border-radius: var(--radius-lg); background: var(--panel);
  box-shadow: 0 0 0 1px var(--line-soft);
  transition: box-shadow 0.2s ease;
}
.dl.is-detected { box-shadow: 0 0 0 2px rgba(255, 173, 0, 0.7), 0 20px 50px -24px rgba(255, 137, 0, 0.55); }
.dl h3 { font-size: 1.5rem; font-weight: 800; }
.dl__file { margin: 0; font-family: var(--mono); font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }
.dl__size { color: var(--text); white-space: nowrap; }
.dl__btn { align-self: stretch; }
.dl__note { margin: 0; font-size: 0.92rem; color: var(--muted); }
.dl__note code { color: var(--text); }
.dl__sum { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.dl__exact { display: grid; gap: 2px; margin: 0 0 12px; }
.dl__bytes { font-family: var(--mono); font-size: 0.82rem; color: #cdd2e0; font-variant-numeric: tabular-nums; }
.dl__sha { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.dl__sum-label { grid-column: 1 / -1; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dl__sum code { font-size: 0.78rem; line-height: 1.45; color: #cdd2e0; overflow-wrap: anywhere; word-break: break-all; }
.copy {
  min-height: 36px; padding: 6px 12px; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
}
.copy:hover { background: var(--accent); color: #fff; }

.verify { max-width: 760px; margin: 28px auto 0; padding: 14px 18px; border-radius: 12px; background: rgba(21, 25, 38, 0.6); box-shadow: 0 0 0 1px var(--line-soft); color: var(--muted); }
.verify summary { cursor: pointer; font-weight: 600; color: var(--text); }
.verify ul { margin: 12px 0 0; padding-left: 20px; }
.verify li { margin-top: 6px; }
.verify code { color: var(--text); overflow-wrap: anywhere; }

/* ---------- Credits ---------- */
.credits__grid { display: grid; gap: 20px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); max-width: 1040px; margin-inline: auto; }
@media (min-width: 900px) { .credits__grid { grid-template-columns: 2fr 3fr; } }
.credits__grid > div { padding: 26px 24px 12px; border-radius: var(--radius); background: var(--panel); box-shadow: 0 0 0 1px var(--line-soft); }
.credits h3 { margin-bottom: 12px; font-size: 1.2rem; font-weight: 700; }
.credits p { color: #c9cedd; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 36px; border-top: 1px solid var(--line-soft); background: var(--bg); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.site-footer nav { margin-left: auto; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
.site-footer nav a { color: var(--muted); font-size: 0.92rem; }
.site-footer nav a:hover { color: var(--text); }
.site-footer__copy { width: 100%; margin: 0; font-size: 0.88rem; color: var(--muted); }
@media (max-width: 640px) { .site-footer nav { margin-left: 0; } }

/* ---------- Status pages (404, download unavailable) ---------- */
.status-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding-block: 48px; padding-inline: var(--gutter); text-align: center;
  background: radial-gradient(60% 50% at 50% 30%, rgba(176, 64, 240, 0.25), transparent 70%), linear-gradient(180deg, var(--field-violet), var(--bg));
}
.status-page img { width: 96px; margin-bottom: 12px; }
.status-page h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; }
.status-page p { max-width: 44ch; color: var(--muted); }
.status-page .btn { margin-top: 12px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .shot:hover img, .btn--primary:hover { transform: none; }
}
