/* PixelRift marketing site.
   Palette is sampled from the Steam key art: crimson backdrop, molten
   orange lava, gold title text, charcoal stone. */

:root {
  /* Fixed regardless of theme: these live on dark surfaces (the hero
     banner, coloured buttons, the lightbox) where they read the same
     either way. */
  --lava:      #ff6a1f;
  --ember:     #f08030;
  --gold:      #ffd23f;
  --stone:     #7a7a85;

  /* Dark is the fallback, so it lives on :root. That way a visitor
     with no JS, where nothing can set data-theme, still gets dark
     rather than the other one by accident. */
  --ink:       #140c0c;
  --ink-2:     #1e1413;
  --ink-3:     #2a1c1a;
  --text:      #f3e7e2;
  --text-dim:  #b9a39d;
  --line:      rgba(255, 210, 63, .18);
  /* On a dark page the gold needs no substitute. */
  --accent:    var(--gold);
  --hero-bg:   #120c0a;
  --scanline:  rgba(0, 0, 0, .22);
  --chip-bg:   rgba(255, 255, 255, .06);
  /* Tells the browser to draw the scrollbars and any form control in
     its dark styling, which it will not infer from these variables. */
  color-scheme: dark;

  /* One typeface everywhere. The two names are kept because the
     rules below use them to mean "heading voice" and "body
     voice", which is still a distinction worth having even when
     both resolve to the same family. */
  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --body:  "Pixelify Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 980px;
  /* Barely-there rounding. Pill shapes and 10px radii are what make a
     page read as a modern template; the art is pixel art, so the
     chrome should have corners too. */
  --r: 2px;
}

:root[data-theme="light"] {
  --ink:       #f6f1e8;
  --ink-2:     #ebe3d6;
  --ink-3:     #ded3c2;
  --text:      #231b16;
  --text-dim:  #5d5349;
  --line:      rgba(60, 40, 20, .22);
  /* No gold on light: headings, rules and borders are simply black.
     Amber passed contrast but read as a theme colour applied for its
     own sake. */
  --accent:    #1a1410;
  --hero-bg:   #efe7da;
  /* Barely there: full-strength stripes read as grey bars on a light
     panel rather than as texture. */
  --scanline:  rgba(60, 40, 20, .06);
  --chip-bg:   rgba(0, 0, 0, .05);
  color-scheme: light;
}

/* No hard shadows on light. The 0-blur offset block is depth on a dark
   page and a dirty smear under cream, so every element that carries one
   drops it here. Borders already define these edges, and the buttons
   still move on :active, into nothing instead of into a shadow. */
:root[data-theme="light"] .keyart img,
:root[data-theme="light"] .btn,
:root[data-theme="light"] .btn:active,
:root[data-theme="light"] .theme-btn,
:root[data-theme="light"] .theme-btn:active { box-shadow: none; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }

/* Form controls do not inherit the page's typeface: a browser hands
   them its own UI font unless told otherwise. Without this a <button
   class="btn"> came out in Segoe UI while an <a class="btn"> beside it
   came out in Pixelify Sans, which is one button in two fonts. */
button, input, select, textarea { font-family: inherit; }

/* Underlined on light because the accent is now the text colour: with
   no hue to set them apart, the underline is what says "link". The
   dark theme keeps gold links, which already stand out.
   Only prose links. A button already looks like one, and this selector
   outranks .btn's own text-decoration, so it has to exclude them here
   rather than let them fight. */
:root[data-theme="light"] a:not(.btn):not(.brand) { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--gold); color: var(--ink);
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

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

/* ───────────────────────────── Nav ───────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink-2);
  border-bottom: 3px solid var(--accent);
}
.nav-in { display: flex; align-items: center; gap: 24px; height: 68px; }
/* The brand is two images: the logo mark, then the wordmark. */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img {
  /* The wordmark art carries transparent padding of its own (the
     lettering is 86px of a 125px canvas), so it is set a little taller
     than the old capsule to land on the same visual height in the bar.
     No rounding: there is no box to round, just the letters. */
  height: 46px; width: auto;
  image-rendering: pixelated;
}
/* The mark is a square with its artwork running to the edges, so at the
   wordmark's 46px it would tower over the lettering. Sized down to sit
   level with it. */
.brand-mark { height: 38px; }
/* Below this the bar gets crowded, and the mark on its own still says
   PixelRift. */
@media (max-width: 460px) {
  .brand-word { display: none; }
}
.nav-panel { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-links { display: flex; gap: 22px; }
/* Shown only on phones; the panel lives in the bar above that. */
.menu-btn { display: none; }
.nav-links a {
  color: var(--text-dim); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: var(--accent); }

/* ──────────────────────────── Hero ───────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 84px 0 72px; }
.hero-art {
  position: absolute; inset: 0;
  /* Follows the theme like every other section. The logo art carries
     its own black outline, so it reads on a light background as well
     as a dark one. */
  background: var(--hero-bg);
  border-bottom: 4px solid var(--accent);
}
/* Scanline overlay: keeps the retro feel without a background image. */
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    180deg, var(--scanline) 0 2px, transparent 2px 4px);
  opacity: .5;
}
.hero-in { position: relative; text-align: center; }

.title { margin: 0 0 20px; }
.title img {
  /* Capped at its own 473px so it is never scaled up past its pixels,
     and pixelated on the way down so it degrades like the art it is
     rather than going soft. */
  width: 100%;
  max-width: 473px;
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
}
.tagline {
  font-size: 18px;
  color: var(--text); max-width: 620px;
  margin: 0 auto 26px;
}

.badges {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 34px;
}
.badge {
  font-family: var(--pixel); font-size: 9px;
  padding: 7px 11px; border-radius: 0;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.badge-hot {
  background: rgba(255, 106, 31, .18);
  border-color: rgba(255, 106, 31, .55);
  color: var(--ember);
}

.keyart { margin: 48px auto 0; max-width: 700px; }
.keyart img {
  width: 100%;
  image-rendering: pixelated;
  border: 3px solid var(--accent);
  border-radius: 0;
  /* Hard offset, the way a drop shadow was done before blur was free. */
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .55);
}

/* ─────────────────────────── Buttons ─────────────────────────── */
.cta, .links {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
}
.links { flex-direction: column; align-items: stretch; }

.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  border-radius: var(--r);
  text-decoration: none; color: #fff;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,.14);
  background: var(--ink-3);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .45);
  transition: filter .1s;
}
/* Pressed in, not floated up: a raised-on-hover card is the other
   tell. The shadow shrinks as the button moves into it. */
.btn:hover { filter: brightness(1.1); }
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .45);
}
.btn b { display: block; font-size: 16px; line-height: 1.3; }
.btn small { display: block; font-size: 12.5px; opacity: .8; }
/* Two kinds of .ico share this slot: the text glyphs still used by the
   browser-play and email buttons, and the brand marks, which are inline
   <svg> so they take the button's white text colour through
   currentColor and stay sharp at any size. */
.btn .ico { font-size: 20px; line-height: 1; }
.btn svg.ico {
  display: block;
  /* The button is a flexbox: without this the mark gets squashed when
     the label beside it is long. */
  flex: 0 0 auto;
  width: 20px; height: 20px;
}

.btn-sm { padding: 9px 16px; font-size: 14px; margin-left: 4px; }
.btn-sm b, .btn-sm small { display: inline; font-size: 14px; }

.btn-steam   { background: #1b6ec2; border-color: #2b86dd; }
.btn-demo    { background: var(--lava); border-color: #ff8c4a; }
.btn-discord { background: #5865f2; border-color: #7b85ff; }
.btn-yt      { background: #e62117; border-color: #ff4c42; }
.btn-mail    { background: #5a4a86; border-color: #8673c4; }

/* ─────────────────────────── Sections ────────────────────────── */
.sec { padding: 78px 0; }
.sec.alt { background: var(--ink-2); border-block: 1px solid var(--line); }

.h2 {
  font-family: var(--pixel);
  font-size: 19px;
  color: var(--accent);
  margin: 0 0 28px;
  display: flex; align-items: baseline; gap: 14px;
}

.sub { margin-top: -16px; margin-bottom: 28px; }
.muted { color: var(--text-dim); }

/* ──────────────────────── Feature cards ──────────────────────── */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r); padding: 26px 24px;
  transition: border-color .1s;
}
.card:hover { border-color: var(--ember); }
.card-ico { font-size: 26px; margin-bottom: 12px; color: var(--ember); }
.card h3 {
  font-family: var(--pixel); font-size: 12px;
  line-height: 1.6; color: var(--accent); margin: 0 0 10px;
}
.card p { margin: 0; font-size: 15.5px; color: var(--text-dim); }

/* ───────────────────────── Screenshots ───────────────────────── */
.shots {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.shot {
  padding: 0; border: 2px solid var(--line); background: none;
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  transition: border-color .1s;
}
.shot:hover { border-color: var(--accent); }
.shot img { width: 100%; }

/* ────────────────────────── Game info ────────────────────────── */
.info-cols {
  display: grid; gap: 36px;
  grid-template-columns: 1.3fr 1fr;
}
.facts { margin: 0; }
.facts > div {
  display: grid; grid-template-columns: 150px 1fr; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.facts dt { color: var(--ember); font-weight: 500; font-size: 14.5px; }
.facts dd { margin: 0; font-size: 15.5px; }

.reqs h3 {
  font-family: var(--pixel); font-size: 12px;
  color: var(--accent); margin: 0 0 16px;
}
.reqs h4 { margin: 18px 0 6px; font-size: 14px; color: var(--ember); }
.reqs ul { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: 15px; }

/* ──────────────────────────── Footer ─────────────────────────── */
.foot {
  padding: 40px 0; background: var(--ink-2);
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.foot p { margin: 0 0 8px; }

/* ─────────────────────────── Lightbox ────────────────────────── */
.lb {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10, 6, 6, .95);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.lb[hidden] { display: none; }
.lb-img {
  max-width: 100%; max-height: 90vh;
  border: 3px solid var(--gold); border-radius: var(--r);
}
.lb-close, .lb-nav {
  position: absolute; background: none; border: none;
  color: var(--text); cursor: pointer; line-height: 1;
}
.lb-close { top: 18px; right: 24px; font-size: 42px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 64px; padding: 0 18px; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-close:hover, .lb-nav:hover { color: var(--gold); }

/* ───────────────────────── Responsive ────────────────────────── */
@media (max-width: 860px) {
  .info-cols { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .tagline { font-size: 16px; }
  .h2 { font-size: 16px; }
  /* Phone bar: [menu] ............ [logo]. order puts the button
     first and auto margin pushes the logo to the far right. */
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    order: 1;
    width: 40px; height: 40px;
    background: var(--ink-3); color: var(--accent);
    border: 2px solid var(--line); border-radius: 0;
    font-size: 20px; line-height: 1; cursor: pointer;
  }
  .menu-btn[aria-expanded="true"] { border-color: var(--accent); }
  .brand { order: 2; margin-left: auto; margin-right: 0; }

  /* The panel drops out of the bar and spans the window. Hidden by
     default rather than display:none on .nav-links, which is what left
     a phone with no navigation at all before. */
  .nav-panel {
    order: 3;
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 6px 0 12px;
    background: var(--ink-2);
    border-bottom: 3px solid var(--accent);
  }
  .nav-panel.open { display: flex; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a {
    padding: 13px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }
  /* Comfortably tappable and full width, rather than squeezed into a
     row that was never meant to wrap. */
  .nav-panel .theme-btn { margin: 10px 20px 0; width: auto; }
  .nav-panel .btn-sm { margin: 10px 20px 0; justify-content: center; }
  .nav-in { gap: 12px; position: relative; }
  .hero { padding: 54px 0 48px; }
  .cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: flex-start; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .lb { padding: 16px; }
  .lb-nav { font-size: 40px; padding: 0 6px; }
}

.warn-banner {
  margin: 0 0 18px;
  padding: 10px 14px;
  background: #3a2410;
  border: 2px solid var(--lava);
  border-left-width: 6px;
  color: #ffce7a;
  font-size: 15px;
  font-weight: 500;
}

/* ───────────────────────── Doc list ───────────────────────── */
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li {
  border: 2px solid var(--line);
  border-left: 6px solid var(--accent);
  background: var(--ink-2);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.doclist a {
  display: block;
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.doclist span { color: var(--text-dim); font-size: 15px; }

/* ───────────────────── Light / dark toggle ───────────────────── */
.theme-btn {
  margin-left: auto;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink-3);
  color: var(--accent);
  border: 2px solid var(--line);
  border-radius: 0;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, .35);
}
/* The nav links already push the right-hand group over; without this
   the button would claim that job too and split them apart. */
.nav-links + .theme-btn { margin-left: 16px; }


/* ═══════════════════════ Tabbed site ═══════════════════════ */
/* The nav bar is now a tab strip across seven pages rather than
   anchors into one, so the current page has to be marked: the colour
   says it at a glance, and aria-current says it to a screen reader. */
.nav-links a.is-active {
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

/* Every page but the home page opens with a short band instead of the
   hero: enough to name the page without pushing its content under the
   fold. */
.page-head {
  padding: 40px 0 30px;
  background: var(--hero-bg);
  border-bottom: 3px solid var(--accent);
}
.page-title {
  font-family: var(--pixel);
  font-size: 26px;
  color: var(--accent);
  margin: 0 0 8px;
}
.page-sub { margin: 0; color: var(--text-dim); }

.h3 {
  font-family: var(--pixel); font-size: 15px;
  color: var(--accent); margin: 44px 0 18px;
}
.sub-h {
  font-family: var(--pixel); font-size: 12px;
  color: var(--accent); margin: 0 0 14px;
}
.mono { font-family: ui-monospace, monospace; font-size: 13px; }

/* A whole card that is a link. Same box as .card, minus the underline
   and the inherited link colour. */
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--ember); }
:root[data-theme="light"] a.card-link { text-decoration: none; }

/* ───────────────────────────  News  ───────────────────────── */
.post {
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  background: var(--ink-2);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.post-title {
  font-family: var(--pixel); font-size: 15px;
  color: var(--accent); margin: 0 0 6px;
}
.post-meta {
  margin: 0 0 14px;
  font-size: 13.5px; color: var(--text-dim);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.post p:last-child { margin-bottom: 0; }

/* ──────────────────────────  Support  ─────────────────────── */
.faq {
  border: 1px solid var(--line);
  background: var(--ink-2);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
}
.faq > summary:hover { color: var(--accent); }
.faq[open] > summary { color: var(--accent); margin-bottom: 10px; }
.faq p { margin: 0; color: var(--text-dim); font-size: 15.5px; }
.faq code {
  font-family: ui-monospace, monospace; font-size: 13.5px;
  background: var(--chip-bg); padding: 1px 5px;
}

/* ──────────────────────────  Account  ─────────────────────── */
.acct-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.acct-head .h2 { margin-bottom: 4px; }

.badge-ok {
  background: rgba(70, 176, 116, .18);
  border-color: rgba(70, 176, 116, .55);
  color: #6fd39b;
}
.badge-warn {
  background: rgba(255, 106, 31, .18);
  border-color: rgba(255, 106, 31, .55);
  color: var(--ember);
}

/* Four numbers that should read at a glance, so they are set large and
   the labels small, rather than both at body size. */
.stats {
  display: grid; gap: 14px; margin: 26px 0 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stat {
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  background: var(--ink-2);
  padding: 16px 18px;
}
.stat-k {
  display: block; font-size: 13px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .08em;
}
.stat-v {
  display: block; font-family: var(--pixel);
  font-size: 24px; color: var(--accent); line-height: 1.4;
}

.bar-row {
  display: grid; grid-template-columns: 180px 1fr 52px;
  align-items: center; gap: 14px; padding: 5px 0;
}
.bar-name { font-size: 15px; }
.bar {
  display: block; height: 14px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
}
.bar-fill { display: block; height: 100%; background: var(--ember); }
.bar-pct { font-size: 13.5px; color: var(--text-dim); text-align: right; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chip {
  font-size: 13px; padding: 5px 10px;
  background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--text-dim);
}
.chip-ok { color: var(--text); border-color: var(--accent); }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.tbl th { color: var(--ember); font-weight: 500; font-size: 14px; }

/* ───────────────────────────  Forms  ──────────────────────── */
.form { display: block; }
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; font-size: 13.5px; color: var(--text-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 11px 12px;
  background: var(--ink); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--body); font-size: 16px;
}
.field input:focus { border-color: var(--accent); outline: none; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; }
.form-msg { margin: 4px 0 14px; font-size: 14.5px; min-height: 1.2em; }
.form-msg.is-bad { color: var(--ember); }
.form-msg.is-good { color: #6fd39b; }
/* The delete box is the one thing on the page that cannot be undone, so
   it is the one thing that looks different. */
.form.danger { border-color: rgba(230, 33, 23, .5); }
.form.danger .sub-h { color: #ff6a5a; }

@media (max-width: 700px) {
  .page-title { font-size: 20px; }
  .bar-row { grid-template-columns: 1fr 44px; }
  .bar { grid-column: 1 / -1; }
  .acct-head { flex-direction: column; }
}

/* ─────────────────── Community level browser ─────────────────── */
/* Hides a label from sight while leaving it for a screen reader, so
   each control is still named without a visible caption. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lvl-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 18px 0 22px;
}
.lvl-search { flex: 1 1 280px; }
.lvl-search input, .lvl-sort select {
  width: 100%; padding: 10px 12px;
  background: var(--ink-2); color: var(--text);
  border: 2px solid var(--line); border-radius: 6px;
  font-size: 14px;
}
.lvl-sort { flex: 0 0 auto; }
.lvl-search input:disabled, .lvl-sort select:disabled { opacity: .55; }
.lvl-check { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.lvl-count { margin-left: auto; font-size: 13px; }
.lvl-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
/* Section subtitles, matching how the game stacks Featured above the
   rest of the community list. */
.lvl-sec { margin: 26px 0 4px; font-size: 18px; }
.lvl-sec:first-child { margin-top: 0; }
.lvl-sec-n {
  font-size: 12px; font-weight: 400; color: var(--text-dim);
  vertical-align: middle;
}
.lvl-sec-note { margin: 0 0 12px; font-size: 13px; }
.lvl-sec + .lvl-grid { margin-top: 12px; }
.lvl {
  position: relative;
  background: var(--ink-2); border: 2px solid var(--line);
  border-radius: 10px;
  display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.lvl:hover { border-color: var(--accent); transform: translateY(-2px); }
/* The whole card is the link. Padding lives here rather than on .lvl so
   the hit area covers the card instead of a rectangle inside it. */
.lvl-hit {
  display: flex; flex-direction: column; gap: 8px; flex: 1;
  padding: 16px 18px; color: inherit; text-decoration: none;
}
.lvl-hit:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* Pinned to the corner so it is not inside the card-wide link. */
.lvl .lvl-copy { position: absolute; top: 12px; right: 14px; }
.lvl-top { padding-right: 56px; }
.lvl-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.lvl-top h3 { margin: 0; font-size: 17px; }
/* Copy the level name, which is what the in-game browser searches on.
   Sits with the title rather than in the footer: it acts on the name,
   so it belongs beside it. */
.lvl-copy {
  flex: 0 0 auto; cursor: pointer;
  padding: 3px 9px; font-size: 11px; line-height: 1.5;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 10px;
  transition: background .15s, color .15s, border-color .15s;
}
.lvl-copy:hover { background: var(--accent); color: var(--ink-2); border-color: var(--accent); }
.lvl-copy.is-done { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.lvl-by { margin: 0; font-size: 13px; color: var(--text-dim); }
.lvl-dot { opacity: .5; }
/* Four lines of description, then an ellipsis: the cards stay a grid
   rather than one card growing to the height of somebody's essay. */
.lvl-desc {
  margin: 0; font-size: 14px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.lvl-tags { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lvl-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: rgba(255, 210, 63, .14); color: var(--text);
  border: 1px solid var(--line); text-transform: capitalize;
}
.lvl-tag.feat { background: var(--accent); color: var(--ink-2); font-weight: 700; }
.lvl-tag.sm { font-size: 10px; }
.lvl-foot {
  margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: var(--text-dim);
}
/* ---- one level, on its own page ---- */
.lvl-back { margin: 0 0 14px; font-size: 14px; }
.lvl-page { max-width: 760px; }
.lvl-page-top { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.lvl-page-top h1 { margin: 0; font-size: 26px; }
.lvl-page h2 { font-size: 15px; margin: 24px 0 6px; color: var(--text-dim); }
.lvl-page-desc { margin: 0; font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.lvl-chips { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lvl-facts { margin: 0; display: grid; gap: 10px 22px;
             grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.lvl-facts dt { font-size: 12px; color: var(--text-dim); }
.lvl-facts dd { margin: 2px 0 0; font-size: 15px; }
.lvl-howto { margin-top: 26px; font-size: 14px; }
@media (max-width: 560px) {
  .lvl-count { margin-left: 0; }
  .lvl-page-top h1 { font-size: 21px; }
}
