/* ============================================================
   AoE2 Architecture Showcase — styles
   ============================================================ */

:root {
  --bg: #14110d;
  --bg-2: #1d1811;
  --panel: #241d14;
  --panel-2: #2c2317;
  --ink: #ece3cf;
  --ink-dim: #b9ac8f;
  --ink-faint: #8a7d61;
  --gold: #d4af52;
  --gold-bright: #f0cf76;
  --line: #3a2f1e;
  --line-soft: #2a2216;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  --radius: 14px;
  --maxw: 1160px;
  --serif: "Trajan Pro", "Cinzel", Georgia, "Times New Roman", serif;
  --body: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a2114 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: #ffe6a0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

h1, h2, h3, .brand {
  font-family: var(--serif);
  letter-spacing: 0.04em;
  font-weight: 600;
  line-height: 1.2;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 600;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(18, 15, 10, 0.82);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand .crest {
  width: 30px; height: 30px; flex: none;
}
.brand b { color: var(--gold-bright); font-weight: 600; }
.nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink-dim);
  font-size: 0.86rem;
  padding: 8px 14px;
  border-radius: 8px;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { color: var(--gold-bright); background: var(--panel); }
.topnav { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.topnav a { color: var(--ink-dim); font-size: 0.86rem; padding: 8px 14px; border-radius: 8px; letter-spacing: 0.04em; transition: background 0.15s, color 0.15s; }
.topnav a:hover { background: var(--panel-2); color: var(--ink); }
.topnav a.hub-link { color: var(--gold); }
.topnav a.hub-link:hover { color: var(--gold-bright); }
.platform-note { font-size: 0.9rem; color: var(--ink-dim); margin: 12px auto 0; max-width: 62ch; }
.platform-note b { color: var(--gold-bright); }
.foot-links { display: block; margin-top: 9px; font-size: 0.82rem; }
.foot-links a { color: var(--gold); }
.foot-links a:hover { color: var(--gold-bright); text-decoration: underline; }
.legal { max-width: 780px; margin: 0 auto; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 6px; color: var(--ink); }
.legal .updated { color: var(--ink-faint); font-size: 0.85rem; margin: 0 0 26px; }
.legal h2 { font-size: 1.2rem; margin: 30px 0 10px; color: var(--gold-bright); }
.legal p, .legal li { color: var(--ink-dim); line-height: 1.65; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--gold); }
.legal a:hover { color: var(--gold-bright); text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 92px 0 70px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(transparent 96%, rgba(212,175,82,0.06) 96%),
    linear-gradient(90deg, transparent 96%, rgba(212,175,82,0.06) 96%);
  background-size: 46px 46px;
  mask-image: radial-gradient(680px 380px at 50% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; text-align: center; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  margin: 14px auto 0;
  max-width: 16ch;
  background: linear-gradient(180deg, #fbe6b3, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  color: var(--ink-dim);
  font-size: 1.12rem;
  max-width: 60ch;
  margin: 18px auto 0;
}
.hero .cta { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--body);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--ink); }
.btn.primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #241a08; border-color: var(--gold-bright); font-weight: 600;
}
.btn.primary:hover { color: #241a08; }

/* ---------- Stats strip ---------- */
.stats {
  display: flex; justify-content: center; gap: 46px; flex-wrap: wrap;
  margin-top: 46px;
}
.stat { text-align: center; }
.stat b { display: block; font-family: var(--serif); font-size: 2rem; color: var(--gold-bright); }
.stat span { font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------- Section headers ---------- */
.section { padding: 70px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 10px 0 0; }
.section-head p { color: var(--ink-dim); max-width: 62ch; margin: 12px auto 0; }
.rule {
  width: 120px; height: 2px; margin: 26px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- Set grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.16s, border-color 0.16s;
}
.card:hover { transform: translateY(-4px); border-color: var(--set-accent, var(--gold)); }
.card .art {
  height: 158px;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--set-accent) 26%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, #191410, #120e09);
  border-bottom: 1px solid var(--line-soft);
}
.card .art svg { height: 118px; width: auto; filter: drop-shadow(0 8px 14px rgba(0,0,0,0.5)); }
.card .body { padding: 16px 18px 20px; }
.card .region { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--set-accent, var(--gold)); }
.card h3 { font-size: 1.16rem; margin: 6px 0 6px; }
.card .tag { color: var(--ink-dim); font-size: 0.88rem; min-height: 2.6em; }
.card .foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; color: var(--ink-faint);
}
.card .foot .count b { color: var(--ink); font-family: var(--serif); }

/* pills */
.pill {
  display: inline-block;
  font-size: 0.74rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-dim);
  margin: 3px 4px 0 0;
}

/* ---------- Detail entries (architecture.html) ---------- */
.entry {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
  align-items: start;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.entry:first-of-type { border-top: none; }
.entry .figure {
  position: sticky; top: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--set-accent) 30%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, #191410, #100c08);
  display: grid; place-items: center;
  padding: 26px 10px;
  box-shadow: var(--shadow);
}
.entry .figure svg { height: 168px; width: auto; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.55)); }
.entry .figure .cap { text-align: center; margin-top: 14px; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.entry .content h2 { font-size: 1.7rem; margin: 0; color: var(--ink); }
.entry .content h2 .accent { color: var(--set-accent); }
.entry .content .region { color: var(--set-accent); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.72rem; }
.entry .content .basis {
  display: inline-block; margin-top: 8px; font-size: 0.8rem;
  color: var(--ink-dim); border: 1px dashed var(--line); border-radius: 8px; padding: 4px 12px;
}
.entry .content p.desc { color: var(--ink-dim); margin: 14px 0 0; max-width: 66ch; }
.ages { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.age {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: var(--panel);
}
.age .k { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--set-accent); }
.age .v { font-size: 0.88rem; color: var(--ink-dim); margin-top: 4px; }
.civline { margin-top: 20px; }
.civline .k { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }

/* ---------- Custom civ builder ---------- */
.builder {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 30px;
  align-items: start;
}
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.field input[type="text"], .field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.95rem;
  padding: 11px 13px;
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
}
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-dim);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 0.82rem;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.choice:hover { color: var(--ink); }
.choice.sel { border-color: var(--gold); color: #241a08; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); font-weight: 600; }

.bonus-row { display: flex; gap: 8px; margin-bottom: 8px; }
.bonus-row input { flex: 1; }
.bonus-row button {
  flex: none; width: 40px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-dim);
  border-radius: 9px; cursor: pointer; font-size: 1.1rem;
}
.bonus-row button:hover { border-color: #a24a3a; color: #e08a7a; }

/* preview card */
.preview {
  position: sticky; top: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--panel);
}
.preview .banner {
  padding: 30px 24px;
  display: grid; place-items: center;
  background:
    radial-gradient(130% 130% at 50% 130%, color-mix(in srgb, var(--set-accent) 34%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, #191410, #0f0b07);
  border-bottom: 1px solid var(--line);
}
.preview .banner svg { height: 150px; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.55)); }
.preview .info { padding: 22px 24px 26px; }
.preview .info .civname { font-family: var(--serif); font-size: 1.5rem; color: var(--gold-bright); }
.preview .info .setname { color: var(--set-accent); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px; }
.preview .info .meta { display: flex; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.preview .info .meta div span { display: block; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.preview .info .meta div b { font-family: var(--serif); color: var(--ink); font-weight: 600; }
.preview .info h4 { font-family: var(--serif); font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 20px 0 8px; }
.preview .info ul { margin: 0; padding-left: 18px; color: var(--ink-dim); font-size: 0.9rem; }
.preview .info ul li { margin: 4px 0; }
.preview .info p.lore { color: var(--ink-dim); font-size: 0.9rem; font-style: italic; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 46px;
  color: var(--ink-faint);
  font-size: 0.82rem;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-dim); }

/* ---------- Real-sprite home cards ---------- */
.card .art img { max-height: 138px; width: auto; filter: drop-shadow(0 10px 12px rgba(0,0,0,0.55)); }
.emblem-row { display: flex; gap: 5px; margin-top: 12px; flex-wrap: wrap; }
.mini-emblem { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); }

/* ---------- Architecture reference (full-width entries) ---------- */
.entry-full {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.entry-full:first-of-type { border-top: none; }
.entry-head { display: grid; grid-template-columns: 1fr auto; gap: 34px; align-items: start; }
.entry-full .region { color: var(--set-accent); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.72rem; }
.entry-full h2 { font-size: 1.8rem; margin: 6px 0 0; }
.entry-full h2 .accent { color: var(--set-accent); }
.entry-full .basis { display: inline-block; margin-top: 8px; font-size: 0.8rem; color: var(--ink-dim); border: 1px dashed var(--line); border-radius: 8px; padding: 4px 12px; }
.entry-full .desc { color: var(--ink-dim); margin: 14px 0 0; max-width: 68ch; }
.civline { margin-top: 20px; }
.civline .k { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.civchips { display: flex; flex-wrap: wrap; gap: 7px; }
.civchip { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; padding: 4px 11px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.civchip img { width: 22px; height: 22px; object-fit: contain; }
.wonder-frame {
  position: relative; width: 220px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--set-accent) 26%, transparent), transparent 62%), linear-gradient(180deg, #191410, #100c08);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.wonder-frame img { max-height: 190px; width: auto; filter: drop-shadow(0 10px 14px rgba(0,0,0,0.6)); }
.wonder-frame span { position: absolute; top: 10px; left: 12px; font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--set-accent); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 26px; }
.shot {
  margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #191410, #120e09);
}
.shot img { display: block; margin: 0 auto; height: 118px; width: auto; object-fit: contain; padding: 10px 6px 4px; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.5)); }
.shot figcaption { font-size: 0.72rem; color: var(--ink-dim); text-align: center; padding: 6px 4px 10px; border-top: 1px solid var(--line-soft); }

/* ---------- Builder (mix & match) ---------- */
.builder-controls {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: end;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.builder-controls .field { margin: 0; min-width: 220px; flex: 1; }
.builder-controls label { display: block; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 7px; }
select, .builder-controls select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; color: var(--ink);
  font-family: var(--body); font-size: 0.92rem; padding: 10px 12px;
}
select:focus { outline: none; border-color: var(--gold); }

.civ-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin: 22px 0; padding: 18px 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: radial-gradient(130% 160% at 100% 0%, color-mix(in srgb, var(--set-accent) 22%, transparent), transparent 55%), linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.banner-info { display: flex; align-items: center; gap: 16px; }
.crest-emblem { width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6)); }
.civ-banner .civname { font-family: var(--serif); font-size: 1.9rem; color: var(--gold-bright); outline: none; border-bottom: 1px dashed transparent; }
.civ-banner .civname:focus { border-bottom-color: var(--gold); }
.civ-banner .setname { color: var(--set-accent); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 2px; }
.banner-art { flex: none; }
.banner-art img { height: 120px; width: auto; filter: drop-shadow(0 10px 12px rgba(0,0,0,0.55)); }

.slot-grid { display: flex; flex-direction: column; gap: 24px; }
.slot-cat-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 13px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.slot-cat-head h3 { margin: 0; font-family: var(--serif); font-size: 1.16rem; color: var(--ink); }
.slot-cat-head span { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.slot-subgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.builder-controls .apply-all { display: inline-flex; align-items: center; gap: 9px; margin: 0; text-transform: none; letter-spacing: normal; color: var(--ink); font-size: 0.9rem; }
.builder-controls .apply-all span { font-size: 0.9rem; letter-spacing: normal; text-transform: none; color: var(--ink-dim); margin: 0; }
.builder-controls .apply-all select { min-width: 210px; margin: 0; }
.slot {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.slot.styled { border-color: var(--set-accent); }
.slot-art {
  position: relative; height: 150px; display: grid; place-items: center; padding: 8px;
  background: radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--set-accent) 24%, transparent), transparent 62%), linear-gradient(180deg, #191410, #110d08);
  border-bottom: 1px solid var(--line-soft);
}
.slot-art img { max-height: 132px; max-width: 96%; width: auto; filter: drop-shadow(0 8px 10px rgba(0,0,0,0.5)); }
.slot-art .na { color: var(--ink-faint); font-size: 0.8rem; }
.age-badge { position: absolute; top: 8px; right: 8px; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: rgba(0,0,0,0.5); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.slot.styled .slot-art::after { content: "custom"; position: absolute; top: 8px; left: 8px; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--set-accent); }
.slot-foot { padding: 11px 12px 13px; }
.slot-name { font-family: var(--serif); font-size: 0.98rem; }
.slot-src { font-size: 0.72rem; color: var(--set-accent); margin: 2px 0 9px; min-height: 1em; }
.slot-ctrls { display: flex; gap: 6px; margin-bottom: 8px; }
.slot-ctrls select { font-size: 0.78rem; padding: 6px 7px; flex: 1; min-width: 0; }

/* age progression strip — shows the locked set across all ages */
.age-strip { display: flex; gap: 5px; margin: 2px 0 10px; flex-wrap: wrap; }
.age-thumb {
  position: relative; flex: 1; min-width: 40px; max-width: 64px; padding: 4px 2px 2px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg,#17120d,#110d08);
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: border-color 0.14s;
}
.age-thumb img { height: 30px; width: auto; max-width: 100%; object-fit: contain; }
.age-thumb span { font-size: 0.58rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.age-thumb.sel { border-color: var(--set-accent); }
.age-thumb.sel span { color: var(--set-accent); }
.age-thumb:hover { border-color: var(--set-accent); }
.slot-browse { width: 100%; justify-content: center; font-size: 0.78rem; padding: 8px; }

/* ---------- civ selection page ---------- */
.era { margin-bottom: 30px; }
.era-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: 0 0 22px; padding: 14px 0 12px; border-bottom: 2px solid var(--gold);
}
.era-head h2 {
  font-size: 1.7rem; margin: 0;
  background: linear-gradient(180deg, #fbe6b3, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.era-head span { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.civ-group { margin-bottom: 16px; }
.civ-group-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 9px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.civ-group-head h3 { font-size: 1.08rem; margin: 0; color: var(--ink); font-family: var(--serif); }
.civ-group-head h3::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  background: var(--set-accent); margin-right: 9px; transform: rotate(45deg);
}
.civ-group-head span { font-size: 0.74rem; letter-spacing: 0.05em; color: var(--set-accent); }
.civ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 7px; }
.civ-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  padding: 8px 5px 6px; border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--ink);
  transition: transform 0.14s, border-color 0.14s;
}
.civ-card:hover { transform: translateY(-2px); border-color: var(--set-accent); }
.civ-emblem { width: 46px; height: 46px; display: grid; place-items: center; }
.civ-emblem img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.55)); }
.civ-name { font-family: var(--serif); font-size: 0.76rem; text-align: center; line-height: 1.15; }
.civ-unique { font-size: 0.7rem; text-align: center; line-height: 1.25; color: var(--set-accent); opacity: 0.9; margin-top: -3px; }
.civ-card.has-unique { border-color: color-mix(in srgb, var(--set-accent) 45%, var(--line)); }
.sibs { font-size: 0.76rem; color: var(--ink-faint); margin-top: 5px; max-width: 60ch; }

/* sticky download bar (footer) */
.download-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(18, 15, 10, 0.95); backdrop-filter: blur(8px);
  border-top: 1px solid var(--gold); box-shadow: 0 -10px 30px -14px rgba(0, 0, 0, 0.85);
}
.download-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }
.download-bar .dl-info { margin: 0; padding: 0; border: none; background: none; color: var(--ink-dim); font-size: 0.9rem; flex: 1; }
.download-bar .dl-info b { color: var(--ink); }
.download-bar .btn.primary { font-size: 1.02rem; padding: 13px 28px; white-space: nowrap; }
.builder-controls .hint { color: var(--ink-faint); font-size: 0.85rem; }
.builder-controls .hint b { color: var(--ink-dim); }

/* download info + install steps */
.dl-info {
  margin: 14px 0 4px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 8px; background: var(--panel); color: var(--ink-dim); font-size: 0.9rem;
}
.dl-info b { color: var(--ink); }
.install { margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--line); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 14px; }
.steps li {
  position: relative; padding: 16px 18px 16px 58px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--ink-dim); line-height: 1.55;
}
.steps li b { color: var(--ink); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600;
  color: #241a08; background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}
.steps code, .notes code {
  background: #0f0c07; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
  font-size: 0.84em; color: var(--gold-bright); word-break: break-word;
}
.notes { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; background: var(--panel); }
.notes > p { margin: 0 0 8px; font-family: var(--serif); color: var(--gold); letter-spacing: 0.06em; }
.notes ul { margin: 0; padding-left: 18px; color: var(--ink-dim); }
.notes li { margin: 6px 0; }

.slot-x {
  position: absolute; top: 7px; left: 7px; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--line); background: rgba(0,0,0,0.55); color: #e08a7a; cursor: pointer; font-size: 1rem; line-height: 1;
}
.slot-x:hover { border-color: #a24a3a; }
.slot-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 240px; border: 2px dashed var(--line); border-radius: var(--radius); background: transparent;
  color: var(--ink-faint); cursor: pointer; font-size: 2rem; transition: border-color 0.15s, color 0.15s;
}
.slot-add span { font-size: 0.82rem; letter-spacing: 0.04em; }
.slot-add:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- picker modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; display: none; background: rgba(8,6,4,0.82); backdrop-filter: blur(5px); }
.modal-overlay.open { display: block; }
.modal {
  position: absolute; top: 4vh; left: 50%; transform: translateX(-50%);
  width: min(1060px, 95vw); height: 92vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 30px 80px -20px rgba(0,0,0,0.9);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-close { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.modal-close:hover { border-color: var(--gold); }
.modal-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-tools select { width: auto; min-width: 170px; }
.modal-tools input[type="text"] { flex: 1; min-width: 180px; width: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-family: var(--body); font-size: 0.92rem; padding: 10px 12px; }
.modal-tools input[type="text"]:focus { outline: none; border-color: var(--gold); }
.pick-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--ink-dim); white-space: nowrap; }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 20px 26px; }
.asset.pickable { cursor: pointer; }
.asset.pickable:hover { border-color: var(--set-accent); transform: translateY(-3px); }

/* ---------- Asset browser ---------- */
.browse-bar {
  position: sticky; top: 62px; z-index: 20;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 14px 0; margin-bottom: 8px;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}
.browse-bar select, .browse-bar input { width: auto; min-width: 180px; }
.browse-bar input { flex: 1; }
.browse-count { color: var(--ink-faint); font-size: 0.82rem; white-space: nowrap; }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.asset {
  margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); transition: border-color 0.14s, transform 0.14s;
}
.asset:hover { border-color: var(--set-accent); transform: translateY(-3px); }
.asset-art {
  height: 128px; display: grid; place-items: center; padding: 8px;
  background: radial-gradient(120% 120% at 50% 120%, color-mix(in srgb, var(--set-accent) 20%, transparent), transparent 62%), linear-gradient(180deg, #17120d, #110d08);
}
.asset-art img { max-height: 112px; max-width: 96%; width: auto; filter: drop-shadow(0 6px 8px rgba(0,0,0,0.5)); }
.asset figcaption { padding: 8px 10px 10px; border-top: 1px solid var(--line-soft); }
.asset figcaption b { display: block; font-size: 0.78rem; color: var(--ink); font-family: var(--serif); font-weight: 600; }
.asset figcaption span { font-size: 0.7rem; color: var(--ink-faint); }
.more-note { grid-column: 1/-1; text-align: center; color: var(--ink-faint); font-size: 0.82rem; padding: 20px; }

/* ---------- castles gallery ---------- */
.castle-group { margin-bottom: 40px; }
.castle-group-head {
  display: flex; align-items: baseline; gap: 14px; margin: 8px 0 18px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.castle-group-head h2 { font-size: 1.35rem; margin: 0; color: var(--ink); }
.castle-group-head h2::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  background: var(--set-accent); margin-right: 10px; transform: rotate(45deg);
}
.castle-group-head span { font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--set-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .entry-head { grid-template-columns: 1fr; }
  .wonder-frame { width: 100%; max-width: 260px; }
}
@media (max-width: 560px) {
  .nav { display: none; }
  .stats { gap: 26px; }
  .browse-bar { position: static; }
}

.lang-select{ margin-left:8px; width:auto; max-width:190px; flex:0 0 auto; background:#241d14; color:#e8dcc0; border:1px solid #3a2f1e; border-radius:8px; padding:5px 8px; font:inherit; font-size:0.82rem; cursor:pointer; }
.lang-select:hover{ border-color:#d4af52; }
