@import url("tokens.css");
:root {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #080b10;
  color: #e2e5dd;
  font-family: var(--sans);
  background-image: radial-gradient(ellipse at 50% 0, #202831, transparent 65%);
  min-height: 100dvh;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
select {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button {
  border: 1px solid #49504e;
  background: #252c2d;
  border-radius: 5px;
  padding: 10px 14px;
  min-height: 42px;
}
button:hover {
  background: #3d4541;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid #edb96b;
  outline-offset: 3px;
}
header {
  max-width: 1150px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  color: #98a19f;
  font-size: 12px;
}
header span {
  font: 10px var(--mono);
  letter-spacing: 0.18em;
}
main {
  max-width: 1100px;
  padding: 4px 26px 40px;
  margin: auto;
}
.game-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 10px 0 20px;
}
.game-heading > div > span {
  font: 10px var(--mono);
  letter-spacing: 0.16em;
  color: #caac79;
}
h1 {
  font-size: 32px;
  letter-spacing: 0.02em;
  margin: 9px 0 0;
}
h1 small {
  font-size: 13px;
  font-weight: 400;
  color: #98a399;
  margin-left: 16px;
}
.game-heading p {
  font-size: 12px;
  line-height: 1.8;
  color: #98a19d;
  margin: 0;
}
.arcade {
  width: min(100%, 800px);
  margin: auto;
  border: 1px solid #4b5351;
  background: #11171a;
  box-shadow: 0 18px 80px #0008;
}
.hud {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 9px 15px;
  font: 11px var(--mono);
  color: #b0bcb2;
}
.hud b {
  color: #f0d5aa;
}
.hud button {
  margin-left: auto;
  font-size: 11px;
  min-height: 32px;
  padding: 5px 12px;
}
#battlefield {
  position: relative;
  aspect-ratio: 4/3;
  outline: none;
  background: #000;
  overflow: hidden;
}
#battlefield:focus-visible {
  box-shadow: inset 0 0 0 2px #d6b270;
}
#battle {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}
#game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #020709c9;
  text-align: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.overline {
  font: 11px var(--mono);
  letter-spacing: 0.18em;
  color: #d3b478;
}
#game-overlay h2 {
  font-size: clamp(28px, 4vw, 50px);
  margin: 15px 0;
}
#game-overlay p {
  font-size: 13px;
  line-height: 1.9;
  color: #c2cbbf;
  margin: 12px 0;
}
#mode-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  margin: 17px 0;
  color: #a8b7af;
}
select {
  background: #16231e;
  border: 1px solid #627464;
  padding: 9px 12px;
  border-radius: 3px;
}
#start-game,
#continue-game {
  background: #cbaa65;
  color: #18211b;
  border-color: #e9c781;
  font-weight: 700;
  margin: 5px;
}
#continue-game {
  background: #283f30;
  color: #d2deb5;
  border-color: #698b5b;
}
#game-overlay small {
  display: block;
  font-size: 10px;
  color: #9aa89e;
  margin: 14px 0;
}
.touch-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 22px;
  background: linear-gradient(#202728, #14191e);
  border-top: 1px solid #475152;
}
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  grid-template-rows: repeat(3, 32px);
  gap: 3px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dpad button {
  padding: 0;
  min-height: 0;
  touch-action: none;
  border-color: #4d5a52;
  background: #303c36;
  font-size: 19px;
}
.dpad button[data-dir*="\-"] {
  color: #94a497;
  font-size: 15px;
}
.dpad span {
  background: #202a26;
  border-radius: 50%;
  margin: 5px;
}
.touch-controls button.pressed {
  background: #c8bb8c;
  color: #121c18;
}
.action-pad {
  display: flex;
  gap: 16px;
  align-items: center;
}
.action-pad button {
  width: 67px;
  height: 67px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(#a4382d, #6c251e);
  border: 2px solid #cb5e45;
  box-shadow: 0 4px #3f1917;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.action-pad b {
  display: block;
  font: 22px var(--mono);
  color: #f9d8b7;
}
.action-pad small {
  font-size: 10px;
  color: #e6bc9e;
}
.action-pad button[data-key="jump"] {
  transform: translateY(-8px);
}
.control-note {
  font-size: 10px;
  line-height: 1.9;
  color: #8da098;
  text-align: center;
}
.route {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 10px;
  color: #8da391;
  margin: 18px auto 8px;
  max-width: 800px;
}
.route > div {
  height: 3px;
  background: #263b2d;
  flex: 1;
}
.route i {
  display: block;
  height: 100%;
  background: #a5c982;
  transition: width 0.15s;
}
.underbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  max-width: 900px;
  margin: 10px auto 20px;
}
.underbar p {
  font-size: 11px;
  color: #9baa9f;
}
.underbar > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.underbar button {
  font-size: 10px;
  background: transparent;
  padding: 8px 10px;
}
.underbar [aria-pressed="true"]#autofire {
  color: #ead4a6;
  border-color: #ac9267;
}
details {
  max-width: 900px;
  margin: 15px auto;
  font-size: 12px;
  line-height: 1.9;
  color: #96a597;
}
summary {
  cursor: pointer;
}
details p {
  max-width: 850px;
}
.edition-note {
  font-size: 10px;
  color: #73847c;
}
#battle-toast {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 12%;
  pointer-events: none;
  text-align: center;
  font-size: clamp(10px, 1.5vw, 15px);
  color: #fff4c6;
  text-shadow:
    0 1px 3px #000,
    0 0 5px #000;
}
#boss-hud {
  position: absolute;
  bottom: 4%;
  left: 7%;
  right: 35%;
  font: 9px var(--mono);
  color: #f5c08f;
  pointer-events: none;
}
#boss-hud > div {
  height: 4px;
  margin-top: 5px;
  background: #3a2018;
}
#boss-health {
  height: 100%;
  display: block;
  background: #ee9660;
}
dialog {
  background: #17231e;
  color: #e3e7d8;
  border: 1px solid #79916d;
  border-radius: 7px;
  padding: 24px;
  max-width: 90vw;
}
dialog::backdrop {
  background: #000b;
}
dialog p {
  font-size: 13px;
}
dialog button {
  margin: 10px 8px 0 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  header {
    padding: 12px 15px;
    font-size: 11px;
  }
  header span {
    font-size: 8px;
    letter-spacing: 0.04em;
  }
  main {
    padding: 0 12px 25px;
  }
  .game-heading {
    margin: 12px 0 15px;
  }
  .game-heading p {
    display: none;
  }
  h1 {
    font-size: 26px;
  }
  h1 small {
    font-size: 11px;
    margin-left: 8px;
  }
  .hud {
    gap: 10px;
    padding: 8px;
    font-size: 9px;
  }
  .hud button {
    font-size: 10px;
  }
  .touch-controls {
    padding: 15px 12px;
    gap: 8px;
  }
  .dpad {
    grid-template-columns: repeat(3, 39px);
    grid-template-rows: repeat(3, 37px);
  }
  .control-note {
    display: none;
  }
  .action-pad {
    gap: 12px;
  }
  .action-pad button {
    width: 62px;
    height: 62px;
  }
  #game-overlay {
    padding: 12px;
  }
  #game-overlay h2 {
    font-size: 27px;
    margin: 8px 0;
  }
  #game-overlay p {
    font-size: 11px;
    margin: 7px 0;
  }
  #game-overlay small {
    display: none;
  }
  .overline {
    font-size: 9px;
  }
  #mode-wrap {
    margin: 8px 0;
    font-size: 10px;
  }
  select {
    font-size: 11px;
    padding: 7px;
  }
  #start-game,
  #continue-game {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 12px;
  }
  .underbar {
    display: block;
  }
  .underbar > div {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr 0.8fr 1fr;
    gap: 5px;
  }
  .underbar button {
    font-size: 10px;
    padding: 8px 2px;
  }
  #boss-hud {
    font-size: 7px;
  }
  .route {
    font-size: 9px;
  }
  .game-heading > div > span {
    font-size: 9px;
  }
}
@media (min-width: 850px) and (min-height: 600px) {
  .arcade {
    width: min(100%, calc((100dvh - 300px) * 4 / 3));
    min-width: 520px;
  }
  .touch-controls {
    padding: 10px 20px;
  }
  .dpad {
    grid-template-columns: repeat(3, 28px);
    grid-template-rows: repeat(3, 24px);
  }
  .action-pad button {
    width: 50px;
    height: 50px;
  }
  .control-note {
    font-size: 9px;
  }
}
.arcade:fullscreen {
  width: 100vw !important;
  height: 100dvh;
  max-width: none;
  min-width: 0;
  display: grid;
  grid-template-columns:
    minmax(105px, 1fr) minmax(0, calc(100dvh * 4 / 3))
    minmax(105px, 1fr);
  align-items: center;
  border: 0;
  gap: 10px;
  padding: 0 10px;
}
.arcade:fullscreen .hud,
.arcade:fullscreen .control-note {
  display: none;
}
.arcade:fullscreen #battlefield {
  grid-column: 2;
  grid-row: 1;
}
.arcade:fullscreen .touch-controls {
  display: contents;
}
.arcade:fullscreen .dpad {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  grid-template-columns: repeat(3, 31px);
  grid-template-rows: repeat(3, 35px);
}
.arcade:fullscreen .action-pad {
  grid-column: 3;
  grid-row: 1;
  flex-direction: column;
  gap: 20px;
  justify-self: center;
}
.arcade:fullscreen .action-pad button {
  width: 58px;
  height: 58px;
  transform: none;
}
@media (orientation: landscape) and (max-height: 550px) {
  body {
    overflow: hidden;
  }
  header,
  .game-heading,
  .route,
  .underbar,
  details {
    display: none;
  }
  main {
    padding: 0;
    max-width: none;
  }
  .arcade {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    min-width: 0;
    display: grid;
    grid-template-columns:
      minmax(105px, 1fr) minmax(0, calc(100dvh * 4 / 3))
      minmax(105px, 1fr);
    align-items: center;
    border: 0;
    gap: 10px;
    padding: 0 10px;
  }
  .hud,
  .control-note {
    display: none;
  }
  #battlefield {
    grid-column: 2;
    grid-row: 1;
  }
  .touch-controls {
    display: contents;
  }
  .dpad {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    grid-template-columns: repeat(3, 31px);
    grid-template-rows: repeat(3, 35px);
  }
  .action-pad {
    grid-column: 3;
    grid-row: 1;
    flex-direction: column;
    gap: 20px;
    justify-self: center;
  }
  .action-pad button {
    width: 58px;
    height: 58px;
    transform: none !important;
  }
}

.mobile-pause {
  display: none;
}
#battlefield[data-state="paused"] #battle-toast,
#battlefield[data-state="lost"] #battle-toast,
#battlefield[data-state="won"] #battle-toast {
  visibility: hidden;
}
.arcade:fullscreen .mobile-pause {
  display: block;
  position: fixed;
  right: 20px;
  top: 12px;
  z-index: 8;
  min-height: 34px;
  padding: 4px 12px;
  background: #24302add;
}
@media (orientation: landscape) and (max-height: 550px) {
  .mobile-pause {
    display: block;
    position: fixed;
    right: 20px;
    top: 12px;
    z-index: 8;
    min-height: 34px;
    padding: 4px 12px;
    background: #24302add;
  }
}
@media (orientation: portrait) {
  .arcade:fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 0;
  }
  .arcade:fullscreen #battlefield {
    width: 100%;
    height: auto;
    flex: none;
  }
  .arcade:fullscreen .touch-controls {
    display: flex;
    width: 100%;
    padding: 20px;
  }
  .arcade:fullscreen .dpad {
    grid-template-columns: repeat(3, 39px);
    grid-template-rows: repeat(3, 39px);
  }
  .arcade:fullscreen .action-pad {
    flex-direction: row;
  }
  .arcade:fullscreen .mobile-pause {
    top: max(12px, env(safe-area-inset-top));
    right: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .route i {
    transition: none;
  }
}
