/* ============================================================
   Soft Modern Product UI
   Palette is cool and desaturated so the one accent, and the
   colour that comes out of the sorter, are the only saturated
   things on the page.
   ============================================================ */

:root {
  --bg:          #eaeff5;
  --surface:     #ffffff;
  --surface-2:   #f5f8fc;
  --surface-3:   #eef3f9;
  --ink:         #101720;
  --ink-2:       #384759;
  --muted:       #64758a;
  --line:        #dfe6ef;
  --line-strong: #c9d4e1;

  --accent:      #3b5bdb;
  --accent-dark: #2c46b8;
  --accent-soft: #eef1fe;
  --accent-ring: rgba(59, 91, 219, .28);

  --warn:        #b45309;
  --warn-soft:   #fef4e7;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --e-1: 0 1px 2px rgba(16, 23, 32, .05);
  --e-2: 0 1px 2px rgba(16, 23, 32, .05), 0 10px 24px -14px rgba(16, 23, 32, .30);
  --e-3: 0 2px 4px rgba(16, 23, 32, .06), 0 26px 50px -26px rgba(16, 23, 32, .40);

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --page: 1120px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* Author `display` rules beat the UA stylesheet's [hidden] rule regardless of
   specificity, so `img { display: block }` above would un-hide every element
   carrying the hidden attribute. This puts it back. */
[hidden] { display: none !important; }


a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

code { font-family: var(--mono); font-size: .875em; }

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

/* ---------- Top bar ---------- */

.topbar {
  max-width: var(--page);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar--floating {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 640;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark__mark {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: linear-gradient(160deg, var(--accent) 0%, #7a4bdb 55%, #d94b8f 100%);
  box-shadow: var(--e-1);
}

.topbar--floating .wordmark,
.topbar--floating .topbar__mail { color: #fff; }

.topbar--floating .wordmark__text {
  text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}

.topbar__mail {
  font-size: .9rem;
  font-weight: 560;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .30);
  backdrop-filter: blur(8px);
  transition: background .2s var(--ease);
}
.topbar__mail:hover { background: rgba(255, 255, 255, .28); color: #fff; }

.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a {
  font-size: .92rem;
  font-weight: 520;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.topnav a:hover { background: var(--surface); color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(74vh, 620px);
  display: flex;
  align-items: flex-end;
  padding: 120px 24px 64px;
  overflow: hidden;
  border-bottom-left-radius: var(--r-xl);
  border-bottom-right-radius: var(--r-xl);
}

.hero__scenery { position: absolute; inset: 0; z-index: -1; }
.hero__scenery img { width: 100%; height: 100%; object-fit: cover; }

.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(9, 14, 22, .82) 0%, rgba(9, 14, 22, .34) 46%, rgba(9, 14, 22, .12) 100%);
}

.hero__inner {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  color: #fff;
}

.hero__eyebrow {
  margin: 0 0 14px;
  font-size: .8rem;
  font-weight: 580;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .74);
}

.hero__name {
  margin: 0;
  font-size: clamp(2.9rem, 9vw, 6.2rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: .96;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .38);
}

.hero__blurb {
  max-width: 46ch;
  margin: 20px 0 26px;
  font-size: 1.06rem;
  color: rgba(255, 255, 255, .87);
}

/* Signature: a strip of colour that sorts itself once, on load. */
.spectrum {
  display: flex;
  gap: 2px;
  height: 12px;
  margin: 22px 0 0;
  max-width: 560px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 18px rgba(0, 0, 0, .30);
}
.spectrum span {
  flex: 1 1 auto;
  background: var(--from);
  transition: background-color 620ms var(--ease);
}
.spectrum.is-sorted span { background: var(--to); }

@media (prefers-reduced-motion: reduce) {
  .spectrum span { transition: none; }
}

/* ---------- Link cluster ---------- */

.linkcluster {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 19px 11px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .26);
  backdrop-filter: blur(10px);
  color: #fff;
  font-weight: 560;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .24);
  border-color: rgba(255, 255, 255, .48);
  color: #fff;
}
.chip:active { transform: translateY(0); }

.chip__glyph {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .20);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .chip, .chip:hover { transform: none; }
}

/* ---------- Studio (portrait + controls) ---------- */

.studio {
  max-width: var(--page);
  margin: 0 auto;
  padding: 72px 24px 24px;
}

.studio__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 26px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-2);
}

.card--portrait { padding: 14px; }

.card__frame {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
}

.portrait { position: relative; aspect-ratio: 4 / 5; }
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.portrait__result {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 420ms var(--ease);
}
.portrait__result.is-visible { opacity: 1; }

.portrait__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(245, 248, 252, .84);
  backdrop-filter: blur(3px);
  font-size: .9rem;
  font-weight: 540;
  color: var(--ink-2);
}
.portrait__veil p { margin: 0; }

.spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.card__foot {
  display: flex;
  gap: 10px;
  padding: 14px 4px 4px;
}

.card--controls { padding: 26px 26px 22px; }

.card__head h2 {
  margin: 0 0 6px;
  font-size: 1.22rem;
  font-weight: 640;
  letter-spacing: -0.022em;
}
.card__head p { margin: 0 0 22px; color: var(--muted); font-size: .95rem; }

.card__note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
}

/* ---------- Form controls ---------- */

.field { margin-bottom: 22px; }

.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: .9rem;
  font-weight: 580;
  margin-bottom: 10px;
}

.field__value {
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 7px;
}

.field__hint { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  outline-offset: 6px;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  box-shadow: var(--e-1);
  cursor: grab;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.slider::-webkit-slider-thumb:hover { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-ring); }
.slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  box-shadow: var(--e-1);
  cursor: grab;
}
.slider::-moz-range-thumb:hover { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-ring); }

.select { position: relative; }
.select::after {
  content: "";
  position: absolute;
  right: 15px; top: 50%;
  width: 8px; height: 8px;
  margin-top: -6px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.select select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 12px 40px 12px 14px;
  font: inherit;
  font-size: .93rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.select select:hover { border-color: var(--line-strong); }
.select select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); outline: none; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font: inherit;
  font-size: .95rem;
  font-weight: 580;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .16s var(--ease), background .18s var(--ease),
              box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 23, 32, .12), 0 8px 18px -10px var(--accent);
}
.btn--primary:hover:not([disabled]) { background: var(--accent-dark); color: #fff; }

.btn--ghost {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink-2);
}
.btn--ghost:hover:not([disabled]) { background: var(--surface-3); border-color: var(--line-strong); color: var(--ink); }

@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }

/* ---------- Readout ---------- */

.readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  padding: 13px 15px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.readout__label {
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 620;
  color: var(--muted);
}
.readout code { flex: 1 1 100%; font-size: .8rem; color: var(--ink-2); word-break: break-all; }
.readout__meta { font-size: .78rem; color: var(--muted); }

/* ---------- Strip / CTA band ---------- */

.strip {
  max-width: var(--page);
  margin: 26px auto 0;
  padding: 0 24px;
}
.strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 32px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 160% at 100% 0%, #e7ecfb 0%, var(--surface-2) 58%);
  border: 1px solid var(--line);
  box-shadow: var(--e-1);
}
.strip__title { margin: 0 0 6px; font-size: 1.2rem; font-weight: 640; letter-spacing: -0.02em; }
.strip__body { margin: 0; max-width: 58ch; color: var(--muted); font-size: .95rem; }

/* ---------- Interior sheets ---------- */

.sheet {
  max-width: 780px;
  margin: 8px auto 0;
  padding: 0 24px 40px;
}
.sheet--wide { max-width: var(--page); }

.sheet__head { margin-bottom: 30px; }
.sheet__head h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.035em; }
.sheet__head p { margin: 0; color: var(--muted); }

.sheet__actions { display: flex; gap: 10px; margin-bottom: 18px; justify-content: flex-end; }

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-2);
  padding: clamp(28px, 5vw, 54px);
}
.prose h1 { margin: 0 0 4px; font-size: 2.1rem; font-weight: 700; letter-spacing: -0.035em; }
.prose h2 {
  margin: 38px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 660;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.prose h3 { margin: 22px 0 2px; font-size: 1.02rem; font-weight: 620; letter-spacing: -0.015em; }
.prose h3 + p { margin-top: 0; color: var(--muted); font-size: .9rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose a { font-weight: 520; }

/* ---------- Cards grid (projects) ---------- */

.cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.card--project {
  position: relative;
  display: block;
  padding: 26px;
  color: inherit;
  text-decoration: none;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card--project:hover {
  transform: translateY(-3px);
  box-shadow: var(--e-3);
  border-color: var(--line-strong);
  color: inherit;
}
@media (prefers-reduced-motion: reduce) { .card--project:hover { transform: none; } }

.card__title { margin: 12px 0 4px; font-size: 1.18rem; font-weight: 640; letter-spacing: -0.022em; }
.card__tagline { margin: 0 0 12px; font-size: .9rem; color: var(--accent-dark); font-weight: 520; }
.card__body { margin: 0 0 16px; font-size: .93rem; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 640;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.badge--live { background: #e6f6ec; color: #1a7f45; }

.taglist { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; }
.taglist li {
  font-size: .74rem;
  font-weight: 540;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--muted);
}

.card__cta { font-size: .9rem; font-weight: 580; color: var(--accent); }

.card--placeholder {
  padding: 26px;
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}
.card--placeholder .card__title { margin-top: 0; color: var(--muted); }

/* ---------- Stats ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--e-1);
}
.tile__value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; }
.tile__value--small { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; padding-top: 10px; }
.tile__label { font-size: .78rem; font-weight: 560; letter-spacing: .04em; color: var(--muted); }

.tablewrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-2);
  overflow-x: auto;
}

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left;
  padding: 15px 20px;
  font-size: .72rem;
  font-weight: 640;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 14px 20px; border-bottom: 1px solid var(--surface-3); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; }
.mono { font-family: var(--mono); font-size: .85rem; }
.muted { color: var(--muted); }

.count {
  display: inline-block;
  min-width: 30px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 620;
  text-align: center;
}

.empty, .notice {
  padding: 22px 24px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.empty p { margin: 0 0 4px; }
.empty p:last-child { margin: 0; }
.notice { margin-bottom: 20px; font-size: .92rem; }
.notice--warn { background: var(--warn-soft); border-color: #f3dcbb; color: var(--warn); }

/* ---------- Footer ---------- */

.footer {
  max-width: var(--page);
  margin: 60px auto 0;
  padding: 26px 24px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .87rem;
  color: var(--muted);
}
.footer p { margin: 0; }
.footer__links { display: flex; gap: 10px; align-items: center; }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .studio__grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 104px; }
}

@media (max-width: 560px) {
  .chip { padding: 9px 15px 9px 10px; font-size: .88rem; }
  .studio { padding-top: 44px; }
  .card--controls { padding: 22px 20px 18px; }
  .sheet__actions { justify-content: flex-start; }
}

@media print {
  .topbar, .footer, .sheet__actions, .notice { display: none !important; }
  body { background: #fff; }
  .prose { border: 0; box-shadow: none; padding: 0; }
}

/* ============================================================
   Unity game pages
   Same soft-UI shell as the rest of the site, but the canvas
   sits on a dark stage: a game wants its surround to recede,
   and a light grey frame around a lit canvas reads as a bug.
   ============================================================ */

.gamehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.gamehead__title {
  margin: 0 0 6px;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.gamehead__tagline { margin: 0; color: var(--muted); font-size: 1.02rem; }
.gamehead__meta { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.pill--quiet { background: var(--surface-3); color: var(--muted); }

.stage {
  background: var(--stage-bg, #0d1524);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--e-3);
  overflow: hidden;
}

.stage__frame {
  position: relative;
  width: 100%;
  background: var(--stage-bg, #0d1524);
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* Unity's own canvas is injected here; force it to fill rather than sit at its
   authored pixel size, which would letterbox oddly on high-DPI screens. */
.stage__canvas,
.stage__canvas canvas,
#unity-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: var(--stage-bg, #0d1524);
}
.stage__canvas { position: absolute; inset: 0; }

.stage__overlay,
.stage__loading,
.stage__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: color-mix(in srgb, var(--stage-bg, #0d1524) 88%, transparent);
  z-index: 2;
}
.stage__panel { display: grid; justify-items: center; gap: 14px; }

.stage__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 620;
  letter-spacing: -0.015em;
  color: #fff;
}
.stage__hint {
  margin: 0;
  max-width: 42ch;
  font-size: .84rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .68);
}

.bar {
  width: min(280px, 60vw);
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width .25s var(--ease);
}

.stage__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.stage__dims { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.btn--tight { padding: 8px 15px; font-size: .87rem; }

.gameinfo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 26px;
}
.gameinfo__block {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--e-1);
}
.gameinfo__block h2 {
  margin: 0 0 10px;
  font-size: .78rem;
  font-weight: 660;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.gameinfo__block p { margin: 0; color: var(--ink-2); font-size: .94rem; }

.controls { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.controls dt {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
  justify-self: start;
}
.controls dd { margin: 0; font-size: .9rem; color: var(--ink-2); }

.gamefoot { margin-top: 24px; font-size: .87rem; color: var(--muted); }

.gamegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.card--game { position: relative; display: block; padding: 0; overflow: hidden;
              color: inherit; text-decoration: none;
              transition: transform .22s var(--ease), box-shadow .22s var(--ease); }
.card--game:hover { transform: translateY(-3px); box-shadow: var(--e-3); color: inherit; }
@media (prefers-reduced-motion: reduce) { .card--game:hover { transform: none; } }
.card__cover { aspect-ratio: 16 / 10; background: #0d1524; display: grid; place-items: center; }
.card__cover img { width: 100%; height: 100%; object-fit: cover; }
.card__cover span { font-family: var(--mono); font-size: .74rem; color: rgba(255,255,255,.45); }
.card--game .card__inner { padding: 20px 22px 22px; }

@media (max-width: 640px) {
  .gamehead { flex-direction: column; align-items: flex-start; }
}

.badge--warn, .badge--setup { background: var(--warn-soft); color: var(--warn); }

/* Build diagnostics on a game page that won't start. */
.audit { display: grid; gap: 14px; margin-top: 18px; }
.audit__block {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.audit__block--hint { background: var(--warn-soft); border-color: #f3dcbb; color: var(--warn); }
.audit__block--hint p { margin: 0; font-size: .92rem; }
.audit h2 {
  margin: 0 0 10px;
  font-size: .76rem;
  font-weight: 660;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.audit__note { margin: 10px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.6; }
.audit__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.audit__cols > div {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.filelist { margin: 0; padding: 0; list-style: none; }
.filelist li {
  font-family: var(--mono);
  font-size: .8rem;
  padding: 4px 0;
  color: var(--ink-2);
  word-break: break-all;
}
.filelist--bad li, .filelist li.is-bad { color: #b3261e; }
.filelist li.is-bad::before { content: "\2717  "; }
.filelist li.is-ok::before { content: "\2713  "; color: #1a7f45; }

.fixcmd {
  margin: 12px 0 0;
  padding: 13px 15px;
  background: #0d1524;
  border-radius: var(--r-sm);
  overflow-x: auto;
}
.fixcmd code {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.8;
  color: #b8ff3d;
  white-space: pre;
}
.filelist li.is-renamed { color: var(--warn); }
/* A word, not a glyph: the arrow character silently fell back to nothing in at
   least one browser, which made a renamed row look identical to a healthy one. */
.filelist li.is-renamed::before { content: "!  "; font-weight: 700; }
.filelist li.is-renamed em {
  font-style: normal;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
}

/* Breadcrumb for pages that now sit one level below /projects. */
.crumb {
  margin: 0 0 8px;
  font-size: .82rem;
  font-weight: 560;
  letter-spacing: .02em;
  color: var(--muted);
}
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb span { margin: 0 4px; opacity: .5; }

/* Shown only on devices without a precise pointer. These builds predate touch
   input entirely, so on a phone they load and then cannot be played — better to
   say so before the download than after it. Pure CSS so there is no flash of
   the wrong state while JS boots. */
.needs-desktop { display: none; }
@media (hover: none) and (pointer: coarse) {
  .needs-desktop {
    display: block;
    margin: 0 0 20px;
    padding: 14px 16px;
    background: var(--warn-soft);
    border: 1px solid #f3dcbb;
    border-radius: var(--r-md);
    color: var(--warn);
    font-size: .9rem;
    line-height: 1.6;
  }
}
