/* ============================================================
   Server Genius — Game Server Calculator
   Design tokens mirrored from genius-space.org
   ============================================================ */

:root {
  --bg: #08080a;
  --bg2: #111114;
  --card: #16161b;
  --inp: #1e1e25;
  --hov: #26262e;
  --brd: #2a2a33;
  --t1: #f0eff4;
  --t2: #9896a3;
  --t3: #6b6878;
  --ac: #6c5ce7;
  --acl: #a29bfe;
  --acg: rgba(108, 92, 231, .12);
  --ac2: #fd79a8;
  --ok: #00b894;
  --warn: #fdcb6e;
  --err: #e17055;
  --r1: 8px;
  --r2: 12px;
  --r3: 16px;
  --sh: 0 8px 48px rgba(0, 0, 0, .4);
  --tr: .2s cubic-bezier(.4, 0, .2, 1);

  --grad: linear-gradient(135deg, var(--acl), var(--ac2));
  --maxw: 1200px;
  --barh: 0px;
}

[data-theme='light'] {
  --bg: #f6f5f9;
  --bg2: #efedf4;
  --card: #ffffff;
  --inp: #f4f2f8;
  --hov: #ebe8f2;
  --brd: #e2dfea;
  --t1: #16161b;
  --t2: #5f5b6b;
  --t3: #837f90;
  --acl: #6c5ce7;
  --acg: rgba(108, 92, 231, .1);
  --sh: 0 8px 40px rgba(22, 22, 27, .1);
  /* The dark-theme status hues are too light on white; darken while keeping hue. */
  --ok: #00997b;
  --warn: #a9761a;
  --err: #c9553a;
}

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

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--t1);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: var(--barh);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
a { color: var(--acl); }

.num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.wrap {
  position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto;
  padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right));
}

/* ===== Ambient BG ===== */

.ambg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambg::before {
  content: ''; position: absolute; top: -30%; left: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(108, 92, 231, .06) 0%, transparent 70%);
  animation: f1 20s ease-in-out infinite;
}
.ambg::after {
  content: ''; position: absolute; bottom: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(253, 121, 168, .04) 0%, transparent 70%);
  animation: f2 25s ease-in-out infinite;
}
@keyframes f1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(80px, 60px); } }
@keyframes f2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-60px, -80px); } }

/* ===== Header ===== */

header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--brd);
  backdrop-filter: blur(20px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 12px;
}

.logo { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
.logo-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--ac), var(--ac2));
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 17px; color: #fff;
  box-shadow: 0 4px 20px rgba(108, 92, 231, .35);
  transition: transform .3s;
}
.logo:hover .logo-icon { transform: rotate(-6deg) scale(1.05); }
.logo-text { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.logo-text .p1 {
  font-family: 'Playfair Display', serif; font-size: 25px; font-weight: 700;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--t1), color-mix(in srgb, var(--t1) 72%, var(--t3)));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.logo-text .p2 {
  font-family: 'Playfair Display', serif; font-size: 25px; font-weight: 400; font-style: italic;
  letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.spacer { flex: 1; }

.hlink {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 8px 14px;
  background: var(--card); border: 1px solid var(--brd); border-radius: var(--r1);
  color: var(--t2); text-decoration: none;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--tr);
}
.hlink:hover { background: var(--hov); border-color: var(--t3); color: var(--t1); }
.hlink i { font-size: 14px; }
.hlink .num { font-size: 12px; letter-spacing: .04em; }

:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

/* ===== Hero ===== */

.hero { position: relative; z-index: 1; padding: 72px 24px 44px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; margin-bottom: 24px;
  background: var(--acg); border: 1px solid rgba(108, 92, 231, .2);
  border-radius: 40px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; color: var(--acl);
  animation: fadeUp .6s ease-out;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.15;
  margin-bottom: 18px;
  animation: fadeUp .6s ease-out .1s both;
}
.hero-accent {
  font-style: italic; font-weight: 400;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc {
  font-size: 16px; color: var(--t2); line-height: 1.7;
  max-width: 580px; margin: 0 auto;
  animation: fadeUp .6s ease-out .2s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Sections ===== */

.section { margin-bottom: 24px; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--t3);
  margin-bottom: 14px;
}
.eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--brd); }

/* ===== Game picker ===== */

.eyebrow-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.eyebrow-row .eyebrow { margin-bottom: 0; flex: 1; min-width: 0; }

.gsearch { position: relative; flex: none; width: 210px; }
.gsearch i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--t3); pointer-events: none;
}
.gsearch input {
  width: 100%; padding: 8px 12px 8px 31px;
  background: var(--card); color: var(--t1);
  border: 1px solid var(--brd); border-radius: 20px;
  font-family: inherit; font-size: 12.5px; outline: none;
  transition: all var(--tr);
}
.gsearch input::placeholder { color: var(--t3); }
.gsearch input:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--acg); }
.gsearch input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.5); }

.empty {
  padding: 22px; text-align: center; font-size: 13px; color: var(--t3);
  background: var(--card); border: 1px dashed var(--brd); border-radius: var(--r3);
}
.gamecard[hidden] { display: none; }

.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }

.gamecard {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px;
  background: var(--card); border: 1px solid var(--brd); border-radius: var(--r3);
  color: inherit; font-family: inherit; cursor: pointer;
  transition: all .3s;
}
.gamecard:hover {
  border-color: rgba(108, 92, 231, .3); transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3), 0 0 0 1px rgba(108, 92, 231, .1);
}
.gamecard[aria-pressed='true'] {
  background: rgba(108, 92, 231, .1);
  border-color: rgba(108, 92, 231, .5);
  box-shadow: 0 4px 16px rgba(108, 92, 231, .18);
}
.gamecard__icon {
  width: 36px; height: 36px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px;
  background: var(--inp); color: var(--game, var(--acl));
  transition: all var(--tr);
}
.gamecard[aria-pressed='true'] .gamecard__icon {
  background: linear-gradient(135deg, var(--ac), var(--ac2)); color: #fff;
  box-shadow: 0 4px 16px rgba(108, 92, 231, .35);
}
.gamecard__t {
  font-size: 13.5px; font-weight: 700; color: var(--t1);
  line-height: 1.3; min-width: 0; overflow-wrap: anywhere;
}

/* ===== Layout ===== */

.split {
  display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 20px; align-items: start;
  margin-bottom: 20px;
}
.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.card { min-width: 0; }

.card {
  background: var(--card); border: 1px solid var(--brd);
  border-radius: var(--r3); box-shadow: var(--sh);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--brd);
}
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-head > i { color: var(--acl); font-size: 14px; }
.card-body { padding: 20px; }

.sticky, .left { position: sticky; top: 86px; }

/* ===== Fields ===== */

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--t1); }
.field__val {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500;
  color: var(--acl); background: var(--acg);
  border: 1px solid rgba(108, 92, 231, .2); border-radius: 20px;
  padding: 3px 11px; white-space: nowrap;
}
.field__hint { margin-top: 8px; font-size: 11.5px; color: var(--t3); line-height: 1.5; }

input[type='range'] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--ac) var(--pct, 0%), var(--inp) var(--pct, 0%));
}
input[type='range']::-moz-range-track { height: 5px; border-radius: 3px; background: var(--inp); }
input[type='range']::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--ac); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5.5px;
  border-radius: 50%; background: #fff; border: 3px solid var(--ac);
  box-shadow: 0 2px 10px rgba(108, 92, 231, .45);
  transition: transform var(--tr);
}
input[type='range']:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type='range']::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 3px solid var(--ac); box-shadow: 0 2px 10px rgba(108, 92, 231, .45);
}

select {
  width: 100%; padding: 10px 34px 10px 13px;
  background-color: var(--inp); color: var(--t1);
  border: 1px solid var(--brd); border-radius: var(--r2);
  font-family: inherit; font-size: 13.5px;
  cursor: pointer; appearance: none; outline: none;
  transition: all var(--tr);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b6878'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
select:hover { background-color: var(--hov); }
select:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--acg); }

.switch {
  position: relative; width: 46px; height: 26px; padding: 0;
  border-radius: 20px; border: 1px solid var(--brd); background: var(--inp);
  cursor: pointer; transition: all var(--tr);
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--t3); transition: all var(--tr);
}
.switch[aria-checked='true'] {
  background: linear-gradient(135deg, var(--ac), var(--ac2));
  border-color: transparent; box-shadow: 0 2px 12px rgba(108, 92, 231, .4);
}
.switch[aria-checked='true'] .knob { left: 25px; background: #fff; }

/* ===== Stats ===== */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }

.stat {
  min-width: 0;                       /* grid items default to min-width:auto */
  padding: 16px 18px; background: var(--bg2);
  border: 1px solid var(--brd); border-radius: var(--r2);
}
.stat__k {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--t3); margin-bottom: 10px;
}
.stat__v {
  font-family: 'JetBrains Mono', monospace; font-size: 28px; font-weight: 700;
  letter-spacing: -.03em; line-height: 1.05;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  /* Never let an unexpectedly long figure push out of the card. */
  overflow-wrap: anywhere; hyphens: none;
}
.stat__v small {
  font-size: 14px; font-weight: 500; margin-left: 4px;
  color: var(--t2); -webkit-text-fill-color: var(--t2);
  white-space: nowrap;
}
.stat__s { margin-top: 9px; font-size: 11.5px; color: var(--t3); line-height: 1.5; }
.stat__s b { color: var(--t2); font-weight: 600; }

.cap { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }
.cap__in {
  display: flex; align-items: center; gap: 9px; flex: none;
  padding: 10px 14px; background: var(--bg2);
  border: 1px solid var(--brd); border-radius: var(--r2);
}
.cap__in > span { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); }
.cap__in > em { font-style: normal; font-size: 12px; color: var(--t3); font-family: 'JetBrains Mono', monospace; }
.cap__in input {
  width: 62px; padding: 4px 8px;
  background: var(--inp); color: var(--t1);
  border: 1px solid var(--brd); border-radius: var(--r1);
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600;
  text-align: right; outline: none; transition: all var(--tr);
}
.cap__in input:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--acg); }

.cap__out {
  flex: 1 1 240px; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--r2);
  background: rgba(108, 92, 231, .1); border: 1px solid rgba(108, 92, 231, .5);
}
.cap__out .big {
  font-family: 'JetBrains Mono', monospace; font-size: 24px; font-weight: 700;
  line-height: 1; letter-spacing: -.03em; flex: none;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cap__out .why { font-size: 12.5px; color: var(--t2); line-height: 1.5; }
.cap__out .why b { color: var(--t1); font-weight: 600; }
.cap__out--none { background: rgba(225, 112, 85, .1); border-color: rgba(225, 112, 85, .45); }
.cap__out--none .big { background: none; -webkit-text-fill-color: var(--err); font-size: 20px; }

@media (max-width: 560px) {
  .cap__in { flex: 1 1 auto; justify-content: space-between; }
  .cap__out { flex-basis: 100%; }
}

/* ===== Tick budget meter ===== */

.tick { margin-top: 16px; padding: 18px; background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r2); }
.tick__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tick__label { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); }
.tick__verdict { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; }

.leds { display: flex; gap: 3px; height: 26px; }
.led { flex: 1; border-radius: 2px; background: var(--inp); transition: background .35s var(--tr), box-shadow .35s var(--tr); }
.led.on { background: var(--ok); box-shadow: 0 0 10px -2px var(--ok); }
.led.on.warn { background: var(--warn); box-shadow: 0 0 10px -2px var(--warn); }
.led.on.danger { background: var(--err); box-shadow: 0 0 10px -2px var(--err); }

.tick__scale {
  display: flex; justify-content: space-between; margin-top: 9px;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--t3);
}
.tick__note { margin-top: 11px; font-size: 11.5px; color: var(--t3); line-height: 1.55; }

/* ===== Hardware tier ===== */

.tier {
  display: flex; gap: 14px; margin-top: 16px; padding: 16px 18px;
  background: rgba(108, 92, 231, .1);
  border: 1px solid rgba(108, 92, 231, .5); border-radius: var(--r2);
  box-shadow: 0 4px 16px rgba(108, 92, 231, .15);
}
.tier__icon {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--ac), var(--ac2)); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(108, 92, 231, .35);
}
.tier__t { font-size: 14px; font-weight: 700; }
.tier__d { font-size: 12.5px; color: var(--t2); margin-top: 3px; line-height: 1.5; }

/* ===== Notes ===== */

.notes { list-style: none; display: grid; gap: 10px; }
.note {
  display: flex; gap: 12px; padding: 13px 15px;
  background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r2);
  font-size: 13px; line-height: 1.55; color: var(--t2);
}
.note i { font-size: 12px; margin-top: 4px; flex: none; }
.note--info i { color: var(--acl); }
.note--warn { border-color: rgba(253, 203, 110, .35); }
.note--warn i { color: var(--warn); }
.note--danger { border-color: rgba(225, 112, 85, .4); }
.note--danger i { color: var(--err); }

/* ===== Snippet tabs ===== */

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  padding: 6px 14px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--brd);
  color: var(--t3); font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all var(--tr);
}
.tab:hover { background: var(--hov); color: var(--t2); transform: translateY(-1px); }
.tab[aria-selected='true'] {
  background: rgba(108, 92, 231, .2);
  border-color: rgba(108, 92, 231, .5);
  color: var(--acl);
  box-shadow: 0 4px 16px rgba(108, 92, 231, .3);
}

.codebox { position: relative; }
.codebox pre {
  padding: 16px; overflow-x: auto;
  background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r2);
  font-family: 'JetBrains Mono', monospace; font-size: 12.2px; line-height: 1.7;
  color: var(--t1); white-space: pre; tab-size: 2;
}
.codebox .copy { position: absolute; top: 10px; right: 10px; }

/* ===== Comparison table ===== */

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--brd); white-space: nowrap; }
th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); font-weight: 500; }
td.n { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
tbody tr { transition: background var(--tr); }
tbody tr:hover { background: var(--bg2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.is-current { background: rgba(108, 92, 231, .1); }
tbody tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--ac); font-weight: 700; }

.pill {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 20px;
  background: rgba(108, 92, 231, .2); border: 1px solid rgba(108, 92, 231, .5);
  color: var(--acl); font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
}

.lead { margin-bottom: 16px; font-size: 13px; color: var(--t2); }

.footnote {
  display: flex; gap: 11px; margin-top: 16px; padding: 14px 16px;
  background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r2);
  font-size: 12.5px; line-height: 1.6; color: var(--t2);
}
.footnote .star {
  font-family: 'JetBrains Mono', monospace; color: var(--ac2);
  font-size: 15px; line-height: 1.2; flex: none;
}
.footnote b { color: var(--t1); font-weight: 600; }

/* ===== Mobile summary bar =====
   On a phone the sliders sit far above the results, so the numbers ride along
   at the bottom of the screen the whole time. Always present on mobile - a bar
   that comes and goes is worse than no bar, because you cannot rely on it. */

.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: none; align-items: center; gap: 12px; width: 100%;
  padding: 11px max(16px, env(safe-area-inset-left)) calc(11px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(20px);
  border: 0; border-top: 1px solid var(--brd);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .35);
  font-family: inherit; color: inherit; text-align: left; cursor: pointer;
}
.mbar__item { flex: 1; min-width: 0; }
.mbar__k {
  display: block; font-size: 9px; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: var(--t3);
}
.mbar__v {
  display: block; margin-top: 2px;
  font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700;
  letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.mbar__v.plain { background: none; -webkit-text-fill-color: currentColor; }
.mbar__up { flex: none; color: var(--t3); font-size: 13px; }

/* ===== Methodology page ===== */

.prose { font-size: 14.5px; line-height: 1.75; color: var(--t2); }
.prose p { margin-bottom: 14px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--t1); font-weight: 600; }
.prose em { color: var(--t2); }
.prose h3 {
  margin: 26px 0 12px; font-size: 14px; font-weight: 700; color: var(--t1);
  letter-spacing: .01em;
}
.prose h3:first-child { margin-top: 0; }
.prose ul { margin: 0 0 14px 18px; }
.prose li { margin-bottom: 7px; }
.prose code {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px;
  background: var(--inp); border: 1px solid var(--brd); border-radius: 5px;
  padding: 1px 6px; color: var(--acl);
}
.prose .note { margin-bottom: 14px; }

pre.mini {
  margin: 0 0 16px; padding: 15px 16px; overflow-x: auto;
  background: var(--bg2); border: 1px solid var(--brd); border-radius: var(--r2);
  font-family: 'JetBrains Mono', monospace; font-size: 12.2px; line-height: 1.7;
  color: var(--t1); white-space: pre; tab-size: 2;
}

.conf {
  display: inline-block; flex: none; padding: 3px 11px; border-radius: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 500;
  letter-spacing: .04em;
}
.conf--high { background: rgba(0, 184, 148, .15); border: 1px solid rgba(0, 184, 148, .45); color: var(--ok); }
.conf--med { background: rgba(253, 203, 110, .14); border: 1px solid rgba(253, 203, 110, .4); color: var(--warn); }
.conf--low { background: rgba(225, 112, 85, .14); border: 1px solid rgba(225, 112, 85, .42); color: var(--err); }

.conf-key { list-style: none; margin: 0 !important; display: grid; gap: 10px; }
.conf-key li { display: flex; gap: 11px; align-items: baseline; margin: 0; font-size: 13.5px; }

.srcs { list-style: none; margin: 20px 0 0 !important; padding-top: 16px; border-top: 1px solid var(--brd); }
.srcs li {
  position: relative; padding-left: 22px; margin-bottom: 9px;
  font-size: 13px; color: var(--t3); line-height: 1.6;
}
.srcs li::before {
  content: '\f0c1'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; left: 0; top: 1px; font-size: 10px; color: var(--ac);
}
.srcs a { text-decoration: none; border-bottom: 1px solid rgba(162, 155, 254, .3); }
.srcs a:hover { border-color: var(--acl); }

@media (max-width: 560px) {
  .prose { font-size: 14px; }
  pre.mini { font-size: 11.2px; padding: 13px; }
  .card-head .conf { font-size: 9.5px; padding: 2px 8px; }
}

/* ===== Footer ===== */

footer { position: relative; z-index: 1; border-top: 1px solid var(--brd); margin-top: 56px; padding: 28px 0 44px; }
footer .wrap { display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
footer p { max-width: 66ch; font-size: 12.5px; color: var(--t3); line-height: 1.6; }
footer a { font-size: 12.5px; text-decoration: none; border-bottom: 1px solid rgba(162, 155, 254, .3); transition: all var(--tr); }
footer a:hover { border-color: var(--acl); }

/* ===== Responsive ===== */

@media (max-width: 940px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .sticky, .left { position: static; }
  /* Sixteen games one-per-row wastes a tablet. Two up, subtitles intact. */
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 48px 24px 32px; }

  .mbar { display: flex; }
  body { --barh: calc(66px + env(safe-area-inset-bottom)); }
}

@media (max-width: 700px) {
  /* Keep the software name anchored while the numbers scroll sideways. */
  th:first-child, td:first-child {
    position: sticky; left: 0; z-index: 1;
    background: var(--card);
  }
  tbody tr.is-current td:first-child { background: color-mix(in srgb, var(--ac) 10%, var(--card)); }
  th:first-child::after, td:first-child::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
    background: var(--brd);
  }
}

@media (max-width: 560px) {
  .eyebrow-row { flex-wrap: wrap; gap: 10px; }
  .gsearch { width: 100%; }
  .wrap { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .header-inner { padding: 12px 16px; gap: 8px; }
  .logo { gap: 10px; }
  .logo-icon { width: 36px; height: 36px; font-size: 15px; }
  .logo-text .p1, .logo-text .p2 { font-size: 20px; }
  .hlink { padding: 8px 11px; }
  .hlink .label { display: none; }

  .hero { padding: 32px 16px 24px; }
  .hero-badge { margin-bottom: 18px; font-size: 11px; padding: 5px 13px; }
  .hero-title { font-size: 30px; margin-bottom: 14px; }
  .hero-desc { font-size: 14.5px; line-height: 1.6; }

  /* Three compact tiles beat three stacked rows: saves ~150px of scroll. */
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .gamecard { gap: 10px; padding: 11px 12px; }
  .gamecard__icon { width: 32px; height: 32px; font-size: 14px; }
  .gamecard__t { font-size: 12.5px; }

  .split, .col { gap: 14px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat__v { font-size: 22px; }
  .stat__s { font-size: 11px; }
  .tick { padding: 15px; }
  .leds { gap: 2px; height: 22px; }

  /* One swipeable row instead of two wrapped lines. */
  .tabs {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-inline: -16px; padding-inline: 16px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; scroll-snap-align: start; }

  .codebox pre { font-size: 11.2px; line-height: 1.65; padding: 14px; -webkit-overflow-scrolling: touch; }
  .codebox .copy { position: static; width: 100%; margin-bottom: 10px; }

  th, td { padding: 11px 12px; }
  footer { margin-top: 36px; padding: 22px 0 32px; }
  footer .wrap { gap: 12px; }
}

@media (max-width: 400px) {
  .header-inner { gap: 6px; padding: 10px 14px; }
  .logo { gap: 8px; }
  .logo-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
  .logo-text .p1, .logo-text .p2 { font-size: 17px; }
  .hlink { padding: 8px 9px; }
  .hlink .num { font-size: 11px; }
  .hero-title { font-size: 27px; }
  .mbar { gap: 8px; }
  .mbar__v { font-size: 14px; }
}

/* Touch devices need larger targets than a mouse does. */
@media (pointer: coarse) {
  /* Bigger thumb, but claw back the vertical space it adds around each field. */
  input[type='range'] { height: 40px; }
  .field { margin-bottom: 12px; }
  .field__top { margin-bottom: 0; }
  .field__hint { margin-top: 0; }
  input[type='range']::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -8.5px; }
  input[type='range']::-moz-range-thumb { width: 22px; height: 22px; }
  /* 16px stops iOS Safari zooming the page on focus. */
  select { min-height: 46px; font-size: 16px; }
  .hlink { min-height: 42px; }
  .tab { padding: 9px 15px; font-size: 12.5px; }
  .mbar { min-height: 60px; }
}

/* Hover effects stick on touch; use press feedback instead. */
@media (hover: none) {
  .gamecard:hover { transform: none; box-shadow: none; border-color: var(--brd); }
  .gamecard[aria-pressed='true']:hover {
    border-color: rgba(108, 92, 231, .5);
    box-shadow: 0 4px 16px rgba(108, 92, 231, .18);
  }
  .gamecard:active { transform: scale(.98); }
  .tab:hover { transform: none; background: var(--card); color: var(--t3); }
  .tab[aria-selected='true']:hover {
    background: rgba(108, 92, 231, .2); color: var(--acl);
    border-color: rgba(108, 92, 231, .5);
  }
  .hlink:hover { background: var(--card); border-color: var(--brd); color: var(--t2); }
  .hlink:active { background: var(--hov); }
  .logo:hover .logo-icon { transform: none; }
  tbody tr:hover { background: transparent; }
  tbody tr.is-current:hover { background: rgba(108, 92, 231, .1); }
  .mbar:active { background: var(--hov); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gamecard:hover, .tab:hover { transform: none; }
}
