@font-face {
  font-family: PixelNumbers;
  src: url('../assets/fonts/Silkscreen-Regular.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+002C-0039;
}
@font-face {
  font-family: Pixelify;
  src: url('../assets/fonts/pixelify-sans-variable.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --ink: #1b1d20;
  --surface: #252a2b;
  --paper: #e3dbbd;
  --muted: #b0b1a5;
  --line: #414842;
  --gold: #d1a06b;
  --red: #944b40;
  --green: #8d9e74;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font:
    1.125rem/1.45 PixelNumbers,
    Pixelify,
    monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings:
    'calt' 0,
    'liga' 0;
}
html {
  scroll-padding-bottom: calc(var(--nav-height, 66px) + 24px);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
h1 {
  font-size: 1.6875rem;
  font-weight: 500;
  line-height: 1.2;
}
h2 {
  font-size: 1.5625rem;
  font-weight: 500;
}
h3 {
  font-size: 1.3125rem;
  font-weight: 500;
}
p + p {
  margin-top: 12px;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 10px 14px;
  min-height: 48px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled),
a:hover {
  color: #f4dca5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.primary {
  background: var(--red);
  color: #fff0c8;
  box-shadow: inset 0 -3px #603b32;
  padding: 12px 20px;
}
.primary:hover:not(:disabled) {
  background: #ac5a49;
}
.secondary {
  border: 1px solid var(--line);
}
.quiet,
.muted,
small {
  color: var(--muted);
}
small,
.small {
  font-size: 1rem;
}
.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
}
.app {
  max-width: 960px;
  margin: auto;
  padding: 0 24px 100px;
}
header {
  min-height: 86px;
  height: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.5625rem;
  text-decoration: none;
  line-height: 1.1;
  margin-right: auto;
  white-space: normal;
  min-width: 0;
  overflow-wrap: anywhere;
}
.brand span {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: 1px;
}
#ticket-button {
  font-size: 1.125rem;
  color: var(--gold);
  white-space: nowrap;
  padding: 10px 6px;
}
.menu {
  font-family: monospace;
  font-size: 1.4375rem;
  padding: 10px;
  min-width: 44px;
}
main {
  max-width: 600px;
  margin: auto;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 18px;
  gap: 12px;
}
.page-head p {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
}
.page-head button {
  font-size: 1rem;
  padding: 10px 8px;
}
.village-head {
  margin: 12px 0;
  min-height: 52px;
  height: auto;
}
.village-head h1 {
  font-size: 1.5rem;
}
.scene {
  height: 400px;
  position: relative;
  background: #a49b6e;
  overflow: hidden;
  isolation: isolate;
}
.scene canvas {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  display: block;
}
.building-hit {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
}
.building-hit:hover {
  background: #fff3c40a;
}
.building-hit:focus-visible {
  outline: 2px dashed #fff0c8;
  outline-offset: -3px;
  background: #fff3c419;
}
.scene-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}
.road-chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 16px 0 24px;
}
.road-chapters button {
  min-width: 0;
  padding: 8px 2px;
  border: 0;
  border-bottom: 3px solid var(--line);
  background: transparent;
}
.road-chapters button.current {
  color: var(--gold);
  border-color: var(--gold);
}
.road-chapters span,
.road-chapters small {
  display: block;
}
.road-chapters span {
  font-size: 1.4rem;
}
.road-chapters small {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.road-teacher {
  border-left: 3px solid var(--gold);
  padding: 6px 0 6px 16px;
  margin: 20px 0;
}
.road-teacher p {
  line-height: 1.5;
}
.lesson-reward {
  color: var(--gold);
}
.road-encounter {
  flex-wrap: wrap;
  gap: 8px;
}
.road-encounter canvas {
  width: 64px;
  height: 56px;
  flex: 0 0 64px;
  image-rendering: pixelated;
}
.road-encounter .grow {
  flex-basis: 130px;
  min-width: 0;
}
.road-encounter h3 {
  font-size: 1.1rem;
}
.road-region > h2 {
  font-size: 1.5rem;
}
.scene-controls button {
  min-height: 44px;
  font-size: 0.875rem;
  background: #292c2cdd;
  padding: 8px 10px;
}
.village-status {
  padding-top: 14px;
}
.status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.status-line h2 {
  font-size: 1.25rem;
}
.status-line small {
  font-size: 0.9375rem;
}
.progress {
  height: 5px;
  background: #3b423c;
  margin: 10px 0 12px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
}
.status-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.status-actions p {
  font-size: 1rem;
  color: var(--muted);
}
.status-actions button {
  white-space: nowrap;
}
.village-note {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 18px;
  text-align: center;
}
nav {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 35px auto 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
nav a {
  text-decoration: none;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: var(--muted);
  font-size: 1.0625rem;
}
nav a[aria-current='page'] {
  color: var(--gold);
}
nav span {
  font-family: monospace;
  font-size: 1.375rem;
}
.flat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.flat-row .grow,
.grow {
  flex: 1;
  min-width: 0;
}
.flat-row .grow {
  flex-basis: 10rem;
}
.flat-row small {
  display: block;
  margin-top: 4px;
}
.flat-row button {
  font-size: 1rem;
}
.row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.section-title {
  margin: 24px 0 8px;
  font-size: 1.25rem;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.actions > * {
  flex: 1;
}
.wide {
  width: 100%;
  margin-top: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: 0 18px;
  margin: 10px 0 18px;
}
.stats div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.stats strong {
  overflow-wrap: anywhere;
  display: block;
  font-size: 1.5625rem;
  font-weight: 500;
  color: var(--gold);
}
.stats span {
  font-size: 1rem;
  color: var(--muted);
}
.hero-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin: 16px 0 20px;
  background: linear-gradient(100deg, #38413a, transparent);
  padding: 12px 16px;
}
.hero-preview canvas {
  width: 96px;
  height: 120px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.hero-preview > div {
  flex: 1 1 8rem;
}
.hero-preview h2 {
  font-size: 1.375rem;
}
.hero-preview p {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 6px;
}
.preset-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.preset-list button {
  border-bottom: 2px solid var(--line);
  font-size: 1rem;
  padding: 8px 10px;
}
.preset-list button.active {
  border-color: var(--gold);
  color: var(--gold);
}
.tactic {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: start;
}
.tactic .number {
  color: var(--gold);
  padding-top: 12px;
}
.tactic select {
  width: 100%;
  min-height: 48px;
  background: transparent;
  border: 0;
  color: var(--paper);
  padding: 5px 4px;
  border-bottom: 1px solid #343c38;
}
.tactic select.condition {
  color: var(--muted);
  font-size: 1rem;
}
.tactic .move {
  padding: 10px 0;
  min-width: 48px;
}
.hint {
  font-size: 1rem;
  color: var(--muted);
  margin: 14px 0;
}
.inline-select {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
}
.inline-select select {
  flex: 1;
  min-width: 0;
}
.form-label {
  display: block;
  margin: 16px 0 6px;
  font-size: 1rem;
  color: var(--muted);
}
input,
select {
  background: #303635;
  color: var(--paper);
  border: 1px solid #545c51;
  padding: 10px 12px;
  min-height: 48px;
  max-width: 100%;
}
input {
  width: 100%;
}
option {
  color: var(--paper);
  background: #252a2b;
}
.pill {
  font-size: 0.8125rem;
  color: var(--gold);
  border: 1px solid #645b47;
  padding: 3px 7px;
  white-space: nowrap;
}
.opponent-name {
  font-size: 1.375rem;
}
.scout {
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 5px 0;
}
.empty {
  padding: 20px 0;
  color: var(--muted);
  font-size: 1rem;
}
.history-row {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--line);
  align-items: center;
  padding: 14px 0;
}
.history-row strong {
  font-weight: 400;
  flex: 1;
}
.history-row small {
  font-size: 0.875rem;
}
.history-row .won {
  color: var(--green);
}
.collection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 18px;
  margin-top: 22px;
}
.outfit {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.outfit canvas {
  display: block;
  margin: 0 auto 8px;
  image-rendering: pixelated;
  width: 96px;
  height: 112px;
}
.outfit small {
  display: block;
  min-height: 48px;
  margin: 6px 0;
}
.outfit button {
  width: 100%;
  font-size: 1rem;
  border: 1px solid var(--line);
}
.swatches {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.swatches button {
  border: 1px solid var(--line);
}
.swatches .selected {
  border-color: var(--gold);
  color: var(--gold);
}
.replay-scene {
  height: 240px;
}
.health-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 12px;
}
.health-bars > div:last-child {
  text-align: right;
}
.health-bars p {
  font-size: 1rem;
}
.health-bars .progress {
  height: 7px;
  margin: 6px 0;
}
.health-bars .progress i {
  background: var(--green);
}
.health-bars > div:last-child .progress i {
  background: #b37055;
}
.replay-line {
  min-height: 100px;
  margin: 18px 0;
}
.replay-line h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.replay-line p {
  font-size: 1.0625rem;
  color: var(--muted);
}
.replay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.replay-controls button {
  flex: 1;
  min-width: 44px;
  padding: 10px 6px;
}
.replay-controls select {
  width: 70px;
  padding: 10px;
}
.replay-range {
  width: 100%;
  padding: 0;
  border: 0;
  accent-color: var(--gold);
}
details {
  margin: 16px 0;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
summary {
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--gold);
}
.log-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.log-row p {
  color: var(--muted);
  margin-top: 4px;
}
.result {
  padding: 20px 0;
  text-align: center;
}
.result h2 {
  font-size: 1.875rem;
  color: var(--gold);
}
.result p {
  margin-top: 8px;
}
.step {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.step .mark {
  color: var(--gold);
  width: 24px;
}
.step small {
  display: block;
  margin-top: 4px;
}
.loading {
  padding: 60px 0;
  text-align: center;
}
.loading p {
  margin: 20px;
  color: var(--muted);
}
dialog {
  position: fixed;
  inset: 0;
  max-width: 500px;
  width: calc(100% - 32px);
  max-height: 85dvh;
  overflow: auto;
  padding: 24px;
  background: var(--surface);
  color: var(--paper);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  box-shadow: 0 20px 100px #0009;
}
dialog::backdrop {
  background: #101411b8;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.sheet-head button {
  font-family: monospace;
  font-size: 1.75rem;
  min-width: 48px;
  padding: 5px;
}
.sheet-head h2 {
  font-size: 1.625rem;
}
#sheet-body > p {
  color: var(--muted);
  font-size: 1.0625rem;
}
#sheet-body .place-choice {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
#toast {
  pointer-events: none;
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height, 66px) + 18px);
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  background: #e3dbbd;
  color: #24282a;
  box-shadow: 0 4px 20px #0005;
  z-index: 10;
  font-size: 1.0625rem;
  text-align: center;
}
.error-banner {
  margin: 12px 0;
  color: #f1bc9d;
  font-size: 1rem;
}
.scene-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--surface);
  font-size: 1rem;
  text-align: center;
  z-index: 1;
}
.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;
}
@media (min-width: 761px) {
  nav {
    position: absolute;
    top: 16px;
    right: max(24px, calc((100vw - 960px) / 2 + 24px));
    gap: 18px;
    margin: 0;
    border: 0;
  }
  header {
    padding-right: 395px;
    gap: 8px;
  }
  .brand {
    font-size: 1.375rem;
  }
  .brand span {
    font-size: 0.75rem;
  }
  #ticket-button {
    position: absolute;
    right: max(24px, calc((100vw - 960px) / 2 + 24px));
    top: 92px;
  }
  .menu {
    position: absolute;
    right: max(116px, calc((100vw - 960px) / 2 + 116px));
    top: 92px;
  }
  .scene {
    border: 1px solid #786e4c;
  }
  main {
    max-width: 540px;
  }
  .page-head {
    margin-top: 30px;
  }
}
@media (max-width: 760px) {
  .app {
    padding: 0 16px calc(var(--nav-height, 66px) + 24px);
  }
  header {
    min-height: 66px;
    height: auto;
    gap: 6px;
    padding-top: env(safe-area-inset-top);
  }
  .brand {
    font-size: 1.3125rem;
  }
  .brand span {
    font-size: 0.75rem;
    letter-spacing: 0;
  }
  .menu {
    font-size: 1.25rem;
    padding: 10px 4px;
    min-width: 48px;
  }
  #ticket-button {
    font-size: 1.0625rem;
  }
  .page-head {
    margin: 20px 0 14px;
  }
  .village-head {
    margin: 10px 0;
    min-height: 48px;
    height: auto;
  }
  .village-head h1 {
    font-size: 1.4375rem;
  }
  .scene {
    margin: 0 -16px;
    width: calc(100% + 32px);
  }
  nav {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    background: #1b1d20f5;
    border-top: 1px solid var(--line);
    margin: 0;
    gap: 0;
    padding: 0 8px env(safe-area-inset-bottom);
    min-height: 66px;
    backdrop-filter: blur(8px);
  }
  nav a {
    flex: 1;
    flex-direction: column;
    gap: 0;
    font-size: 0.875rem;
    min-height: 64px;
  }
  nav span {
    font-size: 1.375rem;
    line-height: 1.2;
  }
  .status-actions button {
    font-size: 1.0625rem;
  }
  .village-status {
    padding-top: 12px;
  }
  .hero-preview {
    gap: 18px;
  }
  dialog {
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 84dvh;
    border: 0;
    border-top: 2px solid var(--gold);
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  }
  .collection-grid {
    gap: 20px 12px;
  }
}
@media (max-height: 700px) and (max-width: 760px) {
  header {
    min-height: 52px;
    height: auto;
  }
  .brand span {
    display: none;
  }
  .village-head {
    margin: 4px 0;
    min-height: 44px;
    height: auto;
  }
  .village-head .eyebrow {
    font-size: 0.6875rem;
  }
  .village-head h1 {
    font-size: 1.3125rem;
  }
  .scene {
    height: 368px;
  }
  .replay-scene {
    height: 210px;
  }
  .village-status {
    padding-top: 7px;
  }
  .village-status .progress {
    margin: 6px 0;
  }
  .status-line h2 {
    font-size: 1.125rem;
  }
  .status-actions button {
    min-height: 48px;
    padding: 8px 15px;
  }
  .status-actions p {
    font-size: 0.9375rem;
  }
  nav,
  nav a {
    min-height: 60px;
  }
  .village-note {
    margin-top: 12px;
  }
}
@media (max-width: 359px) {
  .brand {
    font-size: 1.125rem;
  }
  .menu {
    min-width: 48px;
  }
  #ticket-button {
    font-size: 0.9375rem;
  }
  .status-line small {
    font-size: 0.8125rem;
  }
  .scene {
    height: 340px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

/* A portrait composition on every screen; desktop retains the same village scale. */
[hidden] {
  display: none !important;
}
.pixel-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  vertical-align: middle;
  flex: 0 0 32px;
  margin-right: 6px;
}
nav .pixel-icon {
  margin: 0;
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}
.status-line h2 {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
}
.banner-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.banner-heading > div {
  flex: 1;
  min-width: 0;
}
.banner-heading h2 {
  font-size: 1.25rem;
}
.banner-heading small {
  color: var(--gold);
  font-size: 0.875rem;
}
.banner-heading > button {
  padding: 0;
  min-width: 48px;
  font-size: 1.5rem;
}
.building-banner {
  border-top: 3px solid var(--gold);
  padding: 10px 0 8px;
}
.building-banner p {
  color: var(--muted);
  font-size: 1rem;
  margin: 6px 0 10px;
}
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.banner-actions .primary {
  flex: 1;
  min-width: min(100%, 9rem);
}
.scene-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.scene-controls button {
  min-width: 48px;
  min-height: 44px;
  padding: 4px 8px;
}
.scene-controls .pixel-icon {
  margin: 0;
  width: 26px;
  height: 26px;
}
[data-action='sound'][aria-pressed='true'] {
  background: #534e36;
}
.village-note {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.village-note button {
  padding: 8px 2px;
  font-size: 1rem;
}
.village-note .pixel-icon {
  width: 24px;
  height: 24px;
}
.commission-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.commission-row h3 {
  font-size: 1.1875rem;
}
.commission-row p {
  font-size: 0.9375rem;
  margin: 6px 0;
  color: var(--muted);
}
.commission-row p .pixel-icon {
  width: 20px;
  height: 20px;
  margin-right: 2px;
}
.circuit-card {
  margin: 18px 0 24px;
  padding: 16px 0;
  border-top: 2px solid var(--gold);
  border-bottom: 1px solid var(--line);
}
.circuit-card .hint {
  margin: 8px 0;
}
.route-dots {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin: 16px 0;
}
.route-dots > span {
  text-align: center;
  flex: 1;
  color: var(--muted);
  border-top: 3px solid var(--line);
  padding-top: 7px;
}
.route-dots .current {
  border-color: var(--gold);
  color: var(--paper);
}
.route-dots .done {
  border-color: var(--green);
  color: var(--green);
}
.route-dots small {
  display: block;
  font-size: 0.875rem;
}
@media (min-width: 761px) {
  .app {
    max-width: 520px;
    padding: 0 20px 100px;
  }
  header {
    padding: 8px 0;
    gap: 6px;
    min-height: 74px;
  }
  #ticket-button,
  .menu {
    position: static;
  }
  .brand {
    font-size: 1.3rem;
  }
  .brand span {
    font-size: 0.75rem;
  }
  nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 520px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
    padding: 8px;
    gap: 0;
    background: #1b1d20f5;
    border-top: 1px solid var(--line);
    z-index: 5;
  }
  nav a {
    flex-direction: column;
    gap: 0;
    font-size: 0.9rem;
    min-height: 56px;
  }
  .page-head {
    margin: 14px 0;
  }
  .village-head h1 {
    font-size: 1.45rem;
  }
  .scene {
    width: calc(100% + 40px);
    margin: 0 -20px;
  }
}
@media (max-width: 359px) {
  .building-banner p {
    font-size: 0.9375rem;
  }
  .banner-actions button {
    padding: 10px 12px;
  }
}

/* Text remains readable when the browser's default font size is enlarged. */
@media (max-height: 700px) and (max-width: 760px) {
  .village-scene {
    height: clamp(280px, calc(100dvh - 316px), 368px);
  }
}
.row-top,
.status-line {
  flex-wrap: wrap;
}
nav a {
  min-width: 0;
  overflow-wrap: normal;
  text-align: center;
}
.hero-preview > div,
.page-head > div,
.tactic > div {
  min-width: 0;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 1rem;
}
.earned-reward {
  margin: 16px 0;
}
.enough {
  color: var(--green);
}
header {
  padding-bottom: 4px;
}
@media (max-width: 760px) {
  header {
    padding-bottom: 4px;
    padding-top: max(4px, env(safe-area-inset-top));
  }
}
@media (max-height: 700px) and (max-width: 760px) {
  header {
    padding-bottom: 0;
    padding-top: env(safe-area-inset-top);
  }
}
