/* painted raster plates. Native PNG pixels are unchanged.
   The reviewed 1774 × 887 atlas uses complete 704 × 252 presentation
   regions, with transparent padding around every painted ornament.
   Region columns: x=130,952. Region rows: y=60,323,574. */
:root {
  --painted-menu-atlas: url("assets/menus/painted-menu-atlas-v2.png");
  --painted-menu-left: 12.14953271%;
  --painted-menu-right: 88.97196262%;
  --painted-menu-top: 9.4488189%;
  --painted-menu-middle: 50.86614173%;
  --painted-menu-bottom: 90.39370079%;
}

.site-header nav a,
.header-play,
.button,
.text-link,
.roster-filters button,
.roster-item,
.site-footer > div > a,
.dialog-close,
body .painted-menu {
  --menu-width: 280px;
  --menu-x: var(--painted-menu-right);
  --menu-y: var(--painted-menu-bottom);
  box-sizing: border-box;
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: var(--menu-width);
  max-width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 704 / 252;
  padding: 0 18% 0 32%;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: var(--painted-menu-atlas);
  background-repeat: no-repeat;
  background-size: 251.98863636% 351.98412698%;
  background-position: var(--menu-x) var(--menu-y);
  color: #fff8e8;
  font-family: var(--serif, Georgia, serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .1px;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 2px #090d24;
  vertical-align: middle;
  cursor: pointer;
  transition: filter .16s, transform .16s;
}

/* Percentage padding on an inline button follows its containing block,
   so use the declared plate width for consistent inset label placement. */
.site-header nav a,
.header-play,
.button,
.text-link,
.roster-filters button,
.site-footer > div > a,
.dialog-close,
body .painted-menu {
  padding-left: calc(var(--menu-width) * .32);
  padding-right: calc(var(--menu-width) * .18);
}

.site-header nav a:hover,
.header-play:hover,
.button:hover,
.text-link:hover,
.roster-filters button:hover,
.roster-item:hover,
.site-footer > div > a:hover,
.dialog-close:hover,
body .painted-menu:hover {
  color: #ffffff;
  filter: brightness(1.16);
  transform: translateY(-1px);
}

.button-gold:hover,
.button-outline:hover {
  background-color: transparent;
  background-image: var(--painted-menu-atlas);
  background-repeat: no-repeat;
  background-size: 251.98863636% 351.98412698%;
  background-position: var(--menu-x) var(--menu-y);
  color: #ffffff;
}

.site-header nav a:focus-visible,
.header-play:focus-visible,
.button:focus-visible,
.text-link:focus-visible,
.roster-filters button:focus-visible,
.roster-item:focus-visible,
.site-footer > div > a:focus-visible,
.dialog-close:focus-visible,
body .painted-menu:focus-visible {
  outline: 3px solid #fff0b0;
  outline-offset: 3px;
}

.site-header nav a[aria-current="page"],
.roster-filters button.active,
.roster-filters button[aria-pressed="true"],
body .painted-menu.active,
body .painted-menu[aria-pressed="true"],
body .painted-menu[aria-current="page"] {
  border: 0;
  color: #ffffff;
  filter: brightness(1.2) drop-shadow(0 0 5px #b9dcff);
}

.button,
.header-play,
.site-header nav a[href*="play.html"],
.text-link[href*="play.html"],
.text-link[href*="/game/"],
.roster-item {
  --menu-x: var(--painted-menu-left);
  --menu-y: var(--painted-menu-top);
}
.site-header nav a[href*="#showcase"],
.text-link[href*="/art/"] {
  --menu-x: var(--painted-menu-right);
  --menu-y: var(--painted-menu-top);
}
.site-header nav a[href*="#screenshots"],
.site-footer > div > a[href*="#screenshots"] {
  --menu-x: var(--painted-menu-left);
  --menu-y: var(--painted-menu-middle);
}
.site-header nav a[href*="blog/"],
.site-footer > div > a[href*="blog/"],
.text-link[href*="blog/"] {
  --menu-x: var(--painted-menu-right);
  --menu-y: var(--painted-menu-middle);
}
.text-link[href*="gods-of-war-ensemble"] {
  --menu-x: var(--painted-menu-left);
  --menu-y: var(--painted-menu-bottom);
}

.site-header {
  height: auto;
  min-height: 102px;
  padding: 10px max(3vw, 20px);
  gap: 16px;
}
.site-header .wordmark { flex-shrink: 0; gap: 9px; }
.brand-emblem { display: block; width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.site-footer .brand-emblem { width: 46px; height: 46px; }
.site-header nav { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; justify-content: center; }
.site-header nav a { --menu-width: 170px; flex-shrink: 0; font-size: 11.5px; }
.site-header .header-play { --menu-width: 210px; display: inline-flex; flex-shrink: 0; font-size: 12px; white-space: normal; }
.hero-cover-intro .button,
.hero-copy .button,
.closing-cta .button {
  --menu-width: 300px;
  padding: 0 calc(var(--menu-width) * .18) 0 calc(var(--menu-width) * .32);
  min-height: 0;
  gap: 0;
  font-size: 16px;
}
.button > span[aria-hidden="true"],
.text-link > span[aria-hidden="true"],
.header-play > span[aria-hidden="true"],
.roster-item .roster-arrow { display: none; }
.intro .text-link:hover { color: #ffffff; }
.concept-caption .text-link { --menu-width: 220px; font-size: 11px; gap: 0; }
.ensemble-art .text-link { --menu-width: 240px; font-size: 12px; color: #fff8e8; }
.play-page .page-heading .text-link { --menu-width: 300px; font-size: 12px; white-space: normal; }
.research-strip .text-link { --menu-width: 280px; font-size: 12px; white-space: normal; }
.blog-body .text-link { --menu-width: 320px; font-size: 12px; }
.blog-body .post-actions { gap: 10px; }
.roster-filters { gap: 4px; }
.roster-filters button { --menu-width: 162px; font-size: 11px; }
.roster-list { gap: 4px; }
.roster-item { width: 100%; padding: 0 18% 0 32%; justify-content: center; gap: 0; }
.roster-item > span { min-width: 0; }
.roster-item strong { color: #fff8e8; font-size: 17px; line-height: 1.1; }
.roster-item small { color: #d6d6ed; font-size: 8px; line-height: 1.2; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster-item:hover strong { color: #ffffff; }
.site-footer { flex-wrap: wrap; gap: 20px; }
.site-footer > div { gap: 3px; flex-wrap: wrap; }
.site-footer > div > a { --menu-width: 210px; font-size: 11px; }
.image-dialog { padding-top: 76px; }
.image-dialog .dialog-close { --menu-width: 155px; top: 8px; right: 12px; font-size: 11px; }

/* Explicit opt-in controls for the art gallery and animation workshop.
   These classes never match native game or recorder controls. */
.painted-art-gallery .painted-menu,
.painted-animation-workshop .painted-menu {
  --menu-width: 170px;
  display: inline-flex;
  width: var(--menu-width);
  height: auto;
  min-height: 0;
  padding: 0 calc(var(--menu-width) * .18) 0 calc(var(--menu-width) * .32);
  border: 0;
  background-color: transparent;
  background-image: var(--painted-menu-atlas);
  background-repeat: no-repeat;
  background-size: 251.98863636% 351.98412698%;
  background-position: var(--menu-x) var(--menu-y);
  aspect-ratio: 704 / 252;
  color: #fff8e8;
  font-size: 11px;
  line-height: 1.12;
  white-space: normal;
}
.painted-art-gallery .painted-menu-compact,
.painted-animation-workshop .painted-menu-compact { --menu-width: 140px; font-size: 10px; }
.painted-art-gallery .painted-menu-wide,
.painted-animation-workshop .painted-menu-wide { --menu-width: 300px; font-size: 12px; }

/* Gallery source rules use a background shorthand for selected filters.
   Restore the actual atlas in every selected state instead of allowing
   that shorthand to replace the plate with a flat color. */
body.painted-art-gallery .toolbar button.painted-menu[aria-pressed="true"],
body.painted-art-gallery .toolbar button.painted-menu.active,
body.painted-animation-workshop .controls button.painted-menu[aria-pressed="true"],
body.painted-animation-workshop .controls button.painted-menu.active,
.roster-filters button.active,
.roster-filters button[aria-pressed="true"] {
  border: 0;
  background-color: transparent;
  background-image: var(--painted-menu-atlas);
  background-repeat: no-repeat;
  background-size: 251.98863636% 351.98412698%;
  background-position: var(--menu-x) var(--menu-y);
  color: #ffffff;
  filter: brightness(1.2) drop-shadow(0 0 5px #b9dcff);
}

@media (max-width: 1240px) {
  .site-header .header-play { display: none; }
}
@media (max-width: 950px) {
  .site-header { flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 12px; }
  .site-header nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; width: 100%; flex-basis: 100%; }
  .site-header nav a { --menu-width: 100%; width: 100%; padding: 0 18% 0 32%; font-size: clamp(10px, 1.35vw, 13px); }
  .site-footer > div { width: 100%; justify-content: center; }
}
@media (max-width: 760px) {
  .hero-cover-intro .button,
  .hero-copy .button,
  .closing-cta .button { --menu-width: 280px; font-size: 15px; }
  .concept-caption .text-link { --menu-width: 100%; width: 100%; padding: 0 18% 0 32%; font-size: 10px; }
  .ensemble-art .text-link { --menu-width: 240px; font-size: 12px; }
  .roster-filters button { --menu-width: 145px; font-size: 10px; }
  .roster-item strong { font-size: 14px; }
  .roster-item small { display: none; }
  .blog-body .text-link { --menu-width: 290px; font-size: 11px; }
}
@media (max-width: 600px) {
  .site-header { padding-left: 18px; padding-right: 18px; }
  .site-header nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 3px; }
  .site-header nav a { font-size: clamp(10.5px, 2.8vw, 14px); }
  .site-footer > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .site-footer > div > a { --menu-width: 100%; width: 100%; padding: 0 18% 0 32%; font-size: clamp(9px, 2.5vw, 12px); }
  .site-footer > div > a:last-child { grid-column: 1 / -1; --menu-width: 190px; width: 190px; justify-self: center; padding: 0 34.2px 0 60.8px; }
  .roster-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }
  .roster-filters button { --menu-width: 100%; width: 100%; padding: 0 18% 0 32%; font-size: 11px; }
  body.painted-art-gallery .toolbar,
  body.painted-animation-workshop .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
  }
  body.painted-art-gallery .toolbar button.painted-menu,
  body.painted-animation-workshop .controls button.painted-menu {
    --menu-width: 100%;
    width: 100%;
    max-width: 100%;
    padding: 0 18% 0 32%;
    font-size: 11px;
  }
  body.painted-animation-workshop .controls button.painted-menu:last-child {
    --menu-width: 200px;
    grid-column: 1 / -1;
    width: 200px;
    max-width: 100%;
    padding: 0 36px 0 64px;
    justify-self: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header nav a,
  .header-play,
  .button,
  .text-link,
  .roster-filters button,
  .roster-item,
  .site-footer > div > a,
  .dialog-close,
  body .painted-menu { transition: none; transform: none; }
}
