/* Shared visual language: museum labels, warm stone, aged brass. */
:root {
  color-scheme: dark;
  --ink: #111713;
  --paper: #f1ebdf;
  --muted: #a7afa6;
  --gold: #d9b66f;
  --line: #ffffff20;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: Inter, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button:not(:disabled),
a {
  touch-action: manipulation;
}
button:disabled {
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
::selection {
  background: #d9b66f;
  color: #111713;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #655e4c #151713;
}
.font-display {
  font-family: "EB Garamond", Georgia, serif;
  font-feature-settings: "lnum" 1;
}
.history-home {
  background: var(--ink);
  color: var(--paper);
  min-height: 100dvh;
}
.site-header {
  height: 88px;
  max-width: 1440px;
  margin: auto;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--gold);
  text-decoration: none;
}
.wordmark > span {
  font-family: Georgia, serif;
  font-size: 17px;
  letter-spacing: 2px;
}
.wordmark small {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 2px;
  color: #b2b6a9;
  margin-top: 6px;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 12px;
  color: #c5c9bf;
}
.site-header nav a:hover {
  color: var(--gold);
}
.nav-join {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border: 1px solid #aa936354;
  border-radius: 3px;
}
.history-hero {
  position: relative;
  isolation: isolate;
  min-height: 660px;
  max-width: 1600px;
  margin: auto;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero-art {
  position: absolute;
  inset: 0 0 0 23%;
  z-index: -2;
  background: url("/images/tower-of-babel.jpg") center 45% / cover no-repeat;
}
.history-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      #111713 3%,
      #111713f2 24%,
      #11171391 48%,
      #11171305 82%
    ),
    linear-gradient(0deg, #111713 0%, transparent 32%, #11171330);
}
.hero-content {
  padding: 74px 5% 94px;
  width: 100%;
}
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.2px;
  line-height: 1.7;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow > span {
  width: 27px;
  height: 1px;
  background: var(--gold);
}
.hero-content h1 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(48px, 5.4vw, 82px);
  line-height: 1.03;
  letter-spacing: -2px;
  margin: 26px 0;
}
.hero-content h1 em,
.how-section h2 em,
.picker-heading h1 em {
  font-weight: 400;
  color: #dfc58d;
}
.hero-description {
  font-size: 15px;
  line-height: 1.9;
  color: #c0c4b8;
  max-width: 510px;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
}
.button-gold {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  background: var(--gold);
  color: #202519;
  padding: 16px 23px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}
.button-gold:hover {
  background: #ecd3a0;
}
.hero-actions > span {
  font-size: 10px;
  color: #aeb5a6;
}
.history-numbers {
  display: flex;
  gap: 38px;
  margin-top: 40px;
}
.history-numbers > div + div {
  border-left: 1px solid var(--line);
  padding-left: 38px;
}
.history-numbers dt {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 34px;
  line-height: 1.1;
}
.history-numbers dd {
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #adb4a7;
  margin-top: 5px;
}
.art-caption {
  position: absolute;
  right: 5%;
  bottom: 42px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.art-caption span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #dfd5b9;
}
.art-caption small {
  font-size: 9px;
  color: #a8af9e;
}
.entry-section {
  max-width: 1440px;
  margin: auto;
  padding: 46px 5% 60px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section-heading h2 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
}
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #8f9d7f35;
  border-radius: 5px;
  overflow: hidden;
}
.entry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #182019;
  padding: 29px 30px;
  min-width: 0;
}
.entry-card + .entry-card {
  border-left: 1px solid #8f9d7f35;
}
.entry-icon {
  color: #b6c3a5;
  width: 25px;
  height: 25px;
  margin-bottom: 26px;
}
.entry-number {
  position: absolute;
  right: 25px;
  top: 35px;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #8e9d88;
}
.entry-card h3 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 400;
}
.entry-card p {
  font-size: 12px;
  line-height: 1.9;
  color: #a7b29f;
  margin: 13px 0 25px;
  max-width: 310px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  min-height: 36px;
}
.text-link:hover {
  color: #f0dcae;
}
.entry-card > .text-link,
.entry-links {
  margin-top: auto;
}
.entry-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}
.secondary-link {
  font-size: 11px;
  color: #b0b8a9;
  text-decoration: underline;
  text-decoration-color: #768369;
  text-underline-offset: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.secondary-link:hover {
  color: #f0dcae;
}
.how-section {
  border-top: 1px solid var(--line);
  max-width: 1296px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 65px;
  padding: 65px 0 75px;
}
.how-section h2 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 45px;
  line-height: 1.12;
  margin-top: 20px;
  font-weight: 400;
}
.how-section ol {
  display: grid;
  gap: 25px;
}
.how-section li {
  display: flex;
  gap: 23px;
}
.how-section li > span {
  color: #8e9d88;
  font-size: 11px;
  padding-top: 5px;
}
.how-section h3 {
  font-size: 14px;
  font-weight: 500;
  color: #e1e4d9;
}
.how-section li p {
  font-size: 12px;
  line-height: 1.8;
  color: #a7b29f;
  margin-top: 6px;
}
.site-footer {
  max-width: 1440px;
  margin: auto;
  padding: 30px 5%;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: #919d88;
  font-size: 10px;
  line-height: 1.8;
}
.site-footer > span {
  letter-spacing: 1.5px;
  color: #bac4ad;
}
.site-footer small {
  display: block;
  letter-spacing: 0;
  font-size: 10px;
  color: #919d88;
}
.site-footer p {
  text-align: right;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  z-index: 1000;
  padding: 14px;
  background: var(--paper);
  color: var(--ink);
}
.skip-link:focus {
  top: 12px;
}
.civ-picker {
  background: radial-gradient(ellipse at top right, #233027, #111713 65%);
  color: var(--paper);
  min-height: 100dvh;
  padding: 26px max(5%, calc((100% - 1320px) / 2)) 80px;
}
.picker-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.picker-heading {
  padding: 48px 0 38px;
}
.picker-heading h1 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: clamp(34px, 3.5vw, 54px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 16px 0;
}
.picker-heading > p:last-child {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
.picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}
.civ-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a231c;
  border: 1px solid #4e5b49;
  border-radius: 4px;
  padding: 0 16px;
  color: #a7b29f;
}
.civ-search input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 15px 0;
  font-size: 13px;
  color: var(--paper);
}
.civ-search input:focus-visible {
  outline: none;
}
.civ-search:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.civ-search button {
  padding: 8px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.filter-row button {
  border: 1px solid #ffffff20;
  border-radius: 20px;
  padding: 9px 13px;
  font-size: 11px;
  color: #b7c0b0;
}
.filter-row button[aria-pressed="true"] {
  background: #d9b66f22;
  color: #ecd3a0;
  border-color: #d9b66f85;
}
.result-count {
  color: #99a58f;
  font-size: 10px;
  margin: 20px 0 12px;
}
.civ-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.civ-card {
  background: #1a221c;
  border: 1px solid #ffffff18;
  border-radius: 5px;
  padding: 18px;
  text-align: left;
  transition:
    background 0.15s,
    border-color 0.15s;
  min-width: 0;
}
.civ-card:hover {
  background: #242e24;
  border-color: #9aab83;
}
.civ-card.is-selected {
  border-color: var(--gold);
  background: #283025;
  box-shadow: inset 0 0 0 1px #d9b66f33;
}
.civ-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 19px;
}
.civ-seal {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--civ-color), #ded5bc 45%);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
  color: #efe7d4;
  background: color-mix(in srgb, var(--civ-color) 18%, transparent);
}
.civ-card-region {
  font-size: 9px;
  color: #a6b29c;
  text-align: right;
}
.civ-card h2 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}
.civ-card > p {
  font-size: 10px;
  color: #a8b49d;
  margin-top: 9px;
  min-height: 15px;
}
.civ-mini-stats {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  margin-top: 19px;
  padding-top: 13px;
  font-size: 9px;
  color: #a6b29c;
}
.civ-mini-stats b {
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: #e3d5b6;
  margin-top: 5px;
}
.civ-card-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d9b66f;
  font-size: 9px;
  margin-top: 17px;
}
.civ-detail {
  position: sticky;
  top: 22px;
  background: #efe8d8;
  color: #263023;
  border-radius: 6px;
  overflow: hidden;
}
.detail-landscape {
  height: 137px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse at bottom,
    color-mix(in srgb, var(--civ-color) 35%, #314131),
    #243227
  );
  color: #d9cda9;
  border-bottom: 3px solid var(--gold);
}
.detail-landscape span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.detail-content {
  padding: 25px;
}
.detail-content > .eyebrow {
  color: #70603c;
  font-size: 9px;
}
.detail-content h2 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  margin-top: 9px;
}
.detail-regions {
  font-size: 11px;
  color: #696d5d;
  line-height: 1.7;
  margin: 10px 0 16px;
}
.detail-facts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 10px;
  border-block: 1px solid #25302325;
  padding: 13px 0;
}
.detail-content h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 13px;
  color: #74765f;
}
.detail-trait h4 {
  font-size: 12px;
  font-weight: 700;
}
.detail-trait p {
  font-size: 11px;
  line-height: 1.7;
  color: #666b5c;
  margin: 5px 0 15px;
}
.detail-content > .button-gold {
  width: 100%;
  font-size: 12px;
  gap: 12px;
  background: #263b2c;
  color: #f4ecd7;
  margin-top: 8px;
}
.detail-content > .button-gold:hover {
  background: #3c553d;
}
.detail-note {
  text-align: center;
  font-size: 9px;
  color: #737760;
  margin-top: 11px;
}
.empty-search {
  padding: 50px 20px;
  text-align: center;
  border: 1px dashed #69745a;
  color: #a7b29f;
}
.empty-search > svg {
  margin: 0 auto 12px;
}
.empty-search h2 {
  font-family: Georgia, serif;
  font-size: 23px;
  color: var(--paper);
}
.empty-search p {
  margin: 13px 0;
  font-size: 12px;
}
.game-shell .text-\[\#6f665a\] {
  color: #a99e8b;
}
.game-shell .text-\[\#4c453c\] {
  color: #938773;
}
.game-shell .game-map {
  min-width: 0;
}
.game-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px;
  gap: 4px;
  border-bottom: 1px solid #ffffff18;
}
.game-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-start;
  min-height: 42px;
  padding: 9px 7px;
  border-radius: 4px;
  color: #b7ab96;
  font-size: 10px;
}
.game-tab:hover {
  background: #ffffff09;
  color: #f1e8d7;
}
.game-tab[aria-pressed="true"] {
  background: #d9b66f18;
  color: #ecd08a;
  box-shadow: inset 0 0 0 1px #d9b66f45;
}
.game-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.map-toolbar {
  position: absolute;
  right: 14px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid #bda16b55;
  border-radius: 7px;
  background: #171b16ec;
  box-shadow: 0 6px 20px #0004;
}
.map-toolbar button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #e8d9b8;
  border-radius: 3px;
}
.map-toolbar button:hover {
  background: #d9b66f25;
}
.map-controls-hint {
  position: absolute;
  left: 16px;
  bottom: 19px;
  color: #c9c6b3;
  font-size: 10px;
  line-height: 1.8;
  background: #171b16df;
  border: 1px solid #bda16b35;
  padding: 9px 12px;
  border-radius: 5px;
  pointer-events: none;
}
.map-controls-hint strong {
  font-weight: 500;
  color: #e7cf9f;
}
.map-hover-label {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #171b16ec;
  color: #e5dbc4;
  padding: 9px 13px;
  border: 1px solid #bda16b44;
  border-radius: 5px;
  pointer-events: none;
  font-size: 11px;
}
.map-hover-label span {
  color: #b6b99f;
  margin-left: 9px;
}
.mobile-panel-heading {
  display: none;
}
@media (min-width: 768px) {
  .game-shell .game-actions-panel {
    display: flex;
  }
  .game-actions-panel {
    flex-shrink: 0;
  }
  .how-section {
    width: 90%;
  }
}
@media (max-width: 1100px) {
  .civ-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .picker-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 22px;
  }
  .entry-card {
    padding: 24px;
  }
  .entry-card h3 {
    font-size: 23px;
  }
  .art-caption {
    bottom: 24px;
  }
  .map-controls-hint {
    font-size: 9px;
    padding: 7px;
    max-width: 180px;
  }
}
@media (max-width: 767px) {
  .site-header {
    height: auto;
    min-height: 78px;
    flex-wrap: wrap;
    padding-block: 18px;
    gap: 18px;
  }
  .wordmark > span {
    font-size: 14px;
  }
  .site-header nav {
    gap: 19px;
    font-size: 11px;
    width: 100%;
    justify-content: space-between;
  }
  .nav-join {
    padding: 8px 11px;
  }
  .history-hero {
    min-height: 650px;
  }
  .hero-art {
    inset: 0;
    background-position: 62% center;
  }
  .history-hero:before {
    background:
      linear-gradient(90deg, #111713ec, #11171370),
      linear-gradient(0deg, #111713, transparent 60%);
  }
  .hero-content {
    padding: 64px 6% 88px;
  }
  .hero-content h1 {
    font-size: 52px;
    letter-spacing: -1.5px;
  }
  .hero-description {
    font-size: 13px;
    max-width: 330px;
  }
  .desktop-break {
    display: none;
  }
  .history-numbers {
    gap: 24px;
  }
  .history-numbers > div + div {
    padding-left: 24px;
  }
  .history-numbers dd {
    font-size: 8px;
    letter-spacing: 0.6px;
  }
  .art-caption {
    left: 6%;
    right: 6%;
    text-align: left;
    bottom: 20px;
  }
  .art-caption span {
    display: none;
  }
  .section-heading {
    display: block;
  }
  .section-heading h2 {
    font-size: 29px;
    margin-top: 12px;
  }
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .entry-card + .entry-card {
    border-left: 0;
    border-top: 1px solid #8f9d7f35;
  }
  .entry-card p {
    max-width: none;
  }
  .entry-icon {
    margin-bottom: 20px;
  }
  .entry-section {
    padding-top: 36px;
  }
  .how-section {
    margin: 0 5%;
    grid-template-columns: 1fr;
    gap: 35px;
    padding: 45px 0;
  }
  .how-section h2 {
    font-size: 36px;
  }
  .site-footer {
    gap: 20px;
    flex-direction: column;
  }
  .site-footer p {
    text-align: left;
  }
  .picker-heading {
    padding: 30px 0;
  }
  .picker-top > .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .picker-layout {
    grid-template-columns: 1fr;
  }
  .civ-detail {
    position: static;
    grid-row: 1;
  }
  .detail-landscape {
    display: none;
  }
  .detail-content {
    padding: 20px;
  }
  .detail-content h2 {
    font-size: 29px;
  }
  .detail-content h3,
  .detail-trait {
    display: none;
  }
  .detail-facts {
    padding: 10px 0;
  }
  .detail-note {
    margin-bottom: 0;
  }
  .civ-card {
    padding: 15px;
  }
  .civ-card h2 {
    font-size: 22px;
  }
  .civ-mini-stats {
    gap: 15px;
  }
  .game-shell .game-actions-panel {
    display: none;
  }
  .game-shell .game-actions-panel.is-mobile-open {
    display: flex;
    position: fixed;
    inset: auto 0 calc(53px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-height: 70dvh;
    z-index: 40;
    border-top: 1px solid #a28c5a;
    box-shadow: 0 -16px 60px #0007;
  }
  .game-actions-panel.is-mobile-open > button {
    display: none;
  }
  .mobile-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    font-size: 12px;
    color: #e8d9b8;
  }
  .mobile-panel-heading button {
    padding: 7px;
  }
  .game-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
  }
  .game-tab {
    flex-direction: column;
    gap: 5px;
    font-size: 9px;
    min-height: 48px;
    justify-content: center;
  }
  .game-shell .mobile-game-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .map-controls-hint {
    max-width: 195px;
    bottom: 75px;
  }
  .map-toolbar {
    bottom: 75px;
  }
  .game-shell .game-map {
    min-height: 150px;
  }
}
.map-toolbar,
.map-controls-hint,
.map-hover-label {
  z-index: 2;
}
.game-home-link {
  color: #bbaa87;
  padding: 8px;
  border: 1px solid #ffffff20;
  border-radius: 4px;
}
.game-home-link:hover {
  color: #f0dcae;
  background: #ffffff0a;
}
.trait-disclosure summary {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 13px;
  color: #68694f;
  cursor: pointer;
}
.game-shell > header > div:first-child {
  min-width: 0;
}
.game-shell > header > div:last-child {
  flex-shrink: 0;
}
.game-actions-panel > div:last-child {
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .detail-trait {
    display: block;
  }
  .civ-detail {
    scroll-margin-top: 12px;
  }
  .trait-disclosure summary {
    margin-top: 15px;
  }
  .game-shell > header {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 9px;
  }
  .game-shell > header h1 {
    max-width: 150px;
  }
  .game-shell > header > div:first-child {
    flex-wrap: wrap;
    gap: 7px;
  }
  .game-shell > header > div:last-child {
    margin-left: auto;
  }
  .game-home-link {
    padding: 6px;
  }
  .map-toolbar {
    bottom: 16px;
  }
  .map-controls-hint {
    bottom: 16px;
  }
  .game-actions-panel.is-mobile-open {
    min-height: 300px;
  }
  .game-actions-panel .p-4.flex-1 {
    min-height: 0;
  }
  .game-actions-panel > div:last-child {
    height: 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
