:root {
  --gold: #e4be79;
  --white: #f2ece1;
  --ink: #101b20;
  --muted: #b7b8b0;
  --cyan: #6de5dc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
#viewport,
#viewport canvas,
#shade,
#damage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#viewport {
  touch-action: none;
}
#shade {
  background:
    linear-gradient(
      90deg,
      rgba(9, 20, 25, 0.93),
      rgba(9, 20, 25, 0.56) 35%,
      transparent 72%
    ),
    linear-gradient(0deg, rgba(9, 20, 25, 0.65), transparent 22%);
  pointer-events: none;
  transition: opacity 0.5s;
}
header {
  position: fixed;
  top: 32px;
  left: 42px;
  right: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}
.brand {
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}
.brand > span {
  color: var(--gold);
  font-size: 27px;
  vertical-align: middle;
  margin-right: 10px;
}
.coordinates {
  font-size: 11px;
  letter-spacing: 2px;
  display: flex;
  gap: 18px;
  align-items: center;
}
.coordinates span {
  color: #c2c5bc;
}
.coordinates i {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--cyan);
  border-radius: 50%;
}
#menu {
  position: fixed;
  left: 8%;
  top: 21%;
  z-index: 4;
  max-width: 580px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 600;
}
.eyebrow > span {
  width: 25px;
  height: 1px;
  background: var(--gold);
}
h1 {
  font-size: clamp(54px, 6vw, 92px);
  letter-spacing: 6px;
  line-height: 1.12;
  font-weight: 800;
  margin: 25px 0;
}
h1 > span {
  color: var(--gold);
}
h1 small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 13px;
  margin: 17px 0 0;
}
.intro {
  font-size: 15px;
  line-height: 1.9;
  color: #d2d2c8;
  margin: 28px 0;
}
.primary {
  min-width: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
  padding: 17px 25px;
  font-size: 15px;
  font-weight: 650;
}
.primary:hover {
  background: #f7d494;
}
.primary span {
  font-size: 23px;
  font-weight: 400;
}
.brief {
  display: flex;
  gap: 25px;
  color: #c3bdac;
  font-size: 10px;
  letter-spacing: 1px;
  margin: 25px 0 35px;
}
.controls {
  border-top: 1px solid #ffffff20;
  padding-top: 14px;
  color: #c1c7c5;
  font-size: 11px;
}
.controls p {
  margin: 12px 0;
}
.controls kbd {
  display: inline-block;
  background: #ffffff0d;
  border: 1px solid #ffffff30;
  padding: 3px 6px;
  margin-right: 6px;
  margin-left: 12px;
  border-radius: 2px;
  color: var(--white);
  font-size: 10px;
}
.controls kbd:first-child {
  margin-left: 0;
}
.controls .hint {
  color: #a4aaa7;
  font-size: 10px;
  margin-top: 17px;
}
footer {
  position: fixed;
  bottom: 27px;
  left: 42px;
  right: 42px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 2px;
  color: #c2c7bc;
  z-index: 6;
}
footer > div {
  display: flex;
  gap: 25px;
}
footer label {
  display: flex;
  gap: 9px;
  align-items: center;
}
select {
  background: #152229;
  border: 1px solid #ffffff30;
  color: var(--white);
  font-size: 11px;
  padding: 3px;
}
input {
  accent-color: var(--gold);
}
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.mission {
  position: absolute;
  top: 105px;
  left: 42px;
}
.mission > span,
.score > span {
  display: block;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
}
.mission strong {
  display: block;
  font-size: 37px;
  font-weight: 450;
  letter-spacing: 3px;
  margin-top: 7px;
}
.mission small {
  font-size: 17px;
  color: #d6d6c0;
}
.mission p {
  font-size: 11px;
  color: #d9ddcb;
}
.score {
  position: absolute;
  right: 42px;
  top: 105px;
  text-align: right;
}
.score strong {
  display: block;
  font-size: 32px;
  margin: 9px 0 3px;
  font-weight: 450;
  letter-spacing: 3px;
}
.score small {
  font-size: 11px;
}
.health {
  position: absolute;
  left: 42px;
  bottom: 64px;
  width: 220px;
}
.health > span {
  font-size: 10px;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.health b {
  font-size: 26px;
  letter-spacing: 0;
}
.bar {
  margin-top: 13px;
  height: 4px;
  background: #ffffff35;
}
.bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
  transition: width 0.15s;
}
.ammo {
  position: absolute;
  right: 42px;
  bottom: 62px;
  text-align: right;
}
.ammo > span {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
}
.ammo span small {
  font-size: 9px;
  color: #d1d7cb;
  letter-spacing: 1px;
  margin-left: 8px;
}
.ammo strong {
  display: block;
  font-size: 45px;
  font-weight: 500;
  line-height: 1.35;
}
.ammo strong small {
  font-size: 19px;
  color: #d3d7cf;
}
.ammo > b {
  font-size: 10px;
  font-weight: 400;
  color: #d0d5c9;
  letter-spacing: 2px;
}
.bottom-hint {
  position: absolute;
  bottom: 28px;
  width: 100%;
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: #d2d9d0;
}
#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}
#crosshair i,
#crosshair b {
  position: absolute;
  background: #f4f8e1bb;
}
#crosshair i {
  width: 18px;
  height: 1px;
  left: 3px;
  top: 12px;
}
#crosshair b {
  height: 18px;
  width: 1px;
  left: 12px;
  top: 3px;
}
#crosshair span {
  position: absolute;
  font-size: 36px;
  left: -2px;
  top: -11px;
  color: var(--gold);
  opacity: 0;
}
#crosshair.hit span {
  opacity: 1;
}
#crosshair.hit i,
#crosshair.hit b {
  opacity: 0;
}
#notice {
  position: absolute;
  top: 25%;
  width: 100%;
  text-align: center;
  letter-spacing: 4px;
  color: var(--gold);
  font-size: 15px;
  text-shadow: 0 2px 12px #000;
}
#damage {
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 130px 30px #f7352f;
  opacity: 0;
}
#radar {
  position: absolute;
  right: 42px;
  top: 225px;
  width: 125px;
  height: 125px;
  border: 1px solid #e4be7950;
  border-radius: 50%;
  background: #101b2066;
}
#pause-btn {
  pointer-events: auto;
  position: absolute;
  top: 38px;
  right: 330px;
  background: transparent;
  color: var(--white);
  border: 1px solid #ffffff40;
  padding: 4px 9px;
}
#overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: #071217b8;
  backdrop-filter: blur(9px);
  display: grid;
  place-items: center;
}
.panel {
  max-width: 480px;
  width: 90%;
  padding: 40px;
  border-top: 2px solid var(--gold);
  background: #101b20ee;
}
.panel h2 {
  font-size: 35px;
  letter-spacing: 4px;
  margin: 24px 0 14px;
}
.panel > p {
  color: #bdc6c5;
  font-size: 13px;
  line-height: 1.7;
}
.panel .primary {
  width: 100%;
  margin-top: 28px;
}
.secondary {
  display: block;
  margin: 18px auto 0;
  background: transparent;
  border: 0;
  color: #c7cfca;
  font-size: 12px;
}
.panel #stats {
  display: flex;
  gap: 35px;
  margin: 25px 0;
  color: var(--gold);
  font-size: 25px;
}
.panel #stats small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: #aebbb9;
  margin-top: 6px;
}
body.playing #shade {
  opacity: 1;
  background: linear-gradient(
    180deg,
    #07121799,
    transparent 28%,
    transparent 65%,
    #07121799
  );
}
body.playing header {
  opacity: 1;
}
body.playing #hud {
  text-shadow: 0 2px 8px #071217;
}
body.playing footer {
  display: none;
}
@media (max-height: 740px) {
  #menu {
    top: 17%;
  }
  h1 {
    font-size: 64px;
    margin: 20px 0;
  }
  .intro {
    margin: 20px 0;
  }
  .brief {
    margin: 20px 0;
  }
  .controls {
    padding-top: 6px;
  }
}
@media (max-width: 700px) {
  header {
    left: 20px;
    right: 20px;
    top: 20px;
  }
  .coordinates {
    display: none;
  }
  #menu {
    left: 7%;
    top: 18%;
    width: 86%;
  }
  h1 {
    font-size: 54px;
  }
  .brief {
    gap: 16px;
  }
  footer {
    left: 20px;
    right: 20px;
    bottom: 15px;
  }
  footer > span {
    display: none;
  }
  .mission {
    left: 20px;
    top: 70px;
  }
  .score {
    right: 20px;
    top: 70px;
  }
  .health {
    left: 20px;
    width: 150px;
    bottom: 52px;
  }
  .ammo {
    right: 20px;
    bottom: 50px;
  }
  #radar {
    right: 20px;
    top: 178px;
    width: 95px;
    height: 95px;
  }
  #pause-btn {
    right: 20px;
    top: 20px;
  }
  .bottom-hint {
    font-size: 8px;
  }
  .controls .hint {
    max-width: 95%;
  }
}
@media (max-height: 570px) {
  #menu {
    top: 15%;
  }
  h1 {
    font-size: 42px;
    margin: 14px 0;
  }
  h1 small {
    font-size: 9px;
  }
  .intro {
    margin: 14px 0;
  }
  .brief {
    margin: 14px 0;
  }
  .controls {
    display: none;
  }
  .primary {
    padding: 12px 20px;
  }
  footer {
    bottom: 15px;
  }
}
/* Combat choices stay visible at the bottom without covering the reticle. */
#loadout {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.weapon-slots {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.weapon-slots > span {
  border: 1px solid #ffffff28;
  background: #101b20bb;
  color: #aabbb7;
  padding: 11px 14px;
  font-size: 11px;
}
.weapon-slots > span.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: #152b2ddd;
}
.weapon-slots kbd {
  font-size: 10px;
  border: 1px solid currentColor;
  padding: 2px 5px;
  margin-right: 6px;
}
.weapon-slots .dash-slot {
  position: relative;
  min-width: 122px;
}
.dash-slot b {
  font-weight: 400;
}
.dash-slot > i {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #ffffff20;
}
.dash-slot em {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
}
#upgrade-history {
  color: #c8d3bc;
  font-size: 9px;
  letter-spacing: 1px;
  margin: 10px 0 0;
  max-width: 440px;
}
#combo {
  position: absolute;
  top: 225px;
  left: 42px;
  color: var(--cyan);
  font-size: 15px;
  letter-spacing: 2px;
}
#boss-health {
  position: absolute;
  top: 95px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 40vw);
  text-align: center;
}
#boss-health > span {
  font-size: 12px;
  letter-spacing: 4px;
  color: #eedfff;
}
#boss-health > div {
  height: 6px;
  border: 1px solid #bd99ed55;
  background: #152024;
  margin-top: 12px;
}
#boss-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: #ceabef;
  transition: width 0.1s;
}
#dash-effect {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 100px 15px #55dfd9;
  opacity: 0;
  transition: opacity 0.08s;
}
#upgrade-screen {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  background: #08171dee;
  backdrop-filter: blur(8px);
  padding: 32px;
  overflow: auto;
}
.upgrade-panel {
  width: min(100%, 980px);
}
.upgrade-panel h2 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 4px;
  margin: 22px 0 14px;
}
.upgrade-intro {
  font-size: 13px;
  color: #b5c7c1;
  line-height: 1.8;
}
#upgrade-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 35px 0 25px;
}
.upgrade-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  color: var(--white);
  border: 1px solid #81978b55;
  border-top: 3px solid var(--gold);
  background: #14272c;
  padding: 26px;
  min-height: 240px;
  transition:
    transform 0.15s,
    background 0.15s;
}
.upgrade-card:hover,
.upgrade-card:focus-visible {
  transform: translateY(-6px);
  background: #1b373b;
  border-color: var(--cyan);
}
.upgrade-number {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
}
.upgrade-card strong {
  font-size: 25px;
  letter-spacing: 2px;
  margin: 25px 0 12px;
}
.upgrade-card p {
  font-size: 13px;
  color: #bfcdc8;
  line-height: 1.8;
  margin: 0 0 24px;
}
.choose-label {
  margin-top: auto;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 2px;
}
.upgrade-tip {
  font-size: 11px;
  color: #9eb2ac;
  letter-spacing: 2px;
}
@media (max-width: 1024px) {
  #loadout {
    bottom: 60px;
  }
  .weapon-slots > span {
    padding: 10px 9px;
  }
  .health {
    width: 150px;
  }
  .ammo strong {
    font-size: 38px;
  }
  #upgrade-history {
    max-width: 320px;
  }
}
@media (max-width: 700px) {
  #loadout {
    bottom: 125px;
  }
  .weapon-slots > span {
    padding: 9px 7px;
  }
  #boss-health {
    top: 190px;
    width: 55vw;
  }
  #combo {
    left: 20px;
    top: 160px;
    font-size: 12px;
  }
  #upgrade-options {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
  }
  .upgrade-card {
    min-height: 0;
    padding: 18px;
  }
  .upgrade-card strong {
    margin: 10px 0;
    font-size: 21px;
  }
  .upgrade-card p {
    margin-bottom: 12px;
  }
  #upgrade-screen {
    place-items: start center;
    padding: 25px 18px;
  }
  .upgrade-tip {
    line-height: 1.7;
  }
}
@media (max-height: 740px) {
  #menu {
    top: 14%;
  }
  .controls p {
    margin: 9px 0;
  }
  .intro {
    margin: 17px 0;
  }
  .brief {
    margin: 16px 0;
  }
  .upgrade-card {
    min-height: 210px;
  }
  .upgrade-panel h2 {
    margin-top: 16px;
  }
}

#crosshair.shotgun {
  border: 1px solid #f2ddae80;
  border-radius: 50%;
  width: 42px;
  height: 42px;
}
#crosshair.shotgun i {
  left: 11px;
  top: 20px;
}
#crosshair.shotgun b {
  left: 20px;
  top: 11px;
}
#crosshair.shotgun span {
  left: 7px;
  top: -2px;
}
