/* Current camp, dialog and battle styles. */
:root {
  --paper: #f4f2e9;
  --ink: #293d31;
  --green: #427558;
  --line: #dedfd3;
  --gold: #b38a47;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}
button {
  -webkit-tap-highlight-color: transparent;
}
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button:focus-visible {
  outline: 3px solid #cc9d47;
  outline-offset: 3px;
}
a:focus-visible {
  outline: 3px solid #cc9d47;
  outline-offset: 3px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.brand-icon {
  background: var(--ink);
  color: #eee2af;
  border-radius: 10px;
  width: 43px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 32px;
}
.brand small {
  display: block;
  margin-top: 4px;
  font-weight: 600;
}
nav {
  display: flex;
  height: 100%;
}
.nav {
  border: 0;
  background: none;
  position: relative;
}
.nav.active {
  color: var(--ink);
}
.nav.active:after {
  position: absolute;
  content: "";
  height: 3px;
  background: var(--green);
  bottom: 0;
  left: 0;
  right: 0;
}
.account {
  display: flex;
  align-items: center;
  font-size: 18px;
}
.coin {
  border: 1px solid #e3dbc5;
  background: #eee9d9;
  padding: 9px 14px;
  border-radius: 20px;
  color: #a38042;
}
.avatar {
  border: 1px solid #bbc5ac;
  border-radius: 50%;
  background: #dce3d3;
  font-weight: bold;
}
.icon-button {
  border: 0;
  background: none;
  font-size: 23px;
  margin-left: 6px;
}
main {
  margin: auto;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eyebrow {
  color: var(--green);
  font-weight: 700;
}
.eyebrow > span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 7px;
}
h1 {
  font-weight: 750;
  letter-spacing: 1px;
}
h1 em {
  font-style: normal;
  color: var(--green);
}
.save-label {
  text-align: right;
}
.save-label span {
  color: #5d8b61;
  font-size: 16px;
}
.save-label small {
  display: block;
  margin-top: 7px;
}
.section-label {
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
}
.section-label > span {
  font-size: 16px;
}
.section-label button {
  border: 0;
  background: none;
  color: #78917c;
  padding: 0;
}
.map-card {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0;
  margin-bottom: 12px;
  text-align: left;
  overflow: hidden;
  transition: 0.2s;
}
.map-card.selected {
  border: 2px solid #527958;
  box-shadow: 0 3px 12px #304c3012;
}
.map-info {
  padding: 12px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.map-info strong {
  display: block;
}
.map-info small {
  display: block;
  margin-top: 5px;
}
.quest {
  border: 1px solid #dce2cf;
  border-radius: 9px;
}
.quest .eyebrow {
  letter-spacing: 1px;
  color: #8a9271;
}
.quest h3 span {
  float: right;
  color: #a28c50;
}
.quest p {
  margin-bottom: 17px;
}
.progress {
  height: 5px;
  background: #dce0d2;
  border-radius: 8px;
  overflow: hidden;
}
.progress i {
  height: 100%;
  background: #658663;
  display: block;
  width: 0;
  transition: width 0.3s;
}
.quest-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.quest-bottom button {
  border: 0;
  background: transparent;
  color: #9c7b3b;
  padding: 0;
}
.quest-bottom button:disabled {
  opacity: 0.5;
  cursor: default;
}
.arena-top {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  margin: 0 0 15px;
}
.arena-top > div {
  display: flex;
  align-items: center;
}
.arena-top > span {
  color: #999e86;
  font-size: 16px;
}
.arena {
  position: relative;
  overflow: hidden;
  background: #243f36;
}
#game {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  touch-action: none;
}
.arena-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(#102b3655, transparent 48%, #102a32b0);
  pointer-events: none;
}
.stage-label {
  position: absolute;
  color: #fff8de;
  pointer-events: none;
}
.stage-label small {
  letter-spacing: 3px;
}
.stage-label h2 {
  margin: 9px 0;
  letter-spacing: 3px;
  text-shadow: 0 2px 3px #183c30;
}
.stage-label p {
  margin: 0;
}
.play-overlay {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ready-tag {
  border: 1px solid #a6c69355;
  border-radius: 20px;
  padding: 6px 13px;
  margin-bottom: 15px;
  letter-spacing: 1px;
}
.start {
  background: #f2e7bd;
  border: 1px solid #d0bc77;
  color: #334830;
  padding: 17px 22px;
  border-radius: 6px;
  font-weight: 800;
  box-shadow:
    0 4px 0 #a89e73,
    0 8px 20px #15291670;
  letter-spacing: 2px;
}
.start:hover {
  background: #fff2c6;
  transform: translateY(-1px);
}
.start span {
  float: right;
  font-size: 22px;
}
.play-note {
  margin-top: 16px;
}
.canvas-bottom {
  position: absolute;
  bottom: 16px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
}
.control-guide {
  display: flex;
  align-items: center;
  color: #8b927f;
  flex-wrap: wrap;
}
.control-guide > span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.control-guide kbd {
  font: 16px system-ui;
  border: 1px solid #d2d6c5;
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 3px 4px;
  min-width: 18px;
  text-align: center;
}
.mobile-guide {
  margin-left: auto;
}
.under-arena {
  margin: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.under-arena button {
  background: none;
  border: 0;
  color: #788769;
}
.hero-class {
  color: #7f9476;
  border-radius: 20px;
}
#portrait {
  display: block;
  object-fit: contain;
}
.hero-level > span:first-child {
  color: #507052;
  font-weight: 700;
}
.hero-stats > div {
  justify-content: space-between;
}
.ability {
  display: flex;
  text-align: left;
  align-items: center;
}
.ability > span {
  border-radius: 6px;
  color: #a28b43;
}
.ability strong {
  display: block;
}
.ability small {
  display: block;
}
.record > div:not(.section-label) {
  display: flex;
  justify-content: space-between;
}
.record b {
  font-weight: 600;
}
footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  letter-spacing: 1px;
}
footer i {
  font-style: normal;
  margin-left: 18px;
  letter-spacing: 0;
}
footer b {
  font-size: 6px;
  margin: 0 4px 0 14px;
  color: #7a9c71;
}
[hidden] {
  display: none !important;
}
.modal-backdrop {
  position: fixed;
  z-index: 50;
  place-items: center;
}
.modal h2 {
  margin: 10px 0 12px;
}
.modal label {
  display: block;
  margin: 22px 0 8px;
}
.modal input {
  width: 100%;
  padding: 14px;
  background: #fffdf6;
  border: 1px solid #cbd1bc;
  font: inherit;
  outline-color: var(--green);
}
.primary {
  display: block;
  background: var(--green);
  color: white;
  border: 0;
  border-bottom: 3px solid #2c573d;
  padding: 14px 20px;
  width: 100%;
  margin-top: 20px;
}
.secondary {
  background: none;
  border: 1px solid #c5ceb8;
  padding: 12px;
  width: 100%;
  margin-top: 10px;
}
.hero-options {
  display: grid;
  gap: 10px;
}
.option {
  display: flex;
  width: 100%;
  align-items: center;
  text-align: left;
  border: 1px solid #d8dec9;
  padding: 15px;
}
.option.selected {
  border: 2px solid var(--green);
}
.option canvas {
  image-rendering: pixelated;
}
.option strong {
  display: block;
}
.option small {
  display: block;
  margin-top: 6px;
}
.option .cost {
  margin-left: auto;
  white-space: nowrap;
}
.upgrade-option {
  padding: 18px;
  margin: 10px 0;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #d7dbc6;
}
.upgrade-option strong {
  display: block;
}
.upgrade-option small {
  display: block;
  margin-top: 7px;
}
.result-stats {
  display: flex;
  justify-content: space-around;
  text-align: center;
  background: #e8eddf;
  border-radius: 8px;
}
.result-stats b {
  display: block;
  margin-bottom: 5px;
}
.toast {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  padding: 13px 20px;
  z-index: 60;
  transition: 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#gamehud {
  position: absolute;
}
#gamehud button {
  color: #f2eecf;
  border-radius: 5px;
}
.health {
  display: flex;
  align-items: center;
}
.health > div {
  background: #16372b;
  border: 1px solid #d3cdb177;
}
.health i {
  display: block;
  height: 100%;
  background: #e87867;
  width: 100%;
}
.touch-controls {
  position: absolute;
  bottom: 24px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
#joystick {
  border-radius: 50%;
  display: grid;
  place-items: center;
  touch-action: none;
  pointer-events: auto;
}
#stick {
  border: 2px solid #eeefc99c;
  border-radius: 50%;
  pointer-events: none;
}
#dash {
  border-radius: 50%;
  color: #fff2a7;
  touch-action: none;
  pointer-events: auto;
}
#dash small {
  display: block;
}
.playing .arena-shade {
  display: none;
}
.playing .stage-label {
  display: none;
}
.playing .play-overlay {
  display: none;
}
.playing .canvas-bottom {
  display: none;
}
.playing .arena {
  box-shadow: 0 8px 24px #30492d33;
}
.playing .map-card {
  opacity: 0.65;
}
.playing .map-card.selected {
  opacity: 1;
}
.playing .touch-controls {
  display: flex;
}
@media (max-width: 1100px) {
  .mobile-guide {
    display: none !important;
  }
  .start {
    padding: 13px 18px;
  }
}
@media (max-width: 850px) {
  .brand-icon {
    width: 36px;
    height: 40px;
  }
  .coin {
    padding: 7px 10px;
  }
  footer i {
    display: none;
  }
}
@media (max-width: 600px) {
  .brand-icon {
    font-size: 25px;
  }
  .icon-button {
    padding: 0;
  }
  .save-label {
    display: none;
  }
  .layout {
    flex-direction: column;
  }
  .left {
    order: 2;
  }
  .arena-section {
    order: 1;
  }
  .left .section-label {
    margin-bottom: 12px;
  }
  .map-card {
    margin: 0;
  }
  .quest p {
    margin-bottom: 10px;
  }
  .start {
    padding: 15px 18px;
  }
  .control-guide {
    justify-content: center;
  }
  .control-guide > span:first-child {
    display: none;
  }
  .control-guide > span:nth-child(2) {
    display: none;
  }
  .mobile-guide {
    display: flex !important;
    margin-left: 0;
  }
  .under-arena {
    margin: 16px 0 0;
  }
  footer {
    letter-spacing: 0.3px;
  }
  body.playing header {
    display: none;
  }
  body.playing .arena-top {
    margin: 0;
  }
}
@media (max-height: 520px) and(pointer:coarse) {
  body.playing header {
    display: none;
  }
}
.brand-icon canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.ability canvas {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}
.map-card {
  background: #f9f8f0e8;
}
#portrait {
  image-rendering: auto;
}
.playing .arena {
  background: #203b32;
}
.start:disabled {
  opacity: 0.6;
  cursor: wait;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button {
  font-family: inherit;
}
input {
  font-family: inherit;
}
header {
  min-width: 0;
}
main {
  min-width: 0;
}
.layout {
  min-width: 0;
}
.account {
  min-width: 0;
}
.brand {
  min-width: 0;
}
.map-info {
  min-width: 0;
}
.modal-backdrop {
  display: flex;
  justify-content: center;
  align-items: center;
  inset: auto 0 auto;
  top: var(--dialog-top, 0px);
  width: 100%;
  height: var(--dialog-height, 100vh);
  height: var(--dialog-height, 100dvh);
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: contain;
}
.modal {
  min-width: 0;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal > * {
  min-width: 0;
  max-width: 100%;
}
.modal h2 {
  line-height: 1.4;
}
.modal p {
  line-height: 1.8;
}
.modal input {
  display: block;
  min-width: 0;
  max-width: 100%;
  line-height: 1.5;
  min-height: 48px;
  border-radius: 8px;
}
.primary {
  white-space: normal;
  line-height: 1.5;
}
.secondary {
  white-space: normal;
  line-height: 1.5;
}
.modal-open {
  overflow: hidden;
}
.option {
  gap: 12px;
  flex-wrap: wrap;
}
.option canvas {
  flex: 0 0 56px;
}
.option > span:not(.cost) {
  flex: 1;
  min-width: 100px;
}
.option .cost {
  flex-shrink: 0;
}
.option small {
  line-height: 1.6;
}
.upgrade-option small {
  line-height: 1.6;
}
.result-stats {
  gap: 8px;
  padding: 18px 12px;
}
.result-stats > div {
  min-width: 0;
  flex: 1;
}
.section-label {
  line-height: 1.5;
}
.section-label button {
  min-height: 44px;
  font-size: 18px;
}
.under-arena button {
  min-height: 44px;
}
.arena-top {
  height: auto;
  min-height: 28px;
  flex-wrap: wrap;
}
.stage-label p {
  line-height: 1.6;
}
.play-note {
  text-align: center;
}
.toast {
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
  bottom: max(24px, env(safe-area-inset-bottom));
  overflow-wrap: anywhere;
}
#gamehud {
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .hero-level {
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .brand {
    flex-shrink: 0;
  }
  .brand-icon {
    flex-shrink: 0;
  }
  .brand-icon canvas {
    width: 26px;
    height: 26px;
  }
  .account {
    min-width: 0;
  }
  .coin {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
  }
  .avatar {
    flex-shrink: 0;
  }
  .icon-button {
    flex-shrink: 0;
  }
  .icon-button {
    margin: 0;
    font-size: 24px;
  }
  .avatar {
    font-size: 18px;
  }
  .intro {
    display: block;
  }
  h1 {
    letter-spacing: 0;
  }
  nav {
    align-items: stretch;
  }
  .nav {
    min-width: 0;
  }
  .arena-top > div {
    min-width: 0;
  }
  .arena-top > span {
    font-size: 16px;
  }
  .stage-label h2 {
    margin: 6px 0;
  }
  .ready-tag {
    margin-bottom: 12px;
  }
  .play-note {
    margin-top: 12px;
  }
  .under-arena {
    flex-wrap: wrap;
  }
  .under-arena button {
    margin-left: auto;
  }
  .map-card {
    min-width: 0;
  }
  .map-info strong {
    line-height: 1.5;
    letter-spacing: 0;
  }
  .map-info small {
    line-height: 1.5;
  }
  .quest-bottom button {
    min-height: 44px;
  }
  footer {
    line-height: 1.6;
  }
  .modal h2 {
    margin: 10px 0 14px;
  }
  .modal label {
    margin-top: 18px;
  }
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  body.playing .arena-top {
    min-height: 44px;
    height: auto;
    padding: 6px 12px;
    gap: 4px;
  }
  #gamehud {
    flex-wrap: nowrap;
  }
  .touch-controls {
    left: max(20px, env(safe-area-inset-left));
    right: max(20px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 360px) {
  .option .cost {
    flex-basis: calc(100% - 68px);
    margin-left: 68px;
    white-space: normal;
  }
}
@media (max-height: 520px) and(pointer:coarse) {
  .modal-backdrop {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}
:root {
  --muted: #586a58;
}
body {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.65;
}
button {
  font-weight: 700;
}
input {
  font-weight: 700;
}
p {
  font-weight: 600;
}
small {
  font-weight: 600;
}
.fine {
  font-weight: 600;
}
.brand {
  font-weight: 800;
}
.nav {
  color: #53634d;
}
.save-label {
  color: #52624d;
}
.save-label small {
  color: #52624d;
}
.map-info small {
  color: #52624d;
}
.quest p {
  color: #52624d;
}
.quest-bottom {
  color: #52624d;
}
.hero-level {
  color: #52624d;
}
.hero-stats span {
  color: #52624d;
}
.record span {
  color: #52624d;
}
footer i {
  color: #52624d;
}
.modal p {
  color: #52624d;
}
.modal .fine {
  color: #52624d;
}
.option small {
  color: #52624d;
}
.upgrade-option small {
  color: #52624d;
}
.result-stats small {
  color: #52624d;
}
.eyebrow {
  font-size: 16px;
  letter-spacing: 1px;
}
.section-label {
  font-size: 20px;
  font-weight: 800;
}
.section-label > span {
  color: #59684e;
}
.map-info strong {
  font-size: 18px;
  font-weight: 800;
}
.map-info small {
  font-size: 16px;
}
.under-arena button {
  font-size: 18px;
}
.modal h2 {
  font-size: clamp(26px, 5.8vw, 32px);
  font-weight: 800;
}
.modal p {
  font-size: 18px;
}
.modal label {
  font-size: 18px;
}
.modal input {
  font-size: 18px;
}
.modal .fine {
  font-size: 18px;
}
.option {
  font-size: 18px;
}
.upgrade-option small {
  font-size: 18px;
}
.result-stats small {
  font-size: 18px;
}
.modal input {
  font-weight: 600;
}
.upgrade-option strong {
  font-size: 22px;
}
.primary {
  min-height: 56px;
  font-weight: 800;
}
.secondary {
  min-height: 56px;
  font-weight: 800;
}
.result-stats b {
  font-size: 28px;
}
.toast {
  font-size: 18px;
  font-weight: 700;
  background: #203e2e;
  color: #fffbe3;
}
.stage-label p {
  font-weight: 700;
  color: #fffbe3;
  text-shadow:
    0 1px 3px #102b21,
    0 0 8px #102b21;
}
.stage-label small {
  font-weight: 700;
  color: #fffbe3;
  text-shadow:
    0 1px 3px #102b21,
    0 0 8px #102b21;
}
.ready-tag {
  font-weight: 700;
  color: #fffbe3;
  text-shadow:
    0 1px 3px #102b21,
    0 0 8px #102b21;
}
.play-note {
  font-weight: 700;
  color: #fffbe3;
  text-shadow:
    0 1px 3px #102b21,
    0 0 8px #102b21;
}
.canvas-bottom {
  font-weight: 700;
  color: #fffbe3;
  text-shadow:
    0 1px 3px #102b21,
    0 0 8px #102b21;
}
.stage-label h2 {
  font-weight: 800;
}
.stage-label p {
  border-radius: 6px;
  padding: 6px 10px;
}
.ready-tag {
  background: #123426de;
}
.play-note {
  padding: 4px 10px;
  border-radius: 5px;
  background: #163628e6;
}
.canvas-bottom {
  background: #163628bf;
  border-radius: 5px;
  padding: 5px 8px;
}
.arena-tools {
  display: flex;
  align-items: center;
}
.arena-tools > span {
  font-size: 16px;
  color: #52624d;
}
.arena-tools button {
  border: 1px solid #aebda0;
  font-weight: 800;
  white-space: nowrap;
}
body.playing {
  overflow: hidden;
}
body.arena-expanded {
  overflow: hidden;
}
body.playing > header {
  display: none;
}
body.playing nav {
  display: none;
}
body.playing .intro {
  display: none;
}
body.playing .left {
  display: none;
}
body.playing .right {
  display: none;
}
body.playing footer {
  display: none;
}
body.playing .control-guide {
  display: none;
}
body.playing .under-arena {
  display: none;
}
body.arena-expanded > header {
  display: none;
}
body.arena-expanded nav {
  display: none;
}
body.arena-expanded .intro {
  display: none;
}
body.arena-expanded .left {
  display: none;
}
body.arena-expanded .right {
  display: none;
}
body.arena-expanded footer {
  display: none;
}
body.arena-expanded .control-guide {
  display: none;
}
body.arena-expanded .under-arena {
  display: none;
}
body.playing main {
  padding: 0;
  max-width: none;
  width: 100%;
  margin: 0;
}
body.arena-expanded main {
  padding: 0;
  max-width: none;
  width: 100%;
  margin: 0;
}
body.playing .layout {
  display: block;
  margin: 0;
  gap: 0;
}
body.arena-expanded .layout {
  display: block;
  margin: 0;
  gap: 0;
}
body.playing .arena-section {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #173629;
}
body.arena-expanded .arena-section {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #173629;
}
body.playing .arena-top {
  display: none;
}
body.arena-expanded:not(.playing) .arena-top {
  display: flex;
  flex-shrink: 0;
  margin: 0;
  padding: 12px max(18px, env(safe-area-inset-right)) 12px
    max(18px, env(safe-area-inset-left));
  background: #f4f2e9;
  min-height: 72px;
}
body.playing .arena {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.arena-expanded .arena {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.playing #game {
  width: 100%;
  height: 100%;
}
body.arena-expanded #game {
  width: 100%;
  height: 100%;
}
body.playing .touch-controls {
  bottom: max(28px, env(safe-area-inset-bottom));
  left: max(28px, env(safe-area-inset-left));
  right: max(28px, env(safe-area-inset-right));
}
#gamehud {
  text-shadow: none;
  font-size: 20px;
}
.health {
  grid-area: health;
  min-width: 0;
  gap: 8px;
}
.health > div {
  width: clamp(56px, 10vw, 140px);
  height: 14px;
}
.health b {
  font-size: 20px;
  color: #fffbe3;
  white-space: nowrap;
}
#waveText {
  grid-area: wave;
  font-size: 20px;
  white-space: nowrap;
}
#pause {
  grid-area: pause;
}
#gamehud button {
  font-size: 20px;
  font-weight: 800;
  min-height: 52px;
  min-width: 52px;
  padding: 8px 14px;
  background: #37553f;
  border: 1px solid #d6d8a4;
}
#dash {
  width: 92px;
  height: 92px;
  font-size: 30px;
  background: #163c30e8;
  border: 2px solid #f4ecc8;
}
#dash small {
  font-size: 18px;
  color: #fffbe3;
  font-weight: 800;
}
#joystick {
  width: 138px;
  height: 138px;
  background: #153d32a6;
  border: 3px solid #f1e9c7b3;
}
#stick {
  width: 58px;
  height: 58px;
  background: #e8efd38c;
}
@media (min-width: 601px) and(max-width:1100px) {
  header {
    min-height: 88px;
    flex-wrap: wrap;
  }
  .account-name {
    display: none;
  }
  nav {
    order: 3;
    width: 100%;
    justify-content: center;
    min-height: 56px;
  }
  .nav {
    min-height: 56px;
  }
}
@media (max-width: 600px) {
  .brand small {
    display: none;
  }
  .eyebrow {
    font-size: 16px;
  }
  .arena-top {
    font-size: 18px;
  }
  .arena-tools > span {
    font-size: 16px;
  }
  .stage-label small {
    letter-spacing: 1px;
  }
  .under-arena button {
    font-size: 18px;
  }
  .map-info strong {
    font-size: 18px;
  }
  .map-info small {
    font-size: 16px;
  }
  .map-info {
    padding: 10px 6px;
  }
  .modal h2 {
    font-size: 26px;
  }
  .modal .fine {
    font-size: 18px;
  }
  .option .cost {
    white-space: normal;
  }
  #gamehud {
    font-size: 18px;
  }
  .health {
    gap: 5px;
  }
  .health > div {
    width: 48px;
    height: 12px;
  }
  .health b {
    font-size: 16px;
  }
  #waveText {
    font-size: 18px;
  }
  #gamehud button {
    font-size: 16px;
    padding: 6px 8px;
    min-width: 48px;
    min-height: 48px;
  }
  #joystick {
    width: 118px;
    height: 118px;
  }
  #stick {
    width: 52px;
    height: 52px;
  }
  #dash {
    width: 86px;
    height: 86px;
  }
  #dash small {
    font-size: 18px;
  }
  body.playing .touch-controls {
    left: max(22px, env(safe-area-inset-left));
    right: max(22px, env(safe-area-inset-right));
  }
}
@media (max-width: 360px) {
  .coin {
    font-size: 16px;
  }
  .map-info strong {
    font-size: 16px;
  }
  .map-info small {
    font-size: 16px;
  }
  .health b {
    font-size: 16px;
  }
  .health > div {
    width: 40px;
  }
  .health {
    gap: 4px;
  }
  #waveText {
    font-size: 16px;
  }
}
@media (max-height: 520px) and(pointer:coarse) {
  #joystick {
    width: 108px;
    height: 108px;
  }
  #dash {
    width: 80px;
    height: 80px;
  }
  .touch-controls {
    bottom: max(18px, env(safe-area-inset-bottom));
  }
}
.map-card img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
}
.map-card.locked img {
  filter: saturate(0.55) brightness(0.8);
}
.map-card.locked {
  border-style: dashed;
}
.map-status {
  color: #40513e !important;
  font-size: 16px !important;
  font-weight: 700;
  line-height: 1.5;
}
.map-card .map-info {
  display: block;
}
.map-info > span {
  display: block;
  min-width: 0;
}
.map-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.map-gallery .map-card {
  margin: 0;
}
.locked-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: cover;
  border-radius: 8px;
}
.unlock-condition {
  border: 1px solid #a9bfa0;
  border-radius: 8px;
  background: #e4ecd8;
  padding: 14px;
  color: #2e5037;
  font-size: 18px;
}
.reward-notice {
  border: 1px solid #a9bfa0;
  border-radius: 8px;
  background: #e4ecd8;
  padding: 14px;
  color: #2e5037;
  font-size: 18px;
}
.unlock-condition p {
  margin: 8px 0 0;
}
.explore-time {
  color: #40533f;
}
.camp-loadout {
  border-radius: 7px;
}
.camp-loadout strong {
  font-weight: 800;
}
.coin {
  cursor: pointer;
  font-weight: 800;
}
.shop-item p {
  margin: 8px 0 14px;
}
.shop-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}
.carry-option {
  display: flex !important;
  align-items: center;
  cursor: pointer;
}
.carry-option input {
  accent-color: #427558;
  margin: 0;
}
.run-supplies {
  display: none;
  position: absolute;
  bottom: max(190px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 40px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  z-index: 4;
}
.run-supplies button {
  background: #173c30e8;
  color: #fffbe3;
  border: 2px solid #ebdfab;
  border-radius: 10px;
  min-height: 64px;
  padding: 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}
.run-supplies small {
  display: block;
  font-size: 16px;
  font-weight: 700;
}
.run-supplies button:disabled {
  opacity: 0.5;
  background: #324d37;
  border-color: #889581;
}
body.playing .run-supplies {
  display: grid;
}
body.playing .camp-loadout {
  display: none;
}
body.arena-expanded .camp-loadout {
  display: none;
}
body.playing .toast {
  bottom: calc(275px + env(safe-area-inset-bottom));
}
.arena-tools {
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .map-card img {
    height: 110px;
  }
  .under-arena {
    gap: 14px;
  }
  .run-supplies {
    bottom: 180px;
    gap: 10px;
  }
  .run-supplies button {
    font-size: 18px;
    min-height: 70px;
  }
  .run-supplies small {
    font-size: 16px;
  }
  body.playing .toast {
    bottom: 270px;
  }
}
@media (max-height: 520px) and(pointer:coarse) {
  .run-supplies {
    bottom: 24px;
    width: min(400px, 45%);
    gap: 10px;
  }
  .run-supplies button {
    min-height: 64px;
    font-size: 18px;
  }
  body.playing .toast {
    bottom: 105px;
  }
}
html.game-input-locked {
  overscroll-behavior: none;
}
body.playing:not(.modal-open) {
  overscroll-behavior: none;
  touch-action: none;
}
body.arena-expanded:not(.modal-open) {
  overscroll-behavior: none;
  touch-action: none;
}
body.playing .arena {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
body.playing .arena * {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
body.arena-expanded .arena {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
body.arena-expanded .arena * {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
#joystick {
  position: relative;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
#joystick::before {
  content: "";
  position: absolute;
  inset: 20%;
  background:
    linear-gradient(90deg, transparent 44%, #f8edc54d 44% 56%, transparent 56%),
    linear-gradient(transparent 44%, #f8edc54d 44% 56%, transparent 56%);
  pointer-events: none;
  border-radius: 6px;
}
#joystick::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
}
#stick {
  position: relative;
  z-index: 1;
  will-change: transform;
}
#dash {
  -webkit-tap-highlight-color: transparent;
}
.run-supplies button {
  -webkit-tap-highlight-color: transparent;
}
#gamehud button {
  -webkit-tap-highlight-color: transparent;
}
.modal-backdrop {
  touch-action: pan-y pinch-zoom;
}
.modal {
  touch-action: pan-y pinch-zoom;
}
.modal button {
  touch-action: manipulation;
}
.modal input {
  touch-action: manipulation;
}
#gamehud {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: space-between;
  grid-template-areas: "health wave pause";
  align-items: start;
  height: 44px;
  min-height: 0;
  inset: max(12px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) auto
    max(16px, env(safe-area-inset-left));
  padding: 0;
  gap: 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  color: #fffbe3;
  font-weight: 800;
}
#gamehud .health {
  justify-self: start;
  height: 44px;
  padding: 0 12px;
  gap: 8px;
  background: #15392de0;
  border: 1px solid #dce5b157;
  border-radius: 24px;
  min-width: 0;
  white-space: nowrap;
}
#gamehud .health > div {
  width: 84px;
  height: 9px;
  border-radius: 4px;
  overflow: hidden;
  border-color: #e5eac680;
}
#gamehud .health b {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: #fffbe3;
}
#gamehud #waveText {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 14px;
  background: #15392dd9;
  border: 1px solid #dce5b157;
  border-radius: 24px;
  font-size: 20px;
  line-height: 1.2;
  color: #fffbe3;
  font-weight: 800;
  white-space: nowrap;
}
#gamehud #pause {
  justify-self: end;
  pointer-events: auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  background: #15392de8;
  border: 1px solid #dce5b180;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}
.pause-run-summary {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #bdcdae;
  border-radius: 10px;
  background: #e6eddc;
  font-size: 18px;
  color: #344f37;
}
.pause-run-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.pause-run-summary strong {
  font-weight: 800;
  color: #253d2b;
}
@media (max-width: 600px) {
  #gamehud {
    height: 44px;
    inset: max(10px, env(safe-area-inset-top)) 10px auto;
    gap: 8px;
  }
  #gamehud .health {
    padding: 0 8px;
    gap: 6px;
  }
  #gamehud .health > div {
    width: 44px;
  }
  #gamehud .health b {
    font-size: 20px;
  }
  #gamehud #waveText {
    font-size: 20px;
    padding: 0 10px;
  }
}
@media (max-width: 360px) {
  #gamehud {
    gap: 6px;
  }
  #gamehud .health {
    padding: 0 8px;
    gap: 4px;
  }
  #gamehud .health > div {
    width: 36px;
  }
  #gamehud #waveText {
    padding: 0 8px;
  }
}
body {
  background:
    linear-gradient(#f6f4edeb, #f6f4edeb),
    url("assets/ui.webp") center top/100% auto fixed;
  color: #273d30;
}
header {
  background: #f7f5eff2;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  height: 82px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  gap: 24px;
}
.brand {
  font-size: 22px;
  letter-spacing: 1px;
}
.brand small {
  font-size: 12px;
  letter-spacing: 2px;
}
nav {
  gap: 8px;
}
.nav {
  padding: 0 18px;
  font-size: 18px;
  font-weight: 800;
}
.account {
  gap: 8px;
}
.avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
}
.icon-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
}
.coin {
  min-height: 44px;
}
.account-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}
main {
  max-width: 1280px;
  padding: 30px 24px 0;
}
.intro {
  margin-bottom: 28px;
}
.intro .eyebrow {
  font-size: 16px;
  color: #658168;
}
h1 {
  font-size: 34px;
  margin: 6px 0 8px;
  line-height: 1.4;
}
.intro p {
  font-size: 18px;
  margin: 0;
  color: #637360;
}
.save-label {
  font-size: 16px;
}
.save-label small {
  font-size: 16px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  grid-template-areas: "arena prep" "progress prep";
  gap: 24px;
  align-items: start;
}
.arena-section {
  grid-area: arena;
  min-width: 0;
}
.right {
  grid-area: prep;
  display: block;
  min-width: 0;
  background: #ffffffd9;
  border: 1px solid #d8dfd1;
  border-radius: 16px;
  padding: 20px;
}
.left {
  grid-area: progress;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  background: #ffffffbd;
  border: 1px solid #d8dfd1;
  border-radius: 16px;
  padding: 20px;
  min-width: 0;
}
.left > .section-label {
  margin: 0;
  font-size: 20px;
}
.explore-time {
  margin: 0;
  text-align: right;
  font-size: 16px;
  line-height: 1.6;
}
.quest {
  margin: 0;
  background: #eef2e7;
  border-color: #d4dfc9;
  padding: 16px;
}
.quest .eyebrow {
  font-size: 16px;
}
.quest h3 {
  font-size: 20px;
  margin: 6px 0;
}
.quest p {
  font-size: 18px;
  line-height: 1.6;
}
.quest-bottom {
  font-size: 18px;
}
.quest-bottom button {
  font-size: 18px;
}
.record {
  margin: 0;
  padding: 8px 0;
}
.record .section-label {
  font-size: 18px;
  margin: 0 0 10px;
}
.record > div:not(.section-label) {
  font-size: 18px;
  margin: 12px 0;
}
.record > div:not(.section-label) b {
  font-weight: 800;
}
.step-tag {
  font-size: 16px;
  color: #638068;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.arena-top {
  gap: 12px;
  margin-bottom: 14px;
  align-items: center;
}
.arena-top > div {
  gap: 12px;
  flex-wrap: wrap;
}
.arena-tools > span {
  display: none;
}
.arena-top b {
  font-size: 20px;
}
.arena-tools {
  gap: 8px;
}
.arena-tools button {
  background: #fffdf6;
  border-color: #c8d3bd;
  font-size: 18px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
}
.arena {
  aspect-ratio: 1.35;
  border: 3px solid #fffdf5;
  border-radius: 16px;
  box-shadow: 0 8px 24px #2e4f3412;
}
.stage-label {
  top: 24px;
  left: 24px;
  right: 24px;
  max-width: none;
}
.stage-label h2 {
  font-size: 32px;
}
.stage-label p {
  font-size: 18px;
  background: #173b2d9c;
  max-width: 450px;
}
.stage-label small {
  font-size: 16px;
}
.start {
  min-height: 60px;
  width: min(270px, 85%);
  font-size: 22px;
}
.play-overlay {
  bottom: 80px;
}
.ready-tag {
  font-size: 16px;
}
.play-note {
  font-size: 16px;
}
.canvas-bottom {
  font-size: 16px;
  gap: 10px;
  flex-wrap: wrap;
}
.control-guide {
  padding: 14px 0;
  font-size: 16px;
  gap: 12px;
  border-bottom: 0;
}
.control-guide kbd {
  font-size: 16px;
}
.under-arena.quick-help {
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid #dce3d4;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.quick-help > span {
  font-size: 16px;
  color: #657562;
}
.quick-help button {
  margin-left: auto;
  font-size: 18px;
  padding: 8px 0;
  min-height: 44px;
}
.prep-heading {
  margin: 0 0 20px;
}
.right > .section-label {
  font-size: 20px;
  margin-bottom: 12px;
}
.right .section-label button {
  font-size: 18px;
  min-height: 44px;
  color: #416b4e;
}
.hero-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-areas: "portrait role" "portrait name" "portrait desc" "level level" "xp xp" "stats stats" "ability ability";
  gap: 4px 12px;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
  text-align: left;
}
#portrait {
  grid-area: portrait;
  width: 84px;
  height: 108px;
  margin: 0;
  align-self: center;
}
.hero-class {
  grid-area: role;
  align-self: end;
  justify-self: start;
  font-size: 16px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  background: #e8efde;
  border: 0;
}
.hero-card h2 {
  grid-area: name;
  font-size: 26px;
  letter-spacing: 1px;
  margin: 0;
}
.hero-card > p {
  grid-area: desc;
  font-size: 18px;
  margin: 0;
  line-height: 1.5;
  color: #62735d;
}
.hero-level {
  grid-area: level;
  font-size: 18px;
  margin: 14px 0 4px;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.hero-card > .progress {
  grid-area: xp;
  height: 7px;
}
.hero-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  padding: 12px 0 0;
  margin: 0;
}
.hero-stats > div {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 3px;
  margin: 0;
  font-size: 16px;
}
.hero-stats b {
  font-size: 22px;
  font-weight: 800;
}
.ability {
  grid-area: ability;
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #edf1e5;
  gap: 8px;
}
.ability > span {
  border: 0;
  background: transparent;
  padding: 4px;
}
.ability strong {
  font-size: 18px;
}
.ability small {
  font-size: 16px;
  line-height: 1.5;
  color: #617157;
  margin-top: 4px;
}
.loadout-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #dce3d4;
}
.loadout-panel .section-label {
  font-size: 20px;
  margin-bottom: 12px;
}
.loadout-panel .section-label > span {
  font-size: 16px;
}
.camp-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.camp-slot {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  min-height: 138px;
  padding: 10px 6px;
  border: 1px solid #d5dfc9;
  background: #f5f7ed;
  border-radius: 10px;
  text-align: center;
}
.camp-slot.empty {
  border-style: dashed;
  background: #fafbf6;
  color: #7c8b73;
}
.camp-slot .supply-picture {
  width: 66px;
  height: 66px;
  object-fit: contain;
  image-rendering: pixelated;
}
.camp-slot strong {
  font-size: 16px;
  font-weight: 800;
}
.camp-slot small {
  font-size: 16px;
  margin-top: 2px;
}
.empty-slot-icon {
  font-size: 28px;
  line-height: 1.3;
  margin-bottom: 4px;
  color: #8a9c7e;
}
.camp-loadout {
  padding: 0;
  background: none;
  margin: 10px 0;
  font-size: 16px;
  color: #5e7156;
}
.loadout-panel .secondary {
  font-size: 18px;
  margin-top: 12px;
  min-height: 48px;
  background: #fdfcf6;
  border-color: #c5d3b9;
}
#prepareArmory {
  font-size: 18px;
  min-height: 48px;
  background: #fdfcf6;
  border-color: #c5d3b9;
}
#prepareArmory {
  border-style: dashed;
  margin-top: 20px;
}
.primary {
  border-radius: 9px;
  font-size: 18px;
}
.secondary {
  border-radius: 9px;
  font-size: 18px;
}
.primary {
  box-shadow: none;
  border-bottom-width: 2px;
}
.secondary {
  color: #3e6847;
}
footer {
  margin-top: 30px;
  padding: 24px 0;
  font-size: 16px;
  gap: 14px;
  color: #687760;
  flex-wrap: wrap;
}
footer i {
  font-size: 16px;
}
.modal {
  display: flex;
  flex-direction: column;
  flex: 0 1 560px;
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  overflow: hidden;
  padding: 0;
  border-radius: 18px;
  background: #fbfaf4;
  border: 1px solid #d7dfcd;
  box-shadow: 0 24px 80px #152d3040;
}
.modal[data-kind="shop"] {
  flex-basis: 800px;
  max-width: 800px;
}
.modal[data-kind="maps"] {
  flex-basis: 800px;
  max-width: 800px;
}
.modal[data-kind="armory"] {
  flex-basis: 800px;
  max-width: 800px;
}
.dialog-chrome {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #eef2e8;
  border-bottom: 1px solid #d9e0d1;
  padding: 10px 16px;
  min-height: 64px;
}
.dialog-chrome strong {
  font-size: 18px;
  line-height: 1.5;
  color: #3c5e44;
}
.dialog-chrome button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex-shrink: 0;
  background: #fffdf7;
  border: 1px solid #c6d3b9;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  color: #3d5a42;
  padding: 0;
}
.modal-content {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 0 1 auto;
  scrollbar-gutter: stable;
}
.modal-content h2 {
  font-size: 28px;
  line-height: 1.4;
  margin: 8px 0 14px;
  color: #2e4934;
}
.modal-content .eyebrow {
  font-size: 16px;
  color: #6b8464;
  letter-spacing: 0.5px;
}
.modal-content p {
  font-size: 18px;
  color: #576b50;
  line-height: 1.7;
}
.modal-content > .fine {
  font-size: 16px;
}
.modal-content input {
  font-size: 18px;
}
.modal-content .primary {
  font-size: 18px;
  min-height: 52px;
}
.modal-content .secondary {
  font-size: 18px;
  min-height: 52px;
}
.modal-backdrop {
  background: #142e27ad;
  backdrop-filter: blur(4px);
}
.shop-wallet {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #eaf0e0;
  border: 1px solid #d6e1c8;
  border-radius: 10px;
  font-size: 18px;
  flex-wrap: wrap;
}
.shop-wallet strong {
  font-size: 24px;
  color: #527140;
  font-weight: 800;
}
.shop-wallet > span:last-child {
  font-size: 18px;
  color: #667859;
}
.shop-intro {
  margin: 16px 0 20px;
}
.shop-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.shop-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  margin: 0;
  border: 1px solid #d9e1cd;
  border-radius: 14px;
  background: #fffdf7;
}
.shop-item-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.item-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 126px;
  background: radial-gradient(ellipse, #e0eccb99, #f5f7ed 72%);
  border: 1px solid #e0e6d7;
  border-radius: 10px;
}
.item-art .supply-picture {
  width: 112px;
  height: 112px;
  object-fit: contain;
  image-rendering: pixelated;
}
.item-category {
  font-size: 16px;
  color: #779365;
  font-weight: 700;
}
.shop-item h3 {
  font-size: 22px;
  margin: 4px 0;
  line-height: 1.4;
  color: #314c34;
}
.item-price {
  font-size: 18px;
  color: #9b7b36;
  font-weight: 800;
}
.shop-item > p {
  flex: 1;
  font-size: 18px;
  line-height: 1.65;
  margin: 14px 0 16px;
}
.shop-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.stock-label {
  font-size: 18px;
  color: #637557;
}
.stock-label b {
  font-weight: 800;
  color: #334c35;
}
.shop-actions button {
  font-size: 18px;
  min-height: 48px;
  padding: 10px;
  border-radius: 8px;
  background: #447b52;
  color: #fffef3;
  font-weight: 800;
  border: 0;
}
.shop-actions button:disabled {
  background: #dce4d1;
  color: #718269;
  cursor: default;
}
.carry-option {
  min-height: 56px;
  gap: 10px;
  padding: 10px;
  margin: 14px 0 0 !important;
  border: 1px solid #d9e3cc;
  border-radius: 8px;
  background: #f6f8ee;
  font-size: 16px !important;
  line-height: 1.5;
}
.carry-option.selected {
  border-color: #8da878;
  background: #eaf1dc;
}
.carry-option input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  padding: 0;
}
.carry-option span {
  min-width: 0;
  font-size: 16px;
  line-height: 1.5;
}
.shop-footer-note {
  margin: 18px 0 0;
  padding: 12px;
  background: #eef2e7;
  border-radius: 8px;
  font-size: 16px;
  color: #5f7454;
}
.map-gallery {
  gap: 16px;
}
.map-gallery .map-card {
  border-radius: 12px;
}
.map-gallery .map-card img {
  height: 150px;
}
.map-gallery .map-info {
  padding: 14px;
}
.option {
  background: #fffdf7;
  border-color: #d6e0c9;
  border-radius: 12px;
}
.upgrade-option {
  background: #fffdf7;
  border-color: #d6e0c9;
  border-radius: 12px;
}
.option canvas {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
}
.option strong {
  font-size: 20px;
}
.option small {
  font-size: 18px;
}
.option .cost {
  font-size: 18px;
}
.option.selected {
  background: #edf3e4;
}
.run-supplies button {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas: "picture name" "picture note";
  align-items: center;
  column-gap: 8px;
  text-align: left;
}
.run-supplies .supply-picture {
  grid-area: picture;
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.run-supplies button > span {
  grid-area: name;
  font-size: 18px;
}
.run-supplies button > small {
  grid-area: note;
  font-size: 16px;
}
.upgrade-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100% - 40px));
  padding: 20px;
  background: #153b2dee;
  border: 1px solid #dbe6b6;
  border-radius: 14px;
  text-align: center;
  color: #fffbe3;
  z-index: 8;
}
.upgrade-prompt p {
  font-size: 18px;
  margin: 0 0 14px;
  font-weight: 700;
}
.upgrade-prompt button {
  width: 100%;
  min-height: 52px;
  padding: 12px;
  background: #f1e6bc;
  color: #36533b;
  border: 1px solid #dac789;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
}
body.playing .upgrade-prompt ~ .run-supplies {
  z-index: 4;
}
@media (max-width: 1100px) {
  header {
    height: 76px;
    min-height: 76px;
    padding: 0 20px;
    flex-wrap: nowrap;
    gap: 12px;
  }
  nav {
    order: 0;
    width: auto;
    min-height: 0;
    gap: 0;
    justify-content: center;
  }
  .nav {
    padding: 0 12px;
    min-height: 76px;
  }
  .brand small {
    font-size: 12px;
  }
  .account-name {
    display: none;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas: "arena prep" "progress prep";
    gap: 20px;
  }
  .right {
    display: block;
    padding: 16px;
  }
  .arena {
    aspect-ratio: 1.1;
  }
  .arena-top .step-tag {
    display: none;
  }
  .arena-tools button {
    font-size: 18px;
    padding: 8px 10px;
  }
}
@media (max-width: 900px) {
  header {
    gap: 12px;
  }
  .brand small {
    display: none;
  }
  .brand {
    font-size: 20px;
  }
  .nav {
    padding: 0 10px;
  }
  .account {
    gap: 4px;
  }
  .icon-button {
    margin: 0;
  }
  main {
    padding: 24px 20px 0;
  }
  .intro {
    margin-bottom: 24px;
  }
  .save-label {
    display: none;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "arena" "prep" "progress";
    gap: 20px;
  }
  .arena {
    aspect-ratio: 1.4;
  }
  .right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "heading heading" "label label" "hero loadout" "upgrade upgrade";
    gap: 0 24px;
    padding: 20px;
  }
  .prep-heading {
    grid-area: heading;
    margin-bottom: 14px;
  }
  .right > .section-label {
    grid-area: label;
    margin-bottom: 12px;
  }
  .hero-card {
    grid-area: hero;
  }
  .loadout-panel {
    grid-area: loadout;
    margin: 0;
    padding: 0;
    border: 0;
  }
  #prepareArmory {
    grid-area: upgrade;
  }
  .loadout-panel .section-label {
    font-size: 20px;
  }
  .ability small {
    font-size: 16px;
  }
  .control-guide {
    justify-content: center;
  }
  .mobile-guide {
    display: flex !important;
    margin-left: 0;
  }
}
@media (max-width: 680px) {
  .shop-items {
    grid-template-columns: minmax(0, 1fr);
  }
  .shop-item-top {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
  }
  .item-art {
    width: 96px;
    height: 100px;
  }
  .item-art .supply-picture {
    width: 84px;
    height: 84px;
  }
  .shop-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .shop-actions button {
    padding: 10px 18px;
  }
  .shop-item {
    padding: 16px;
  }
  .shop-item > p {
    margin: 12px 0 16px;
  }
  .carry-option span {
    font-size: 18px;
  }
  .carry-option {
    min-height: 54px;
  }
  .shop-wallet {
    gap: 8px;
  }
  .shop-wallet strong {
    font-size: 22px;
  }
}
@media (max-width: 600px) {
  header {
    height: 72px;
    min-height: 72px;
    padding: 0 12px;
    gap: 8px;
  }
  .brand {
    font-size: 20px;
    gap: 6px;
  }
  .brand-icon {
    width: 32px;
    height: 36px;
  }
  .account {
    gap: 4px;
  }
  .coin {
    max-width: 76px;
    font-size: 16px;
    padding: 6px 10px;
  }
  .account-name {
    display: none;
  }
  .icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    order: 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    min-height: 64px;
    padding: 0 8px env(safe-area-inset-bottom);
    background: #fbfaf3;
    border-top: 1px solid #d6dfcc;
    gap: 0;
    z-index: 20;
    justify-content: space-around;
  }
  .nav {
    padding: 8px 4px;
    flex: 1;
    min-height: 64px;
    font-size: 18px;
  }
  .nav.active:after {
    top: 0;
    bottom: auto;
  }
  main {
    padding: 22px 16px calc(88px + env(safe-area-inset-bottom));
  }
  .intro h1 {
    font-size: 28px;
  }
  .intro .eyebrow {
    font-size: 16px;
  }
  .intro p {
    font-size: 18px;
    line-height: 1.6;
  }
  .arena {
    aspect-ratio: 0.9;
  }
  .arena-top {
    align-items: center;
    gap: 8px;
  }
  .arena-top b {
    font-size: 20px;
  }
  .arena-tools {
    gap: 8px;
  }
  .arena-tools button {
    font-size: 18px;
    min-height: 44px;
    padding: 8px 10px;
  }
  .stage-label {
    top: 18px;
    left: 18px;
    right: 18px;
  }
  .stage-label h2 {
    font-size: 30px;
  }
  .stage-label small {
    font-size: 16px;
  }
  .stage-label p {
    font-size: 18px;
    max-width: 100%;
  }
  .canvas-bottom {
    left: 12px;
    right: 12px;
    bottom: 12px;
    font-size: 16px;
    gap: 6px;
  }
  .control-guide {
    font-size: 16px;
    padding: 12px 0;
  }
  .quick-help > span {
    font-size: 16px;
  }
  .quick-help button {
    font-size: 18px;
  }
  .right {
    display: block;
    padding: 18px;
  }
  .loadout-panel {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #dce3d4;
  }
  .hero-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }
  #portrait {
    width: 90px;
    height: 110px;
  }
  .hero-card h2 {
    font-size: 26px;
  }
  .hero-card > p {
    font-size: 18px;
  }
  .camp-slot {
    min-height: 132px;
  }
  .camp-slot .supply-picture {
    width: 70px;
    height: 70px;
  }
  .camp-slot strong {
    font-size: 18px;
  }
  .camp-slot small {
    font-size: 16px;
  }
  .camp-loadout {
    font-size: 16px;
  }
  .left {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px;
    gap: 14px;
  }
  .explore-time {
    text-align: left;
    font-size: 18px;
  }
  .left > .section-label {
    font-size: 20px;
  }
  .record {
    padding: 0;
  }
  .record .section-label {
    font-size: 20px;
  }
  .modal {
    border-radius: 14px;
  }
  .modal-content {
    padding: 20px 16px;
  }
  .dialog-chrome {
    padding: 8px 12px;
    min-height: 60px;
  }
  .dialog-chrome strong {
    font-size: 18px;
  }
  .modal-content h2 {
    font-size: 26px;
  }
  .modal-content .eyebrow {
    font-size: 16px;
  }
  .modal-content p {
    font-size: 18px;
  }
  .modal-content > .fine {
    font-size: 16px;
  }
  .map-gallery {
    grid-template-columns: minmax(0, 1fr);
  }
  .option .cost {
    flex-basis: calc(100% - 84px);
    margin-left: 84px;
  }
  .option > span:not(.cost) {
    min-width: 0;
  }
  .option canvas {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }
  footer {
    font-size: 16px;
    padding: 20px 0;
    gap: 8px;
    margin-top: 24px;
  }
  footer i {
    display: none;
  }
}
@media (max-width: 360px) {
  .brand {
    font-size: 18px;
  }
  .coin {
    max-width: 62px;
    padding: 6px 8px;
  }
  .arena {
    aspect-ratio: 0.75;
  }
  .arena-top b {
    font-size: 18px;
  }
  .arena-tools {
    gap: 6px;
  }
  .arena-tools button {
    font-size: 16px;
    padding: 8px;
  }
  .intro h1 {
    font-size: 26px;
  }
  .shop-item-top {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
  }
  .item-art {
    width: 82px;
    height: 90px;
  }
  .item-art .supply-picture {
    width: 74px;
    height: 74px;
  }
  .shop-item {
    padding: 14px;
  }
  .shop-actions {
    gap: 8px;
    flex-wrap: wrap;
  }
  .shop-actions button {
    padding: 10px 14px;
  }
  .stock-label {
    font-size: 18px;
  }
  .shop-wallet {
    gap: 6px;
  }
  .shop-wallet > span:last-child {
    flex-basis: 100%;
  }
}
@media (max-width: 600px) {
  .stage-label p {
    display: none;
  }
  .ready-tag {
    display: none;
  }
  .play-overlay {
    bottom: 78px;
  }
}
.settings-options {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}
.settings-options label {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #78957855;
  border-radius: 12px;
  background: #fffdf588;
  cursor: pointer;
}
.settings-options input {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  accent-color: #3f7559;
}
.settings-options strong {
  display: block;
  font-size: 19px;
  font-weight: 800;
}
.settings-options small {
  display: block;
  font-size: 16px;
  line-height: 1.6;
  margin-top: 4px;
}
.backup-file {
  display: grid;
  gap: 12px;
  font-size: 18px;
  font-weight: 750;
  margin: 18px 0;
}
.backup-file input {
  width: 100%;
  min-width: 0;
  font-size: 16px;
}
#backupError {
  color: #9b392f;
  font-weight: 750;
}
.low-health #arena:after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 65px #c43e3977;
  pointer-events: none;
  z-index: 1;
}
.reduce-motion * {
  scroll-behavior: auto !important;
  animation: none !important;
  transition: none !important;
}
.reduce-motion *:before {
  scroll-behavior: auto !important;
  animation: none !important;
  transition: none !important;
}
.reduce-motion *:after {
  scroll-behavior: auto !important;
  animation: none !important;
  transition: none !important;
}
