/*
 * The game's public site: the game's own windows laid on its own dark ground. Every frame, board, plaque, slot and
 * button is a painted piece of the interface kit (art/ui, the game's client/src/art/ui), drawn as 9-slices exactly as
 * the game's stylesheet draws them; the faces are the game's (Marcellus for what names things, Alegreya to read,
 * Cinzel 700 for a window's title, the figures cut for each); the pictures are the game's own art and screenshots. No
 * picture of anyone else's, nothing fetched from another host. Simple on purpose: nothing here depends on a measured
 * size, and a phone's width is a column of the same pieces.
 */
@font-face { font-family: "Label Figures"; font-weight: 400; font-display: swap; src: url("art/fonts/figures-label.woff2") format("woff2"); unicode-range: U+30-39; }
@font-face { font-family: "Text Figures"; font-weight: 400; font-display: swap; src: url("art/fonts/figures-text-400.woff2") format("woff2"); unicode-range: U+30-39; }
@font-face { font-family: "Text Figures"; font-weight: 700; font-display: swap; src: url("art/fonts/figures-text-700.woff2") format("woff2"); unicode-range: U+30-39; }
@font-face { font-family: "Marcellus"; font-weight: 400; font-display: swap; src: url("fonts/marcellus-400.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url("fonts/cinzel-700.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 400; font-display: swap; src: url("fonts/alegreya-400.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/alegreya-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 700; font-display: swap; src: url("fonts/alegreya-700.woff2") format("woff2"); }

:root {
  --font-label: "Label Figures", "Marcellus", "Palatino Linotype", "Book Antiqua", serif;
  --font-text: "Text Figures", "Alegreya", "Palatino Linotype", Georgia, serif;
  --font-title: "Label Figures", "Cinzel", "Marcellus", "Palatino Linotype", serif;
  --cream: #f2e5c6;
  --cream-dim: #c4af86;
  --faint: #8a7656;
  --gold: #e8bb5e;
  --gold-dim: #b98a3a;
  --chosen-ink: #f0b03c;
  --ground: #0f0a06;
  --line: #4a3522;
  /* The kit's pieces, as the game slices them (client/src/style.css, ":root"). */
  --kit-window: url("art/ui/window.webp") 52 fill / 40px stretch;
  --kit-window-timber: url("art/ui/window.webp") 26 / 20px stretch;
  --kit-title: url("art/ui/title.webp") 40 62 fill / 14px 22px stretch;
  --kit-plaque: url("art/ui/plaque.webp") 56 fill / 13px stretch;
  --kit-slot: url("art/ui/slot.webp") 34 fill / 8px stretch;
  --kit-button: url("art/ui/button.webp") 64 fill / 11px stretch;
  --kit-button-lit: url("art/ui/button-lit.webp") 64 fill / 11px stretch;
  --shadow: 0 1px 0 #000, 0 0 3px rgb(0 0 0 / 0.85);
  /* A window's frame, and how far its name board stands up out of it. */
  --edge: 40px;
  --board-up: 52px;
  --gap: 28px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--ground); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--cream);
  font: 400 18px/1.6 var(--font-text);
  /* the game's dark ground, a little warmer where the light falls from above */
  background: radial-gradient(ellipse 120% 70% at 50% 0%, rgb(110 70 30 / 0.16), transparent 62%), var(--ground);
}
img { max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: rgb(232 187 94 / 0.35); }
p { margin: 0 0 12px; }

/* --- The bar: the name on its board, the pages, Play ---------------------------------------------------------- */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 6px;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  min-width: 200px;
  padding: 0 26px;
  border: 16px solid transparent;
  border-width: 16px 25px;
  border-image: url("art/ui/title.webp") 40 62 fill / 16px 25px stretch;
  font: 700 23px/1 var(--font-title);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 1px 0 #000, 0 0 6px rgb(0 0 0 / 0.9);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; filter: brightness(1.1); }
.links { display: flex; flex-wrap: wrap; gap: 4px 24px; font: 400 17px/1.3 var(--font-label); }
.links a { padding: 6px 0; color: var(--cream-dim); text-shadow: var(--shadow); }
.links a:hover, .links a[aria-current] { color: var(--gold); text-decoration: none; }
.top .play { margin-left: auto; }

/* --- The page ---------------------------------------------------------------------------------------------- */
.main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* A window of the kit: its timber and iron round a dark panel, its name on a board across its top edge (as the
 * game's windows, client/src/style.css ".window", ".window-head"). */
.win {
  position: relative;
  margin: calc(var(--board-up) + 8px) 0 var(--gap);
  padding: 34px 20px 16px;
  border: var(--edge) solid transparent;
  border-image: var(--kit-window);
  border-image-width: var(--edge);
  box-shadow: 0 14px 26px rgb(0 0 0 / 0.55);
  border-radius: 5px;
}
.win > .board {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--board-up));
  height: 56px;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: inherit;
}
.board > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  height: 50px;
  padding: 0 22px;
  border: 14px solid transparent;
  border-width: 14px 22px;
  border-image: var(--kit-title);
  font: 700 20px/1 var(--font-title);
  letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow: var(--shadow);
  white-space: nowrap;
}
.win > p, .feature-text > p { max-width: 70ch; }
.say { font-size: 20px; line-height: 1.5; color: var(--cream); }
.win .more { margin: 10px 0 0; font: 400 15.5px var(--font-label); }
.win .more a { color: var(--gold); text-shadow: var(--shadow); }

/* A heading on the ground between two of the kit's iron rules, as the game's windows caption a part of themselves. */
.rule-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 46px 0 6px;
  font: 400 22px/1.2 var(--font-label);
  letter-spacing: 0.08em;
  color: var(--cream-dim);
  text-shadow: var(--shadow);
}
.rule-head::before, .rule-head::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2c2014 18%, #3a2918 50%, #2c2014 82%, transparent);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.9);
}

/* --- The kit's buttons ------------------------------------------------------------------------------------------- */
.btn {
  --wash: none;
  --relief: inset 0 1px 0 rgb(255 214 160 / 0.22), inset 0 -2px 0 rgb(0 0 0 / 0.45);
  position: relative;
  isolation: isolate;
  appearance: none;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border: 11px solid transparent;
  border-image: var(--kit-button);
  border-radius: 7px;
  background: #46281e;
  box-shadow: 0 0 0 1px #0a0503, 0 3px 5px rgb(0 0 0 / 0.7);
  font: 400 15px/1.1 var(--font-label);
  color: var(--cream);
  text-shadow: var(--shadow);
  white-space: nowrap;
  cursor: pointer;
}
/* (its states are drawn by a layer of its own over its piece and under its words: the piece fills its middle, so a
 * shade on the button itself would never show; as the game draws it) */
.btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -11px;
  border-radius: inherit;
  background: var(--wash);
  box-shadow: var(--relief);
  pointer-events: none;
}
.btn:hover { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) {
    --wash: rgb(255 214 160 / 0.12);
    --relief: inset 0 1px 0 rgb(255 214 160 / 0.4), inset 0 -2px 0 rgb(0 0 0 / 0.45);
  }
}
.btn:active:not(:disabled) {
  --wash: rgb(0 0 0 / 0.26);
  --relief: inset 0 2px 0 rgb(0 0 0 / 0.75), inset 0 5px 6px -2px rgb(0 0 0 / 0.8), inset 0 -1px 0 rgb(255 214 160 / 0.28);
  box-shadow: 0 0 0 1px #0a0503;
}
/* Play, when it goes somewhere: the kit's lit piece and its word gold, as the chosen button of the game. */
.btn.lit { border-image: var(--kit-button-lit); color: var(--chosen-ink); filter: brightness(1.2); }
/* Disabled: grey and flat, still in its place, its word dimmed and still plain to read (the game's one disabled look). */
.btn:disabled {
  --wash: rgb(255 255 255 / 0.1);
  --relief: none;
  box-shadow: 0 0 0 1px #0a0503;
  filter: grayscale(0.85) brightness(0.72);
  cursor: not-allowed;
}
.btn.big { min-height: 52px; min-width: 170px; padding: 0 22px; font-size: 18px; letter-spacing: 0.04em; }

.play { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.play > small { font: 400 13px/1.2 var(--font-label); color: var(--cream-dim); text-shadow: var(--shadow); letter-spacing: 0.04em; }
.play.small .btn { min-width: 110px; }
.play.small > small { font-size: 12px; }
.acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 20px; margin: 18px 0 6px; }

/* --- Screenshots ------------------------------------------------------------------------------------------------ */
.shot { margin: 0; }
.shot .frame {
  position: relative;
  overflow: hidden;
  background: #0b0705;
  /* inside a window: a thin dark line, as the wiki's shots have; never a second frame inside a frame */
  box-shadow: 0 0 0 1px #050302, 0 0 0 2px #3c2a19;
}
.shot .frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* standing on the ground by itself: in the kit's timber, as the game frames its map */
.shot.framed .frame {
  border: 20px solid transparent;
  border-image: var(--kit-window-timber);
  border-image-width: 20px;
  border-radius: 5px;
  box-shadow: 0 16px 30px rgb(0 0 0 / 0.6);
}
.shot figcaption { margin-top: 7px; font: 400 14px/1.4 var(--font-label); color: var(--cream-dim); text-shadow: var(--shadow); }
/* A shot not taken yet: a plain dark panel of its shape, with its name (site/shots.md). */
.shot .frame.missing { display: flex; align-items: center; justify-content: center; text-align: center; background: #0c0805; }
.wanted b { display: block; font: 400 16px/1.3 var(--font-label); color: var(--cream-dim); }
.wanted small { display: block; font: 400 13px/1.3 var(--font-label); color: var(--faint); }

/* --- The game's own pictures in a row, each with its name ---------------------------------------------------------- */
.things { display: flex; flex-wrap: wrap; gap: 12px 10px; margin: 14px 0 4px; padding: 0; list-style: none; }
.things li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 78px;
  text-align: center;
  font: 400 12.5px/1.25 var(--font-label);
  color: var(--cream-dim);
  text-shadow: var(--shadow);
}
.pic {
  display: inline-block;
  flex: none;
  width: 52px;
  height: 52px;
  border: 8px solid transparent;
  border-image: var(--kit-slot);
  background: #0b0705;
}
.pic img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pic.mark { border: 0; border-radius: 50%; background: #0b0705; box-shadow: 0 0 0 2px #3a2816, 0 0 0 3px #000; overflow: hidden; }
.pic.mark img { object-fit: cover; }
.pic.glyph { border: 0; background: none; width: 46px; height: 46px; }
.things.small li { width: 70px; }
.things.small .pic { width: 46px; height: 46px; }
.things.small .pic.glyph { width: 40px; height: 40px; }

/* --- The front page ------------------------------------------------------------------------------------------- */
.hero { margin: 8px 0 0; }
.hero-shot { position: relative; }
/* the window laid over the foot of the world's picture, as the game's windows lie over its world */
.hero-win {
  position: relative;
  z-index: 1;
  width: 620px;
  max-width: calc(100% - 48px);
  margin: -170px 0 var(--gap) 48px;
}
.hero-win .say { font-size: 21px; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  padding: 8px 6px 6px;
  border: 13px solid transparent;
  border-image: var(--kit-plaque);
  text-align: center;
}
.facts b { display: block; font: 700 30px/1.1 var(--font-text); color: var(--gold); text-shadow: var(--shadow); }
.facts span { display: block; font: 400 14px/1.3 var(--font-label); color: var(--cream-dim); text-shadow: var(--shadow); }

/* Windows side by side, as many as the width holds, each the same width. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); column-gap: var(--gap); }
.card { display: flex; flex-direction: column; margin-bottom: 4px; }
.card .shot { margin: 0 0 14px; }
.card .more { margin-top: auto; padding-top: 10px; }

/* A picture on the ground and a window beside it. */
.pair { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: center; margin: 52px 0 0; }
.pair > .win { margin-bottom: 0; }
/* A screenshot not taken yet is simply not there (build.ts): each place lays out well without it. A card is its words
 * and its row of the game's pictures, larger, in the middle of its window; a pair is its window alone; the hero's window
 * stands on the ground, not pulled up over nothing. */
.card.no-shot { justify-content: center; }
.card.no-shot > p { font-size: 19px; line-height: 1.5; }
.card.no-shot .things { margin: 18px 0 6px; }
.card.no-shot .more { margin-top: 14px; }
.pair.no-shot { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin-left: auto; margin-right: auto; }
.hero.no-shot .hero-win { width: auto; max-width: 900px; margin: calc(var(--board-up) + 14px) 0 var(--gap); }
.closing { max-width: 760px; margin-left: auto; margin-right: auto; margin-top: 90px; }

/* --- The world ------------------------------------------------------------------------------------------------ */
.intro { max-width: 900px; }
.on-world .main > .shot.framed { margin: 0 0 var(--gap); }
.regions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.plaque.region {
  display: block;
  height: 100%;
  padding: 8px 10px 8px;
  border: 13px solid transparent;
  border-image: var(--kit-plaque);
  color: var(--cream);
}
.plaque.region:hover { text-decoration: none; filter: brightness(1.12); }
.plaque.region b { display: block; font: 400 18px/1.25 var(--font-label); color: var(--cream); text-shadow: var(--shadow); }
.plaque.region em { display: block; margin: 2px 0 4px; font: 400 13px/1.2 var(--font-label); font-style: normal; letter-spacing: 0.06em; color: var(--gold); text-shadow: var(--shadow); }
.plaque.region span { display: block; font-size: 14.5px; line-height: 1.4; color: var(--cream-dim); }
.narrow { max-width: 900px; }

/* --- What you can do: a picture and its words, the sides taking turns ---------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin-top: 84px;
}
.feature.flip > .shot { order: 2; }
.feature.no-shot { grid-template-columns: minmax(0, 1fr); }
.feature.no-shot .pic { width: 60px; height: 60px; }
.feature.no-shot .pic.glyph { width: 54px; height: 54px; }
.feature.no-shot .things li { width: 88px; }
.feature-text .things { margin-top: 16px; }

/* --- Credits -------------------------------------------------------------------------------------------------- */
.prose { max-width: 820px; font-size: 16.5px; }
.prose h2 { margin: 26px 0 10px; padding-bottom: 5px; font: 400 21px/1.25 var(--font-label); color: var(--gold); text-shadow: var(--shadow); border-bottom: 1px solid var(--line); }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose a { overflow-wrap: anywhere; }
.prose kbd { font: 400 14px var(--font-label); color: var(--faint); }

/* --- The foot ------------------------------------------------------------------------------------------------- */
.foot {
  border-top: 2px solid #050302;
  box-shadow: 0 -1px 0 #2a1d12;
  background: #0b0705;
}
.foot-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
}
.foot-name { font: 700 17px/1 var(--font-title); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-dim); }
.foot-name:hover { color: var(--cream); text-decoration: none; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 22px; font: 400 15px var(--font-label); }
.foot-links a { color: var(--cream-dim); }
.foot-links a:hover, .foot-links a[aria-current] { color: var(--gold); text-decoration: none; }
.foot-in p { flex-basis: 100%; margin: 6px 0 0; font: 400 13.5px/1.5 var(--font-label); color: var(--faint); }

/* --- A narrower window --------------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-win { width: auto; max-width: none; margin: calc(var(--board-up) + 14px) 0 var(--gap); }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair > .win { margin-top: calc(var(--board-up) + 8px); }
  .feature { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .feature.flip > .shot { order: 0; }
}

/* --- A phone ------------------------------------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root { --edge: 22px; --board-up: 40px; --gap: 18px; }
  body { font-size: 17px; }
  .top { justify-content: space-between; padding: 12px 12px 4px; gap: 8px 12px; }
  .brand { height: 48px; min-width: 0; padding: 0 16px; border-width: 13px 20px; border-image-width: 13px 20px; font-size: 19px; letter-spacing: 0.12em; }
  .top .play { margin-left: 0; }
  .links { order: 3; width: 100%; justify-content: center; gap: 0 20px; font-size: 16px; }
  .main { padding: 12px 12px 44px; }
  .win { padding: 26px 10px 12px; }
  .board > span { min-width: 0; height: 42px; padding: 0 14px; border-width: 11px 18px; border-image-width: 11px 18px; font-size: 17px; }
  .win > .board { height: 46px; }
  .say, .hero-win .say { font-size: 18px; }
  .shot.framed .frame { border-width: 11px; border-image-width: 11px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .facts b { font-size: 26px; }
  .things li, .things.small li { width: 66px; font-size: 12px; }
  .acts { gap: 14px; }
  .btn.big { min-width: 140px; }
  .feature { margin-top: 64px; }
  .rule-head { margin-top: 34px; font-size: 19px; gap: 10px; }
}
