/* Caesar IV look. Art is cropped from the game by tools/extract_web_assets.py. */
:root {
  --label: #c4ab72;        /* laurel button text, sampled from the main menu */
  --label-hover: #e8d39c;
  --ink: #e6e0cf;
  --muted: #9e9580;
  --line: rgba(196, 171, 114, .35);
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
}

* { box-sizing: border-box; }

html { background: #1f1e2b; }

body {
  margin: 0;
  min-height: 100vh;
  padding-block: 20px 40px;
  padding-inline: 16px;
  background: #2c2b3d url("img/marble.png") center / cover no-repeat fixed;
  color: var(--ink);
  font: 16px/1.45 var(--serif);
}

a { color: inherit; }

/* ---- Laurel button: textbutton_sm.tga, always drawn at its own 253:77 shape.
   laurel.png stacks normal / hover / pressed / disabled, so no state waits on a download. ---- */
.laurel {
  --w: 253px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--w);
  max-width: 100%;
  aspect-ratio: 253 / 77;
  /* keep the label on the blue plate, clear of the laurels */
  padding: 0 calc(var(--w) * .19) calc(var(--w) * .01);
  border: 0;
  background: url("img/laurel.png") 0 0 / 100% 400% no-repeat;
  color: var(--label);
  font: calc(var(--w) * .071) / 1 var(--serif);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.laurel:hover,
.laurel:focus-visible {
  background-position: 0 33.3333%;
  color: var(--label-hover);
  outline: none;
}
.laurel:active,
.laurel[aria-current],
.laurel[aria-pressed="true"] {
  background-position: 0 66.6667%;
  color: var(--label-hover);
}
.laurel:disabled {
  background-position: 0 100%;
  color: #8b8b8b;
  cursor: default;
}
.laurel.small { --w: 190px; }

/* Pressing a button nudges it down and right, like the game's click. */
.laurel:active:not(:disabled),
.dialog:active:not(:disabled) {
  transform: translate(2px, 2px);
}

/* ---- Dialog button: build_backgrnd_buttons.tga (OK / Cancel), blue plate with a thin gold rim.
   dialog.png stacks normal / hover / pressed / disabled at 127x40. ---- */
.dialog {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 127px;
  height: 40px;
  padding: 0 10px 1px;
  border: 0;
  background: url("img/dialog.png") 0 0 / 100% 400% no-repeat;
  color: #e9eeee;       /* sampled from the in-game OK / Cancel labels */
  font: 15px/1 var(--serif);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.dialog:hover,
.dialog:focus-visible {
  background-position: 0 33.3333%;
  color: #fff;
  outline: none;
}
.dialog:active,
.dialog[aria-pressed="true"] {
  background-position: 0 66.6667%;
  color: #fff;
}
.dialog[aria-pressed="true"] { text-shadow: 0 0 6px rgba(255, 255, 255, .35); }
.dialog:disabled {
  background-position: 0 100%;
  color: #9a9a9a;
  cursor: default;
}
.buttons.dialogs { gap: 6px; margin-top: 4px; }

/* ---- Top bar: sound on the left, account on the right ---- */
.topbar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-height: 40px;  /* reserve the row so the account buttons don't shift the page when they appear */
}
.topbar .account { margin: 0; justify-content: flex-end; }
.sound-toggle { width: 110px; height: 35px; font-size: 13px; }
.buttons.left { justify-content: flex-start; }

/* ---- Account forms and setup guide ---- */
.account-form { max-width: 340px; margin: 6px auto 0; }
.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 3px; color: var(--label); }
.field input, .find input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #b89c5c;
  border-radius: 3px;
  background: rgba(8, 18, 24, .85);
  color: var(--ink);
  font: 16px var(--serif);
}
.field input:focus { outline: 2px solid var(--label); outline-offset: 1px; }
.form-error { min-height: 1.4em; margin: 0 0 6px; color: #ff9a7a; text-align: center; }
.form-footer { text-align: center; color: var(--muted); }
.form-footer a, .sub a, .setup a:not(.dialog), .note a { color: var(--label-hover); }

.note { color: var(--muted); margin: 4px 0 10px; }
.setup { margin: 8px auto 12px; max-width: 760px; }
.setup h2 { margin-top: 8px; }
.steps { padding-left: 1.4em; margin: 10px 0; line-height: 1.55; }
.steps li { margin-bottom: 18px; padding-left: 4px; }
.steps li::marker { color: var(--label); }
.steps b { color: var(--label-hover); font-weight: normal; }
.steps .buttons { margin-top: 8px; }
code { font: 14px Consolas, "Courier New", monospace; color: #e8dcb8; background: rgba(0, 0, 0, .35); padding: 1px 4px; border-radius: 2px; }
pre.lines { overflow-x: auto; padding: 10px 12px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); font: 13px/1.5 Consolas, "Courier New", monospace; color: #e8dcb8; }
.warning { margin: 8px 0 0; color: #f0c27a; }
.steps .note { margin: 8px 0 0; }
.note.small { font-size: 13px; }
details .steps { margin-top: 8px; }
.dialog.wide { width: 210px; }
.direct-link { margin: 8px 0 0; font-size: 14px; }
.direct-link a { overflow-wrap: anywhere; font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.dialog.inline { width: 230px; vertical-align: middle; margin-left: 6px; }
/* A lesser alternative next to a main button: smaller and dimmed until hovered. */
.driver-downloads { align-items: center; }
.dialog.secondary { width: 96px; height: 30px; font-size: 13px; color: #b9c2c2; filter: saturate(.45) brightness(.8); }
.dialog.secondary:hover, .dialog.secondary:focus-visible { filter: none; }
details { margin-top: 6px; color: var(--muted); }
summary { cursor: pointer; color: var(--label); }

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px;
}

/* ---- Header ---- */
.site {
  max-width: 1100px;
  margin: 0 auto 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
/* The game's logo, on the same marble as the page. Its width and height
   attributes reserve the space before it loads. */
.title { display: block; width: min(380px, 100%); line-height: 0; }
.title img { display: block; width: 100%; height: auto; }
/* The ornament is cut from the marble behind the page; feather its edges into it. */
.feather {
  --feather: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent), linear-gradient(transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: var(--feather);
  -webkit-mask-composite: source-in;
  mask-image: var(--feather);
  mask-composite: intersect;
}
.find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
}
.find label { color: var(--label); text-shadow: 0 1px 2px #000; }
.find input { width: 180px; }
.find input:focus { outline: 2px solid var(--label); outline-offset: 1px; }

/* ---- Framed panel: Border_5.tga ---- */
.panel {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 360px;
  --panel-pad: 12px;
  padding: 6px 12px 14px;
  border-style: solid;
  border-width: 26px;
  border-image: url("img/panel.png") 34 fill / 26px stretch;
}

h1, h2, h3 { font-weight: normal; color: var(--label); margin: 0; }
h1 { font-size: 28px; text-align: center; }
h2 { font-size: 22px; text-align: center; margin: 22px 0 4px; }
h3 { font-size: 18px; margin: 24px 0 8px; }
.sub { text-align: center; color: var(--muted); margin: 2px 0 12px; }

.divider {
  height: 1px;
  margin: 18px 0 4px;
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
}

/* ---- Scenario cards: map preview (from the scenario's terrain texture) in a gold frame ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px 16px;
  margin-top: 12px;
}
.cards:has(> :nth-child(-n+4):last-child) { /* a handful of cards: centre them rather than leave gaps */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.cards:has(> :nth-child(-n+4):last-child) .card { width: 190px; }
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
}
.card .frame { width: 100%; aspect-ratio: 1; cursor: pointer; transition: filter .15s; }
.card .name { margin-top: 6px; color: var(--label); font-size: 17px; line-height: 1.2; }
.card small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.card small b { color: var(--ink); font-weight: normal; }
.card.unsettled .frame { filter: saturate(.55) brightness(.75); }
.card:hover .frame, .card:focus-visible .frame { filter: brightness(1.15); }
.card:hover .name, .card:focus-visible .name, .card[aria-current] .name { color: var(--label-hover); }
.card:focus-visible { outline: none; }
.card[aria-current] .frame { box-shadow: 0 0 0 2px var(--label-hover), 0 0 14px rgba(232, 211, 156, .45); }

.scenario-head {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin: 18px 0 14px;
}
.scenario-head .frame { flex: none; width: 220px; aspect-ratio: 1; cursor: default; }
.scenario-head h2 { text-align: left; margin: 0; }
.scenario-head .meta { margin: 2px 0 10px; color: var(--muted); }
.scenario-head .overview { margin: 0 0 8px; max-width: 68ch; color: var(--ink); line-height: 1.55; }

/* ---- Leaderboard ---- */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th {
  padding: 6px 10px;
  text-align: right;
  font-weight: normal;
  color: var(--label);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 6px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(196, 171, 114, .12);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
th.l, td.l { text-align: left; }
tbody tr:hover td { background: rgba(120, 20, 10, .28); }
td.rank { color: var(--muted); width: 3em; }
tr.gold td.rank { color: #e5c158; }
tr.silver td.rank { color: #cfd3d6; }
tr.bronze td.rank { color: #c88b52; }
td.sorted { color: #fff3cf; }
td a { text-decoration: none; color: var(--ink); border-bottom: 1px dotted var(--muted); }
td a:hover { color: var(--label-hover); border-bottom-color: var(--label-hover); }
td.ratings { color: var(--muted); }
/* Four narrow rating columns: tighter sides keep the table from scrolling on a laptop-width window. */
th.ratings, td.ratings { padding-inline: 4px; }

/* ---- Scroll box: uicontrols.tga's scrollbar. scroll.png holds columns up / down / knob,
   rows normal / hover / pressed, 32px each. ---- */
/* Framed like the game's list boxes (e.g. Game Screen Resolution) with listframe.png,
   the gold rules of Border_2.tga, on all four sides and again between the list and
   its scrollbar. */
.scroller {
  display: flex;
  background: rgba(8, 8, 12, .5);
  border: 4px solid transparent;
  border-image: url("img/listframe.png") 6 / 4px stretch;
}
.scroll-view {
  flex: 1;
  min-width: 0;
  max-height: 340px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scroll-view::-webkit-scrollbar { display: none; }
.scroll-view:focus-visible { outline: 1px solid var(--line); outline-offset: 2px; }
.scrollbar {
  flex: none;
  width: 42px;
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  /* just the left rule of the frame: its middle rows, stretched */
  border-style: solid;
  border-width: 0 0 0 4px;
  border-image: url("img/listframe.png") 6 0 6 6 / 0 0 0 4px stretch;
}
.scroller.fits .scrollbar { visibility: hidden; }
.scroll-arrow, .scroll-knob {
  display: block;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: url("img/scroll.png") 0 0 / 300% 300% no-repeat;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.scroll-arrow.down { background-position-x: 50%; }
.scroll-arrow:hover { background-position-y: 50%; }
.scroll-arrow:active { background-position-y: 100%; transform: translate(1px, 1px); }
.scroll-track { position: relative; flex: 1; min-height: 40px; touch-action: none; }
.scroll-track::before { /* the rail the knob rides on */
  content: "";
  position: absolute;
  inset: 2px calc(50% - 2px);
  border-radius: 2px;
  background: linear-gradient(90deg, #6d5526, #d9bd78 50%, #6d5526);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
}
.scroll-knob { position: absolute; top: 0; left: 0; background-position-x: 100%; touch-action: none; cursor: grab; }
.scroll-knob:hover, .scroll-knob.dragging { filter: brightness(1.15); }
.scroll-knob.dragging { cursor: grabbing; }

/* ---- Homepage: the game's online menu, below the logo in the header ---- */
.menu-head {
  margin: -6px calc(-1 * var(--panel-pad)) 0;
  padding: 14px 0 12px;
  background: #3b3a52 url("img/marble.png") center / cover;
  text-align: center;
}
.menu-head .status {
  display: inline-block;
  min-width: 220px;
  margin: 0;
  padding: 5px 14px;
  background: #000;
  border: 1px solid #b89c5c;
  color: var(--label);
  font-size: 14px;
  position: relative;
}
.menu-head .ornament { display: block; margin: 8px auto 0; width: 234px; max-width: 100%; height: auto; }
.menu-band {
  margin: 0 calc(-1 * var(--panel-pad));
  padding: 22px 12px 18px;
  background: #2a2630 url("img/strip.jpg") center / cover;
  box-shadow: inset 0 0 0 999px rgba(20, 18, 30, .42), inset 0 14px 18px -10px #000, inset 0 -14px 18px -10px #000;
}
.choices { display: flex; justify-content: center; gap: clamp(16px, 7vw, 80px); }
.choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(220px, 38vw);
  text-align: center;
  text-decoration: none;
}
.choice .frame {
  width: 100%;
  aspect-ratio: 220 / 300;
  cursor: pointer;
  position: relative;
  box-shadow: 0 12px 28px #000;
  transition: transform .2s, filter .2s;
}
/* The paintings differ in shape; keep them from stretching the frame, and zoom in a touch
   past the sliver of dark card edge the crops carry. Only the gold outer 13px of
   panel.png's edge is used: the rest of its 34px slice is a dark inner shadow that
   showed as black bars around the paintings. */
.choice .frame { overflow: hidden; border-width: 6px; border-image: url("img/panel.png") 13 / 6px stretch; }
.choice .frame img { position: absolute; inset: 0; transform: scale(1.05); }
/* Tilted toward each other, as on the game's chooser. */
.choice.left .frame { transform: perspective(800px) rotateY(14deg); }
.choice.right .frame { transform: perspective(800px) rotateY(-14deg); }
.choice:hover .frame, .choice:focus-visible .frame { transform: perspective(800px) rotateY(0); filter: brightness(1.12); }
.choice:focus-visible { outline: none; }
.choice .laurel { --w: min(220px, 38vw); }
.choice:hover .laurel, .choice:focus-visible .laurel { background-position: 0 33.3333%; color: var(--label-hover); }
.choice:active .laurel { background-position: 0 66.6667%; transform: translate(2px, 2px); }
.choice small { color: var(--ink); font-size: 14px; line-height: 1.3; text-shadow: 0 1px 3px #000; }
.menu-lower {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr));
  gap: 8px 26px;
  margin-top: 18px;
}
.menu-lower h2 { margin: 0 0 8px; font-size: 20px; }
.inset { background: rgba(8, 8, 12, .5); border: 1px solid var(--line); padding: 6px 8px; }
.menu-lower .empty { padding: 40px 0; }
/* Half-width columns: the time moves under the name and the screenshot drops out. */
.menu-lower .plays li { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 10px; }
.menu-lower .plays .shot { display: none; }
.menu-lower .plays .when { grid-column: 2; grid-row: 2; margin-top: -4px; text-align: left; font-size: 12px; }
.menu-lower .plays .frame.mini { grid-row: span 2; }
.menu-lower .plays .result { grid-column: 3; grid-row: 1 / span 2; }
.leaders { margin: 0; list-style: none; }
.leaders li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 12px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(196, 171, 114, .12);
}
.leaders li:last-child { border-bottom: 0; }
.leaders a { text-decoration: none; color: var(--ink); }
.leaders a .scen { color: var(--label); }
.leaders a:hover .scen, .leaders a:hover .who { color: var(--label-hover); }
.leaders .val { grid-row: span 2; text-align: right; color: #fff3cf; font-variant-numeric: tabular-nums; line-height: 1.2; }
.leaders .val small { display: block; color: var(--muted); font-size: 12px; }
.leaders .obj { color: var(--muted); font-size: 13px; }
.about { margin-top: 18px; }

/* ---- Latest plays ---- */
.plays { margin: 0; padding: 0; list-style: none; }
.plays li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 96px 7em 7.5em;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(196, 171, 114, .12);
}
/* Hover looks like the game's selected list row: deep red with a thin gold rim. */
.plays li:hover { background: #4a120c; box-shadow: inset 0 0 0 1px #c9ae6c; border-radius: 4px; }
.frame.mini { width: 44px; height: 44px; border-width: 4px; border-image-width: 4px; cursor: pointer; }
.plays .what { min-width: 0; line-height: 1.3; }
.plays .what > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plays .what small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plays .what a { text-decoration: none; color: var(--ink); border-bottom: 1px dotted var(--muted); }
.plays .what a.city { color: var(--label); }
.plays .what a:hover { color: var(--label-hover); border-bottom-color: var(--label-hover); }
.plays .result { text-align: right; font-variant-numeric: tabular-nums; color: #fff3cf; line-height: 1.2; }
.plays .result small { display: block; color: var(--muted); font-size: 12px; }
.plays .when { text-align: right; color: var(--muted); font-size: 14px; white-space: nowrap; }

/* ---- Screenshots ---- */
.frame {
  display: block;
  padding: 0;
  border-style: solid;
  border-width: 10px;
  border-image: url("img/panel.png") 34 / 10px stretch;
  background: #000;
  cursor: zoom-in;
}
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Scenario previews, the city screenshot and the city's building map fill the whole frame,
   border included, and frame.png (panel.png with its dark inside cleared) is laid over them:
   the gold rim and corner ornaments stay whole and no dark band shows between rim and picture.
   --frame-w must match the frame's border width. */
:is(.card, .scenario-head, .city-shot) .frame, .map-frame { --frame-w: 10px; }
.frame.mini { --frame-w: 4px; }
:is(.card, .scenario-head, .city-shot) .frame, .map-frame, .frame.mini { position: relative; }
:is(:is(.card, .scenario-head, .city-shot) .frame, .frame.mini) > img, .map-frame > svg {
  position: absolute;
  top: calc(-1 * var(--frame-w));
  left: calc(-1 * var(--frame-w));
  width: calc(100% + 2 * var(--frame-w));
  height: calc(100% + 2 * var(--frame-w));
  max-width: none;
}
:is(.card, .scenario-head, .city-shot) .frame::after, .map-frame::after, .frame.mini::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--frame-w));
  border: var(--frame-w) solid transparent;
  border-image: url("img/frame.png") 34 / var(--frame-w) stretch;
  pointer-events: none;
}

td.shot { padding-block: 3px; }
.thumb {
  display: block;
  width: 96px;
  height: 40px;  /* the game uploads 800x334 panoramas */
  padding: 0;
  border: 1px solid #b89c5c;
  background: #000;
  cursor: zoom-in;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb:hover, .thumb:focus-visible { border-color: var(--label-hover); outline: none; }

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.gallery figure { margin: 0; width: min(340px, 100%); text-align: center; }
.gallery .frame { width: 100%; aspect-ratio: 800 / 334; }
.gallery figcaption { margin-top: 4px; color: var(--muted); font-size: 14px; }
.gallery figcaption a:hover { color: var(--label-hover); }

.lightbox {
  max-width: min(1100px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .8); }
.lightbox .frame { border-width: 18px; border-image-width: 18px; cursor: default; }
.lightbox .frame img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 180px); margin: 0 auto; object-fit: contain; }
.lightbox .caption { margin: 8px 0 0; color: var(--label); font-size: 18px; text-shadow: 0 1px 2px #000; }

/* ---- City ---- */
.city-cell { display: flex; align-items: center; gap: 10px; }
.city-shot { margin: 14px auto 0; max-width: 820px; }
.city-shot .frame { width: 100%; aspect-ratio: 800 / 334; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px 18px;
  margin: 18px 0 0;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd { margin: 0; font-size: 18px; }
.stats .sorted dd { color: #fff3cf; }
.stats a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.stats a:hover { color: var(--label-hover); border-bottom-color: var(--label-hover); }

/* ---- Rating columns: ratings.png at 1.5x (180x192), five 36px columns. A capital
   (rows 0-18), the top --h of the shaft (18-171, never stretched: --h is at most 140)
   and a base (171-192). A full column (18 + 140 + 21 = 179px) reaches the goal line at
   the top of its track. The row's height is fixed so columns never shift what follows. ---- */
.pillars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(14px, 5vw, 44px);
  height: 272px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
}
.pillar { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.pillar .goal-mark { color: var(--muted); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.pillar.met .goal-mark { color: #e5c158; }
.pillar .track { position: relative; display: flex; justify-content: center; align-items: flex-end; width: 100%; height: 179px; }
.pillar .track::before { /* the goal: where a full column's capital tops out */
  content: "";
  position: absolute;
  top: 0;
  left: 4px;
  right: 4px;
  border-top: 1px dashed rgba(229, 193, 88, .6);
}
.pillar .col { position: relative; display: flex; flex-direction: column; width: 36px; }
.pillar .col b { display: block; width: 36px; background: url("img/ratings.png") calc(var(--x) * -36px) 0 / 180px 192px no-repeat; }
/* These must outrank .pillar .col b, whose background shorthand resets the position. */
.pillar .col .cap { height: 18px; }
.pillar .col .shaft { height: var(--h); background-position-y: -18px; }
.pillar .col .base { height: 21px; background-position-y: -171px; }
.pillar .val { margin-top: 6px; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pillar.sorted .val { color: #fff3cf; }
.pillar.met .val { color: #e5c158; }
.pillar small { color: var(--muted); font-size: 13px; }
.pillar.no-goal .track::before { content: none; }
.pillar.no-goal .goal-mark { opacity: .7; }
.roads-note { max-width: 760px; margin: -2px auto 10px; text-align: center; font-size: 14px; font-style: italic; }
.map-wrap { margin: 4px auto 14px; max-width: 760px; }
.map-frame { width: 100%; aspect-ratio: 1; cursor: grab; }
.map-frame:active { cursor: grabbing; }
.city-map { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
.city-map rect { stroke: rgba(0, 0, 0, .7); stroke-width: 1px; vector-effect: non-scaling-stroke; fill-opacity: .88; }
.city-map .has-icon rect { fill-opacity: .45; }
.city-map .building:hover rect { fill-opacity: 1; stroke: #fff; }
.city-map image { pointer-events: none; }
.city-map .blank { fill: #4d5a3a; stroke: none; }
.map-wrap .buttons { margin-top: 8px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.legend .swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, .7); }
.building-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px 28px;
  align-items: start;
}
.building-groups h4 { margin: 10px 0 2px; font-weight: normal; color: var(--label); font-size: 16px; }
.building-groups td { padding-block: 3px; }
.building-groups td.icon { width: 36px; padding: 0 4px 0 0; }
.building-groups td.icon img { display: block; }

/* ---- Notices ---- */
.notice { max-width: 760px; margin: 0 auto 14px; padding: 8px 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--ink); }
.notice summary { color: var(--label-hover); }
.notice p { margin: 8px 0; line-height: 1.5; }
.notice a:not(.dialog) { color: var(--label-hover); }
.notice .steps { margin: 8px 0; }
.notice .steps li { margin-bottom: 10px; }

.empty, .error { text-align: center; color: var(--muted); padding: 48px 0; }
.error { color: #ff9a7a; }

@media (max-width: 560px) {
  .panel { border-width: 18px; border-image-width: 18px; padding-inline: 4px; }
  .laurel { --w: 200px; }
  .laurel.small { --w: 160px; }
  .dialog { width: 106px; height: 34px; font-size: 14px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 14px 10px; }
  .scenario-head { flex-direction: column; align-items: center; text-align: center; }
  .scenario-head h2 { text-align: center; }
  .scenario-head .frame { width: min(260px, 100%); }
  table { font-size: 14px; }
  .hide-narrow { display: none; }
  .plays li { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; }
  .plays .shot { display: none; }
  .plays .when { grid-column: 2 / -1; margin-top: -8px; text-align: left; font-size: 12px; }
  .scroll-view { max-height: 300px; }
  .panel { --panel-pad: 4px; }
  .menu-head .status { min-width: 0; font-size: 13px; }
  .menu-band { padding-inline: 4px; }
  .choice small { font-size: 12px; }
  .pillars { gap: 4px; }
  .pillar { min-width: 0; flex: 1; }
  .pillar .val { font-size: 15px; }
  .pillar small { font-size: 11px; }
}
