/* MetaAOE site. Same palette and type as the app (css/theme.css). */
:root {
  --ink: #101624;
  --ink-deep: #0b101b;
  --panel: #161e30;
  --raised: #1e283e;
  --line: #2a3650;
  --text: #ece5d3;
  --muted: #a3acc0;
  --faint: #7d88a1;
  --gold: #e0ad45;
  --gold-soft: rgba(224, 173, 69, 0.14);

  --age-1: #9aa1ad;
  --age-2: #c98d4c;
  --age-3: #6b9bd6;
  --age-4: #e0ad45;

  --food: #e0624b;
  --wood: #b5844f;
  --goldres: #e8c547;
  --builder: #7fb38a;
  --up: #7cc68a;
  --down: #e6857a;

  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-cond: 'Barlow Semi Condensed', 'Barlow', 'Arial Narrow', system-ui, sans-serif;
  --wrap: 1160px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #f0c46a; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-cond); line-height: 1.08; margin: 0; font-weight: 700; letter-spacing: -0.005em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 28px; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(16, 22, 36, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--font-cond); font-weight: 700; font-size: 21px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang a {
  font: 600 13px/1 var(--font-cond); letter-spacing: 0.04em;
  color: var(--muted); padding: 7px 10px; border-radius: 999px; text-decoration: none;
}
.lang a:not([aria-current]):hover { color: var(--text); }
.lang a[aria-current] { background: var(--gold); color: var(--ink); }
@media (max-width: 760px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 17px/1 var(--font-cond); letter-spacing: 0.01em;
  padding: 15px 22px; border-radius: 8px; text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-main { background: var(--gold); color: var(--ink); }
.btn-main:hover { background: #ebbb57; color: var(--ink); }
.btn-main small { font: 600 12px/1 var(--font); background: rgba(16,22,36,0.16); padding: 4px 7px; border-radius: 4px; }
.btn-ghost { color: var(--text); border-color: var(--line); background: var(--panel); }
.btn-ghost:hover { border-color: var(--gold); color: var(--text); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 64px 0 72px;
  background:
    radial-gradient(ellipse 70% 60% at 78% 30%, rgba(224, 173, 69, 0.10), transparent 70%),
    linear-gradient(180deg, var(--ink-deep), var(--ink));
  overflow: hidden;
}
/* map-grid texture: the war table, laid flat in perspective and drifting slowly toward the reader */
.hero::before {
  content: ''; position: absolute; left: -60%; right: -60%; bottom: -10%; height: 130%; pointer-events: none;
  background-image:
    linear-gradient(rgba(236, 229, 211, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 229, 211, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(58deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(0deg, #000 10%, transparent 70%);
  mask-image: linear-gradient(0deg, #000 10%, transparent 70%);
  animation: table 9s linear infinite;
}
@keyframes table {
  from { transform: perspective(520px) rotateX(58deg) translateY(0); }
  to { transform: perspective(520px) rotateX(58deg) translateY(64px); }
}
.hero.off::before { animation-play-state: paused; }
.hero .wrap { position: relative; display: grid; gap: 48px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .hero .wrap { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); } }
.hero h1 { font-size: clamp(42px, 6.6vw, 74px); max-width: 12ch; }
.hero .lead { margin-top: 20px; font-size: 19px; color: var(--muted); max-width: 34em; }
.hero .lead strong { color: var(--text); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fine { margin-top: 16px; font-size: 14px; color: var(--faint); }

/* hero visual: desktop window + live overlay mock */
/* The stage is one 3D scene: the window sits back, the overlay floats in front of it.
   site.js tilts the whole scene with the pointer (--rx / --ry), and the parts assemble once on load. */
.stage {
  position: relative; padding-bottom: 72px;
  transform-style: preserve-3d;
  transform: perspective(1600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage .window { animation: stage-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stage .live { translate: 0 0 40px; animation: live-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both; }
@keyframes stage-in { from { opacity: 0; translate: 0 0 -120px; rotate: y 10deg; } }
@keyframes live-in { from { opacity: 0; translate: 0 28px 40px; } }
.window {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  background: var(--panel);
}
.stage .device { transform: rotateY(-4deg); transform-origin: left center; animation: device-float 7s ease-in-out 1.2s infinite; }
/* the app open on a laptop: screen bezel + keyboard deck, slow float */
.stage .window { padding: 9px 9px 11px; border-radius: 14px 14px 4px 4px; background: linear-gradient(180deg, #1d2536, #0c111b); border-color: rgba(255,255,255,.09); position: relative; }
.stage .window::before { content: ''; position: absolute; top: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #2c3548; }
.stage .window img { display: block; border-radius: 3px; }
.device-base { position: relative; height: 14px; margin: 0 -7%; border-radius: 2px 2px 12px 12px; background: linear-gradient(180deg, #3a4357 0%, #232a39 45%, #151a25 100%); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.device-base::before { content: ''; position: absolute; top: 0; left: 50%; width: 16%; height: 5px; margin-left: -8%; border-radius: 0 0 6px 6px; background: #1a2030; }
@keyframes device-float { 0%, 100% { translate: 0 0 0; } 50% { translate: 0 -6px 0; } }
.stage .live { position: absolute; left: -24px; bottom: 0; width: min(360px, 86%); }
@media (max-width: 979px) {
  .stage { padding-bottom: 0; transform: none; }
  .stage .window { transform: none; }
  .stage .device { transform: none; }
  .stage .live { position: relative; left: auto; bottom: auto; width: min(380px, 94%); margin: -36px 0 0 auto; }
}
@media (max-width: 420px) {
  .live-age { flex-wrap: wrap; row-gap: 6px; }
  .live-clock { font-size: 19px; }
}

/* live overlay mock (HTML/CSS, mirrors windows/in_game.html) */
.live {
  background: rgba(30, 37, 52, 0.97);
  border: 1px solid #3a4560; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(224, 173, 69, 0.08);
  font-family: var(--font); color: var(--text);
  overflow: hidden;
}
.live-head { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: rgba(16, 22, 36, 0.7); }
.civ-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 6px;
  font: 700 11px/1 var(--font-cond); letter-spacing: 0.04em; color: #f3ead6;
  background: hsl(var(--h, 40), 42%, 30%); box-shadow: inset 0 0 0 1.5px hsla(var(--h, 40), 55%, 62%, 0.55);
}
img.civ-badge { object-fit: cover; background: none; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.live-title { min-width: 0; flex: 1; }
.live-title b { display: block; font: 700 15px/1.15 var(--font-cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-title span { font-size: 12px; color: var(--muted); }
.live-clock {
  font: 700 22px/1 var(--font-cond); font-variant-numeric: tabular-nums;
  padding: 6px 9px; border: 1.5px solid var(--gold); border-radius: 7px; background: var(--ink);
}
.live-next { display: flex; align-items: center; gap: 10px; padding: 7px 11px; font: 600 13px/1 var(--font-cond); color: var(--muted); }
.live-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.live-bar i { display: block; height: 100%; width: 0; background: var(--age-1); border-radius: 2px; transition: width 0.9s linear; }
.live-body { padding: 10px 12px 12px; }
.live-res { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.age-badge { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 4px; font: 700 13px/1 var(--font-cond); color: var(--ink); background: var(--age-1); }
.age-badge.a2 { background: var(--age-2); }
.age-badge.a3 { background: var(--age-3); }
.age-badge.a4 { background: var(--age-4); }
.vil { display: inline-flex; align-items: center; gap: 2px; font: 700 21px/1 var(--font-cond); margin-right: 2px; }
.vil img, .chip img { width: 20px; height: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.06); font: 700 15px/1 var(--font-cond); font-variant-numeric: tabular-nums;
}
.chip.food { color: var(--food); } .chip.wood { color: #c99a63; } .chip.gold { color: var(--goldres); } .chip.builder { color: var(--builder); }
.chip.off { opacity: 0.28; }
.live-note { margin-top: 10px; font: 600 16px/1.35 var(--font); min-height: 2.7em; }
.live-note .ico { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px 1px 3px; border-radius: 5px; background: rgba(255,255,255,0.07); }
.live-note .ico img { width: 18px; height: 18px; }
.live-age #live-age { white-space: nowrap; }
.live-age { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 9px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); font: 700 14px/1 var(--font-cond); }
.live-age .cost { margin-left: auto; display: inline-flex; gap: 8px; }
.live-age .cost span { display: inline-flex; align-items: center; gap: 3px; }
.live-age .cost img { width: 16px; height: 16px; }
/* a new step lands: the card catches the light, changed numbers bump */
.live.step { animation: step-glow 1.1s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes step-glow {
  from { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(224, 173, 69, 0.08), 0 0 0 0 rgba(224, 173, 69, 0.45); border-color: var(--gold); }
  to { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(224, 173, 69, 0.08), 0 0 0 14px rgba(224, 173, 69, 0); }
}
.live .bump { animation: bump 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes bump { 30% { scale: 1.18; } }
.live .swap { animation: swap 0.55s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes swap { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
/* last five seconds before the next step: the clock pulses */
.live-clock.soon { animation: soon 1s ease-out infinite; }
@keyframes soon { 0% { box-shadow: 0 0 0 0 rgba(224, 173, 69, 0.5); } 100% { box-shadow: 0 0 0 8px rgba(224, 173, 69, 0); } }

/* ---------- sections ---------- */
section { padding: 88px 0; }
.section-title { font-size: clamp(32px, 4.6vw, 48px); max-width: 18ch; }
.section-lead { margin-top: 14px; font-size: 19px; color: var(--muted); max-width: 36em; }

/* chapters: before / during / after the game, marked with the app's age colours */
.chapter { padding: 0; }
.chapter-head { display: flex; align-items: center; gap: 14px; padding-top: 96px; }
.chapter-head .age-badge { min-width: 34px; height: 30px; font-size: 17px; }
.chapter-head h2 { font-size: 22px; color: var(--muted); font-weight: 600; letter-spacing: 0.01em; }
.chapter-head::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

.feature { display: grid; gap: 36px; align-items: center; padding: 56px 0 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; }
  .feature.flip .feature-text { order: 2; }
  .feature.narrow-shot { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .feature.narrow-shot.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.feature h3 { font-size: clamp(28px, 3.4vw, 38px); }
.feature p { margin-top: 14px; color: var(--muted); max-width: 34em; }
.feature p.note { font-size: 15px; color: var(--faint); }
.ticks { margin-top: 20px; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks img { width: 22px; height: 22px; flex: none; margin-top: 2px; }
kbd {
  font: 600 13px/1 var(--font-cond); padding: 3px 6px; border-radius: 4px;
  background: var(--raised); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text); white-space: nowrap;
}
.shot { position: relative; }
.shot.tall { max-width: 440px; justify-self: center; width: 100%; }
.shot .window { background: transparent; }
.caption { margin-top: 10px; font-size: 13px; color: var(--faint); }

.pair { display: grid; gap: 20px; padding-top: 56px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.pane h3 { font-size: 28px; display: flex; align-items: center; gap: 12px; }
.pane h3 img { width: 28px; height: 28px; }
.pane p { margin-top: 12px; color: var(--muted); }
.pane .shot { margin-top: 22px; }
.shot.crop .window { max-height: 340px; -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent); mask-image: linear-gradient(180deg, #000 75%, transparent); }
.voice-lines { margin-top: 20px; display: grid; gap: 8px; }
.voice-lines li { font: 600 16px/1.3 var(--font); padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--raised); border-radius: 0 6px 6px 0; }
.voice-lines li span { display: block; font: 500 13px/1.2 var(--font); color: var(--faint); margin-bottom: 3px; }

/* ---------- promo video ---------- */
.promo { padding-top: 40px; padding-bottom: 0; }
.promo .window { margin-top: 28px; max-width: 1080px; }
.promo video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* ---------- two games ---------- */
.games { background: var(--ink-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.games-grid { display: grid; gap: 20px; margin-top: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .games-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; } }
.game { border-radius: 12px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--age-3); }
.game.aoe2 { border-top-color: var(--age-2); }
.game h3 { font-size: 30px; }
.game h3 small { display: block; margin-top: 6px; font: 500 15px/1.3 var(--font); color: var(--muted); }
.game ul { margin-top: 18px; display: grid; gap: 9px; }
.game li { padding-left: 18px; position: relative; }
.game li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 2px; background: var(--age-3); }
.game.aoe2 li::before { background: var(--age-2); }
.game .note { margin-top: 18px; font-size: 15px; color: var(--faint); }
.games .shot { margin-top: 40px; }
.langs { margin-top: 48px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 20px; }
.langs h3 { font-size: 22px; margin-right: 6px; }
.langs ul { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.langs li { font: 600 18px/1 var(--font-cond); color: var(--muted); }

/* ---------- fair play ---------- */
.fair .wrap { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .fair .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; } }
.rules { display: grid; gap: 0; border-top: 1px solid var(--line); }
.rules li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.rules b { display: block; font: 700 20px/1.2 var(--font-cond); }
.rules span { color: var(--muted); font-size: 16px; }
.rules svg { width: 30px; height: 30px; }

/* ---------- FAQ ---------- */
.faq-list { margin-top: 36px; max-width: 820px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font: 700 20px/1.3 var(--font-cond);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ''; position: absolute; right: 8px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform 0.2s;
}
.faq-list details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-list details p { padding: 0 0 22px; color: var(--muted); max-width: 40em; }

/* ---------- notify ---------- */
.notify { padding: 0 0 96px; }
.notify-box {
  border-radius: 14px; padding: 40px 28px; text-align: left;
  background:
    linear-gradient(135deg, rgba(224, 173, 69, 0.16), rgba(224, 173, 69, 0.02) 60%),
    var(--panel);
  border: 1px solid rgba(224, 173, 69, 0.35);
  display: grid; gap: 24px; align-items: center; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) { .notify-box { grid-template-columns: auto minmax(0, 1fr) auto; padding: 44px 48px; gap: 36px; } }
.notify-box > img { width: 72px; height: 72px; border-radius: 16px; }
.notify-box h2 { font-size: clamp(30px, 4vw, 42px); }
.notify-box p { margin-top: 10px; color: var(--muted); max-width: 36em; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); background: var(--ink-deep); padding: 44px 0 56px; font-size: 14px; color: var(--faint); }
.foot { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .foot { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.foot p + p { margin-top: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 22px; align-content: start; }
.foot nav a { color: var(--muted); }
.foot .brand { font-size: 18px; margin-bottom: 14px; }

/* ---------- meta page ---------- */
.page-head { padding: 64px 0 24px; }
.page-head h1 { font-size: clamp(38px, 6vw, 60px); }
.page-head p { margin-top: 14px; color: var(--muted); max-width: 40em; font-size: 18px; }
.meta-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; background: var(--panel); }
.seg button { font: 600 15px/1 var(--font-cond); background: none; border: 0; color: var(--muted); padding: 9px 14px; border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.meta-status { margin-left: auto; font-size: 14px; color: var(--faint); }
.meta-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-variant-numeric: tabular-nums; }
.meta-table th { text-align: left; font: 600 14px/1 var(--font-cond); color: var(--faint); padding: 10px 8px; border-bottom: 1px solid var(--line); }
.meta-table th.num, .meta-table td.num { text-align: right; }
.meta-table td { white-space: nowrap; padding: 10px 8px; border-bottom: 1px solid rgba(42, 54, 80, 0.6); }
.meta-table td.rank { color: var(--faint); width: 36px; font: 600 15px/1 var(--font-cond); }
.meta-table .civ { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.meta-table .wr { font: 700 18px/1 var(--font-cond); }
.wr.up { color: var(--up); } .wr.down { color: var(--down); }
.bar { position: relative; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.06); min-width: 80px; }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.bar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--faint); }
.meta-table td.n-games { color: var(--muted); }
@media (max-width: 640px) {
  .meta-table .col-bar, .meta-table .col-games { display: none; }
  .meta-table .civ { gap: 8px; }
  .meta-table td { padding: 10px 4px; }
  .meta-table .civ { white-space: normal; font-size: 15px; }
  .meta-table .wr { font-size: 16px; }
  .meta-status { margin-left: 0; width: 100%; }
}
.meta-empty { margin-top: 24px; padding: 24px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
.meta-foot { margin-top: 22px; font-size: 14px; color: var(--faint); max-width: 48em; }
.meta-foot p + p { margin-top: 8px; }

/* ---------- legal page ---------- */
.prose { max-width: 760px; padding-bottom: 88px; }
.prose h2 { font-size: 28px; margin-top: 44px; }
.prose p, .prose li { margin-top: 12px; color: var(--muted); }
.prose ul { list-style: disc; padding-left: 22px; }
.prose strong { color: var(--text); }
.ph { background: var(--gold-soft); color: var(--gold); padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* ---------- civ pages (en/civs/, generated by _tools/build-pages.js) ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: var(--faint); }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }
.civ-head h1 { display: flex; align-items: center; gap: 16px; text-wrap: balance; }
.civ-head h1 .civ-badge { width: 52px; height: 52px; border-radius: 10px; font-size: 16px; }
.civ-facts { display: grid; gap: 1px; margin: 30px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .civ-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.3fr); } }
.civ-facts > div { background: var(--panel); padding: 18px 20px; }
.civ-facts dt { font: 600 14px/1 var(--font-cond); color: var(--faint); letter-spacing: 0.02em; }
.civ-facts dd { margin: 8px 0 0; }
.civ-facts b { display: block; font: 700 24px/1.15 var(--font-cond); color: var(--text); }
.civ-facts span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.civ-sec { padding: 44px 0 0; }
.sub-title { font-size: clamp(26px, 3.2vw, 34px); text-wrap: balance; }
.builds-table td.b-name { white-space: normal; min-width: 14em; }
.builds-table .b-name a { font-weight: 600; }
.builds-table .b-name small { display: block; margin-top: 3px; font-size: 13px; color: var(--faint); }
.meta-table td.col-units { white-space: normal; color: var(--muted); }
.meta-table a.civ { color: var(--text); text-decoration: none; }
.meta-table a.civ:hover { color: var(--gold); }
@media (max-width: 640px) {
  .meta-table .col-x { display: none; }
  .civs-table td, .builds-table td.b-name { white-space: normal; min-width: 0; }
  .civ-grid a { font-size: 14px; gap: 8px; }
}
.civ-sec .pair { padding-top: 0; }
.pane h2 { font-size: 26px; }
.counter-list { margin-top: 16px; display: grid; gap: 10px; }
.counter-list li { display: grid; gap: 2px; padding: 10px 14px; border-radius: 8px; background: var(--raised); }
.counter-list b { font: 700 17px/1.2 var(--font-cond); }
.counter-list span { font-size: 15px; color: var(--up); }
.counter-list.beats span { color: var(--muted); }
.civ-cta { padding: 56px 0 0; }
.civ-grid { display: grid; gap: 8px; margin-top: 20px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 46%), 1fr)); }
.civ-grid a { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.civ-grid a:hover { border-color: var(--gold); color: var(--text); }
.civs-home { padding-bottom: 0; }
.civs-home .civ-grid { margin-top: 32px; }
.civs-all { margin-top: 18px; }
.civ-source { padding: 32px 0 88px; }

/* ---------- motion ----------
   Everything here is opt-in: content is visible without JS, and with prefers-reduced-motion nothing moves.
   site.js adds .reveal only to elements still below the fold, then .in when they scroll into view;
   .tilt to the shots and cards when the pointer is a mouse. */
.tilt {
  position: relative;
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
/* a soft light follows the pointer across the glass */
.tilt::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 236, 200, 0.09), transparent 55%);
  opacity: 0; transition: opacity 0.3s ease-out;
}
.tilt:hover { will-change: transform; }
/* smooth edges on the tilted layer (Chrome draws jagged borders otherwise) */
.tilt { backface-visibility: hidden; outline: 1px solid transparent; }
.tilt:hover::after { opacity: 1; }
.window.tilt:hover { box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6); }

/* declared after .tilt so the entrance wins while it plays */
.reveal { opacity: 0; transform: perspective(1200px) translateY(36px) rotateX(8deg); transform-origin: 50% 100%; }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }

/* parallax: the shots lag a little behind the page (scroll-driven, no JS; ignored where unsupported) */
@supports (animation-timeline: view()) {
  .feature .shot, .games > .wrap > .shot { animation: drift linear both; animation-timeline: view(); animation-range: cover; }
  @keyframes drift { from { translate: 0 -24px; } to { translate: 0 24px; } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before, .stage .window, .stage .device, .stage .live, .live.step, .live .bump, .live .swap, .live-clock.soon,
  .feature .shot, .games > .wrap > .shot { animation: none; }
  .live-bar i, .stage, .tilt { transition: none; }
  .tilt { transform: none; }
  .reveal { opacity: 1; transform: none; }
}

/* games: bold benefit first, then the detail */
.game li strong { color: var(--text); font-weight: 600; }
/* getting started in 3 steps */
.easy { list-style: none; margin: 28px 0 8px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.easy li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); }
.easy b { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--ink); font: 700 15px/1 var(--font-cond); }
.easy strong { color: var(--text); font-weight: 600; }
