@font-face {
  font-family: "Playfair Display";
  src: url("../assets/fonts/v40_nuFiD-vYSZviVYUb_rj3ij__anPXDTzYgA.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans Pro";
  src: url("../assets/fonts/v24_6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans Pro";
  src: url("../assets/fonts/v24_6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lqDY.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans Pro";
  src: url("../assets/fonts/v24_6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lqDY.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/v31_JTUSjIg1_i6t8kCHKm459Wlhyw.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090909;
  --bg-raise: #141414;
  --ink: #f4f0e8;
  --muted: #c4bdb2;
  --line: rgba(244, 240, 232, 0.16);
  --red: #a33b32;
  --red-bright: #d4654e;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans Pro", "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--red-bright); }

a:hover { color: #f0b2a4; }

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}

p { margin: 0 0 1rem; }

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: #fff;
  color: #000;
  padding: 0.4rem 0.7rem;
  z-index: 5;
}

.skip:focus { top: 0.5rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(9, 9, 9, 0.94);
  z-index: 4;
}

.brand {
  display: flex;
  align-items: center;
  line-height: 0;
  flex: 0 0 auto;
}

.brand img {
  height: 46px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 1.15rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.account {
  position: relative;
  flex: 0 0 auto;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-login,
.account-menu > summary {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.account-login:hover,
.account-menu > summary:hover,
.account-menu[open] > summary { border-color: var(--red-bright); }

.account-menu > summary { list-style: none; }

.account-menu > summary::-webkit-details-marker { display: none; }

.account-menu > summary::after {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 0.5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.2rem) rotate(45deg);
}

.account-name {
  display: inline-block;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 13rem;
  display: grid;
  background: #111;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 6;
}

.account-panel a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.65rem 0.9rem;
}

.account-panel a:hover { background: #1d1d1d; color: #fff; }

.account-grade {
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav a[aria-current="page"] {
  color: var(--red-bright);
}

.site-nav { align-items: center; }

.nav-menu { position: relative; }

.nav-menu > summary {
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-menu > summary::-webkit-details-marker { display: none; }

.nav-menu > summary::after {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-left: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.2rem) rotate(45deg);
}

.nav-menu > summary:hover,
.nav-menu > summary[aria-current="page"] { color: var(--red-bright); }

.nav-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.9rem);
  min-width: 11rem;
  display: grid;
  background: #111;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 6;
}

.site-nav .nav-panel a { padding: 0.65rem 0.9rem; }

.site-nav .nav-panel a:hover { background: #1d1d1d; color: #fff; }

.nav-toggle {
  display: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.7rem;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  min-height: 78vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem 3rem;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.72)),
    url("../assets/images/PLaying.jpg") center / cover no-repeat;
  transition: min-height 1.4s ease, padding 1.4s ease;
}

.hero.is-rolled {
  min-height: 17vh;
  padding: 0.6rem 1rem 0.8rem;
}

.hero img {
  width: min(760px, 92vw);
  transition: width 1.4s ease;
  background: none;
  border: 0;
  filter:
    drop-shadow(1px 0 0 #000)
    drop-shadow(-1px 0 0 #000)
    drop-shadow(0 1px 0 #000)
    drop-shadow(0 -1px 0 #000);
}

.hero.is-rolled img { width: min(230px, 55vw); }

@media (prefers-reduced-motion: reduce) {
  .hero, .hero img { transition: none; }
}

.seal {
  text-align: center;
  padding: 2.4rem 1rem 1.2rem;
}

.seal img {
  width: min(420px, 78vw);
  margin: 0 auto;
}

.intro-band {
  background: #3a4248;
  text-align: center;
  padding: 3.2rem 1.25rem;
}

.intro-band h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 500;
}

.intro-band p {
  color: #d5d0c8;
  max-width: 46rem;
  margin: 0.35rem auto;
}

.cal-banner {
  padding: 5px 1.25rem;
}

.cal-banner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
}

.cal-banner-copy {
  width: auto;
  max-width: 46rem;
}

.cal-banner-copy p {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  min-height: 2lh;
}

.cal-banner-seal {
  display: block;
  flex: none;
  height: var(--banner-seal, 7.25rem);
  width: auto;
  max-width: none;
  margin: 0;
}

.cal-banner-feature {
  display: block;
  flex: none;
  line-height: 0;
}

.cal-banner-feature img {
  height: var(--banner-seal, 7.25rem);
  width: auto;
  max-width: none;
  border: 1px solid rgba(244, 240, 232, 0.35);
}

.cal-banner-feature:hover img { border-color: #fff; }

@media (max-width: 640px) {
  .cal-banner-feature { display: none; }
}

.cal-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.65rem;
}

.cal-switch .cal-tools { margin: 0; }

.cal-tablist {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-tab {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(244, 240, 232, 0.45);
  background: transparent;
  color: #f4f0e8;
  cursor: pointer;
}

.cal-tab svg {
  width: 26px;
  height: 26px;
  display: block;
}

.cal-tab.is-on {
  border-color: #C9A53B;
  color: #C9A53B;
}

.cal-edit-tabs { margin: 0.2rem 0 1.2rem; flex-wrap: wrap; }

.cal-tab.cal-tab-text {
  width: auto;
  height: auto;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.upcoming {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 52rem;
}

.upcoming li {
  border-bottom: 1px solid #2a2a2a;
  padding: 0.9rem 0;
}

.upcoming .when,
.upcoming .place,
.upcoming .repeat { margin: 0; }

.upcoming h3 {
  margin: 0.15rem 0;
  font-size: 1.35rem;
}

.upcoming .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
  align-items: center;
  margin-top: 0.35rem;
}

.upcoming .row-actions form { display: inline; margin: 0; }

.cal-panel[hidden] { display: none; }

.cal-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1rem;
  align-items: start;
}

.cal-map-list {
  background: #141414;
  border: 1px solid rgba(244, 240, 232, 0.22);
  padding: 0.9rem 0.95rem 0.4rem;
  min-height: 12rem;
}

.cal-map-list h3 {
  font-size: 1.25rem;
  margin: 0 0 0.55rem;
}

.cal-map-events {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cal-map-events li {
  margin: 0 0 0.75rem;
}

.cal-map-events span,
.cal-map-events em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.88rem;
}

.cal-map .map-key {
  background: rgba(196, 174, 134, 0.92);
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.cal-map .map-key .silver { margin-left: 0.55rem; }

.cal-map .map-star.national svg { transform: scale(1.45); }

.cal-map .map-star.is-current svg { transform: scale(2.2); }

.cal-map .map-star.national.is-current svg { transform: scale(2.5); }

@media (max-width: 800px) {
  .cal-map-layout { grid-template-columns: 1fr; }
}

.cal-banner h1,
.cal-banner p { margin: 0; }

.cal-banner p { margin-top: 0.15rem; }

.open-hero {
  min-height: 520px;
  align-content: center;
  text-align: center;
  background:
    linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)),
    url("../assets/images/Memoir-44.webp") center / cover no-repeat;
}

.open-hero h1 {
  color: #fff;
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.open-hero .lede {
  color: #f4f0e8;
  margin-left: auto;
  margin-right: auto;
}

.open-hero .count { justify-content: center; }

.open-hero-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.open-hero-link:hover { color: var(--ink); }

.grades-scroll { overflow-x: auto; margin-bottom: 0.8rem; }

.grades-table th { font-size: 0.78rem; vertical-align: bottom; min-width: 7rem; }

.grades-table td.grade-check { text-align: center; }

.grades-table input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }

.grades-table input:not([type]) { min-width: 11rem; }

.discord-table td { vertical-align: middle; }

.discord-table input:not([type]),
.discord-table select { width: 100%; min-width: 8rem; }

.discord-table td.grade-check { text-align: center; }

.discord-table td.discord-actions { white-space: nowrap; }

.discord-picks {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
}

.discord-picks legend { padding: 0 0.3rem; }

.discord-refresh { margin: 2rem 0; }

.discord-posted { margin: 0; font-size: 0.95rem; }

.link-field { display: grid; gap: 0.3rem; font-size: 0.95rem; }

.link-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.link-row input { flex: 1; min-width: 0; }

.link-open {
  display: inline-flex;
  align-items: center;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.link-open:hover { border-color: #e1b04a; color: #e1b04a; }

.link-open[hidden] { display: none; }

.bracket {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  overflow-x: auto;
  padding: 0.5rem 0 1.25rem;
  margin-bottom: 1.5rem;
}

.bk-round {
  flex: 0 0 15.5rem;
  display: grid;
  gap: 0.9rem;
}

.bk-round > h3 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.bk-box {
  border: 1px solid #3c3c3c;
  background: #111;
}

.bk-head {
  background: #f4f0e8;
  color: #161616;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}

.bk-head.is-advance { background: #6a62d8; color: #fff; }

.bk-match,
.bk-stand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  font-size: 0.92rem;
}

.bk-stand { grid-template-columns: 1.4rem minmax(0, 1fr) auto; }

.bk-match + .bk-match,
.bk-stand + .bk-stand { border-top: 1px solid #222; }

.bk-p1 { text-align: right; }

.bk-p1, .bk-p2, .bk-stand > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-match a, .bk-stand a { color: inherit; text-decoration: none; }

.bk-match a:hover, .bk-stand a:hover { text-decoration: underline; }

.bk-match .is-win { color: #fff; font-weight: 700; }

.bk-match .is-loss { color: #6f6f6f; }

.bk-score {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  text-align: center;
}

.bk-score small { display: block; font-size: 0.68rem; color: #e1b04a; }

.bk-tbd { color: #6f6f6f; }

.bk-rank { color: #e1b04a; font-weight: 700; }

.bk-foot {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #333;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.bk-final { flex-basis: 14rem; }

.tourney-format { color: var(--muted); max-width: 46rem; }

.tourney-players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.35rem 1rem;
  padding: 0;
  list-style: none;
}

.tourney-resend { margin: 1rem 0 2rem; }

.tourney-resend summary,
.tourney-add summary,
.tourney-match summary,
.tourney-admin-actions summary { cursor: pointer; color: #e1b04a; }

.tourney-resend .form { margin-top: 0.8rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tourney-me { font-size: 1.05rem; }

.tourney-match {
  border: 1px solid var(--line);
  padding: 0.8rem 1rem;
  margin-bottom: 0.9rem;
  max-width: 46rem;
}

.tourney-match h3 { margin: 0 0 0.3rem; font-size: 1rem; }

.tourney-match p { margin: 0.2rem 0; }

.tourney-result { font-size: 1.1rem; }

.tourney-next {
  border: 1px solid #C9A53B;
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  max-width: 52rem;
}

.tourney-next p { margin: 0 0 0.7rem; }

.tourney-next .row-actions { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; }

.tourney-next form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.tourney-admin-round td { vertical-align: top; }

.tourney-admin-round td.is-win { color: #fff; font-weight: 700; }

.tourney-admin-actions { min-width: 12rem; }

.tourney-admin-actions details { margin: 0.2rem 0; }

.tourney-admin-actions form { margin-top: 0.5rem; }

.tourney-add { margin: 1rem 0 2rem; }

.tourney-add .form { margin-top: 0.8rem; }

.score-grid { display: grid; gap: 0.7rem; margin: 0.7rem 0; max-width: 36rem; }

.score-game {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) 7rem 7rem;
  gap: 0.6rem;
  align-items: end;
}

.score-row label { font-size: 0.8rem; }

.score-row input { width: 100%; }

.score-side select { max-width: 12rem; }

.cal-pop-register { font-weight: 700; }

.tourney-picks {
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
}

.format-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
  gap: 1rem 1.4rem;
  align-items: start;
}

.format-fields { display: grid; gap: 0.7rem; align-content: start; }

.format-fields .cal-note { margin: 0; }

.format-diagram {
  margin: 0;
  border: 1px solid #2c2c2c;
  background: #0b0b0b;
  padding: 0.5rem;
}

.format-diagram svg { display: block; width: 100%; height: auto; }

.form.form-wide { max-width: 56rem; }

.tourney-picks[hidden],
.format-pick [hidden] { display: none; }

@media (max-width: 760px) {
  .format-pick { grid-template-columns: 1fr; }
}

.tourney-picks legend { padding: 0 0.3rem; }

.state-picks.is-off { opacity: 0.4; }

.nationwide-pick { font-size: 1rem; }

.people-level { display: flex; gap: 0.5rem; align-items: center; }

.people-level select { min-width: 12rem; }

@media (max-width: 640px) {
  .score-row { grid-template-columns: 1fr 1fr; }
  .score-row > span { grid-column: 1 / -1; }
  .bk-round { flex-basis: 13.5rem; }
}

.event-picture {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.event-picture > img {
  width: 8rem;
  height: auto;
  border: 1px solid var(--line);
}

.event-picture > div {
  display: grid;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.event-picture .cal-note { margin: 0; }

@media (max-width: 640px) {
  .event-picture { flex-direction: column; }
}

.discord-picks .cal-note { margin: 0; }

.discord-picks input:disabled + span { color: var(--muted); }

.rules-doc section { margin-bottom: 3rem; scroll-margin-top: 5rem; }

.rules-doc h3 {
  margin: 1.6rem 0 0.45rem;
  font-size: 1.2rem;
  scroll-margin-top: 5rem;
}

.rules-doc p, .rules-doc li { line-height: 1.6; }

.rules-doc ul { padding-left: 1.3rem; }

.rules-doc blockquote {
  margin: 1rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--red);
  color: var(--muted);
}

.rules-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}

.rules-jump a {
  border: 1px solid var(--line);
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rules-jump a:hover { border-color: var(--red); }

.rules-back { text-align: center; }

.open-poster {
  width: min(380px, 100%);
  margin: 0 auto;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.open-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.open-pair .open-poster { width: auto; margin: 0; }

.open-release img {
  aspect-ratio: 644 / 979;
  object-fit: contain;
  background: #fff;
}

.open-release-actions { display: inline-flex; align-items: center; gap: 0.6rem; }

@media (max-width: 640px) {
  .open-pair { grid-template-columns: minmax(0, 1fr); }
  .open-pair .open-poster { width: min(380px, 100%); margin: 0 auto; }
  .open-release img { aspect-ratio: auto; }
}

.open-hero .count div {
  background: transparent;
  border: 0;
  min-width: 0;
}

.open-hero .count strong {
  display: flex;
  gap: 4px;
  justify-content: center;
  font-family: "Source Sans Pro", "Segoe UI", sans-serif;
  font-size: 1.7rem;
}

.open-hero .count i {
  background: #fff;
  color: #161616;
  font-style: normal;
  min-width: 1.35rem;
  padding: 0.15rem 0.2rem;
  line-height: 1.35;
}

.narrow { max-width: 820px; }

.banner {
  min-height: 42vh;
  display: grid;
  align-content: end;
  padding: 4rem 1.25rem 2rem;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.28)),
    var(--banner, url("../assets/images/Memoir-44.webp")) center / cover no-repeat;
}

.banner-inner, .wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.wrap { padding: 3.5rem 0; }

.lede {
  font-size: 1.25rem;
  color: var(--muted);
  max-width: 40rem;
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.column-head h2 { margin: 0 0 0.7rem; }

.column-mark {
  height: 58px;
  width: auto;
  max-width: 120px;
  flex: none;
}

.columns article, .card, .person, .event, .event-poster {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.event-poster {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.event-poster img {
  width: 100%;
  height: auto;
  display: block;
}

.event-poster.is-wide { grid-column: span 2; }

@media (max-width: 860px) {
  .event-poster.is-wide { grid-column: auto; }
}

.event-poster-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.event-poster-foot a {
  font-size: 1.05rem;
  text-decoration: none;
}

.poster-expand {
  display: inline-grid;
  place-items: center;
  padding: 0.2rem;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  line-height: 0;
}

.poster-expand:hover { opacity: 0.75; }

.poster-expand:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

dialog.lightbox-full[open] {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  cursor: zoom-out;
}

dialog.lightbox-full::backdrop { background: rgba(0, 0, 0, 0.95); }

dialog.lightbox-full img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.section-title {
  margin-bottom: 1.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--red);
  display: inline-block;
}

.partners {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.partners a {
  background: #f6f3ee;
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 0.8rem;
}

.partners img {
  max-height: 84px;
  width: auto;
  margin: 0 auto;
}

.partners .partner-photo {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: #111;
  text-decoration: none;
}

.partners .partner-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: 50% 30%;
}

.partners .partner-photo span {
  position: relative;
  align-self: end;
  justify-self: stretch;
  padding: 1.6rem 0.8rem 0.6rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  color: #fff;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.people, .events, .gallery {
  display: grid;
  gap: 1.25rem;
}

.people { grid-template-columns: 1fr; }

.person {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.person img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.person h3 { margin-bottom: 0.15rem; }

.place {
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.events { grid-template-columns: repeat(2, 1fr); }

.when {
  color: var(--red-bright);
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.detail { color: var(--muted); margin-bottom: 0.35rem; }

.count {
  display: flex;
  gap: 0.8rem;
  margin: 1.2rem 0 0.4rem;
}

.count div {
  min-width: 4.6rem;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  text-align: center;
  padding: 0.55rem 0.4rem;
}

.count strong {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.8rem;
}

.count span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.gallery { grid-template-columns: repeat(3, 1fr); }

.shot {
  padding: 0;
  border: 0;
  background: #000;
  cursor: zoom-in;
}

.shot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.download {
  display: inline-block;
  margin-top: 0.4rem;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.download:hover { background: #c25044; color: #fff; }

.social-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 0 2.5rem;
}

.social-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.social-button svg { flex: none; }

.form {
  display: grid;
  gap: 0.85rem;
  max-width: 38rem;
}

label { display: grid; gap: 0.3rem; font-size: 0.95rem; }

input, textarea, select { max-width: 100%; }

label, .form > * { min-width: 0; }

label { grid-template-columns: minmax(0, 1fr); }

input, textarea, .form select {
  font: inherit;
  color: var(--ink);
  background: #101010;
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
}

.form input[type="checkbox"],
.form input[type="radio"] {
  width: auto;
  padding: 0;
}

input:focus, textarea:focus, .form select:focus {
  outline: 2px solid var(--red-bright);
  outline-offset: 1px;
}

.apply-duties {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  max-width: 40rem;
}

.choices {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.choices legend {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.choice {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.duties-check {
  align-items: center;
  margin: 0.15rem 0 0.35rem;
}

.duties-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  accent-color: var(--red);
}

.duties-check span { color: var(--red-bright); }

.duties-check.is-accepted span { color: var(--ink); }

.apply-page {
  max-width: 42rem;
  padding-top: 1.25rem;
}

.apply-sheet { text-align: left; }

.apply-sheet .form { max-width: none; }

dialog.duties {
  display: none;
}

dialog.duties[open] {
  position: fixed;
  inset: 0;
  width: 66vw;
  height: 66vh;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: auto;
  overflow: hidden;
  padding: 1.6rem 1.75rem 1.4rem;
  background: #141414;
  color: var(--ink);
  border: 1px solid rgba(244, 240, 232, 0.28);
  font-size: 1.08rem;
  line-height: 1.5;
}

.duties-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.duties-head h2 {
  margin: 0;
  font-size: 1.85rem;
}

.duties-close {
  flex: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(244, 240, 232, 0.35);
  font: inherit;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.duties-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
  text-align: left;
  padding-right: 0.4rem;
}

.duties-scroll h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.25rem;
}

.duties-scroll h3:first-child { margin-top: 0; }

.duties-scroll ul {
  margin: 0;
  padding-left: 1.2rem;
}

.duties-scroll li + li { margin-top: 0.55rem; }

@media (max-width: 700px) {
  dialog.duties[open] {
    width: calc(100vw - 1.25rem);
    height: calc(100vh - 1.25rem);
    padding: 1rem;
  }
  .duties-head h2 { font-size: 1.35rem; }
}

.duties-close-line {
  margin: 1.3rem 0 1rem;
  font-family: "Playfair Display", Georgia, serif;
}

button.send:disabled {
  opacity: 0.4;
  cursor: default;
}

button.send, .nav-toggle {
  cursor: pointer;
}

button.send {
  justify-self: start;
  background: var(--red);
  color: #fff;
  border: 0;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1.3rem;
}

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.notice {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  background: #172117;
  margin-bottom: 1rem;
}

.notice.error { background: #2a1513; }

.contact-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.directory { list-style: none; padding: 0 0 0 1.35rem; margin: 0; }
.directory li { margin: 0 0 0.85rem; }
.directory .who::after { content: ", "; }
.directory .where { color: var(--muted); }
.directory .mail { display: block; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 1.25rem 2rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a { color: var(--ink); }
.site-footer p { margin: 0; }
.site-footer .facebook,
.site-footer .paypal,
.site-footer .venmo,
.site-footer .discord {
  display: inline-flex;
  line-height: 0;
}

.site-footer .footer-social {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 92vw;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.86); }

dialog img { max-height: 88vh; margin: 0 auto; }

.page-logo {
  text-align: center;
  padding: 2.5rem 1rem 0.5rem;
}

.page-logo img {
  width: min(520px, 88vw);
  margin: 0 auto;
}

.coord-map { padding-top: 0.4rem; }

.coord-map.wrap { width: min(1480px, calc(100% - 2rem)); }

.coord-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
}

.coord-detail {
  min-height: 0;
  background: #141414;
  border: 1px solid rgba(244, 240, 232, 0.22);
  padding: 1rem 1rem 0.4rem;
  overflow: auto;
}

.coord-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.coord-detail .portrait { width: min(168px, 72%); }

.coord-detail .bio {
  display: block;
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
  text-align: left;
  font-size: 0.98rem;
}

.coord-detail .bio p { display: block; margin: 0 0 0.75rem; }

.coord-detail .bio p + p::before { content: none; }

@media (max-width: 900px) {
  .coord-layout { grid-template-columns: 1fr; }
  .coord-detail { max-height: 28rem; }
}

.map-frame { position: relative; }

.map-frame > img {
  width: 100%;
  height: auto;
  display: block;
}

.map-star {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 1;
  overflow: visible;
}

.map-star svg {
  display: block;
  width: 22px;
  height: 22px;
  overflow: visible;
  transform: scale(1);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.2, 1.2);
}

.map-star.is-current { z-index: 6; }

.map-star.is-current svg { transform: scale(3); }

.map-star.national { z-index: 2; }

.map-star.national svg { transform: scale(2); }

.map-star.national.is-current svg { transform: scale(6); }

.map-star path {
  stroke: #fff;
  stroke-width: 1px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 860px) {
  .page-coordinators .map-star {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
  }
  .page-coordinators .map-star svg {
    width: 11px;
    height: 11px;
  }
}

.map-star.national path { fill: #e1b04a; }
.map-star.regional path { fill: #d5d7dc; }

.map-star:hover,
.map-star:focus,
.map-star:focus-visible { z-index: 5; outline: none; }

.map-card {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 14rem;
  transform: translateX(-50%);
  padding: 0.35rem 0.6rem 0.4rem;
  background: #141414;
  border: 1px solid rgba(244, 240, 232, 0.35);
  text-align: center;
  pointer-events: none;
}

.map-star.drop .map-card {
  bottom: auto;
  top: calc(100% + 8px);
}

.map-star.pull .map-card {
  left: auto;
  right: calc(100% + 6px);
  transform: none;
}

.map-star.edge .map-card {
  left: calc(100% + 8px);
  right: auto;
  bottom: auto;
  top: 0;
  transform: none;
}

.map-star:hover .map-card,
.map-star:focus .map-card,
.map-star:focus-visible .map-card { display: block; }

.map-card strong,
.map-card em {
  display: block;
  font-style: normal;
  line-height: 1.2;
}

.map-card strong {
  font-family: "Source Sans Pro", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.map-card em {
  color: var(--muted);
  font-size: 0.82rem;
}

.map-key {
  position: absolute;
  left: 3.2%;
  bottom: 6%;
  margin: 0;
  color: #1c1812;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.map-key a {
  color: #1c1812;
  text-decoration: none;
}

.map-key a + a { margin-left: 0.85rem; }

.map-key a:hover { text-decoration: underline; }

.map-key i {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin: 0 0.3rem 0 0;
  border: 1px solid #fff;
  transform: rotate(45deg);
  vertical-align: -1px;
}

.map-key .gold { background: #e1b04a; }
.map-key .silver { background: #d5d7dc; }

#national-coordinators,
#regional-coordinators { scroll-margin-top: 4.5rem; }

.copy-title {
  display: block;
  text-align: center;
  border: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 500;
  margin: 0 auto 1.6rem;
}

.copy-title::after {
  content: "";
  display: block;
  width: 72px;
  height: 1px;
  margin: 0.75rem auto 0;
  background: rgba(244, 240, 232, 0.45);
}

.page-coordinators .people {
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 2rem 1.75rem;
}

.page-coordinators .person {
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: center;
}

.page-coordinators .portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  margin: 0 auto 0.85rem;
}

.page-coordinators .portrait img {
  position: absolute;
  width: calc(var(--iw) / var(--ss) * 100%);
  height: calc(var(--ih) / var(--ss) * 100%);
  left: calc(var(--sl) / var(--ss) * -100%);
  top: calc(var(--st) / var(--ss) * -100%);
  max-width: none;
  margin: 0;
  border-radius: 0;
  aspect-ratio: auto;
  object-fit: fill;
}

.page-coordinators .coord-detail .portrait { width: min(168px, 72%); }

.page-coordinators .person h2 {
  min-height: 2.6em;
  margin: 0 0 0.55rem;
  font-family: "Source Sans Pro", "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.page-coordinators .person h2 span::before { content: " - "; }

.page-coordinators .bio {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-height: 1.45;
  max-height: calc(1.45em * 5);
  overflow: hidden;
}

.page-coordinators .bio p {
  display: inline;
  margin: 0;
}

.page-coordinators .bio p + p::before { content: " "; }

.page-coordinators .bio.is-open {
  display: block;
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
}

.page-coordinators .bio.is-open p { display: block; margin: 0 0 0.8rem; }

.page-coordinators .bio.is-open p + p::before { content: none; }

.coordinator-join {
  max-width: 860px;
  text-align: center;
}

.coordinator-join .file-row { text-align: left; }
.coordinator-join .file-row + .file-row { margin-top: 0.6rem; }

.coordinator-join .apply-duties,
.coordinator-join .form,
.coordinator-join .notice {
  text-align: left;
}

.coordinator-join .form { margin-inline: auto; }

.more {
  display: inline-block;
  margin-top: 0.6rem;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: #2a2a2a;
  color: var(--ink);
  text-decoration: none;
  padding: 0.95rem 1.1rem;
}

.file-row:hover { color: #fff; }

.file-row + .file-row { margin-top: 0.6rem; }

.file-row-actions {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-row-actions a { color: var(--ink); text-decoration: none; }

.file-row-actions a:hover { color: #e1b04a; text-decoration: underline; }

.mat-files {
  display: grid;
  gap: 0.6rem;
  max-width: 52rem;
}

.mat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.mat-card {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 0.65rem;
  background: #2a2a2a;
  color: var(--ink);
  text-decoration: none;
}

.mat-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #161616;
}

.mat-card.mat-sheet img {
  aspect-ratio: 3 / 4;
  object-fit: contain;
}

.mat-card.mat-map .mat-map-frame > img {
  aspect-ratio: 2 / 1;
  object-fit: contain;
}

.mat-map-frame { position: relative; }

.mat-map-tool {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: rgba(9, 9, 9, 0.82);
  color: #fff;
}

.mat-map-tool.is-print { left: 0.55rem; }

.mat-map-tool.is-pdf { right: 0.55rem; }

.mat-map-tool:hover { background: var(--red); color: #fff; }

.mat-map-tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.mat-map-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.8rem 0.85rem;
}

.mat-map-title span { padding: 0; min-width: 0; overflow-wrap: anywhere; }

.mat-book {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.mat-card .mat-book img {
  width: 1.8rem;
  height: 1.8rem;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
  filter: brightness(0) invert(1);
}

.mat-book:hover img { opacity: 0.65; }

.archive-tools { margin: 0 0 1rem; }

.archive-search {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem 0.8rem;
  margin: 0 0 1rem;
}

.archive-search legend {
  padding: 0 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.archive-langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  margin: 0;
  padding: 0;
}

.archive-langs legend {
  float: left;
  margin-right: 0.35rem;
  padding: 0;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
}

.archive-lang {
  position: relative;
  display: grid;
  place-items: center;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.45;
}

.archive-lang input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.archive-lang img { display: block; width: 26px; height: 17px; object-fit: cover; }

.archive-lang:hover { opacity: 0.8; }

.archive-lang:has(input:checked) { opacity: 1; border-color: #f4f0e8; }

.archive-lang:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }

.archive-results {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.archive-count { margin: 0; }

.archive-order { margin: 0; }

.archive-order label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.archive-pager { margin: 0 0 1rem; }

.mat-cards + .archive-pager { margin: 1.25rem 0 0; }

.mat-card.mat-map {
  display: flex;
  flex-direction: column;
}

.mat-card.mat-map:has(.mat-flags) .mat-map-title { padding-bottom: 0.2rem; }

.mat-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding: 0 0.8rem 0.6rem;
}

.mat-flag {
  display: grid;
  place-items: center;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  opacity: 0.55;
}

.mat-card .mat-flag img {
  width: 24px;
  height: 16px;
  aspect-ratio: auto;
  object-fit: cover;
  background: transparent;
}

.mat-flag:hover { opacity: 0.85; }

.mat-flag.is-on { opacity: 1; border-color: #f4f0e8; }

.mat-flag:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.mat-book:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

dialog.scenario-story {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(42rem, calc(100% - 2rem));
  max-height: min(40rem, calc(100% - 2rem));
  overflow: auto;
  padding: 1.25rem 1.35rem 1.5rem;
  border: 1px solid var(--line);
  background: #161616;
  color: var(--ink);
}

dialog.scenario-story::backdrop { background: rgba(0, 0, 0, 0.72); }

.scenario-story h2 { margin: 0 2rem 0.4rem 0; font-size: 1.55rem; }

.scenario-story-close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.scenario-story section { margin-top: 1.05rem; }

.scenario-story h3 { margin: 0 0 0.35rem; font-size: 1rem; }

.scenario-story p { margin: 0; white-space: pre-line; line-height: 1.45; }

.mat-card span {
  padding: 0 0.8rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.mat-card:hover { color: #fff; }

.mat-corps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1.5rem;
}

.mat-corps-item {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.mat-fold > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  cursor: pointer;
  margin-bottom: 0.85rem;
}

.mat-fold > summary h2 { margin: 0; }

.mat-fold > summary::-webkit-details-marker { display: none; }

.mat-fold > summary::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.mat-fold[open] > summary::before { transform: rotate(45deg); }

.mat-fold > summary:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

.mat-corps-item img {
  width: 100%;
  height: auto;
  display: block;
}

.mat-corps-item h3 { margin: 0.2rem 0 0; }

.mat-corps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mat-download {
  display: inline-grid;
  place-items: center;
  padding: 0.2rem;
  color: #fff;
  line-height: 0;
  flex: none;
}

.mat-download:hover { opacity: 0.75; }

.mat-download:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.mat-corps-item h3 a {
  color: var(--ink);
  text-decoration: none;
}

.mat-corps-item h3 a:hover { color: #fff; }

.mat-corps-text {
  margin: 0;
  white-space: pre-line;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.mat-banner {
  display: grid;
  gap: 0.65rem;
  max-width: 64rem;
  background: #2a2a2a;
  color: var(--ink);
  text-decoration: none;
}

.mat-banner img {
  width: 100%;
  aspect-ratio: 1440 / 374;
  object-fit: cover;
  display: block;
  background: #161616;
}

.mat-banner span {
  padding: 0 0.8rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.mat-banner + .mat-banner { margin-top: 1.4rem; }

.mat-banner:hover { color: #fff; }

.mat-group { margin-top: 1.8rem; }

.mat-group h2 {
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 981px) {
  .page-coordinators .person:last-child:nth-child(3n + 1) { grid-column: 2; }
}

@media (max-width: 980px) {
  .page-coordinators .people { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .page-coordinators .people { grid-template-columns: 1fr; }
}


@media (max-width: 860px) {
  .site-header { gap: 0.6rem; padding: 0.75rem 0.9rem; }
  .nav-toggle { display: block; margin-left: auto; padding: 0.35rem 0.6rem; }
  .account-name { max-width: 6rem; }
  .account-login,
  .account-menu > summary { padding: 0.35rem 0.6rem; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand img {
    height: auto;
    width: 100%;
    max-width: 272px;
    max-height: 36px;
    object-fit: contain;
    object-position: left center;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #090909;
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 1.25rem 1rem;
    flex-direction: column;
  }
  .site-nav.is-open { display: flex; }
  .site-nav { align-items: flex-start; }
  .nav-panel { position: static; box-shadow: none; border: 0; border-left: 1px solid var(--line); margin-top: 0.6rem; background: transparent; }
  .columns, .partners, .events, .gallery, .contact-layout, .person {
    grid-template-columns: minmax(0, 1fr);
  }
  .contact-layout > * { min-width: 0; }
  .open-hero .count { flex-wrap: wrap; gap: 0.5rem; }
  .banner-inner { min-width: 0; }
  .partners { grid-template-columns: repeat(2, 1fr); }
}

.cal-wrap {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3.5rem;
}

.page-calendar .cal-tools {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin: 0 0 0.8rem;
}

.page-calendar .cal-login {
  color: #e1b04a;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  text-decoration: none;
  text-transform: uppercase;
}

.cal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1.4rem;
}

.cal-filters input,
.cal-filters select,
.page-calendar .form-grid input,
.page-calendar .form-grid select,
.page-calendar .form-grid textarea,
.page-calendar .form input,
.page-calendar .form select {
  font: inherit;
  color: var(--ink);
  background: #101010;
  border: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
}

.page-calendar input[type="date"] {
  color-scheme: dark;
}

.page-calendar input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1.35rem;
  height: 1.35rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e1b04a' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1.15rem 1.15rem;
}

.cal-filters a.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  color: var(--ink);
  text-decoration: none;
}

.cal-filters a.chip.is-on {
  background: #f4f0e8;
  color: #161616;
}

.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.cal-head h2 {
  font-weight: 500;
  margin: 0;
}

.cal-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin: 0;
}

.cal-range label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-calendar .cal-range input[type="date"] {
  font: inherit;
  color: var(--ink);
  background: #101010;
  border: 1px solid var(--line);
  padding: 0.45rem 0.65rem;
}

.cal-nav {
  color: var(--ink);
  text-decoration: none;
  padding: 0 0.35rem;
}

.cal-views,
.cal-note,
.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.cal-views a { color: inherit; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #2a2a2a;
  border-left: 1px solid #2a2a2a;
}

.cal-dow,
.cal-day {
  border-right: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  min-width: 0;
}

.cal-dow {
  padding: 0.35rem;
  color: #9a9a9a;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.cal-day {
  min-height: 6.6rem;
  padding: 0.3rem;
}

.cal-day.is-today { background: #141414; }

.cal-num { font-size: 0.85rem; }

a.cal-num {
  color: inherit;
  text-decoration: none;
}

a.cal-num:hover { color: #e1b04a; }

.cal-event,
button.cal-event {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.12rem 0.35rem;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cal-event.national,
.cal-event.national:hover { background: #C9A53B; color: #161616; }
.cal-event.regional,
.cal-event.open_play,
.cal-event.regional:hover,
.cal-event.open_play:hover { background: #3d6b6b; color: #fff; }

button.cal-event-name {
  background: none;
  border: 0;
  padding: 0;
  color: var(--red-bright);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.cal-pop-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
}

.cal-pop-back[hidden] { display: none; }

.cal-pop {
  width: min(28rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid rgba(244, 240, 232, 0.2);
  background: #141414;
  color: var(--ink);
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.cal-pop p:empty { display: none; margin: 0; }

.cal-pop [data-pop="details"] { white-space: pre-line; overflow-wrap: anywhere; }

.cal-pop-image[hidden],
.cal-pop-page[hidden],
.cal-pop-side[hidden] { display: none; }

.cal-pop-side {
  display: grid;
  gap: 0.8rem;
}

.cal-pop.has-image .cal-pop-side { margin-top: 2.8rem; }

.cal-pop-page {
  display: block;
  text-align: center;
  color: #fff;
  font-size: 1.25rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cal-pop-page:hover { color: var(--ink); }

.cal-pop.has-image {
  position: relative;
  width: min(54rem, 100%);
}

.cal-pop.has-image .cal-pop-close {
  float: none;
  position: absolute;
  top: 1rem;
  right: 1.1rem;
}

.cal-pop.has-image .cal-pop-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 17rem);
  gap: 1.4rem;
  align-items: start;
}

.cal-pop-image { display: block; }

.cal-pop-image img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 700px) {
  .cal-pop.has-image .cal-pop-body { grid-template-columns: minmax(0, 1fr); }
  .cal-pop-side { max-width: 18rem; width: 100%; margin: 0 auto; }
  .cal-pop.has-image [data-pop="when"],
  .cal-pop.has-image [data-pop="runs"] { padding-right: 4.5rem; }
  .cal-pop.has-image .cal-pop-side { margin-top: 0; }
}

.cal-pop-close {
  float: right;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(244, 240, 232, 0.2);
  font: inherit;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}

.venue-list { list-style: none; padding: 0; }
.venue-list li { margin: 0.4rem 0; }
.venue-list form { display: inline; }

.cal-key {
  margin-top: 0.9rem;
  color: var(--muted);
}

.cal-key i {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin: 0 0.3rem 0 0.8rem;
  vertical-align: -1px;
}

.cal-key i.national { background: #C9A53B; }
.cal-key i.regional { background: #3d6b6b; }
.cal-key i:first-child { margin-left: 0; }

.cal-month-list { display: none; }

.cal-month-hint {
  display: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.cal-detail {
  max-width: 40rem;
}

.page-calendar .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  max-width: 46rem;
}

.page-calendar .form-grid .wide { grid-column: 1 / -1; }

.page-calendar .checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}

.page-calendar label.check {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.page-calendar button.solid,
.page-calendar a.solid-link {
  background: #f4f0e8;
  color: #161616;
  border: 1px solid #f4f0e8;
  font: inherit;
  padding: 0.7rem 1rem;
  text-decoration: none;
  cursor: pointer;
}

.page-calendar button.ghost,
.cal-filters button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font: inherit;
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.profile {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0.55rem 1.25rem;
  max-width: 42rem;
  margin: 0;
}

.profile dt { color: #d5d0c8; }

.profile dd { margin: 0; }

@media (max-width: 700px) {
  .profile { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .profile dd { margin-bottom: 0.7rem; }
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.account-table th {
  text-align: left;
  color: #9a9a9a;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.account-table td,
.account-table th {
  border-bottom: 1px solid #2a2a2a;
  padding: 0.7rem 0.4rem;
  vertical-align: top;
}

.actions form { display: inline; }

.actions button.link {
  background: none;
  border: 0;
  color: #C9A53B;
  font: inherit;
  cursor: pointer;
  padding: 0 0.35rem;
}

.page-calendar .note,
.page-calendar .flash {
  border: 1px solid #333;
  padding: 0.75rem 1rem;
  max-width: 46rem;
}

.page-calendar .flash { border-color: #C9A53B; }

.page-calendar .flash.flash-error { border-color: var(--red-bright); background: #2a1513; }

[data-states-label][hidden] { display: none; }

.state-picks {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  padding: 0.8rem;
  margin: 0;
}

.state-picks legend { padding: 0 0.3rem; }

@media (max-width: 760px) {
  .cal-grid { margin-bottom: 1.5rem; }
  .cal-dow {
    padding: 0.3rem 0;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-align: center;
  }
  .cal-day {
    min-height: 3.4rem;
    padding: 0.25rem 0.2rem;
    text-align: center;
  }
  .cal-day.has-events { cursor: pointer; }
  .cal-day.is-picked { outline: 2px solid #e1b04a; outline-offset: -2px; }
  .cal-num { font-size: 0.8rem; }
  .cal-day .cal-event,
  .cal-day button.cal-event {
    height: 0.4rem;
    margin-top: 0.2rem;
    padding: 0;
    border-radius: 2px;
    font-size: 0;
    pointer-events: none;
  }
  .cal-month-list { display: block; }
  .cal-month-list.is-picking .cal-month-day { display: none; }
  .cal-month-list.is-picking .cal-month-day.is-picked { display: block; }
  .cal-month-list.is-picking:not(.has-pick) .cal-month-hint { display: block; }
  .cal-month-day { scroll-margin-bottom: 1rem; }
  .cal-month-day h3 { margin-top: 0; }
  .page-calendar .form-grid,
  .state-picks { grid-template-columns: 1fr 1fr; }
  .cal-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .cal-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .cal-filters input[type="search"],
  .cal-filters select { grid-column: 1 / -1; width: 100%; }
  .cal-filters a.chip { text-align: center; }
  .cal-filters input[name="place"] { width: 100%; }
  .cal-filters button.ghost { width: 100%; }
  .cal-head .cal-range {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    width: 100%;
  }
  .cal-range label { grid-column: 2; justify-content: space-between; }
  .cal-range label input { flex: 1; min-width: 0; max-width: 11rem; }
  .cal-range a[aria-label="Previous range"] { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .cal-range a[aria-label="Next range"] { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
}

@font-face {
  font-family: "PosterStencil";
  src: url("../assets/fonts/Liberty-Stencil-Grunge.otf") format("opentype");
  font-display: swap;
}

.poster-maker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.75rem;
  align-items: start;
  margin-top: 1.25rem;
}

.poster-form { max-width: none; }

.poster-form label > span:first-child,
.poster-lines legend { display: inline-flex; align-items: center; }

.poster-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.poster-lines { display: grid; gap: 0.45rem; margin: 0; padding: 0.6rem 0.8rem 0.8rem; border: 1px solid var(--line); }

.poster-lines legend { padding: 0 0.3rem; }

.poster-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  color: #111;
  font-size: 0.8rem;
  font-weight: 700;
}

.poster-preview { display: grid; gap: 0.8rem; justify-items: start; position: sticky; top: 5rem; }

.poster-preview canvas { width: 100%; height: auto; display: block; background: #000; }

.poster-help { border: 1px solid var(--line); padding: 0.7rem 1rem; background: var(--bg-raise); }

.poster-help summary { cursor: pointer; font-weight: 600; }

.poster-help-body {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.9rem;
}

.poster-help-body img { width: 100%; display: block; }

.poster-help-body ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }

.poster-help-body li { display: flex; align-items: baseline; gap: 0.1rem; }

.poster-help-body li .poster-tag { position: relative; top: 0.25rem; }

@media (max-width: 800px) {
  .poster-maker,
  .poster-help-body { grid-template-columns: 1fr; }
  .poster-preview { position: static; }
}

/* Know your units tutorial (units.php) */
.units-page { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; padding-top: 1.6rem; }
.units-page h2 { margin: 2.4rem 0 0.4rem; }
.units-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0.5rem;
}
.units-jump a {
  border: 1px solid var(--line);
  padding: 0.3rem 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.units-jump a:hover { border-color: var(--red-bright); color: #fff; }

.units-basics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.units-basics-grid article {
  background: #171717;
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
}
.units-basics-grid h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.units-basics-grid p, .units-basics-grid li { color: var(--muted); }
.units-basics-grid ol { margin: 0; padding-left: 1.2rem; }
.units-basics-grid strong { color: var(--ink); }
.units-faces { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.units-faces li { display: flex; align-items: center; gap: 0.65rem; }
.units-face {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0.3rem;
  background: #ece6d6;
  border-radius: 0.35rem;
  object-fit: contain;
  color: #1b1b1b;
  display: inline-grid;
  place-items: center;
}
.units-svg svg { width: 100%; height: 100%; }

.units-group-intro { color: var(--muted); max-width: 52rem; }
.unit-card {
  background: #171717;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red-bright);
  padding: 1.2rem 1.3rem 0.8rem;
  margin: 1.2rem 0;
  scroll-margin-top: 5.5rem;
}
.unit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.2rem;
}
.unit-figures {
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 7.5rem;
}
.unit-fig { height: 2.4rem; width: auto; filter: invert(0.93); }
.unit-fig-armor { height: 1.6rem; }
.unit-fig-artillery { height: 2.1rem; }
.unit-ship { height: 3rem; width: auto; border-radius: 0.2rem; }
.unit-title { flex: 1 1 14rem; min-width: 0; }
.unit-title h3 { margin: 0; font-size: 1.45rem; }
.unit-source { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }
.unit-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.unit-badges img { width: 2.6rem; height: 2.6rem; object-fit: contain; }
.unit-badge { display: inline-flex; cursor: help; }
.unit-badge[hidden] { display: none; }
.exp-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.35rem 0 0; }
.exp-tag {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; line-height: 1.35;
  background: var(--exp, #e8762b); color: var(--exp-ink, #140b05); white-space: nowrap;
}
.unit-ref:not([hidden]) ~ .unit-ref:not([hidden])::before { content: ", "; }

.unit-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 0.8rem;
  margin: 1rem 0;
}
.unit-stats > div { background: #101010; border: 1px solid var(--line); padding: 0.7rem 0.85rem; min-width: 0; }
.unit-stats dt {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.unit-stats dd { margin: 0; }
.unit-stats > .unit-hits { grid-column: 1 / -1; }
.unit-hit-list { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; margin: 0 0 0.35rem; padding: 0; }
.unit-hit-list li { display: flex; align-items: center; gap: 0.5rem; }
.unit-hit-list small { color: var(--muted); }
.unit-hit-flag .units-face { color: #b8432f; }
.unit-dice { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; }
.unit-dice li { display: grid; justify-items: center; gap: 0.1rem; }
.unit-dice small { color: var(--muted); font-size: 0.72rem; }
.unit-hex {
  width: 2.1rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: #e7d9b4;
  color: #1f6b2a;
  font-weight: 700;
  font-size: 1.15rem;
}
.unit-dice-note { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.78rem; }

.unit-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.2rem;
}
.unit-body h4 {
  margin: 0 0 0.4rem;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
}
.unit-body ul { margin: 0; padding-left: 1.1rem; }
.unit-body li { margin-bottom: 0.4rem; }
.unit-body > div:only-child { grid-column: 1 / -1; }
.unit-tips { background: #10140f; border: 1px solid rgba(160, 190, 140, 0.18); padding: 0.75rem 0.9rem; align-self: start; }
.unit-tips li { color: var(--muted); }
.unit-top { margin: 0.6rem 0 0; text-align: right; font-size: 0.85rem; }
.units-credit { margin-top: 2.5rem; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 760px) {
  .unit-stats, .unit-body { grid-template-columns: minmax(0, 1fr); }
  .unit-card { padding: 1rem 0.9rem 0.6rem; }
  .units-page { width: calc(100% - 2rem); }
}

/* Know your terrain tutorial (terrain.php) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 2.6rem;
  padding: 0.15rem 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 0.25rem;
  white-space: nowrap;
}
.tv svg { width: 1.15rem; height: 1.15rem; }
.tv-ok { background: rgba(110, 170, 90, 0.16); color: #a6d58f; }
.tv-stop { background: rgba(214, 170, 60, 0.16); color: #e6c26a; }
.tv-no { background: rgba(214, 70, 60, 0.18); color: #ff7a66; }
.tv-minus { background: rgba(120, 160, 220, 0.16); color: #a9c6f2; }
.tv-none { color: var(--muted); font-weight: 400; }
.tv-na { color: var(--muted); font-weight: 400; }
.units-basics-grid .tv { min-width: 0; vertical-align: middle; }

.terrain-tools {
  position: sticky;
  top: 4.4rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.4rem;
  margin: 2rem 0 0.5rem;
  padding: 0.8rem 0.9rem;
  background: rgba(14, 14, 14, 0.96);
  border: 1px solid var(--line);
}
.terrain-tool { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.terrain-tool-label {
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.terrain-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); }
.terrain-seg button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.terrain-seg button:last-child { border-right: 0; }
.terrain-seg button img { height: 1rem; width: auto; filter: invert(0.93); }
.terrain-seg button[aria-checked="true"] { background: var(--red-bright); color: #fff; }
.terrain-seg button[aria-checked="true"] img { filter: invert(1); }
.terrain-search input {
  background: #101010;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.6rem;
  font: inherit;
  width: 13rem;
  max-width: 100%;
}
.terrain-cats { margin: 0; flex-basis: 100%; }
.terrain-cats a { font-size: 0.82rem; }
.terrain-empty { flex-basis: 100%; margin: 0; color: var(--muted); }

.terrain-page .unit-card { scroll-margin-top: 13rem; }
.terrain-page .units-group { scroll-margin-top: 12rem; }
.terrain-tile { width: 4.2rem; height: 4.2rem; object-fit: contain; flex: 0 0 auto; }
.terrain-tile-sm { width: 1.7rem; height: 1.7rem; object-fit: contain; vertical-align: middle; margin-right: 0.45rem; }
.terrain-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.terrain-chips li { font-size: 0.8rem; padding: 0.2rem 0.55rem; border: 1px solid var(--line); }
.terrain-chips .chip-warn { color: #e6c26a; border-color: rgba(214, 170, 60, 0.35); }
.terrain-chips .chip-ok { color: #a6d58f; border-color: rgba(110, 170, 90, 0.35); }
.terrain-chips .chip-flag { color: #d9a6e6; border-color: rgba(190, 120, 210, 0.4); }

.terrain-grid-wrap { overflow-x: auto; margin: 0.9rem 0 0.4rem; }
.terrain-grid { border-collapse: collapse; width: 100%; max-width: 40rem; }
.terrain-grid th, .terrain-grid td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); text-align: center; }
.terrain-grid tbody th { text-align: left; font-weight: 400; color: var(--muted); font-size: 0.92rem; white-space: nowrap; }
.terrain-grid thead th { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.terrain-grid thead th img { display: block; margin: 0 auto 0.2rem; height: 1.3rem; width: auto; filter: invert(0.93); }

[data-unit="0"] [data-u]:not([data-u="0"]),
[data-unit="1"] [data-u]:not([data-u="1"]),
[data-unit="2"] [data-u]:not([data-u="2"]) { opacity: 0.28; }
[data-unit="0"] td[data-u="0"],
[data-unit="1"] td[data-u="1"],
[data-unit="2"] td[data-u="2"] { background: rgba(212, 101, 78, 0.12); }

.terrain-plain { margin: 0.6rem 0 0.2rem; padding: 0.7rem 0.9rem; background: #10140f; border: 1px solid rgba(160, 190, 140, 0.18); }
.terrain-plain h4, .terrain-special h4 {
  margin: 0 0 0.35rem;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red-bright);
}
.terrain-plain ul, .terrain-special ul { margin: 0; padding-left: 1.1rem; }
.terrain-plain li, .terrain-special li { margin-bottom: 0.3rem; }
.terrain-plain .muted { color: var(--muted); }
.terrain-special { margin: 0.7rem 0 0.4rem; }
.terrain-body { display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); gap: 0 1.6rem; align-items: start; }
.terrain-body .terrain-special { margin-top: 1rem; }

.terrain-table-scroll { overflow-x: auto; border: 1px solid var(--line); }
.terrain-table { border-collapse: collapse; min-width: 64rem; width: 100%; font-size: 0.88rem; }
.terrain-table th, .terrain-table td { padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); text-align: center; }
.terrain-table thead th { background: #141414; font-weight: 400; color: var(--muted); font-size: 0.78rem; position: sticky; top: 0; }
.terrain-table thead th img { height: 1.1rem; width: auto; filter: invert(0.93); }
.terrain-table thead tr:first-child th[colspan] { border-left: 1px solid var(--line); }
.terrain-table tbody th { text-align: left; white-space: nowrap; font-weight: 400; }
.terrain-table tbody th { min-width: 13rem; }
.terrain-table tbody th a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.terrain-table tbody th a:hover { color: #fff; text-decoration: underline; }
.terrain-table .tv { min-width: 2.2rem; font-size: 0.78rem; }
.terrain-table td[data-u="0"] { border-left: 1px solid var(--line); }
.terrain-table-cat th { background: #1d1d1d; color: var(--red-bright) !important; font-family: "Montserrat", "Segoe UI", sans-serif; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.terrain-table-flag { color: #d9a6e6; font-size: 0.8rem; text-align: left !important; }
.terrain-table-src { color: var(--muted); white-space: nowrap; font-size: 0.8rem; }

@media (max-width: 760px) {
  .terrain-tools { position: static; }
  .terrain-page .unit-card, .terrain-page .units-group { scroll-margin-top: 5rem; }
  .terrain-tile { width: 3.2rem; height: 3.2rem; }
  .terrain-body { grid-template-columns: minmax(0, 1fr); }
  .terrain-body .terrain-special { margin-top: 0.7rem; }
  .terrain-grid tbody th { white-space: normal; font-size: 0.85rem; }
  .terrain-grid .tv { min-width: 0; }
}

/* Log in / Register rotating button: fixed width, orange glow fills in from the edges and back out */
.account-login {
  box-sizing: border-box;
  width: 7.6rem;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
  white-space: nowrap;
  animation: login-glow 4s ease-in-out infinite alternate;
}
.account-login-text { display: inline-block; transition: opacity 0.2s ease; }
.account-login-text.is-fading { opacity: 0; }
@keyframes login-glow {
  from { box-shadow: inset 0 0 0 0 rgba(232, 118, 43, 0); border-color: var(--line); color: var(--ink); }
  to { box-shadow: inset 0 0 1.4rem 3rem #e8762b; border-color: #e8762b; color: #140b05; }
}
.account-login:hover,
.account-login:focus-visible { animation-play-state: paused; }
@media (max-width: 860px) {
  .account-login { width: 6.6rem; padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .account-login-text { transition: none; }
}

/* Users page */
.user-fields { display: contents; border: 0; margin: 0; padding: 0; }
.people-actions { white-space: nowrap; }
.people-actions form { display: inline; margin-left: 0.6rem; }
.people-table tr.is-disabled td { opacity: 0.55; }

/* Email players: rich editor that looks like the email */
.message-label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; }
.message-editor-wrap .ql-toolbar.ql-snow { background: #f4f1ea; border-color: #c9bfae; }
.message-editor-wrap .ql-container.ql-snow { border-color: #c9bfae; }
.message-editor-wrap .ql-editor {
  min-height: 18rem;
  background: #fff;
  color: #1d1d1d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.message-editor-wrap .ql-editor.ql-blank::before { color: #888; }
.message-editor-wrap .ql-editor a { color: #b0471a; }
.message-editor-wrap .ql-editor img { max-width: 100%; height: auto; }
.message-editor-wrap .ql-snow .ql-tooltip { color: #1d1d1d; z-index: 5; }
.message-editor-wrap textarea[data-editor-field]:not([hidden]) { width: 100%; }
.message-groups .check, .message-posts .check { display: flex; flex-wrap: wrap; align-items: baseline; margin: 0.25rem 0; }
.message-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.message-editor-wrap { min-width: 0; }
.message-editor-wrap .ql-container.ql-snow { height: auto; }

/* Maps tab: battles day by day */
.battles { margin: 0 0 2.5rem; }
.battles-kicker { margin: 0 0 0.4rem; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: #e1b04a; }
.battle-feature-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.battle-feature-head h2 { flex: 1; margin: 0; font-size: 1.6rem; }
.battle-feature-head h2 .muted { font-size: 0.95rem; font-family: inherit; }
.battle-feature-head button { min-width: 2.6rem; }
.battle-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: #111;
}
.battle-feature-map img { display: block; width: 100%; height: auto; }
.battle-feature-map.is-empty { display: grid; place-items: center; min-height: 12rem; border: 1px dashed var(--line); color: #888; }
.battle-feature-body h3 { margin: 0.2rem 0 0.4rem; font-size: 1.35rem; line-height: 1.25; }
.battle-when { margin: 0; color: #cfc6b4; }
.battle-when span { display: inline-block; margin-right: 0.4rem; padding: 0.1rem 0.5rem; background: #e8762b; color: #140b05; font-weight: 700; font-size: 0.8rem; }
.battle-where { margin: 0 0 0.4rem; color: #a99f8d; font-size: 0.9rem; }
.battle-sides { margin: 0 0 0.5rem; font-weight: 600; }
.battle-tags { margin: 0 0 0.6rem; }
.battle-tag { display: inline-block; margin: 0 0.3rem 0.3rem 0; padding: 0.05rem 0.45rem; font-size: 0.72rem; border: 1px solid var(--line); color: #ddd; }
.battle-tag.is-countryside { border-color: #6aa86a; color: #a8dca8; }
.battle-tag.is-winter { border-color: #8ac4d8; color: #c6eaf6; }
.battle-tag.is-desert { border-color: #c9b25a; color: #f0dd8e; }
.battle-tag.is-beach { border-color: #6f9fd8; color: #b5d2f6; }
.battle-tag.is-format { border-color: #b48ad8; color: #dcc6f2; }
.battle-tag.is-air { border-color: #4fc6c6; color: #a6eded; }
.battle-forces { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.5rem; font-size: 0.88rem; }
.battle-side ul { margin: 0.25rem 0 0; padding: 0; list-style: none; }
.battle-side li span { display: inline-block; min-width: 4.6rem; color: #a99f8d; }
.battle-source { margin: 0 0 0.5rem; font-size: 0.8rem; color: #8f877a; }
.battle-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0; }
.battles-title { margin: 1.6rem 0 0.8rem; }
.battles > .battles-title:first-child { margin-top: 0; }
[data-battles-featured-wrap] { margin: 1.4rem 0 0; }
.battles-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.6rem 0.75rem; align-items: end; }
.battles-filters label { display: grid; gap: 0.25rem; font-size: 0.8rem; }
.battles-filters select, .battles-filters input {
  font: inherit; font-size: 0.9rem; color: var(--ink); background: #101010; border: 1px solid var(--line); padding: 0.4rem 0.5rem; min-width: 0;
}
.battles-search { grid-column: span 2; }
/* On this day and Clear sit at the right end of the last filter row. */
.battles-buttons { display: flex; gap: 0.5rem; justify-content: flex-end; grid-column: span 2 / -1; }
.battles-buttons button { flex: 0 0 auto; padding: 0.45rem 0.9rem; white-space: nowrap; }
@media (max-width: 400px) { .battles-buttons { grid-column: 1 / -1; } }
.battles-list { border-top: 1px solid var(--line); }
.battle-row { border-bottom: 1px solid var(--line); }
.battle-row summary { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 0.8rem; align-items: center; padding: 0.55rem 0; cursor: pointer; list-style: none; }
.battle-row summary::-webkit-details-marker { display: none; }
.battle-row summary:hover .battle-row-name { color: #e8762b; }
.battle-row summary img, .battle-row-nomap { display: block; width: 5.5rem; height: 3.6rem; object-fit: cover; background: #1a1a1a; border: 1px solid #222; }
.battle-row-main { display: grid; gap: 0.1rem; min-width: 0; }
.battle-row-date { font-size: 0.78rem; color: #e1b04a; }
.battle-row-name { font-weight: 600; }
.battle-row-where { font-size: 0.8rem; color: #a99f8d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.battle-row-tags { text-align: right; }
.battle-row-body { padding: 0 0 0.9rem 6.3rem; }
.battles-more { display: block; margin: 1rem auto 0; }
@media (max-width: 760px) {
  .battle-feature { grid-template-columns: 1fr; }
  .battle-forces { grid-template-columns: 1fr; }
  .battles-search { grid-column: 1 / -1; }
  .battle-row summary { grid-template-columns: 4.2rem minmax(0, 1fr); }
  .battle-row summary img, .battle-row-nomap { width: 4.2rem; height: 3rem; }
  .battle-row-tags { grid-column: 2; text-align: left; }
  .battle-row-body { padding-left: 0; }
}
.battles-also { margin: 1.2rem 0 0.4rem; font-size: 1rem; color: #cfc6b4; }
.battle-notes { margin: 0 0 0.5rem; font-size: 0.88rem; white-space: pre-line; color: #cfc6b4; }
.battle-links .battle-edit { color: #e1b04a; }
/* Admin: battles */
.battle-admin-map { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.battle-admin-map img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.battle-admin-nomap { display: grid; place-items: center; min-height: 10rem; padding: 1rem; border: 1px dashed var(--line); color: #888; text-align: center; }
.battle-admin-map > div { display: grid; gap: 0.5rem; }
.battle-admin-side { display: grid; gap: 0.5rem; border: 1px solid var(--line); padding: 0.75rem; margin: 0; min-width: 0; }
.battle-admin-delete { margin-top: 1.5rem; }
.battles-admin-filters { flex-wrap: wrap; }
.battles-admin-pages { display: flex; flex-wrap: wrap; gap: 0.35rem; }
@media (max-width: 760px) { .battle-admin-map { grid-template-columns: 1fr; } }
/* An opened battle in a list shows the same large card as "On this day". */
.battle-row-body { padding: 0 0 0.9rem; }
.battle-row-body .battle-feature { margin-bottom: 0; }
.battle-row[open] > summary { grid-template-columns: minmax(0, 1fr) auto; padding: 0.5rem 0; }
.battle-row[open] > summary img,
.battle-row[open] > summary .battle-row-nomap,
.battle-row[open] > summary .battle-row-name,
.battle-row[open] > summary .battle-row-where,
.battle-row[open] > summary .battle-row-tags { display: none; }
.battle-row[open] > summary::after { content: "Hide ▲"; font-size: 0.78rem; color: #a99f8d; }
.battle-row[open] > summary:hover::after { color: #e8762b; }

/* Admin > Database */
.db-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.2rem 0 2rem; }
.db-actions form { border: 1px solid rgba(255, 255, 255, 0.12); padding: 1rem; }
.db-actions button { width: 100%; }
.db-actions .cal-note { margin: 0.6rem 0 0; }
.db-table td:nth-child(2), .db-table td:nth-child(3) { text-align: right; }
.db-steps { line-height: 1.6; padding-left: 1.2rem; }
.flash-error p { margin: 0.2rem 0; }

/* Log a Game (game-edit.php, games.php) */
.game-form h2 { margin-top: 2rem; }
.game-form fieldset { border: 0; padding: 0; margin: 0; }
.game-form legend { font-weight: 600; margin-bottom: 0.4rem; }
.map-pick { position: relative; }
.map-pick-list { position: absolute; z-index: 20; left: 0; right: 0; max-height: 26rem; overflow-y: auto; background: #1d1b18; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.map-pick-item { display: flex; gap: 0.7rem; align-items: center; width: 100%; padding: 0.45rem 0.6rem; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.map-pick-item:hover, .map-pick-item.is-active { background: rgba(232, 118, 43, 0.18); }
.map-pick-item img { width: 72px; height: 48px; object-fit: cover; flex: none; background: #2a2723; }
.map-pick-item span { display: flex; flex-direction: column; min-width: 0; }
.map-pick-item small { color: var(--muted); }
.map-pick-preview { margin: 0.6rem 0 0; max-width: 28rem; }
.map-pick-preview img { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
.game-length { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; }
.game-length > span { width: 100%; }
.game-length label { display: flex; align-items: center; gap: 0.35rem; }
.page-calendar .game-length input { width: 5rem; }
.gp-list { display: grid; gap: 0.8rem; }
.gp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem 0.9rem; align-items: end; padding: 0.8rem; border: 1px solid var(--line); }
.gp-color-pick { display: flex; gap: 0.4rem; align-items: center; }
.gp-swatch { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); flex: none; vertical-align: -0.15rem; margin-right: 0.35rem; }
.gp-color-pick .gp-swatch { width: 1.6rem; height: 1.6rem; margin: 0; }
.gp-remove { background: none; border: 0; color: #e8762b; font: inherit; font-size: 0.85rem; cursor: pointer; padding: 0.3rem 0; justify-self: start; }
.gr-round { border: 1px solid var(--line) !important; padding: 0.9rem !important; margin: 0 0 1rem !important; min-width: 0; }
.gr-round legend { padding: 0 0.4rem; display: flex; gap: 1rem; align-items: center; }
.gr-sides { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: end; margin-bottom: 0.6rem; }
.gr-sides .cal-note { margin: 0; }
.gr-scores input { width: 4.2rem; }
.gr-scores th, .gr-scores td { text-align: center; white-space: nowrap; }
.gr-scores tbody th { text-align: left; }
.gr-scores small { color: var(--muted); display: block; font-weight: normal; }
.score-total .only-type, .score-total .only-type-row { display: none; }
.score-type .only-total { display: none; }
.gr-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem 1rem; align-items: end; margin-top: 0.6rem; }
.gr-more .wide { grid-column: 1 / -1; }
.score-mode { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: 1rem !important; }
.score-mode legend { width: 100%; }
.gphotos { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.6rem 0; }
.gphoto { display: flex; flex-direction: column; gap: 0.25rem; width: 150px; }
.gphoto img { width: 150px; height: 110px; object-fit: cover; display: block; border: 1px solid var(--line); }
.review-box { border-left: 3px solid #e8762b; padding-left: 0.9rem; }
.game-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2rem 0; }
.game-actions .danger { color: #e06b5b; margin-left: auto; }
.game-view { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem; margin: 1rem 0 1.5rem; }
.game-view > div:only-child { grid-column: 1 / -1; }
.game-map { margin: 0; }
.game-map img { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
.game-result { font-size: 1.35rem; font-weight: 700; margin: 0 0 0.8rem; color: #e8762b; }
.game-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.game-facts dt { color: var(--muted); }
.game-facts dd { margin: 0; }
.game-players { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.game-players li { border: 1px solid var(--line); padding: 0.6rem 0.8rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; }
.gplayer { display: inline-flex; align-items: center; margin-right: 0.8rem; }
.gplayer small { color: var(--muted); margin-left: 0.3rem; }
.gmedals { margin-left: auto; font-weight: 600; }
.game-round { margin: 1.5rem 0; }
.game-round h2 small { font-size: 0.9rem; color: var(--muted); font-weight: normal; margin-left: 0.6rem; }
.review-answer { border: 1px solid #e8762b; padding: 1rem; margin: 1rem 0; max-width: 40rem; }
.review-answer h2 { margin-top: 0; }
.review-answer input { width: 100%; }
.discord-share { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; }
.game-list td { vertical-align: top; }
.game-list small { color: var(--muted); }
.game-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 2rem; }
.game-record { font-size: 1.15rem; }
.game-record small { color: var(--muted); }
.game-top { padding-left: 1.3rem; }
.game-top small { color: var(--muted); }
.game-waiting { padding-left: 1.2rem; }
@media (max-width: 700px) {
  .game-view { grid-template-columns: 1fr; }
  .game-actions .danger { margin-left: 0; }
}

/* Color picker on Log a Game */
.gc { position: relative; display: inline-block; }
.gc-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.gc-btn { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 9rem; padding: 0.45rem 0.7rem; background: #f4f0e8; color: #161616; border: 1px solid #f4f0e8; font: inherit; cursor: pointer; }
.gc-btn .gp-swatch, .gc-opt .gp-swatch { width: 1.3rem; height: 1.3rem; margin: 0; border-color: rgba(0, 0, 0, 0.35); }
.gc-caret { margin-left: auto; }
.gc-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: 17rem; max-width: 80vw; padding: 6px; background: #f4f0e8; border: 1px solid #c9c2b5; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.gc-pop[hidden] { display: none; }
.gc-opt { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; background: none; border: 1px solid transparent; color: #161616; font: inherit; text-align: left; cursor: pointer; }
.gc-opt:hover, .gc-opt:focus { background: #e6dfd2; outline: none; }
.gc-opt.is-current { border-color: #e8762b; background: #fbe6d7; font-weight: 700; }
.gc-opt.is-taken { opacity: 0.45; }
.gc-opt.is-taken span:last-child::after { content: " · taken"; font-size: 0.8em; }
.game-form [hidden], .gp-swatch[hidden] { display: none !important; }
.game-form label { display: flex; flex-direction: column; gap: 0.3rem; }
.game-form label.check { flex-direction: row; }
.game-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.game-form select:not(.gc-native),
.game-form textarea,
.review-answer input,
.discord-share select {
  font: inherit;
  color: var(--ink);
  background: #101010;
  border: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}
.game-form input[type="datetime-local"] { color-scheme: dark; }
.gr-scores input { width: 4.2rem !important; padding: 0.4rem !important; text-align: center; }
.page-calendar .game-length input { width: 5rem; }
.game-length label { flex-direction: row !important; }
.gp-row .gc, .gp-row .gc-btn { width: 100%; }
.page-calendar .game-length input { width: 5rem !important; }
.game-form button.ghost { font: inherit; background: transparent; color: var(--ink); border: 1px solid rgba(244, 240, 232, 0.6); padding: 0.6rem 1rem; cursor: pointer; }
.game-form button.ghost:hover { border-color: #e8762b; color: #e8762b; }
.gr-sides label { max-width: 100%; }

/* Log a Game: modern fields and buttons (v121) */
.game-form, .review-answer, .discord-share { --f-bg: #151413; --f-line: rgba(244, 240, 232, 0.16); --f-hover: rgba(244, 240, 232, 0.32); --accent: #e8762b; }
.game-form label, .review-answer label, .discord-share label { font-size: 0.85rem; letter-spacing: 0.02em; color: #d8d1c5; }
.game-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.game-form select:not(.gc-native),
.game-form textarea,
.game-form .date-pick-shown,
.review-answer input,
.discord-share select,
.gc-btn {
  font: inherit;
  font-size: 0.98rem;
  color: #f4f0e8;
  background-color: var(--f-bg);
  border: 1px solid var(--f-line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  min-height: 2.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.game-form select:not(.gc-native), .discord-share select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.6rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e8762b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
}
.game-form select option { background: #1d1b18; color: #f4f0e8; }
.game-form input:hover, .game-form select:hover, .game-form textarea:hover, .gc-btn:hover, .discord-share select:hover { border-color: var(--f-hover); }
.game-form input:focus, .game-form select:focus, .game-form textarea:focus, .gc-btn:focus, .review-answer input:focus, .discord-share select:focus,
.game-form .date-pick-shown.active {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 118, 43, 0.25);
}
.game-form .date-pick-shown {
  cursor: pointer;
  padding-left: 2.7rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e8762b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.85rem center;
}
.game-form input[type="checkbox"], .game-form input[type="radio"], .discord-share input[type="checkbox"] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.game-form input[type="file"] { font-size: 0.9rem; color: #c4bdb2; }
.game-form input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 0.8rem; padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer;
  background: transparent; color: #f4f0e8; border: 1px solid var(--f-hover);
}
.game-form input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }

/* Buttons */
.game-form button.solid, .review-answer button.solid, .discord-share button.solid, .game-page .solid-link {
  background: var(--accent, #e8762b); color: #140b05; border: 1px solid #e8762b; border-radius: 10px;
  font: inherit; font-weight: 700; padding: 0.75rem 1.3rem; cursor: pointer; box-shadow: 0 4px 14px rgba(232, 118, 43, 0.25);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.game-form button.solid:hover, .review-answer button.solid:hover, .discord-share button.solid:hover { background: #f08a43; box-shadow: 0 6px 18px rgba(232, 118, 43, 0.35); }
.game-form button.solid:active, .game-form button.ghost:active { transform: translateY(1px); }
.game-form button.ghost, .review-answer button:not(.solid) {
  font: inherit; font-weight: 600; background: transparent; color: #f4f0e8; border: 1px solid var(--f-hover, rgba(244,240,232,.32));
  border-radius: 10px; padding: 0.7rem 1.2rem; cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.game-form button.ghost:hover, .review-answer button:not(.solid):hover { border-color: #e8762b; color: #e8762b; }
.game-form button.ghost.add { width: 100%; border-style: dashed; padding: 0.85rem; color: #d8d1c5; }
.game-form button.ghost.add span { color: #e8762b; font-size: 1.15rem; margin-right: 0.3rem; }
.game-form button.ghost.add:hover { background: rgba(232, 118, 43, 0.07); }
.game-actions .danger { background: none; border: 0; color: #e06b5b; font: inherit; text-decoration: underline; cursor: pointer; }
.gp-remove { border-radius: 6px; }

/* Cards */
.gp-row, .gr-round { border-radius: 14px; background: rgba(255, 255, 255, 0.02); }
.gp-row { padding: 1rem; }

/* Segmented choice: one number or by type */
.segmented { display: inline-flex !important; flex-wrap: wrap; gap: 0 !important; padding: 4px !important; border: 1px solid rgba(244, 240, 232, 0.16) !important; border-radius: 12px; background: #151413; }
.segmented legend { width: 100%; padding: 0 0 0.4rem; }
.segmented label.check { position: relative; padding: 0.55rem 1rem; border-radius: 9px; cursor: pointer; color: #c4bdb2; font-size: 0.92rem; }
.segmented label.check input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label.check:has(input:checked) { background: #e8762b; color: #140b05; font-weight: 700; }
.segmented label.check:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(232, 118, 43, 0.35); }

/* Color picker button follows the fields */
.gc-btn { display: inline-flex; align-items: center; gap: 0.55rem; text-align: left; cursor: pointer; }
.gc-btn .gp-swatch { border-color: rgba(255, 255, 255, 0.4); }
.gc-caret { color: #e8762b; }
.gc-pop { background: #1d1b18; border: 1px solid rgba(244, 240, 232, 0.16); border-radius: 12px; padding: 8px; gap: 4px; }
.gc-opt { color: #f4f0e8; border-radius: 8px; }
.gc-opt .gp-swatch { border-color: rgba(255, 255, 255, 0.4); }
.gc-opt:hover, .gc-opt:focus { background: rgba(244, 240, 232, 0.08); }
.gc-opt.is-current { background: rgba(232, 118, 43, 0.18); border-color: #e8762b; }

/* Calendar (flatpickr) in the site colors */
.flatpickr-calendar { border-radius: 14px !important; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important; font-family: inherit; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: #e8762b !important; border-color: #e8762b !important; color: #140b05 !important; font-weight: 700; }
.flatpickr-day.today { border-color: #e8762b !important; }
.flatpickr-day:hover { background: rgba(232, 118, 43, 0.2) !important; border-color: transparent !important; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: #e8762b !important; }
.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover, .flatpickr-time input:focus { background: rgba(232, 118, 43, 0.15) !important; }
.flatpickr-calendar, .flatpickr-calendar .flatpickr-months .flatpickr-month, .flatpickr-calendar .flatpickr-weekdays,
.flatpickr-calendar span.flatpickr-weekday, .flatpickr-calendar .flatpickr-time, .flatpickr-calendar .flatpickr-innerContainer,
.flatpickr-calendar .flatpickr-days, .flatpickr-calendar .dayContainer { background: #1d1b18 !important; }
.flatpickr-calendar { border: 1px solid rgba(244, 240, 232, 0.16) !important; }
.flatpickr-calendar.arrowTop:after { border-bottom-color: #1d1b18 !important; }
.flatpickr-calendar.arrowBottom:after { border-top-color: #1d1b18 !important; }
.flatpickr-calendar .flatpickr-time { border-top: 1px solid rgba(244, 240, 232, 0.12) !important; }
.flatpickr-calendar .flatpickr-time input::selection { background: rgba(232, 118, 43, 0.5); }
.flatpickr-calendar span.flatpickr-weekday { color: #c4bdb2 !important; }
.gc-caret { font-size: 0; width: 12px; height: 8px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e8762b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center; margin-right: 0.1rem; }
@media (max-width: 600px) { .game-form .form-grid { grid-template-columns: 1fr; } }
.rule-ref { color: inherit; text-decoration: underline; text-decoration-color: rgba(232, 118, 43, 0.6); text-underline-offset: 2px; }
.rule-ref:hover { color: #e8762b; text-decoration-color: #e8762b; }
/* Expansion toggles on the terrain page */
.terrain-exp button { display: inline-flex; align-items: center; gap: 0.4rem; }
.terrain-exp button small { opacity: 0.7; font-size: 0.78em; }
.terrain-exp .exp-tick { width: 0.95rem; height: 0.95rem; border: 1.5px solid currentColor; border-radius: 3px; flex: none; position: relative; }
.terrain-exp button[aria-pressed="true"] { background: var(--red-bright); color: #fff; }
.terrain-exp button[aria-pressed="true"] .exp-tick::after { content: ""; position: absolute; left: 0.24rem; top: 0.03rem; width: 0.28rem; height: 0.55rem; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.terrain-exp button:disabled { cursor: default; opacity: 0.85; }
/* Expansion toggles, v126: clear on / off states */
.terrain-exp { border: 0 !important; gap: 0.4rem; }
.terrain-exp button {
  border: 1px solid rgba(244, 240, 232, 0.22) !important; border-radius: 999px; padding: 0.4rem 0.85rem 0.4rem 0.6rem;
  background: transparent; color: rgba(244, 240, 232, 0.55); transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.terrain-exp button:hover { border-color: var(--exp, #e8762b) !important; color: #f4f0e8; }
.terrain-exp button[aria-pressed="false"] .exp-tick { border-color: var(--exp, rgba(244, 240, 232, 0.45)); }
.terrain-exp .exp-tick { width: 1.05rem; height: 1.05rem; border: 1.5px solid rgba(244, 240, 232, 0.45); border-radius: 50%; }
.terrain-exp button[aria-pressed="true"] { background: var(--exp, #e8762b); border-color: var(--exp, #e8762b) !important; color: var(--exp-ink, #140b05); font-weight: 700; }
.terrain-exp button[aria-pressed="true"] small { opacity: 0.8; }
.terrain-exp button[aria-pressed="true"] .exp-tick { background: var(--exp-ink, #140b05); border-color: var(--exp-ink, #140b05); }
.terrain-exp button[aria-pressed="true"] .exp-tick::after { left: 0.33rem; top: 0.14rem; width: 0.26rem; height: 0.5rem; border-color: var(--exp, #e8762b); }
.units-page [hidden], .terrain-page [hidden] { display: none !important; }
.units-tools { margin: 0 0 1rem; }

/* Site-wide fields and buttons, in the Log a Game style (v128).
   ":root body" lifts these above the older page rules so every page matches. */
:root { --f-bg: #151413; --f-line: rgba(244, 240, 232, 0.16); --f-hover: rgba(244, 240, 232, 0.32); --accent: #e8762b; }
:root body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="image"]),
:root body select:not(.gc-native),
:root body textarea {
  font: inherit;
  color: #f4f0e8;
  background-color: var(--f-bg);
  border: 1px solid var(--f-line);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
:root body select:not(.gc-native) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23e8762b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
:root body select[multiple] { background-image: none; padding-right: 0.85rem; }
:root body select option { background: #1d1b18; color: #f4f0e8; }
:root body input:hover:not(:focus):not(:disabled), :root body select:hover:not(:focus):not(:disabled), :root body textarea:hover:not(:focus):not(:disabled) { border-color: var(--f-hover); }
:root body input:focus, :root body select:focus, :root body textarea:focus, :root body .date-pick-shown.active {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 118, 43, 0.25);
}
:root body input:disabled, :root body select:disabled, :root body textarea:disabled { opacity: 0.55; cursor: not-allowed; }
:root body input::placeholder, :root body textarea::placeholder { color: #8f887d; }
:root body input[type="date"], :root body input[type="time"], :root body input[type="datetime-local"] { color-scheme: dark; }
:root body input[type="checkbox"], :root body input[type="radio"] { accent-color: var(--accent); }
:root body input[type="file"] { font: inherit; font-size: 0.9rem; color: #c4bdb2; }
:root body input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 0.8rem; padding: 0.5rem 0.9rem; border-radius: 8px; cursor: pointer;
  background: transparent; color: #f4f0e8; border: 1px solid var(--f-hover); transition: border-color 0.15s, color 0.15s;
}
:root body input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
/* Fields inside tables stay compact. */
:root body table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
:root body table select { padding-top: 0.4rem; padding-bottom: 0.4rem; border-radius: 8px; }
/* The email editor's link box keeps its light look. */
:root body .ql-tooltip input[type="text"] { background: #fff; color: #1d1d1d; border: 1px solid #ccc; border-radius: 4px; padding: 3px 5px; box-shadow: none; }

/* Calendar and clock fields (filled by js/pickers.js): no typing, click to pick. */
:root body .date-pick-shown, :root body .time-pick-shown {
  cursor: pointer;
  padding-left: 2.6rem;
  background-repeat: no-repeat !important;
  background-position: left 0.85rem center !important;
}
:root body .date-pick-shown { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e8762b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") !important; }
:root body .time-pick-shown { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e8762b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") !important; }

/* Buttons */
:root body button.solid, :root body a.solid-link, :root body button.send, :root body input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--accent); color: #140b05; border: 1px solid var(--accent); border-radius: 10px;
  font: inherit; font-weight: 700; letter-spacing: normal; text-transform: none; text-decoration: none;
  padding: 0.7rem 1.25rem; cursor: pointer; box-shadow: 0 4px 14px rgba(232, 118, 43, 0.25);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
}
:root body button.solid:hover, :root body a.solid-link:hover, :root body button.send:hover:not(:disabled), :root body input[type="submit"]:hover {
  background: #f08a43; border-color: #f08a43; color: #140b05; box-shadow: 0 6px 18px rgba(232, 118, 43, 0.35);
}
:root body button.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 600; background: transparent; color: #f4f0e8; border: 1px solid var(--f-hover);
  border-radius: 10px; padding: 0.7rem 1.2rem; cursor: pointer; text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
}
:root body button.ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(232, 118, 43, 0.06); }
:root body button.solid:active, :root body a.solid-link:active, :root body button.send:active, :root body button.ghost:active { transform: translateY(1px); }
:root body button.solid:focus-visible, :root body a.solid-link:focus-visible, :root body button.send:focus-visible, :root body button.ghost:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(232, 118, 43, 0.4);
}
:root body button.solid:disabled, :root body button.send:disabled, :root body button.ghost:disabled { opacity: 0.45; cursor: default; box-shadow: none; transform: none; }
:root body .battles-buttons button.ghost { padding: 0.55rem 0.6rem; }

/* v129: picker icons clear the text, rounded file fields, boxes and tabs */
:root body .date-pick-shown, :root body .time-pick-shown { padding-left: 2.6rem !important; }
:root body input[type="file"] {
  background: var(--f-bg); border: 1px solid var(--f-line); border-radius: 10px; padding: 0.45rem; box-sizing: border-box;
}
:root body fieldset { border-color: var(--f-line); border-radius: 12px; }
:root body .cal-tab {
  border: 1px solid var(--f-hover); border-radius: 10px; background: transparent; color: #f4f0e8;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
:root body .cal-tab:hover { border-color: var(--accent); color: var(--accent); }
:root body .cal-tab.is-on { background: var(--accent); border-color: var(--accent); color: #140b05; font-weight: 700; }
:root body .cal-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(232, 118, 43, 0.4); }
:root body .cal-tab.cal-tab-text { padding: 0.55rem 1rem; letter-spacing: 0.04em; }

/* v130: compact fields in tables, small outline buttons for in-row actions */
:root body table input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
:root body table select { padding-top: 0.4rem !important; padding-bottom: 0.4rem !important; border-radius: 8px; }
:root body button.link {
  font: inherit; font-size: 0.88rem; font-weight: 600; line-height: 1.2;
  background: transparent; color: #f4f0e8; border: 1px solid var(--f-hover); border-radius: 8px;
  padding: 0.35rem 0.75rem; margin: 0.1rem 0; cursor: pointer; text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
:root body button.link:hover { border-color: var(--accent); color: var(--accent); background: rgba(232, 118, 43, 0.06); }
:root body button.link:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(232, 118, 43, 0.4); }
:root body button.link.danger, :root body button.link[value="disable"], :root body button.link[value="delete"] { color: #f08b7d; border-color: rgba(224, 107, 91, 0.5); }
:root body button.link.danger:hover, :root body button.link[value="disable"]:hover, :root body button.link[value="delete"]:hover { color: #fff; background: #c2493b; border-color: #c2493b; }
:root body .page-calendar .note, :root body .page-calendar .flash, :root body .flash { border-radius: 10px; }

/* Know your units: video button flips a card to a 3D board (js/unit-demo.js) */
.unit-card.has-demo { position: relative; transition: transform 0.23s ease-in-out; }
.unit-card.has-demo .unit-head { padding-right: 3.4rem; }
.unit-demo-btn {
  position: absolute; top: 0.9rem; right: 0.9rem; z-index: 2;
  width: 2.6rem; height: 2.6rem; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1px solid rgba(232, 118, 43, 0.7); background: rgba(232, 118, 43, 0.08); color: #e8762b;
  cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  animation: demo-btn-glow 2.4s ease-in-out 3;
}
.unit-demo-btn svg { width: 1.35rem; height: 1.35rem; }
.unit-demo-btn:hover, .unit-demo-btn:focus-visible { background: #e8762b; color: #140b05; transform: scale(1.06); outline: none; box-shadow: 0 0 0 3px rgba(232, 118, 43, 0.35); }
@keyframes demo-btn-glow { 50% { box-shadow: 0 0 0 6px rgba(232, 118, 43, 0.18); } }
.unit-demo-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 0.9rem; }
.unit-demo-head h3 { margin: 0; font-size: 1.35rem; }
.unit-demo-tools { display: flex; align-items: center; gap: 0.6rem; }
.unit-demo-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.unit-demo-stage {
  position: relative; border-radius: 14px; overflow: hidden; min-height: 12rem;
  background: radial-gradient(ellipse at 50% 40%, #2a2a24 0%, #141413 75%); border: 1px solid rgba(244, 240, 232, 0.12);
}
.unit-demo-stage canvas { display: block; width: 100%; height: auto; }
.unit-demo-main { min-width: 0; }
.unit-demo-roll {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.6rem; min-height: 4.6rem;
  padding: 0.6rem 0.8rem; border-radius: 12px; background: rgba(244, 240, 232, 0.04); border: 1px solid rgba(244, 240, 232, 0.1);
}
.unit-demo-roll-empty { color: var(--muted); font-size: 0.85rem; }
.unit-demo-roll-text { font-weight: 600; font-size: 0.95rem; }
.unit-demo-roll-dice { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.demo-die { display: grid; justify-items: center; gap: 0.15rem; }
.demo-face {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0.3rem; box-sizing: border-box; border-radius: 0.45rem;
  background: #f3eee1; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.demo-face svg, .demo-face img { width: 100%; height: 100%; object-fit: contain; }
.demo-face img { filter: brightness(0) opacity(0.88); }
.demo-die small { font-size: 0.7rem; color: var(--muted); }
.unit-demo-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 0.9rem; }
.unit-demo-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.demo-tag {
  position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 0.78rem; line-height: 1.2; font-weight: 600;
  padding: 0.28rem 0.6rem; border-radius: 999px; color: #f4f0e8; background: rgba(20, 19, 18, 0.86);
  border: 1px solid rgba(244, 240, 232, 0.25); transition: opacity 0.35s; display: inline-flex; align-items: center; gap: 0.35rem;
}
.demo-tag.you { border-color: #4f86d6; }
.demo-tag.foe { border-color: #d0573f; }
.demo-tag.terrain { background: rgba(244, 240, 232, 0.92); color: #1d1b18; border-color: transparent; }
.demo-tag.dice { background: #e8762b; color: #140b05; border-color: #e8762b; font-size: 0.82rem; }
.demo-tag.no { background: #b8432f; border-color: #b8432f; font-size: 0.82rem; }
.demo-tag.no svg { width: 1rem; height: 1rem; }
.unit-demo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.unit-demo-steps button {
  width: 100%; display: flex; gap: 0.7rem; align-items: flex-start; text-align: left; font: inherit; color: #d8d1c5;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(244, 240, 232, 0.14); border-radius: 12px; padding: 0.65rem 0.75rem;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.unit-demo-steps button:hover { border-color: rgba(232, 118, 43, 0.6); }
.unit-demo-steps button b {
  flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem;
  border: 1px solid rgba(244, 240, 232, 0.35); color: #f4f0e8;
}
.unit-demo-steps button span { font-size: 0.86rem; line-height: 1.4; }
.unit-demo-steps button strong { display: block; color: #f4f0e8; font-size: 0.95rem; margin-bottom: 0.15rem; }
.unit-demo-steps button[aria-current="step"] { border-color: #e8762b; background: rgba(232, 118, 43, 0.1); }
.unit-demo-steps button[aria-current="step"] b { background: #e8762b; border-color: #e8762b; color: #140b05; }
.unit-demo-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; margin: 0.8rem 0 0.2rem; font-size: 0.8rem; color: var(--muted); }
.unit-demo-legend span { width: 0.85rem; height: 0.85rem; border-radius: 50%; display: inline-block; margin-left: 0.5rem; }
.unit-demo-legend span:first-child { margin-left: 0; }
.dl-you { background: #3a6db5; } .dl-foe { background: #b5452f; }
.dl-move { background: transparent; border: 2px solid #e8762b; border-radius: 3px !important; }
.dl-stop { background: #d8483a; border-radius: 3px !important; }
@media (max-width: 760px) {
  .unit-demo-grid { grid-template-columns: 1fr; }
  .demo-tag { font-size: 0.68rem; padding: 0.2rem 0.45rem; }
}
@media (prefers-reduced-motion: reduce) { .unit-demo-btn { animation: none; } .unit-card.has-demo { transition: none; } }
.dl-range { background: transparent; border: 2px solid #f2c14e; border-radius: 3px !important; }
.demo-tag.num { background: rgba(20, 19, 18, 0.78); border-color: #f2c14e; color: #f8e3a6; font-size: 0.74rem; padding: 0.18rem 0.5rem; }
.demo-tag.info { background: #f4f0e8; color: #1d1b18; border-color: #f4f0e8; }

/* ---- Scenario roll call (rollcall.php) ---- */
.rc { width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 3.5rem; }
.rc .flash { border: 1px solid #C9A53B; border-radius: 10px; padding: 0.75rem 1rem; max-width: 46rem; }
.rc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 0.9rem; }
.rc-search { flex: 1 1 18rem; }
.rc-search input { width: min(26rem, 100%); }
.rc-found { margin: 0; color: var(--muted); font-size: 0.95rem; }
.rc-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.rc-tabs button { background: none; border: 1px solid transparent; border-bottom: 0; color: var(--muted); font: inherit; font-size: 0.95rem; padding: 0.45rem 0.8rem; border-radius: 8px 8px 0 0; cursor: pointer; }
.rc-tabs button small { opacity: 0.65; font-size: 0.8em; }
.rc-tabs button:hover { color: var(--ink); }
.rc-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--line); background: var(--bg-raise); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent, #e8762b); }
.rc-tabs button.rc-has::after { content: attr(data-rc-hits); margin-left: 0.35rem; background: var(--accent, #e8762b); color: #140b05; border-radius: 999px; padding: 0 0.4rem; font-size: 0.75rem; font-weight: 700; }
.rc-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1.1rem; margin-bottom: 1.1rem; }
.rc-legend h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.rc-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.rc-legend li { display: flex; align-items: center; gap: 0.4rem; }
.rc-legend p { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.88rem; }
.rc-swatch { width: 1.6rem; height: 1rem; border-radius: 3px; background: var(--rc-c); border: 1px solid rgba(0, 0, 0, 0.35); }
.rc-pick { margin-bottom: 1rem; align-items: flex-start; }
.rc-pick .terrain-seg { flex: 1 1 30rem; }
.rc-pick-all { display: inline-flex; gap: 0.3rem; }
.rc-pick-all .chip { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 0.2rem 0.7rem; font: inherit; font-size: 0.85rem; cursor: pointer; }
.rc-pick-all .chip:hover { color: var(--ink); border-color: var(--accent, #e8762b); }
.rc-section { margin: 0 0 1.6rem; scroll-margin-top: 5rem; }
.rc-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.9rem; margin-bottom: 0.4rem; }
.rc-section-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: 0.02em; }
.rc-year { color: var(--accent, #e8762b); font-weight: 700; margin-left: 0.3rem; }
.rc-contents { margin: 0; color: var(--muted); font-size: 0.9rem; font-style: italic; }
.rc-table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--line); }
.rc-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.35; }
.rc-table thead th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--bg-raise); padding: 0.4rem 0.6rem; white-space: nowrap; }
.rc-table td { padding: 0.32rem 0.6rem; border-top: 1px solid rgba(0, 0, 0, 0.12); vertical-align: middle; }
.rc-table tbody tr { background: var(--rc-row, #e9e6df); color: #1d1a14; }
.rc-table tbody tr.rc-plain, .rc-table tbody tr.rc-note-row { background: #e9e6df; }
.rc-table tbody tr:hover td { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.05); }
.rc-table tbody tr.rc-sub { background: #2a2826; color: var(--ink); }
.rc-table tbody tr.rc-sub th { text-align: left; padding: 0.35rem 0.6rem; font-size: 0.88rem; letter-spacing: 0.03em; }
.rc-table tbody tr:target td, .rc-table tbody tr:target th { outline: 2px solid var(--accent, #e8762b); outline-offset: -2px; }
.rc-num { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; background: var(--rc-mark, transparent); }
.rc-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-name a { color: #142c6b; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(20, 44, 107, 0.35); text-underline-offset: 2px; }
.rc-name a:hover { text-decoration-color: currentColor; }
.rc-where { display: inline-flex; vertical-align: -1px; margin-left: 0.25rem; color: #5b5346; cursor: help; }
.rc-legend-icon { color: var(--muted); }
.rc-theater abbr { text-decoration: none; font-weight: 700; font-size: 0.82rem; }
.rc-theater a { color: #142c6b; font-weight: 700; font-size: 0.82rem; text-decoration: underline; text-decoration-color: rgba(20, 44, 107, 0.35); text-underline-offset: 2px; }
.rc-theater a:hover { text-decoration-color: currentColor; }
.rc-legend-rules { flex-direction: column; gap: 0.2rem !important; }
.rc-legend-rules a { color: var(--ink); }
.rc-legend-rules a:first-child { display: inline-block; min-width: 2rem; font-weight: 700; color: var(--accent, #e8762b); }
.rc-legend-rules abbr { display: inline-block; min-width: 2rem; font-weight: 700; text-decoration: none; color: var(--muted); }
.rc-muted { color: var(--muted); font-size: 0.85em; }
.rc-sides { white-space: nowrap; }
.rc-side { display: inline-flex; gap: 4px; vertical-align: middle; }
.rc-flag { display: inline-block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }
.rc-vs { font-size: 0.72rem; color: #5b5346; margin: 0 0.35rem; text-transform: uppercase; vertical-align: middle; }
.rc-official { display: inline-block; background: var(--rc-c); color: #142000; font-weight: 700; font-size: 0.72rem; border-radius: 999px; padding: 0.05rem 0.5rem; margin-right: 0.35rem; }
.rc-section-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.rc-section-foot p { margin: 0 auto 0 0; color: var(--muted); font-size: 0.82rem; }
.rc-actions { display: inline-flex; gap: 0.2rem; flex-wrap: nowrap; }
.rc-btn { background: var(--bg-raise); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 0.82rem; padding: 0.15rem 0.55rem; cursor: pointer; line-height: 1.4; }
.rc-btn:hover { border-color: var(--accent, #e8762b); }
.rc-table .rc-btn { background: rgba(255, 255, 255, 0.6); color: #1d1a14; border-color: rgba(0, 0, 0, 0.2); padding: 0.05rem 0.4rem; }
.rc-table tr.rc-sub .rc-btn { background: var(--bg-raise); color: var(--ink); border-color: var(--line); }
.rc-edit { width: 1%; white-space: nowrap; }
.rc-dialog { width: min(44rem, calc(100% - 2rem)); background: #151413; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; }
.rc-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.rc-dialog h2 { margin: 0 0 0.8rem; font-size: 1.2rem; }
.rc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem 1rem; }
.rc-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; color: var(--muted); }
.rc-form label input, .rc-form label select { color: var(--ink); }
.rc-form .rc-wide { grid-column: 1 / -1; }
.rc-form [hidden] { display: none !important; }
.rc-form .rc-check { flex-direction: row; align-items: center; gap: 0.5rem; align-self: end; }
.rc-lookup { margin: -0.3rem 0 0; font-size: 0.85rem; color: var(--accent, #e8762b); min-height: 1em; }
.rc-sides-edit { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; display: grid; gap: 0.5rem; }
.rc-sides-edit legend { color: var(--muted); font-size: 0.9rem; padding: 0 0.3rem; }
.rc-sides-edit label { display: grid; grid-template-columns: 9rem 1fr auto; align-items: center; gap: 0.5rem; }
.rc-side-preview { display: inline-flex; gap: 2px; min-width: 3rem; }
.rc-bad { color: var(--red-bright); font-weight: 700; font-size: 0.8rem; }
.rc-hint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.rc-palette { display: flex; flex-wrap: wrap; gap: 0.3rem; max-height: 9.5rem; overflow-y: auto; }
.rc-palette button { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--bg-raise); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem 0.4rem; font-size: 0.75rem; cursor: pointer; }
.rc-palette button:hover { border-color: var(--accent, #e8762b); }
.rc-dialog-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.rc-dialog-actions .solid { background: var(--accent, #e8762b); color: #140b05; border: 0; border-radius: 8px; padding: 0.5rem 1.2rem; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 640px) {
  .rc-form { grid-template-columns: 1fr; }
  .rc-sides-edit label { grid-template-columns: 1fr auto; }
  .rc-sides-edit label input { grid-column: 1 / -1; }
  .rc-table { font-size: 0.85rem; }
}

/* ---- Scenario roll call: Diagrams tab ---- */
.rc-charts { position: relative; --rc-bar: #e8762b; --rc-grid: rgba(244, 240, 232, 0.1); }
.rc-charts-intro { color: var(--muted); font-size: 0.95rem; margin: 0 0 1rem; }
.rc-charts-intro a { color: var(--ink); }
.rc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.rc-tile { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 1rem; display: flex; flex-direction: column; }
.rc-tile-n { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rc-tile-l { color: var(--muted); font-size: 0.88rem; }
.rc-filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; margin-bottom: 1.2rem; }
.rc-filters label, .rc-top, .rc-pick-scenario { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }
.rc-chart { margin: 0 0 2rem; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem 0.8rem; scroll-margin-top: 5rem; }
.rc-chart figcaption { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; align-items: end; margin-bottom: 0.8rem; }
.rc-chart figcaption h2 { grid-column: 1; margin: 0; font-size: 1.15rem; }
.rc-chart figcaption p { grid-column: 1; margin: 0.15rem 0 0; color: var(--muted); font-size: 0.88rem; }
.rc-chart figcaption label { grid-column: 2; grid-row: 1 / span 2; }
.rc-pick-scenario input { width: min(22rem, 70vw); }
.rc-empty { color: var(--muted); margin: 1rem 0; }
.rc-rank-row { display: grid; grid-template-columns: minmax(9rem, 17rem) 1fr; align-items: center; gap: 0.6rem; width: 100%; min-height: 1.6rem; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.rc-rank-row:hover .rc-rank-name, .rc-rank-row:focus-visible .rc-rank-name { color: var(--rc-bar); }
.rc-rank-row:focus-visible { outline: 2px solid var(--rc-bar); outline-offset: 1px; border-radius: 4px; }
.rc-rank-axis { cursor: default; min-height: 1.3rem; }
.rc-rank-name { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-rank-pos { display: inline-block; min-width: 1.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-rank-track { position: relative; height: 1.6rem; }
.rc-rank-axis .rc-rank-track { height: 1.3rem; }
.rc-rank-area { position: absolute; inset: 0 2.4rem 0 0; }
.rc-tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-rank-bar { position: absolute; left: 0; top: 50%; height: 12px; transform: translateY(-50%); background: var(--rc-bar); border-radius: 0 4px 4px 0; }
.rc-rank-row:hover .rc-rank-bar { filter: brightness(1.15); }
.rc-rank-val { position: absolute; top: 50%; transform: translate(6px, -50%); font-size: 0.78rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.rc-years-plot { display: grid; grid-template-columns: 2rem 1fr; gap: 0.4rem; padding: 1.2rem 0 1.9rem; }
.rc-years-y { position: relative; height: 13rem; }
.rc-years-y span { position: absolute; right: 0; transform: translateY(50%); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-years-area { position: relative; height: 13rem; display: flex; gap: 2px; border-bottom: 1px solid rgba(244, 240, 232, 0.3); }
.rc-years-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--rc-grid); pointer-events: none; }
.rc-year-col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; background: none; border: 0; padding: 0; cursor: default; color: var(--ink); }
.rc-year-col:hover { background: rgba(244, 240, 232, 0.04); }
.rc-year-col:focus-visible { outline: 2px solid var(--rc-bar); outline-offset: -2px; }
.rc-year-bar { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(24px, 70%); background: var(--rc-bar); border-radius: 4px 4px 0 0; }
.rc-year-val { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -3px); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.rc-year-x { position: absolute; top: calc(100% + 0.3rem); left: 50%; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-year-x.rc-quiet { visibility: hidden; }
.rc-table-view { margin-top: 0.6rem; }
.rc-table-view summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.rc-data-table tbody tr { background: #e9e6df; }
.rc-tip { position: absolute; z-index: 5; max-width: 22rem; background: #0b0b0b; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.65rem; font-size: 0.82rem; line-height: 1.35; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.rc-tip span { color: var(--muted); }
@media (max-width: 640px) {
  .rc-rank-row { grid-template-columns: minmax(7rem, 45%) 1fr; }
  .rc-chart figcaption { grid-template-columns: 1fr; }
  .rc-chart figcaption label { grid-column: 1; grid-row: auto; margin-top: 0.5rem; }
}

.file-row-note { color: var(--muted); font-style: italic; }

/* ---- Tournament entry fees (tournament-admin.php, tournament-player.php) ---- */
.pay-tag { display: inline-block; border-radius: 999px; padding: 0.05rem 0.55rem; font-size: 0.8rem; font-weight: 700; white-space: nowrap; background: rgba(244, 240, 232, 0.12); color: var(--ink); }
.pay-ok { background: #2f6b34; color: #fff; }
.pay-part { background: #8a6a12; color: #fff; }
.pay-due { background: #7a2c25; color: #fff; }
.pay-summary { margin: 0 0 0.6rem; }
.pay-inline { display: flex; gap: 0.4rem; align-items: center; }
.pay-history tr.pay-void td { opacity: 0.55; text-decoration: line-through; }
.pay-history tr.pay-void td small { text-decoration: none; }
.pay-history code { font-size: 0.8rem; }
.pay-box { border: 1px solid var(--line); border-radius: 12px; padding: 0.4rem 1.1rem 0.9rem; margin: 1rem 0 1.4rem; background: var(--bg-raise); }
.pay-button { display: inline-block; background: #ffc439; color: #111; font-weight: 700; border-radius: 999px; padding: 0.55rem 1.4rem; text-decoration: none; }
.pay-button:hover { background: #f2b52a; }

.pay-small { padding: 0.3rem 0.9rem; font-size: 0.85rem; white-space: nowrap; }
.pay-events td { vertical-align: top; }
.pay-tally { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raise); padding: 0.6rem 1.1rem 0.8rem; margin: 0 0 1.4rem; }
.pay-tally-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; }
.pay-tally-head h2 { margin: 0.3rem 0; }
.pay-tally-head label { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.9rem; }
.pay-tally-table td, .pay-tally-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-tally-table tfoot th, .pay-tally-table tfoot td { border-top: 2px solid var(--line); font-weight: 700; }

/* On Today: the flags of the two sides */
.battle-flags { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.battle-flag-set { display: inline-flex; gap: 2px; }
.battle-flag-set:empty { display: none; }
.battle-flag { display: inline-block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.battle-vs { font-size: 0.7rem; text-transform: uppercase; color: var(--muted); }
.battle-sides { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; }
.battle-row-tags .battle-flags { margin-right: 0.4rem; }
.battle-row summary img.battle-flag { display: inline-block; width: 24px; height: 16px; object-fit: fill; background: none; border: 0; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }

/* Map scores and favorites (Military archive cards, profile) */
.mat-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; margin-top: auto; padding: 0.35rem 0.8rem 0.75rem; font-size: 0.85rem; color: var(--muted); }
.mat-rate.is-busy { opacity: 0.6; }
.mat-stars { display: inline-flex; }
.mat-star, .mat-fav { padding: 0 0.08rem; background: none; border: 0; cursor: pointer; font-size: 1.25rem; line-height: 1; color: #5c574f; }
.mat-star.is-on { color: #e8b42b; }
.mat-stars:hover .mat-star { color: #e8b42b; }
.mat-stars .mat-star:hover ~ .mat-star { color: #5c574f; }
.mat-fav { font-size: 1.3rem; color: #9a938a; }
.mat-fav.is-on, .mat-fav:hover { color: #e0475b; }
.mat-star:focus-visible, .mat-fav:focus-visible { outline: 2px solid #fff; outline-offset: 1px; border-radius: 3px; }
.mat-avg { margin-left: auto; white-space: nowrap; }
.mat-avg strong { color: #e8b42b; font-weight: 600; }
.mat-avg-n, .mat-avg-none { color: #8f877a; }
.mat-rate-sign { font-size: 0.8rem; }
.archive-fav { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.fav-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.8rem; margin: 0 0 0.6rem; }
.fav-map { display: grid; gap: 0.3rem; padding-bottom: 0.5rem; background: #2a2a2a; color: var(--ink); text-decoration: none; }
.fav-map:hover { outline: 1px solid #e8762b; }
.fav-map img { width: 100%; aspect-ratio: 2 / 1; object-fit: contain; background: #161616; }
.fav-map > span { padding: 0 0.6rem; }
.fav-map-stars { color: #e8b42b; letter-spacing: 1px; }
.fav-map-stars .is-off { padding: 0; color: #5c574f; }
/* Maps tab campaign cards with a rating row; On Today battle card rating row */
.mat-card.mat-camp { display: flex; flex-direction: column; }
.mat-camp-link { display: grid; gap: 0.65rem; color: inherit; text-decoration: none; }
.mat-camp-link:hover { color: #fff; }
.mat-rate.battle-rate { margin: 0 0 0.6rem; padding: 0; }
.mat-rate.battle-rate .mat-avg { margin-left: 0.4rem; }
.mat-rate:empty { display: none; }
.mat-card .mat-rate span { padding: 0; font-size: inherit; line-height: inherit; }
.mat-rate { line-height: 1.2; }
/* Rating row: bigger, brighter stars so the row reads as something to click */
.mat-rate .mat-rate-label { font-size: 0.8rem; color: var(--muted); }
.mat-rate .mat-stars .mat-star { font-size: 1.45rem; color: #8a8378; padding: 0 0.1rem; }
.mat-rate .mat-stars .mat-star.is-on, .mat-rate .mat-stars:hover .mat-star { color: #f0b429; }
.mat-rate .mat-stars .mat-star:hover ~ .mat-star { color: #8a8378; }
.mat-rate .mat-fav { font-size: 1.5rem; color: #b5ada2; }
.mat-rate .mat-fav.is-on, .mat-rate .mat-fav:hover { color: #e0475b; }
.mat-rate.battle-rate { font-size: 0.9rem; }

/* On Today: nation pickers (flags, several at once) */
.battles-nation-pick { display: grid; gap: 0.25rem; font-size: 0.8rem; grid-column: span 2; position: relative; min-width: 0; }
.battles-pick-label small { color: var(--muted); font-size: 0.72rem; }
.nation-pick > summary { list-style: none; display: flex; align-items: center; gap: 0.45rem; min-height: 2.15rem; padding: 0.3rem 2rem 0.3rem 0.7rem; border: 1px solid var(--f-line, rgba(244, 240, 232, 0.16)); border-radius: 10px; background: var(--f-bg, #151413); cursor: pointer; position: relative; overflow: hidden; white-space: nowrap; }
.nation-pick > summary::-webkit-details-marker { display: none; }
.nation-pick > summary::after { content: ""; position: absolute; right: 0.8rem; top: 50%; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: 0.8; }
.nation-pick[open] > summary, .nation-pick > summary:hover { border-color: var(--f-hover, rgba(244, 240, 232, 0.32)); }
.nation-pick-flags { display: inline-flex; gap: 2px; }
.nation-pick-name { overflow: hidden; text-overflow: ellipsis; }
.nation-grid { position: absolute; z-index: 30; left: 0; top: calc(100% + 0.3rem); width: min(34rem, 92vw); max-height: 22rem; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.3rem; padding: 0.6rem; background: #1d1c1a; border: 1px solid rgba(244, 240, 232, 0.2); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); }
.nation-grid-tools { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.nation-none { background: none; border: 0; color: #e8762b; cursor: pointer; font-size: 0.8rem; text-decoration: underline; }
.nation-chip { display: flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.5rem; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; font-size: 0.82rem; text-align: left; }
.nation-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nation-chip small { color: var(--muted); font-size: 0.72rem; }
.nation-chip:hover { border-color: rgba(244, 240, 232, 0.25); }
.nation-chip.is-on { border-color: #e8762b; background: rgba(232, 118, 43, 0.16); }
.nation-chip .battle-flag, .nation-pick .battle-flag { flex: none; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
@media (max-width: 560px) { .battles-nation-pick { grid-column: 1 / -1; } }

/* Profile, My maps tab */
.profile-tabs { margin: 0 0 1.2rem; }
.profile-tabs a.cal-tab { width: auto; text-decoration: none; }
.pm-sec { margin: 0 0 2rem; }
.pm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 0.6rem 1rem; margin: 0 0 0.8rem; }
.pm-head h2 { margin: 0; }
.pm-head p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.88rem; }
.pm-head label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }
.pm-controls { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: end; }
.pm-seg { display: inline-flex; border: 1px solid rgba(244, 240, 232, 0.3); border-radius: 10px; overflow: hidden; }
.pm-seg button { background: none; border: 0; color: var(--ink); padding: 0.45rem 0.9rem; cursor: pointer; font: inherit; font-size: 0.88rem; }
.pm-seg button + button { border-left: 1px solid rgba(244, 240, 232, 0.3); }
.pm-seg button.is-on { background: #e8762b; color: #140b05; font-weight: 700; }
.pm-card { padding-bottom: 0.6rem; }
.pm-card:hover { outline: none; }
.pm-card > a img { display: block; }
.pm-card-name { font-size: 0.95rem; }
.pm-card-name a { color: var(--ink); text-decoration: none; }
.pm-card-name a:hover { color: #e8762b; }
.pm-card-meta { color: var(--muted); font-size: 0.8rem; }
.pm-card .mat-rate { padding: 0 0.6rem; margin: 0; }
.pm-card-links { display: flex; gap: 0.8rem; }
.pm-record { font-size: 0.85rem; white-space: nowrap; }
.pm-rated { display: grid; grid-template-columns: 5rem minmax(10rem, 1fr) auto auto; align-items: center; gap: 0.4rem 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.pm-rated img, .pm-noimg { display: block; width: 5rem; aspect-ratio: 2 / 1; object-fit: contain; background: #161616; }
.pm-rated-main { display: flex; flex-direction: column; min-width: 0; }
.pm-rated .mat-rate { padding: 0; margin: 0; }
.pm-chart-note { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.6rem; }
.pm-bar-row { display: grid; grid-template-columns: minmax(9rem, 17rem) 1fr 4.6rem; align-items: center; gap: 0.6rem; min-height: 1.7rem; }
.pm-bar-row:focus-visible { outline: 2px solid #e8762b; outline-offset: 1px; border-radius: 4px; }
.pm-bar-name { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-bar-name a { color: var(--ink); text-decoration: none; }
.pm-bar-name a:hover { color: #e8762b; }
.pm-track { position: relative; height: 1.7rem; }
.pm-axis .pm-track { height: 1.2rem; }
.pm-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(244, 240, 232, 0.3); }
.pm-bar { position: absolute; top: 50%; height: 12px; transform: translateY(-50%); background: #e8762b; border-radius: 0 4px 4px 0; }
.pm-bar.is-neg { border-radius: 4px 0 0 4px; }
.pm-bar-row:hover .pm-bar { filter: brightness(1.15); }
.pm-bar-val { font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pm-bar-val small { color: var(--muted); }
.pm-tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); }
.pm-table td, .pm-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .pm-rated { grid-template-columns: 4rem 1fr; }
  .pm-rated img, .pm-noimg { width: 4rem; }
  .pm-rated .mat-rate, .pm-rated .pm-record { grid-column: 2; }
  .pm-bar-row { grid-template-columns: minmax(6rem, 40%) 1fr 3.8rem; }
}
.pm-bar.is-neg { background: #6f9fd8; }

/* Days of Wonder legacy: the old ratings (out of 3) and battle reports saved from daysofwonder.com. */
.archive-dow { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.dow-legacy {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.35rem;
  margin: 0 0.8rem 0.85rem; padding: 0.4rem 0.6rem; width: calc(100% - 1.6rem);
  border: 1px dashed var(--line); border-radius: 8px; background: rgba(244, 240, 232, 0.03);
  color: var(--muted); font: inherit; font-size: 0.8rem; text-align: left; cursor: pointer;
}
.dow-legacy:hover, .dow-legacy:focus-visible { border-color: #e8762b; color: var(--ink); }
.mat-card .dow-legacy span { padding: 0; }
.dow-legacy .dow-tag { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: #e8762b; width: 100%; }
.dow-legacy .dow-stars { color: #f0b429; font-weight: 700; }
.dow-legacy .dow-stars small { color: var(--muted); font-weight: 400; }
.dow-legacy .dow-n { opacity: 0.8; }
.dow-legacy .dow-dot { opacity: 0.6; }
dialog.dow-dialog { width: min(52rem, calc(100% - 2rem)); max-height: min(46rem, calc(100% - 2rem)); }
.dow-kicker { margin: 0 2rem 0.15rem 0 !important; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #e8762b; }
.dow-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.75rem; margin: 0.6rem 0 0.9rem; }
.dow-stat { border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.85rem; background: rgba(244, 240, 232, 0.03); }
.dow-stat strong { font-size: 1.45rem; }
.dow-stat > span { color: var(--muted); }
.dow-stat small { display: block; color: var(--muted); margin-top: 0.1rem; }
.dow-dist { display: grid; gap: 0.25rem; margin-top: 0.55rem; }
.dow-dist-row { display: grid; grid-template-columns: 4rem 1fr 2.8rem; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.dow-dist-label { color: #f0b429; letter-spacing: 0.05em; }
.dow-dist-bar { height: 8px; border-radius: 4px; background: rgba(244, 240, 232, 0.08); overflow: hidden; }
.dow-dist-bar i { display: block; height: 100%; background: #f0b429; border-radius: 4px; }
.dow-dist-n { text-align: right; color: var(--muted); }
.dow-split { display: flex; gap: 2px; height: 10px; margin: 0.6rem 0 0.45rem; }
.dow-split i { display: block; height: 100%; }
.dow-split-a { background: #e8762b; border-radius: 4px 0 0 4px; }
.dow-split-b { background: #6f9fd8; border-radius: 0 4px 4px 0; }
.dow-split-legend { display: grid; gap: 0.15rem; font-size: 0.82rem; }
.dow-split-key::before { content: ""; display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 2px; margin-right: 0.4rem; }
.dow-split-key.is-a::before { background: #e8762b; }
.dow-split-key.is-b::before { background: #6f9fd8; }
.dow-tabs, .dow-langs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.3rem 0 0.7rem; }
.dow-langs .chip, .dow-tabs .chip { cursor: pointer; font: inherit; font-size: 0.85rem; }
.dow-panel .cal-note { margin: 0.3rem 0 0.6rem; color: var(--muted); }
.dow-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.dow-comments li { border-left: 3px solid rgba(240, 180, 41, 0.45); padding: 0.35rem 0 0.35rem 0.7rem; }
.dow-comment-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.2rem; font-size: 0.88rem; }
.dow-row-stars { color: #f0b429; letter-spacing: 0.04em; }
.dow-flag { border-radius: 2px; }
.dow-comments p { font-size: 0.92rem; }
.dow-table-wrap { overflow-x: auto; }
.dow-reports { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dow-reports th { text-align: left; font-weight: 600; color: var(--muted); padding: 0.3rem 0.45rem; border-bottom: 1px solid var(--line); }
.dow-reports td { padding: 0.35rem 0.45rem; border-top: 1px solid rgba(244, 240, 232, 0.07); vertical-align: top; }
.dow-reports td small { display: block; color: var(--muted); }
.dow-reports td.is-won .dow-player { color: #f0b429; font-weight: 700; }
.dow-reports .dow-date { white-space: nowrap; color: var(--muted); }
.dow-reports .dow-score { white-space: nowrap; text-align: center; font-variant-numeric: tabular-nums; }
.dow-reports .dow-note td { border-top: 0; padding-top: 0; }
.dow-reports .dow-note p { font-size: 0.82rem; color: var(--muted); padding-left: 0.6rem; border-left: 2px solid var(--line); }
.dow-source { margin-top: 0.9rem !important; font-size: 0.78rem; color: var(--muted); }
.dow-source a { color: #e8762b; }
/* Way Back Machine section (Materials, USM 44 Corps tab). */
.dow-hub > p:first-child { max-width: 60rem; }
.dow-hub a { color: #e8762b; }
.dow-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; margin: 0.9rem 0; }
.dow-totals div { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; background: rgba(244, 240, 232, 0.03); }
.dow-totals strong { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.dow-totals span { color: var(--muted); font-size: 0.82rem; }
.dow-tools { display: flex; flex-wrap: wrap; gap: 0.6rem 0.9rem; align-items: end; }
.dow-tools label { display: grid; gap: 0.25rem; font-size: 0.8rem; }
.dow-tools input { min-width: min(18rem, 100%); }
.dow-list { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.dow-list th { text-align: left; font-weight: 600; color: var(--muted); padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); font-size: 0.8rem; }
.dow-list td { padding: 0.45rem 0.5rem; border-top: 1px solid rgba(244, 240, 232, 0.07); vertical-align: middle; }
.dow-list td small { display: block; color: var(--muted); font-size: 0.75rem; }
.dow-list .dow-open { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.dow-list .dow-open:hover, .dow-list .dow-open:focus-visible { color: #e8762b; text-decoration: underline; }
.dow-list .dow-rate-cell, .dow-list .dow-games-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dow-list .dow-rate-cell small { display: inline; margin-left: 0.15rem; }
.dow-list .dow-sides-cell { min-width: 10rem; }
.dow-split-sm { height: 6px; margin: 0 0 0.25rem; max-width: 12rem; }
.dow-map-link { font-size: 0.82rem; white-space: nowrap; }
@media (max-width: 640px) {
  .dow-list th:nth-child(6), .dow-list td:nth-child(6), .dow-list th:nth-child(7), .dow-list td:nth-child(7) { display: none; }
  .dow-list .dow-rate-cell { white-space: normal; }
  .dow-map-cell { width: 3.4rem; }
  .dow-map-thumb { width: 3.2rem; }
}
.dow-comment-head > * { flex: 0 0 auto; }
.dow-comment-head .dow-flag { width: 20px; height: 13px; display: inline-block; margin: 0; }
@media (max-width: 560px) {
  .dow-reports { font-size: 0.78rem; }
  .dow-reports th, .dow-reports td { padding: 0.3rem 0.3rem; }
  .dow-reports .dow-date { white-space: normal; min-width: 4.2rem; }
  .dow-reports .dow-player { word-break: break-word; }
}

/* The 1–5 version of an old Days of Wonder score, and the map pictures that open the Military archive. */
.dow-five { color: var(--ink); font-weight: 600; }
.dow-legacy .dow-five { margin-left: 0.25rem; color: #f0b429; opacity: 0.85; }
.dow-five-big { display: inline-block; margin-left: 0.8rem; padding-left: 0.8rem; border-left: 1px solid var(--line); }
.dow-five-big strong { font-size: 1.45rem; color: #f0b429; }
.dow-five-big span { color: var(--muted); }
.dow-list .dow-five { margin-left: 0.3rem; }
.dow-list th small { font-weight: 400; opacity: 0.8; }
.dow-map-cell { width: 4.6rem; }
.dow-map-thumb { display: block; width: 4.2rem; }
.dow-map-thumb img { display: block; width: 100%; height: auto; margin: 0; border-radius: 4px; border: 1px solid var(--line); }
.dow-map-thumb:hover img, .dow-map-thumb:focus-visible img { border-color: #e8762b; }
.dow-map-top { margin: 0.4rem 0 0.2rem; }
.dow-map-big { display: block; position: relative; color: #e8762b; }
.dow-map-big img { display: block; width: 100%; max-height: 16rem; object-fit: cover; object-position: center; margin: 0; border-radius: 8px; border: 1px solid var(--line); }
.dow-map-caption { display: block; margin-top: 0.3rem; font-size: 0.8rem; }
.battle-dow { margin: 0.2rem 0 0.6rem; width: 100%; }
/* A [hidden] element stays hidden even when its class sets a display (the battles "Show more" button). */
[hidden] { display: none !important; }

/* Legacy (1–3, historical) and 5-star (converted votes) ratings shown side by side. */
.dow-pair { white-space: nowrap; }
.dow-lbl { font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.dow-stars.is-five { color: #f0b429; }
.dow-legacy .dow-stars:not(.is-five) { color: #c9b27a; }
.dow-stat-kicker { margin: 0 0 0.25rem !important; font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.dow-stat.is-five { border-color: rgba(240, 180, 41, 0.45); }
.dow-stat.is-five strong { color: #f0b429; }
.dow-summary { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.dow-vote { display: inline-flex; gap: 0.8rem; margin-left: auto; }
.dow-vote-part { display: inline-flex; align-items: center; gap: 0.3rem; }
.dow-comment-head { flex-wrap: wrap; }
.dow-comment-head .dow-vote { flex: 1 1 auto; justify-content: flex-end; }
.dow-list .dow-rate-cell small.dow-votes { display: block; margin-left: 0; }
.dow-list .dow-rate-cell.is-five .dow-row-stars { color: #f0b429; font-weight: 700; }
.dow-list .dow-rate-cell:not(.is-five) .dow-row-stars { color: #c9b27a; }
.dow-talk { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem; color: var(--ink); font: inherit; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.dow-talk:hover, .dow-talk:focus-visible { border-color: #e8762b; color: #e8762b; }

/* Materials, USM 44 Corps tab: a sub-tab per material group, then the Way Back Machine. */
.mat-subtabs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0.4rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.mat-subtab {
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 0.45rem 0.1rem 0.55rem;
  color: var(--muted); font: inherit; font-family: "Playfair Display", Georgia, serif; font-size: 1.3rem; font-weight: 700; cursor: pointer;
}
.mat-subtab:hover, .mat-subtab:focus-visible { color: var(--ink); }
.mat-subtab.is-on { color: #e8762b; border-bottom-color: #e8762b; }
.mat-corps-panel { margin-top: 0.4rem; }
@media (max-width: 560px) { .mat-subtab { font-size: 1.1rem; } }

/* On Today: the star range (two handles on one 1–5 track). */
.battles-stars { display: grid; gap: 0.25rem; font-size: 0.8rem; grid-column: span 2; min-width: 0; }
.battles-stars output { margin-left: 0.4rem; color: #f0b429; font-weight: 700; }
.star-range { position: relative; height: 2.1rem; }
.star-range-track { position: absolute; left: 0.55rem; right: 0.55rem; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: rgba(244, 240, 232, 0.14); }
.star-range-track i { position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: 3px; background: #f0b429; }
.star-range input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  background: none; border: 0; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.star-range input[type="range"]:focus { outline: none; }
.star-range input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; }
.star-range input[type="range"]::-moz-range-track { background: none; border: 0; }
.star-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
  width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #f0b429; border: 2px solid #140b05; box-shadow: 0 0 0 1px #f0b429;
}
.star-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto; cursor: grab; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #f0b429; border: 2px solid #140b05;
}
.star-range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.55); }
.star-range input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.55); }
.star-range-ticks { display: flex; justify-content: space-between; padding: 0 0.2rem; color: var(--muted); font-size: 0.72rem; }
@media (max-width: 560px) { .battles-stars { grid-column: 1 / -1; } }
:root body .star-range input[type="range"] { border: 0; background: none; box-shadow: none; padding: 0; min-height: 0; border-radius: 0; }

/* Way Back Machine filters: search, the rating and win % sliders, minimums, sort, comments, clear. */
.dow-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.7rem 0.9rem; align-items: end; margin-bottom: 0.4rem; }
.dow-tools .dow-tool-search { grid-column: span 2; }
.dow-tools .dow-tool-search input { width: 100%; min-width: 0; }
.dow-tool-range { display: grid; gap: 0.25rem; font-size: 0.8rem; grid-column: span 2; min-width: 0; }
.dow-tool-range output { margin-left: 0.4rem; color: #f0b429; font-weight: 700; }
.star-range.is-win .star-range-track { background: linear-gradient(90deg, rgba(111, 159, 216, 0.45), rgba(244, 240, 232, 0.14) 50%, rgba(232, 118, 43, 0.45)); }
.star-range.is-win .star-range-track i { background: rgba(244, 240, 232, 0.55); }
.dow-tool-check { align-self: center; white-space: nowrap; }
.dow-tool-clear { justify-self: start; }
@media (max-width: 560px) { .dow-tools .dow-tool-search, .dow-tool-range { grid-column: 1 / -1; } }
.dow-tools .dow-tool-check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; padding-bottom: 0.6rem; }
.dow-tools .dow-tool-check input { min-width: 0; width: 1.05rem; height: 1.05rem; margin: 0; }

/* Game form: the 1–5 star picker (inputs are in 5…1 order, shown 1…5 left to right). */
.star-pick { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 0.15rem; }
.star-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.star-pick label { font-size: 2rem; line-height: 1; color: rgba(244, 240, 232, 0.25); cursor: pointer; padding: 0 0.1rem; transition: color 0.1s; }
.star-pick input:checked ~ label, .star-pick label:hover, .star-pick label:hover ~ label { color: #f0b429; }
.star-pick:hover input:checked ~ label:not(:hover):not(:hover ~ label) { color: rgba(240, 180, 41, 0.45); }
.star-pick input:focus-visible + label { outline: 2px solid #f0b429; outline-offset: 2px; border-radius: 4px; }
.map-stars { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; }
.map-stars legend small { color: var(--muted); font-weight: 400; }
.star-none { font-size: 0.85rem; color: var(--muted); }
/* Corps contributions in the Way Back Machine popup. */
.dow-corps-tag { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 999px; background: rgba(232, 118, 43, 0.15); color: #e8762b; font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; }
.dow-comments li.is-corps { border-left-color: #e8762b; }
.dow-reports tr.is-corps td:first-child { box-shadow: inset 3px 0 0 #e8762b; }
.dow-mix { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.78rem; }
.dow-from { margin: 1rem 0 0.5rem !important; }
.dow-comment-head small { color: var(--muted); }
/* On Today: the date box and the battle list fold away from their headings (open at first). */
.battles-fold > summary { margin-bottom: 0.6rem; }
.battles-fold > summary .battles-kicker { margin: 0; }
.battles-fold > summary:has(.battles-kicker) { color: #e1b04a; }
.battles-fold > summary .battles-title { margin: 0; }
.battles-fold + .battles-fold, [data-battles-featured-wrap] + .battles-fold { margin-top: 1.6rem; }
.battles-fold > summary::before { flex: 0 0 auto; margin-right: 0.15rem; }
.battles-fold > summary:has(.battles-kicker)::before { width: 0.45rem; height: 0.45rem; }
/* An opened battle: a fold arrow before its date (like the section headings), so it reads as something to close. */
.battle-row[open] > summary .battle-row-date { display: inline-flex; align-items: center; gap: 0.5rem; }
.battle-row[open] > summary .battle-row-date::before {
  content: ""; flex: 0 0 auto; width: 0.45rem; height: 0.45rem; margin: 0 0.15rem 0.2rem 0.1rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.battle-row[open] > summary:hover .battle-row-date { color: #e8762b; }
.battle-row[open] > summary { cursor: pointer; }
/* Map submissions (map-submit.php, map-review.php). */
.battles-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; }
.battles-title-row .battles-title { margin: 0; }
.battles-submit { display: inline-block; padding: 0.4rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.battles-submit:hover, .battles-submit:focus-visible { border-color: #e8762b; color: #e8762b; }
.mapsub-form h2 { margin-top: 1.6rem; }
.mapsub-forces { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.5rem 0.8rem; }
.mapsub-forces legend small, .mapsub-form label small { color: var(--muted); font-weight: 400; }
.mapsub-check-info { border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem; background: rgba(244, 240, 232, 0.03); font-size: 0.9rem; }
.mapsub-check-info p { margin: 0.2rem 0; }
.mapsub-check-info ul { margin: 0.3rem 0 0.4rem 1.1rem; padding: 0; }
.mapsub-problem { border: 1px solid #d9534f; border-radius: 10px; padding: 0.8rem 1rem; margin: 0.8rem 0 1.2rem; background: rgba(217, 83, 79, 0.1); }
.mapsub-problem h2 { margin: 0 0 0.4rem; font-size: 1.2rem; color: #ff8a80; }
.mapsub-problem p { margin: 0.25rem 0; }
.mapsub-mine { list-style: none; margin: 0.4rem 0 1.4rem; padding: 0; display: grid; gap: 0.5rem; }
.mapsub-mine li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; }
.mapsub-mine li small { color: var(--muted); }
.mapsub-mine li p { flex-basis: 100%; margin: 0.2rem 0 0; }
.mapsub-status { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; }
.mapsub-status.is-pending { background: rgba(240, 180, 41, 0.15); color: #f0b429; }
.mapsub-status.is-approved { background: rgba(76, 175, 80, 0.15); color: #7bd47f; }
.mapsub-status.is-denied { background: rgba(217, 83, 79, 0.15); color: #ff8a80; }
.mapsub-card { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.2rem; padding: 1rem; margin: 1rem 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(244, 240, 232, 0.02); }
.mapsub-preview { display: flex; align-items: flex-start; justify-content: center; color: #e8762b; }
.mapsub-preview img { width: 100%; height: auto; margin: 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.mapsub-body h2 { margin: 0 0 0.3rem; }
.mapsub-body p { margin: 0.25rem 0; }
.mapsub-meta, .mapsub-small { color: var(--muted); font-size: 0.88rem; }
.mapsub-text { white-space: pre-line; font-size: 0.9rem; }
.mapsub-body details summary { cursor: pointer; color: #e8762b; font-size: 0.9rem; margin-top: 0.3rem; }
.mapsub-check { margin: 0.7rem 0; padding: 0.6rem 0.8rem; border-radius: 10px; border: 1px solid var(--line); font-size: 0.88rem; }
.mapsub-check ul { margin: 0.3rem 0 0 1.1rem; padding: 0; }
.mapsub-check.is-ok { border-color: rgba(76, 175, 80, 0.5); }
.mapsub-check.is-ok strong { color: #7bd47f; }
.mapsub-check.is-warn { border-color: rgba(240, 180, 41, 0.55); }
.mapsub-check.is-warn strong, .mapsub-check li.is-note { color: #f0b429; }
.mapsub-check.is-fail { border-color: #d9534f; }
.mapsub-decide { margin-top: 0.6rem; display: grid; gap: 0.5rem; }
.mapsub-decide label { display: grid; gap: 0.3rem; font-size: 0.85rem; }
.map-review .mat-subtabs a { text-decoration: none; }
@media (max-width: 720px) { .mapsub-card { grid-template-columns: 1fr; } }
/* "Submit a map" (On Today): a button with a map icon, next to the "Find a battle" heading. */
:root body a.battles-submit {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem;
  border: 1px solid #e8762b; border-radius: 10px; background: rgba(232, 118, 43, 0.1);
  color: #f4f0e8; font-weight: 700; font-size: 0.95rem; text-decoration: none; line-height: 1.2;
}
:root body a.battles-submit svg { color: #e8762b; flex: 0 0 auto; }
:root body a.battles-submit:hover, :root body a.battles-submit:focus-visible { background: #e8762b; color: #140b05; }
:root body a.battles-submit:hover svg, :root body a.battles-submit:focus-visible svg { color: #140b05; }
.battles-title-row { margin-bottom: 0.8rem; }
/* The wins bar under a Days of Wonder line (On Today and Military archive cards). */
.dow-legacy .dow-card-split { display: block; width: 100%; margin-top: 0.4rem; }
.dow-legacy .dow-card-split .dow-split { margin: 0 0 0.2rem; max-width: 18rem; }
.dow-legacy .dow-card-split small { display: block; font-size: 0.75rem; color: var(--muted); }
.mat-card .dow-legacy .dow-card-split span, .mat-card .dow-legacy .dow-card-split small { padding: 0; }
/* "Submit a map" glows for its first 3 seconds on the page to catch the eye (still for reduced motion). */
@keyframes battles-submit-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 118, 43, 0); }
  50% { box-shadow: 0 0 14px 4px rgba(232, 118, 43, 0.75); background-color: rgba(232, 118, 43, 0.3); }
}
:root body a.battles-submit { animation: battles-submit-glow 1s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) { :root body a.battles-submit { animation: none; } }
/* Rules tab: an expansion card (its rules link + the "About" button) and the About window. */
.mat-exp { display: flex; flex-direction: column; }
.mat-exp .mat-exp-link { display: flex; flex-direction: column; flex: 1 1 auto; color: inherit; text-decoration: none; }
.mat-exp .mat-exp-link img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top; width: 100%; }
.mat-exp-about {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0 0.8rem 0.8rem; padding: 0.35rem 0.6rem;
  border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 0.82rem; cursor: pointer;
}
.mat-exp-about:hover, .mat-exp-about:focus-visible { border-color: #e8762b; color: #e8762b; }
dialog.exp-dialog { width: min(58rem, calc(100% - 2rem)); max-height: min(50rem, calc(100% - 2rem)); }
.exp-top { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 1.1rem; align-items: start; margin-top: 0.5rem; }
.exp-cover img { width: 100%; height: auto; margin: 0; border-radius: 6px; border: 1px solid var(--line); }
.exp-cover { margin: 0; }
.exp-intro p { margin: 0 0 0.7rem !important; white-space: normal !important; }
.exp-quote { margin: 0.4rem 0 0; padding: 0.5rem 0 0.5rem 0.9rem; border-left: 3px solid #e8762b; }
.exp-quote p { margin: 0 !important; font-style: italic; }
.exp-quote cite { display: block; margin-top: 0.3rem; font-size: 0.82rem; color: var(--muted); font-style: normal; }
.exp-section { margin-top: 1.2rem !important; }
.exp-section h3 { font-size: 1.05rem !important; margin-bottom: 0.5rem !important; }
.exp-files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.4rem 1rem; }
.exp-files li { display: grid; grid-template-columns: auto 1fr; column-gap: 0.55rem; align-items: center; padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 8px; }
.exp-files li.is-main { border-color: #e8762b; }
.exp-files li a { color: #e8762b; font-weight: 600; }
.exp-files li small { grid-column: 2; color: var(--muted); font-size: 0.75rem; }
.exp-flag { width: 22px; height: 15px; margin: 0; border-radius: 2px; grid-row: span 2; }
.exp-fileicon { grid-row: span 2; font-size: 0.62rem; font-weight: 700; padding: 0.15rem 0.3rem; border-radius: 3px; background: #d9534f; color: #fff; }
.exp-contents { margin: 0; padding-left: 1.2rem; columns: 2 18rem; column-gap: 1.6rem; }
.exp-contents li { margin: 0 0 0.3rem; break-inside: avoid; }
.exp-highlights { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.8rem; }
.exp-highlight, .exp-photo { margin: 0; }
.exp-highlight img, .exp-photo img { width: 100%; height: auto; margin: 0; border-radius: 6px; background: rgba(244, 240, 232, 0.06); }
.exp-highlight figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; line-height: 1.35; }
.exp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.5rem; }
.exp-gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.exp-notes { margin-top: 1rem; font-size: 0.88rem; color: var(--muted); }
.exp-notes p { margin: 0 0 0.4rem !important; }
@media (max-width: 600px) { .exp-top { grid-template-columns: 1fr; } .exp-cover { max-width: 10rem; } }

/* Expansion cards: the (i) and PDF round icons on the picture, like the Military archive's map cards. */
.mat-exp-frame { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; }
.mat-exp-tool { top: 1.6rem; transform: none; border: 0; cursor: pointer; padding: 0; }
.mat-exp-tool.is-info { left: 0.55rem; }
.mat-exp-tool.is-pdf { right: 0.55rem; }
.mat-card .mat-exp-tool { padding: 0; }

/* On Today: the designer of a map, and the Designer search box. */
.battle-designer { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); }
.battle-designer-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: #e8762b; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.battle-designer-link:hover, .battle-designer-link:focus-visible { color: #f0b429; }
.battles-designer { display: grid; gap: 0.25rem; font-size: 0.8rem; }
.battles-designer input { width: 100%; }
.battles-dow-only { display: inline-flex !important; align-items: center; gap: 0.45rem; font-size: 0.88rem !important; align-self: end; padding-bottom: 0.6rem; white-space: nowrap; }
.battles-dow-only input { width: 1.05rem; height: 1.05rem; margin: 0; }

/* On Today: "showing / total" after the list title. */
.battles-title-count { font-family: inherit; font-size: 0.6em; font-weight: 700; color: var(--muted); margin-left: 0.4rem; letter-spacing: 0.02em; white-space: nowrap; }

/* On Today: the link icon at the top right of a battle card (copies the link to that battle). */
.battle-feature { position: relative; }
.battle-share { position: absolute; top: 0.7rem; right: 0.7rem; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 1px solid rgba(232, 118, 43, 0.55); background: rgba(18, 18, 18, 0.85); color: #e8762b; text-decoration: none; transition: background 0.15s, color 0.15s; }
.battle-share:hover, .battle-share:focus-visible { background: #e8762b; color: #121212; }
.battle-share.is-copied { background: #3f8f4a; border-color: #3f8f4a; color: #fff; }
.battle-share-done { position: absolute; right: calc(100% + 0.5rem); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 0.8rem; font-weight: 700; color: #7fd18a; pointer-events: none; }
.battle-share-done:empty { display: none; }
.battle-feature-body { padding-right: 2.6rem; }
