/* The board game's website (site/README.md). Parchment, ink and the game's red, as in the online game. */

@font-face { font-family: "Cinzel"; font-weight: 400; font-display: swap; src: url("/fonts/cinzel-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url("/fonts/cinzel-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cardo"; font-weight: 400; font-display: swap; src: url("/fonts/cardo-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cardo"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/cardo-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Cardo"; font-weight: 700; font-display: swap; src: url("/fonts/cardo-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #f3e8cd;
  --paper-deep: #e8d8b2;
  --ink: #2a1d12;
  --ink-soft: #5e4a35;
  --edge: #b9a07a;
  --red: #8e2a1a;
  --red-bright: #b2361f;
  --gold: #d9b56a;
  --night: #1c140e;
  --display: "Cinzel", "Cardo", Georgia, serif;
  --body: "Cardo", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.15rem/1.6 var(--body);
  /* The footer stays at the bottom of short pages. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--red); }
a:hover { color: var(--red-bright); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); text-align: center; margin: 2.5rem 0 1rem; letter-spacing: 0.04em; }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.8rem); margin: 2.2rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.3rem; }
p { margin: 0 0 1rem; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.lead { font-size: 1.25rem; text-align: center; max-width: 46rem; margin: 0 auto 1.5rem; }

/* Buttons */
.btn {
  display: inline-block;
  font: 700 1rem/1 var(--display);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  padding: 0.95rem 1.5rem;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-play { background: var(--red); color: #fff; border-color: #5f1a0f; box-shadow: 0 3px 0 #5f1a0f; }
.btn-play:hover { background: var(--red-bright); color: #fff; }
.btn-ghost { background: rgba(20, 13, 8, 0.55); color: #fff; border-color: var(--gold); }
.btn-ghost:hover { background: rgba(20, 13, 8, 0.8); color: #fff; }
.btn-line { color: var(--red); border-color: var(--red); background: transparent; }
.btn-small { padding: 0.65rem 1rem; font-size: 0.85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* Header */
.top { background: var(--night); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.top-inner { max-width: 1200px; margin: 0 auto; padding: 0.4rem 1.25rem; display: flex; align-items: center; gap: 1.2rem; }
.brand img { display: block; width: 76px; }
.nav { display: flex; gap: 1.4rem; flex: 1; }
.nav a, .lang { color: #f3e8cd; text-decoration: none; font: 700 0.92rem var(--display); letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.nav a:hover, .lang:hover { color: var(--gold); }
.nav a[aria-current="page"] { color: var(--gold); }
.lang { font-weight: 400; text-transform: none; font-family: var(--body); font-size: 1rem; }

/* Home: the banner, with the logo and the two ways in */
.hero { position: relative; background: var(--night); }
.hero picture img { display: block; width: 100%; height: clamp(420px, 62vw, 640px); object-fit: cover; object-position: 50% 40%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10, 6, 3, 0) 35%, rgba(10, 6, 3, 0.85)); pointer-events: none; }
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 1.25rem 2.2rem; text-align: center; color: #fff; }
.hero-text h1 { margin: 0 auto 0.4rem; }
.hero-text h1 img { width: clamp(150px, 22vw, 250px); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
.tagline { font: 700 clamp(1.05rem, 2.6vw, 1.45rem) var(--display); letter-spacing: 0.04em; text-shadow: 0 2px 6px #000; margin-bottom: 1.2rem; }
/* The two ways in: huge, side by side and of equal width; Play online is the filled one. */
.hero .actions { display: grid; grid-template-columns: repeat(2, minmax(340px, 480px)); grid-auto-rows: 1fr; justify-content: center; gap: 1.25rem; margin: 0; }
.hero .actions .btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 80px; padding: 1rem 1.2rem; font-size: 1.4rem; letter-spacing: 0.04em; line-height: 1.2; border-radius: 10px; border-width: 3px;
}
.hero .actions .btn-play { box-shadow: 0 5px 0 #5f1a0f, 0 10px 28px rgba(0, 0, 0, 0.45); }
.intro h2 { text-align: center; }
.intro > p { max-width: 48rem; margin: 0 auto 1.5rem; text-align: center; }

/* Quick facts */
.facts { list-style: none; padding: 0; margin: 1.5rem auto 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
.facts li { background: var(--paper-deep); border: 1px solid var(--edge); border-radius: 999px; padding: 0.4rem 1.1rem; }
.facts strong { font-family: var(--display); color: var(--red); }

/* The cards to the rules pages */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: #fffaf0; border: 1px solid var(--edge); border-radius: 10px; padding: 1.2rem 0.8rem 1rem;
  text-decoration: none; color: var(--ink); box-shadow: 0 4px 14px rgba(60, 40, 20, 0.12); transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(60, 40, 20, 0.2); color: var(--red); }
.card img { width: 110px; height: 110px; object-fit: contain; }
.card span { font: 700 1rem var(--display); text-align: center; }

/* The online game band on the home page */
.band { background: var(--night); color: #f3e8cd; border-top: 3px solid var(--gold); }
.band-inner { display: flex; align-items: center; gap: 2rem; padding-top: 2.5rem; }
.band h2 { color: #fff; margin-top: 0; }
.band-pic { width: 180px; flex: none; }

/* The silver number badge */
.badge {
  display: inline-grid; place-items: center; flex: none;
  min-width: 2.4em; height: 2.4em; padding: 0 0.35em; border-radius: 999px;
  font: 700 0.85rem var(--display); color: var(--ink);
  background: radial-gradient(circle at 50% 45%, #fff 0 45%, #cfcfcf 62%, #8e8e8e 100%);
  border: 2px solid #777; vertical-align: middle;
}

/* Components */
.group { border-top: 1px solid var(--edge); }
.group h2 { display: flex; align-items: center; gap: 0.7rem; font-size: 1.4rem; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem; align-items: end; }
.items.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.item { margin: 0; text-align: center; }
.item img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.items.small .item img { max-height: 120px; }
.item figcaption { margin-top: 0.4rem; font-weight: 700; }

/* Setup */
.steps { list-style: none; padding: 0; margin: 0; }
.step { display: grid; grid-template-columns: auto 1fr 300px; gap: 1.2rem; align-items: center; padding: 1.6rem 0; border-top: 1px solid var(--edge); }
.step .badge { font-size: 1.2rem; }
.step-pic { text-align: center; }
.step-pic img { max-height: 240px; width: auto; }
.note { font-style: italic; color: var(--ink-soft); }
.go { font: 700 1.6rem var(--display); color: var(--red); }

/* Units and buildings */
.pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.piece { margin: 0; text-align: center; }
.piece img { width: 170px; }

/* Game modes */
.modes-layout { display: grid; grid-template-columns: 2fr 3fr; gap: 2.5rem; align-items: start; }
.modes-pic { border-radius: 10px; box-shadow: 0 8px 24px rgba(40, 25, 10, 0.3); position: sticky; top: 7rem; }
.mode h2 { margin-top: 0; color: var(--red); }
.mode + .mode { border-top: 1px solid var(--edge); padding-top: 1.2rem; }

/* Civilizations */
.civs { display: grid; gap: 0.5rem; }
.civ { display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; align-items: center; padding: 1.3rem 0; border-top: 1px solid var(--edge); }
.civ h2 { margin: 0 0 0.4rem; }
.bonus { font-weight: 700; color: var(--red); margin: 0; }

/* Shop */
.shop-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
.shop .lead { text-align: left; margin: 0 0 1rem; }
.soon { display: inline-block; font: 700 1rem var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: var(--red); padding: 0.35rem 0.9rem; border-radius: 4px; }
.box { filter: drop-shadow(0 12px 24px rgba(40, 25, 10, 0.35)); }

/* Contact and not found */
.contact { text-align: center; }
.contact .actions { justify-content: center; }
.address { font-size: 1.35rem; }

/* Footer */
.foot { background: var(--night); color: #cbb998; border-top: 3px solid var(--gold); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; padding-top: 2rem; padding-bottom: 2rem; }
.foot nav { display: flex; flex-direction: column; gap: 0.3rem; }
.foot a { color: #f3e8cd; text-decoration: none; }
.foot a:hover { color: var(--gold); }
.copy { margin: 0 0 0 auto; align-self: flex-end; font-size: 0.95rem; }

/* Tablets and phones */
@media (max-width: 860px) {
  .top-inner { flex-wrap: wrap; gap: 0.4rem 1rem; padding: 0.4rem 1rem 0; }
  .brand img { width: 56px; }
  .lang { margin-left: auto; }
  .nav { order: 5; flex-basis: 100%; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.1rem; padding: 0.4rem 0 0.6rem; }
  .nav a { font-size: 0.8rem; }
  .step { grid-template-columns: auto 1fr; }
  .step-pic { grid-column: 2; text-align: left; }
  .step-pic img { max-height: 200px; }
  .modes-layout, .shop-layout { grid-template-columns: 1fr; }
  .modes-pic { position: static; max-width: 420px; margin: 0 auto; }
  .box { max-width: 380px; margin: 0 auto; display: block; }
  .band-inner { flex-direction: column; text-align: center; gap: 1rem; }
  .band-pic { width: 130px; }
  .copy { margin: 0; }
  /* Stacked and full width once two side by side no longer fit. */
  .hero .actions { grid-template-columns: minmax(0, 480px); }
  .hero .actions .btn { min-height: 72px; font-size: 1.2rem; letter-spacing: 0.03em; }
}
@media (max-width: 520px) {
  body { font-size: 1.08rem; }
  .civ { grid-template-columns: 84px 1fr; gap: 1rem; align-items: start; }
  .hero picture img { height: 540px; object-position: 47% 40%; }
  .hero .actions .btn { font-size: 1.08rem; padding: 1rem 0.8rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card img { width: 80px; height: 80px; }
  .card span { font-size: 0.85rem; }
  .items { grid-template-columns: repeat(2, 1fr); }
  .items.small { grid-template-columns: repeat(3, 1fr); }
  .items.small .item img { max-height: 90px; }
  .item figcaption { font-size: 0.95rem; }
  .step-pic img { max-height: 160px; }
}
