@font-face {
  font-family: DM;
  src: url(assets/dm-sans-latin-400-normal.woff2);
  font-display: swap;
}
@font-face {
  font-family: DM;
  src: url(assets/dm-sans-latin-600-normal.woff2);
  font-display: swap;
  font-weight: 600 800;
}
@font-face {
  font-family: Barlow;
  src: url(assets/barlow-condensed-latin-700-normal.woff2);
  font-display: swap;
  font-weight: 700;
}
@font-face {
  font-family: Workbench;
  src: url(assets/workbench.woff2);
  font-display: swap;
}
:root {
  color-scheme: dark;
  --page: #141b28;
  --panel: #202b39;
  --panel-hi: #2b394a;
  --ink: #fff2d4;
  --muted: #b4c2c5;
  --accent: #ffd472;
  --second: #93d9ce;
  --line: #536579;
  --key: #0d1624;
  --shadow: #0c121c;
  --header: #1b2433;
  --btn-ink: #212532;
  --map-h: clamp(446px, 52vh, 598px);
  font:
    400 15px/1.35 DM,
    Arial,
    sans-serif;
  background: var(--page);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
}
h1,
h2,
h3,
p,
ol {
  margin: 0;
}
h2,
h3 {
  font-family: Barlow, 'Arial Narrow', sans-serif;
  line-height: 1.02;
}
button,
select,
a {
  font: inherit;
}
button,
select {
  color: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--second);
  outline-offset: 3px;
  z-index: 12;
}
#wordmark,
.stage-button canvas {
  image-rendering: pixelated;
}
[hidden] {
  display: none !important;
}
.section-code,
.brand > span,
.study-label,
.controls label > span,
.rank-setting > span,
.column-head,
.map-key,
.place,
.rank-count,
.grand-total b,
.score-toggle strong {
  font-family: ui-monospace, Menlo, monospace;
}
.section-code,
.brand > span,
.study-label,
.controls label > span,
.rank-setting > span,
.column-head {
  font-size: 10px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
}
.shell {
  max-width: 1540px;
  margin: 0 auto;
}
.studies {
  background: #141720;
  color: #b8beca;
  border-bottom: 1px solid #3b4048;
}
.study-inner {
  max-width: 1540px;
  padding: 0 clamp(16px, 3.6vw, 58px);
  margin: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 39px;
}
.study-label {
  color: #b3b7be;
  padding-right: 12px;
  font-size: 9px;
}
.studies a {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 2px;
  white-space: nowrap;
}
.studies a:hover {
  color: white;
}
.studies [aria-current] {
  color: #fff4d5;
  background: #323540;
  box-shadow: inset 0 -2px #edb65f;
}
.mast {
  margin: 0 clamp(16px, 3.6vw, 58px);
  border-bottom: 1px solid var(--line);
}
.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 21px;
}
.brand > span {
  color: var(--second);
  display: block;
  letter-spacing: 0.18em;
  margin: 0 0 8px 2px;
}
.brand h1 {
  line-height: 0;
}
.brand img {
  display: block;
  width: clamp(220px, 25vw, 358px);
  height: auto;
}
.actions {
  display: flex;
  align-items: center;
  gap: 17px;
}
.index-button,
.add-button {
  font-size: 13px;
  font-weight: 700;
}
.index-button {
  background: transparent;
  color: var(--ink);
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.add-button {
  background: var(--accent);
  color: var(--btn-ink);
  padding: 10px 16px;
  border: 2px solid var(--key);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.53),
    3px 3px var(--shadow);
  white-space: nowrap;
}
.add-button:hover {
  filter: brightness(1.08);
}
.add-button:active {
  transform: translate(1px, 1px);
}
main,
footer {
  margin: 0 clamp(16px, 3.6vw, 58px);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 0 16px;
}
.map-title .section-code,
.section-code {
  color: var(--second);
}
.map-title h2 {
  font-size: clamp(34px, 3.1vw, 48px);
  margin-top: 3px;
  letter-spacing: 0.002em;
}
.controls {
  display: flex;
  align-items: end;
  gap: 15px;
}
.controls label > span,
.rank-setting > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
}
.controls select,
.seg {
  height: 35px;
}
.controls select {
  border: 1px solid var(--line);
  font-weight: 600;
  border-radius: 0;
  background-color: var(--panel);
  color: var(--ink);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 55%),
    linear-gradient(135deg, currentColor 45%, transparent 50%);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  background-position:
    calc(100% - 13px) 52%,
    calc(100% - 8px) 52%;
  padding: 4px 26px 4px 10px;
  cursor: pointer;
}
.controls select {
  width: 138px;
  font-size: 13px;
}
.seg {
  display: flex;
  border: 1px solid var(--line);
  background: var(--panel);
}
.seg button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}
.seg button[aria-pressed='true'] {
  color: var(--btn-ink);
  background: var(--accent);
  box-shadow: inset 0 -3px rgba(0, 0, 0, 0.15);
}
.arena {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  border: 2px solid var(--key);
  box-shadow:
    0 0 0 1px var(--line),
    4px 4px var(--shadow);
  background: var(--panel);
}
.map-wrap {
  position: relative;
  min-width: 0;
  min-height: var(--map-h);
  overflow: hidden;
}
.map-viewport,
#cartography,
#labels,
#markers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#cartography {
  image-rendering: pixelated;
  cursor: grab;
  touch-action: none;
  background: #162940;
}
#cartography:active {
  cursor: grabbing;
}
#labels,
#markers {
  pointer-events: none;
}
.pin {
  pointer-events: auto;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  color: #fff4d7;
  line-height: 1;
  cursor: pointer;
  isolation: isolate;
}
.pin-art {
  height: var(--pin);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-art img {
  width: var(--pin);
  height: var(--pin);
  object-fit: contain;
}
.pin.selected .pin-art:before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 6px;
  background: var(--accent);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 34%,
    70% 34%,
    70% 65%,
    55% 65%,
    55% 100%,
    45% 100%,
    45% 65%,
    30% 65%,
    30% 34%,
    0 34%
  );
}
.pin-label {
  max-width: 100%;
  display: block;
  padding: 2px 4px;
  background: #1c2736;
  color: #f6eed9;
  border: 1px solid #80919b;
  box-shadow: 1px 1px #112039;
  font:
    600 10px/1.1 DM,
    Arial,
    sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.pin.selected .pin-label,
.pin:hover .pin-label {
  background: var(--accent);
  border-color: var(--key);
  color: var(--btn-ink);
  font-weight: 700;
}
.borough-label {
  position: absolute;
  color: #d5dddf;
  font:
    bold 9px/1.1 ui-monospace,
    Menlo,
    monospace;
  letter-spacing: 0.09em;
  text-shadow:
    1px 1px #293540,
    -1px -1px #293540;
  white-space: nowrap;
}
.map-tools {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 2px var(--shadow);
  z-index: 2;
  border: 1px solid var(--key);
}
.map-tools button {
  width: 32px;
  height: 31px;
  background: var(--panel);
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  font:
    600 20px/1 DM,
    sans-serif;
}
.map-tools button:last-child {
  border-bottom: 0;
}
.map-tools button:hover {
  background: var(--panel-hi);
}
.map-tools button:disabled {
  color: var(--line);
}
.map-filter {
  position: absolute;
  top: 10px;
  left: 49px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 3px 5px 3px 9px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.map-filter button {
  font: 600 18px/1 DM;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 1px 4px;
}
.map-key {
  position: absolute;
  bottom: 9px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  background: var(--panel);
  color: var(--ink);
  padding: 4px 7px;
  border: 1px solid var(--line);
  font-size: 10px;
}
.map-key i {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--accent);
  border: 1px solid var(--line);
}
.score-toggle,
.stages {
  display: none;
}
.scoreboard {
  position: absolute;
  z-index: 3;
  right: 15px;
  top: 15px;
  width: clamp(264px, 24%, 360px);
  border: 2px solid var(--key);
  background: var(--panel);
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px var(--line),
    4px 4px var(--shadow);
  padding: 13px 13px 0;
}
.score-head {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 2px 0 11px;
  border-bottom: 2px solid var(--accent);
}
.board-emblem {
  width: 38px;
  height: 33px;
  flex: none;
  background: url(assets/trophy.png) center / contain no-repeat;
  image-rendering: pixelated;
}
.score-head h2 {
  font-size: clamp(24px, 2.05vw, 33px);
  letter-spacing: 0.01em;
}
.score-head .section-code {
  font-size: 9px;
  margin-bottom: 3px;
}
.column-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  letter-spacing: 0.05em;
  font-size: 9px;
  padding: 10px 5px 5px;
}
.ranks {
  padding: 0;
  list-style: none;
}
.rank {
  display: grid;
  grid-template-columns: 20px 33px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  position: relative;
  width: 100%;
  min-height: 43px;
  padding: 4px 5px;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  background: transparent;
  color: inherit;
}
.rank:hover,
.rank[aria-pressed='true'] {
  background: var(--panel-hi);
}
.rank[aria-pressed='true'] {
  box-shadow: inset 3px 0 var(--accent);
}
.place {
  font-size: 11px;
  color: var(--muted);
}
.rank-avatar {
  height: 32px;
  display: grid;
  place-items: center;
}
.rank-avatar img {
  display: block;
  max-width: 34px;
  max-height: 32px;
  object-fit: contain;
}
.rank-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.12;
}
.rank-copy b {
  font-size: 13px;
}
.rank-copy small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.rank-count {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.ranks li:first-child .place,
.ranks li:first-child .rank-count {
  color: var(--accent);
}
.grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px -12px 0;
  padding: 10px 15px;
  background: var(--panel-hi);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}
.grand-total b {
  font-size: 19px;
  color: var(--accent);
  line-height: 1;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 0 23px;
  color: var(--muted);
  font-size: 10px;
}
#load-error {
  max-width: 460px;
  margin: 15px auto;
  color: #a92626;
  background: white;
  padding: 15px;
}
dialog {
  width: min(500px, calc(100% - 30px));
  max-height: 82dvh;
  overflow: auto;
  background: var(--panel);
  color: var(--ink);
  padding: 16px 20px 23px;
  border: 2px solid var(--accent);
  box-shadow: 6px 6px var(--shadow);
}
dialog::backdrop {
  background: #090c17bb;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  margin-bottom: 12px;
}
.close {
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  background: var(--panel-hi);
  color: inherit;
  border: 1px solid var(--line);
}
#dialog-title {
  font:
    700 36px/1.06 Barlow,
    sans-serif;
  margin: 4px 0 13px;
}
.print-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.print-card {
  padding: 7px 4px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--panel-hi);
  border: 1px solid var(--line);
  color: inherit;
  text-align: center;
}
.print-card:hover {
  border-color: var(--accent);
}
.card-face {
  height: 73px;
  display: grid;
  place-items: center;
}
.card-face img {
  max-height: 65px;
  max-width: 78px;
}
.print-card strong {
  font-size: 12px;
}
.print-card small {
  color: var(--muted);
  font-size: 10px;
}
body[data-view='manual'] {
  color-scheme: light;
  --page: #f3e9cd;
  --panel: #fff5d9;
  --panel-hi: #eee0bb;
  --ink: #262c2b;
  --muted: #5b6055;
  --accent: #a7322a;
  --second: #81362c;
  --line: #98917b;
  --key: #333b3b;
  --shadow: #938771;
  --btn-ink: #fff5d1;
  --map-h: clamp(442px, 52vh, 584px);
}
[data-view='manual'] .mast {
  margin: 0;
  background: #a6332d;
  border-bottom: 5px double #f9e6bd;
  color: #fff2cf;
}
.mast-inner {
  position: relative;
}
[data-view='manual'] .mast-inner {
  padding: 19px clamp(16px, 3.6vw, 58px) 18px;
}
[data-view='manual'] .brand > span {
  color: #ffe9b8;
}
[data-view='manual'] .index-button {
  color: #fff2cf;
  border-color: #e8ab88;
}
[data-view='manual'] .add-button {
  background: #fff0be;
  color: #33362d;
  border-color: #542722;
  box-shadow: 3px 3px #742e29;
}
[data-view='manual'] .arena {
  grid-template-columns: minmax(0, 1fr) clamp(268px, 25%, 335px);
  border-color: var(--key);
  box-shadow: 3px 3px var(--shadow);
}
[data-view='manual'] .scoreboard,
[data-view='stage'] .scoreboard {
  position: relative;
  right: auto;
  top: auto;
  width: auto;
  border: 0;
  border-left: 2px solid var(--key);
  box-shadow: none;
  padding: 17px 15px 0;
}
[data-view='manual'] .score-head {
  border-bottom: 3px double var(--key);
}
[data-view='manual'] .rank {
  min-height: 47px;
  border-top: 1px dotted var(--line);
}
[data-view='manual'] .rank-copy b {
  font-weight: 700;
}
[data-view='manual'] .ranks li:first-child .rank {
  background: #f1e3c1;
}
[data-view='manual'] .rank-count {
  font-family: Barlow, sans-serif;
  font-size: 21px;
}
[data-view='manual'] .grand-total,
[data-view='stage'] .grand-total {
  margin: 9px -15px 0;
}
[data-view='manual'] .grand-total {
  border-top: 3px double var(--key);
}
[data-view='manual'] .borough-label {
  color: #3c5156;
  text-shadow:
    1px 1px #f8e8ba,
    -1px -1px #f8e8ba;
}
[data-view='manual'] .pin-label {
  background: #fff7df;
  color: #303735;
  border-color: #615c4e;
  box-shadow: 1px 1px #858578;
}
[data-view='manual'] .pin.selected .pin-label,
[data-view='manual'] .pin:hover .pin-label {
  background: var(--accent);
  color: var(--btn-ink);
}
body[data-view='stage'] {
  --page: #1d3190;
  --panel: #172865;
  --panel-hi: #293f86;
  --ink: #fffae3;
  --muted: #bfcff1;
  --accent: #ffe679;
  --second: #91eadb;
  --line: #6987bd;
  --key: #101c4c;
  --shadow: #101b4c;
  --btn-ink: #23294a;
  --map-h: clamp(448px, 53vh, 600px);
  background: linear-gradient(150deg, #243b9b, #1a2a74 80%);
}
[data-view='stage'] .mast {
  border-bottom: 4px double var(--line);
}
[data-view='stage'] .arena {
  grid-template-columns: 100px minmax(0, 1fr) clamp(248px, 22%, 315px);
  box-shadow:
    0 0 0 1px #95bcde,
    5px 5px var(--shadow);
}
[data-view='stage'] .stages {
  display: flex;
  flex-direction: column;
  background: #142258;
  border-right: 2px solid var(--key);
  padding: 9px 6px 6px;
}
[data-view='stage'] .stages h3 {
  font:
    700 10px ui-monospace,
    Menlo,
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--second);
  padding: 4px 0 9px;
  text-align: center;
}
#stage-grid {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  flex: 1;
  gap: 4px;
}
.stage-button {
  min-height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  border: 1px solid #526e9e;
  background: #213672;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}
.stage-button canvas {
  height: 22px;
  width: auto;
}
.stage-button[aria-pressed='true'] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #36548d;
  color: var(--accent);
}
[data-view='stage'] .scoreboard {
  background: linear-gradient(#253573, #132557);
}
[data-view='stage'] .score-head {
  display: block;
  border-bottom: 3px double var(--second);
}
[data-view='stage'] .board-emblem {
  float: right;
  width: 31px;
  height: 29px;
}
[data-view='stage'] .score-head h2 {
  clear: both;
  font-size: clamp(23px, 2.3vw, 34px);
}
[data-view='stage'] .rank {
  min-height: 45px;
}
[data-view='stage'] .ranks li:first-child .rank {
  background: #233c77;
}
[data-view='stage'] .rank:after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 64px;
  right: 7px;
  height: 2px;
  background: linear-gradient(to right, var(--print-color) var(--bar), transparent var(--bar));
  opacity: 0.5;
}
[data-view='stage'] .place {
  font-family: Workbench, monospace;
}
[data-view='stage'] .pin-label {
  border-color: #93b1df;
  background: #1c2c68;
}
[data-view='stage'] .pin.selected .pin-label,
[data-view='stage'] .pin:hover .pin-label {
  background: var(--accent);
  color: var(--btn-ink);
}
[data-view='stage'] .map-title h2 {
  font-family: Workbench, Barlow, sans-serif;
  font-size: clamp(30px, 2.9vw, 45px);
}
@media (min-width: 1600px) {
  .map-wrap {
    min-height: 530px;
  }
}
@media (max-width: 960px) {
  .rank-copy b {
    font-size: 12px;
  }
  .controls {
    gap: 9px;
  }
  [data-view='stage'] .arena {
    grid-template-columns: 75px minmax(0, 1fr) 230px;
  }
  [data-view='stage'] .scoreboard {
    padding: 12px 9px 0;
  }
  [data-view='stage'] .grand-total {
    margin-left: -9px;
    margin-right: -9px;
  }
}
@media (max-width: 740px) {
  :root,
  body[data-view] {
    --map-h: clamp(363px, 55svh, 485px);
  }
  .study-inner {
    padding: 0 12px;
    gap: 1px;
  }
  .study-label {
    padding-right: 5px;
  }
  .studies a {
    font-size: 11px;
    padding: 6px 8px;
  }
  .mast,
  main,
  footer {
    margin-left: 13px;
    margin-right: 13px;
  }
  .mast-inner {
    padding: 17px 0 14px;
    gap: 9px;
  }
  .brand img {
    width: clamp(150px, 38vw, 245px);
  }
  .brand > span {
    font-size: 8px;
    margin-bottom: 5px;
  }
  .actions {
    gap: 9px;
  }
  .index-button {
    font-size: 11px;
  }
  .add-button {
    font-size: 11px;
    padding: 6px 8px;
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 9px;
    padding: 13px 0;
  }
  .map-title h2 {
    font-size: 31px;
  }
  .controls {
    gap: 9px;
  }
  .controls select {
    width: 122px;
  }
  .seg button {
    padding: 0 8px;
  }
  .controls select,
  .seg button {
    font-size: 12px;
  }
  .controls label > span,
  .rank-setting > span {
    font-size: 9px;
  }
  .arena,
  [data-view='manual'] .arena,
  [data-view='stage'] .arena {
    display: block;
  }
  .map-wrap {
    min-height: var(--map-h);
  }
  .score-toggle {
    z-index: 5;
    position: absolute;
    right: 7px;
    top: 7px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 2px 2px var(--shadow);
    padding: 6px 8px;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
  }
  .score-toggle strong {
    font-size: 10px;
    color: var(--accent);
  }
  .scoreboard,
  [data-view='manual'] .scoreboard,
  [data-view='stage'] .scoreboard {
    display: none;
    position: absolute;
    top: 52px;
    right: 7px;
    width: min(283px, calc(100% - 15px));
    padding: 10px 12px 0;
    border: 2px solid var(--key);
    box-shadow:
      0 0 0 1px var(--line),
      3px 3px var(--shadow);
  }
  .scores-open {
    z-index: 6;
  }
  .scores-open .scoreboard,
  [data-view] .scores-open .scoreboard {
    display: block;
  }
  .rank,
  [data-view='manual'] .rank,
  [data-view='stage'] .rank {
    min-height: 36px;
  }
  .rank-avatar,
  .rank-avatar img {
    max-height: 27px;
  }
  .grand-total,
  [data-view] .grand-total {
    margin: 4px -12px 0;
  }
  .score-head,
  [data-view='stage'] .score-head {
    display: flex;
    gap: 8px;
    padding: 0 0 8px;
  }
  .score-head h2,
  [data-view='stage'] .score-head h2 {
    font-size: 25px;
  }
  .map-tools {
    left: 7px;
    top: 7px;
  }
  .map-tools button {
    width: 34px;
    height: 33px;
  }
  footer {
    font-size: 9px;
    gap: 6px;
    flex-wrap: wrap;
  }
  [data-view='manual'] .mast {
    margin: 0;
  }
  [data-view='manual'] .mast-inner {
    padding: 16px 13px 15px;
  }
  [data-view='stage'] .stages {
    display: flex;
    position: relative;
    padding: 4px 5px;
    flex-direction: row;
    align-items: stretch;
    border: 0;
    border-top: 2px solid var(--key);
    order: 2;
  }
  [data-view='stage'] .arena {
    display: flex;
    flex-direction: column;
  }
  [data-view='stage'] .stages h3 {
    display: none;
  }
  #stage-grid {
    grid-template-rows: 1fr;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
  }
  .stage-button {
    font-size: 9px;
    line-height: 1.15;
    padding: 3px 1px;
    gap: 2px;
  }
  .stage-button canvas {
    height: 13px;
  }
  [data-view='stage'] .map-wrap {
    order: 1;
  }
  [data-view='stage'] .map-title h2 {
    font-size: 30px;
  }
  .map-key {
    left: 7px;
    bottom: 7px;
    font-size: 9px;
  }
  .print-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 470px) {
  .toolbar {
    display: block;
  }
  .controls {
    margin-top: 9px;
    display: grid;
    grid-template-columns: minmax(82px, 0.8fr) minmax(0, 1.2fr);
  }
  .controls .rank-setting {
    grid-column: 1 / -1;
  }
  .controls select {
    width: 100%;
  }
  .seg button {
    flex: 1;
    white-space: nowrap;
  }
  .map-title h2 {
    font-size: 28px;
  }
  .map-title .section-code {
    font-size: 9px;
  }
  .mast-inner {
    gap: 6px;
  }
  .actions {
    gap: 7px;
  }
  .index-button {
    font-size: 10px;
  }
  .add-button {
    font-size: 10px;
    padding: 6px;
  }
  .map-filter {
    left: 46px;
    top: 51px;
    max-width: calc(100% - 58px);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.featured {
  display: flex;
  align-self: stretch;
  gap: 14px;
  align-items: center;
  margin-right: auto;
  margin-left: clamp(18px, 4vw, 80px);
}
.featured button {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: 83px;
  height: 75px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 0;
  font:
    600 10px/1.1 DM,
    sans-serif;
}
.featured button:before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 4px;
  left: 6px;
  right: 6px;
  bottom: 17px;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, #619bac1a 3px 4px),
    linear-gradient(100deg, transparent, #31495a 50%, transparent);
  clip-path: polygon(
    16% 0,
    84% 0,
    84% 5%,
    94% 5%,
    94% 15%,
    100% 15%,
    100% 85%,
    93% 85%,
    93% 95%,
    83% 95%,
    83% 100%,
    15% 100%,
    15% 95%,
    6% 95%,
    6% 85%,
    0 85%,
    0 16%,
    6% 16%,
    6% 5%,
    16% 5%
  );
}
.featured img {
  width: 66px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(2px 3px 0 var(--shadow));
}
.featured button:hover img,
.featured button:focus-visible img {
  transform: translateY(-3px);
}
.featured button:hover span {
  color: var(--ink);
  text-decoration: underline;
}
[data-view='manual'] .featured button {
  color: #fff4d2;
}
[data-view='manual'] .featured button:before {
  background: repeating-linear-gradient(0deg, #812e27 0 1px, #8e342b 1px 4px);
}
[data-view='manual'] .featured img {
  filter: drop-shadow(2px 2px 0 #703329);
}
[data-view='stage'] .featured button:before {
  background: linear-gradient(#627fbe 2px, #243577 2px 90%, #172350 90%);
  clip-path: polygon(
    7% 0,
    93% 0,
    93% 7%,
    100% 7%,
    100% 93%,
    93% 93%,
    93% 100%,
    7% 100%,
    7% 93%,
    0 93%,
    0 7%,
    7% 7%
  );
}
@media (max-width: 860px) {
  .featured {
    display: none;
  }
}
