:root {
  color-scheme: dark;
  --ink: #d5d9cc;
  --muted: #8c9990;
  --red: #c34e3b;
  --line: #79847540;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070c0a;
  color: var(--ink);
  font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible {
  outline: 3px solid #d1d9b7;
  outline-offset: 8px;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
[hidden] {
  display: none !important;
}
#game,
#world,
.screen,
.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#game {
  overflow: hidden;
}
#world {
  display: block;
}
.vignette,
.grain,
#damage,
#flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.vignette {
  background: radial-gradient(ellipse, transparent 32%, #0207064d 74%, #000b);
  z-index: 2;
}
.grain {
  opacity: 0.09;
  z-index: 12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.5' filter='url(%23n)'/%3E%3C/svg%3E");
}
#damage {
  box-shadow: inset 0 0 150px 50px #b12b20;
  opacity: 0;
  z-index: 3;
}
#flash {
  background: #ffdba340;
  opacity: 0;
  z-index: 3;
}
#blood {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
#ui {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  z-index: 4;
  pointer-events: none;
}
#ui > .screen,
#ui > .overlay {
  pointer-events: auto;
}
.touch-only,
.options label.touch-only {
  display: none;
}
@media (pointer: coarse) {
  .touch-only {
    display: revert;
  }
  .options label.touch-only {
    display: flex;
  }
  .mouse-only {
    display: none;
  }
}
#menu {
  z-index: 5;
  overflow: hidden;
}
.menu-art,
.menu-shade {
  position: absolute;
  inset: 0;
}
.menu-art {
  background: url('../assets/ui/specimen-07-title-hospital-v01.png') center/cover;
  animation: breathe 20s ease-in-out infinite alternate;
}
.menu-shade {
  background: linear-gradient(90deg, #030907ed 0%, #040907a8 30%, #02070505 70%),
    linear-gradient(0deg, #030705eb, transparent 28%, transparent 80%, #03070599);
}
header,
footer {
  position: absolute;
  left: 5.5%;
  right: 5.5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header {
  top: 5%;
  font-size: 20px;
  letter-spacing: 4px;
}
.identity b {
  font:
    700 36px Georgia,
    serif;
  letter-spacing: 0;
}
.tag {
  color: #a6b2a3;
  font-size: 18px;
}
footer {
  bottom: 4%;
  font-size: 20px;
  letter-spacing: 2px;
  color: #819082;
}
.title-block {
  position: absolute;
  left: 8%;
  top: 17%;
  width: 840px;
}
.eyebrow {
  font-size: 20px;
  letter-spacing: 6px;
  color: #a5afa0;
}
.eyebrow i,
.chapter-card i {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--red);
  margin-right: 16px;
  box-shadow: 0 0 16px #a84424;
}
.english-title {
  font:
    400 34px Georgia,
    serif;
  letter-spacing: 20px;
  margin: 34px 0 12px;
}
.english-title span {
  color: var(--red);
}
h1 {
  font-family: 'PMingLiU', 'Noto Serif TC', serif;
  font-size: 124px;
  font-weight: 600;
  letter-spacing: 22px;
  margin: 0 0 28px;
  color: #d5d6c8;
  text-shadow: 0 4px 30px #000;
}
.rule {
  width: 72px;
  height: 3px;
  background: var(--red);
}
.intro {
  font-size: 24px;
  line-height: 2;
  letter-spacing: 4px;
  color: #9ea897;
  margin: 26px 0 34px;
}
.primary {
  width: 440px;
  padding: 26px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid #748270;
  background: #aebf9b12;
  color: #d1d8c8;
  letter-spacing: 6px;
  text-align: left;
  font-size: 26px;
  transition: 0.2s;
}
.primary:hover {
  background: #aebf9b26;
  border-color: #c9d3bf;
}
.primary span:last-child {
  font-size: 34px;
}
#start-label {
  font-size: 26px;
}
#loading {
  font-size: 20px;
  color: #8f9b85;
  margin-top: 14px;
  min-height: 28px;
}
.options {
  display: flex;
  gap: 40px;
  margin-top: 20px;
  font-size: 22px;
  color: #8b988b;
}
.options label {
  cursor: pointer;
  display: flex;
  align-items: center;
}
.options input {
  accent-color: #75846a;
  margin: 0 12px 0 0;
  width: 24px;
  height: 24px;
}
.chapter-card {
  position: absolute;
  right: 7%;
  bottom: 16%;
  border-left: 2px solid #82927b65;
  padding: 6px 0 6px 40px;
  width: 460px;
}
.chapter-card > span {
  font-size: 18px;
  letter-spacing: 8px;
  color: #879980;
}
.chapter-card strong {
  display: block;
  font:
    42px 'PMingLiU',
    serif;
  letter-spacing: 9px;
  margin: 22px 0;
}
.chapter-card small {
  font-size: 20px;
  letter-spacing: 2px;
  color: #93a08b;
}
.chapter-card div {
  font-size: 18px;
  color: #a59e8a;
  margin-top: 30px;
  letter-spacing: 4px;
}
#hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.hud-top,
.hud-bottom {
  position: absolute;
  left: 4%;
  right: 4%;
  display: flex;
  justify-content: space-between;
}
.hud-top {
  top: 5%;
}
.hud-bottom {
  bottom: 5%;
  align-items: flex-end;
}
.micro {
  display: block;
  font-size: 18px;
  letter-spacing: 4px;
  color: #a1afa0;
}
h2 {
  font-family: 'PMingLiU', serif;
  letter-spacing: 9px;
  font-weight: 500;
}
.hud-top h2 {
  font-size: 38px;
  margin: 14px 0 20px;
}
.stage-progress {
  display: flex;
  gap: 9px;
}
.stage-progress i {
  width: 52px;
  height: 4px;
  background: #6c796044;
}
.stage-progress i.done {
  background: #b6c797;
}
.score-box {
  text-align: right;
  position: relative;
  padding-right: 110px;
}
.score-box strong {
  display: block;
  font:
    50px Consolas,
    monospace;
  letter-spacing: 6px;
  margin-top: 10px;
}
#mult {
  display: block;
  font:
    24px Consolas,
    monospace;
  color: #d6a35a;
  letter-spacing: 4px;
  margin-top: 6px;
  min-height: 30px;
}
#pause-button {
  position: absolute;
  right: 0;
  top: 0;
  width: 88px;
  height: 88px;
  font-size: 34px;
  background: #16201866;
  border: 2px solid #74816a60;
  color: #c9d3c2;
  pointer-events: auto;
}
#lives {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}
#lives i {
  width: 24px;
  height: 48px;
  border-radius: 12px 12px 5px 5px;
  background: linear-gradient(#ff8a5c, #b8261a 60%, #5c0f0a);
  box-shadow: 0 0 22px #e3482a99;
  transition: 0.3s;
}
#lives i.lost {
  background: #3a2a26;
  box-shadow: none;
  opacity: 0.35;
  transform: scale(0.8);
}
#lives i.flash {
  animation: lifeflash 0.5s 3;
}
.ammo {
  text-align: right;
}
#bullets {
  display: flex;
  justify-content: flex-end;
  gap: 11px;
  margin: 16px 0 14px;
}
#bullets i {
  width: 18px;
  height: 54px;
  border-radius: 9px 9px 2px 2px;
  background: linear-gradient(90deg, #9c8656, #e2cf96 45%, #8a7344);
  box-shadow: 0 0 10px #0008;
  transition:
    opacity 0.08s,
    transform 0.08s;
}
#bullets i.empty {
  opacity: 0.13;
  transform: translateY(7px);
}
#bullets.reloading i {
  animation: reloadfill 0.7s both;
}
#reload-tip {
  font-size: 18px;
  letter-spacing: 4px;
  color: #8e9b86;
}
#touch-pad {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;
}
body:not(.playing) #touch-pad {
  display: none;
}
#stick {
  position: absolute;
  width: 250px;
  height: 250px;
  margin: -125px 0 0 -125px;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid #74816a70;
  background: radial-gradient(circle, #0a120e22 0 40%, #16201899 41% 100%);
  box-shadow:
    0 0 30px #000a,
    inset 0 0 40px #000c;
  opacity: 0.55;
  transition: opacity 0.2s;
}
#stick.active {
  opacity: 1;
}
#stick:before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px dashed #74816a55;
}
#stick b {
  position: absolute;
  width: 0;
  height: 0;
  border: 9px solid transparent;
}
#stick b:nth-of-type(1) {
  left: 50%;
  top: 6px;
  margin-left: -9px;
  border-bottom-color: #b6c79770;
  border-top: 0;
}
#stick b:nth-of-type(2) {
  left: 50%;
  bottom: 6px;
  margin-left: -9px;
  border-top-color: #b6c79770;
  border-bottom: 0;
}
#stick b:nth-of-type(3) {
  top: 50%;
  left: 6px;
  margin-top: -9px;
  border-right-color: #b6c79770;
  border-left: 0;
}
#stick b:nth-of-type(4) {
  top: 50%;
  right: 6px;
  margin-top: -9px;
  border-left-color: #b6c79770;
  border-right: 0;
}
#stick i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3c4a3a, #141c17 72%);
  border: 2px solid #b6c79788;
  box-shadow:
    0 8px 20px #000c,
    inset 0 0 16px #000a;
}
#stick i:before,
#stick i:after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
#stick i:before {
  width: 26px;
  height: 26px;
  border: 2px solid #e2cf9699;
}
#stick i:after {
  width: 4px;
  height: 4px;
  background: #e2cf96;
}
#fire-button {
  position: absolute;
  right: 135px;
  bottom: 185px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 2px solid #c34e3bb0;
  background: radial-gradient(circle, #c34e3b30, #16201899 68%);
  color: #f0dcc4;
  box-shadow:
    0 0 30px #000a,
    inset 0 0 34px #a8442433;
  pointer-events: auto;
  touch-action: none;
  transition:
    transform 0.06s,
    background 0.06s;
}
#fire-button strong {
  display: block;
  font:
    600 44px 'PMingLiU',
    'Noto Serif TC',
    serif;
  letter-spacing: 12px;
  padding-left: 12px;
}
#fire-button small {
  display: block;
  font-size: 16px;
  letter-spacing: 4px;
  color: #c9a891;
  margin-top: 8px;
  padding-left: 4px;
}
#fire-button.on {
  transform: scale(0.94);
  background: radial-gradient(circle, #c34e3b80, #2a1513d0 68%);
}
#reload-button {
  position: absolute;
  right: 400px;
  bottom: 100px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid #9c865690;
  padding: 0 0 0 6px;
  font:
    500 32px 'PMingLiU',
    'Noto Serif TC',
    serif;
  letter-spacing: 6px;
  color: #e2cf96;
  background: radial-gradient(circle, #16201899 60%, transparent 61%),
    conic-gradient(#e2cf96 calc(var(--p, 0) * 360deg), #9c865622 0);
  box-shadow: 0 0 24px #000a;
  pointer-events: auto;
  touch-action: none;
}
#reload-button:active {
  transform: scale(0.94);
}
#reload-button.need {
  border-color: #ff5a3c;
  color: #ff8a6a;
  animation: needreload 0.45s infinite alternate;
}
#reticle {
  position: absolute;
  width: 46px;
  height: 46px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
#reticle i {
  position: absolute;
  inset: 0;
  border: 2px solid #f0e6c8cc;
  border-radius: 50%;
  box-shadow:
    0 0 6px #000a,
    inset 0 0 6px #000a;
}
#reticle i:before,
#reticle i:after {
  content: '';
  position: absolute;
  background: #ffe9b8;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 3px #000;
}
#reticle i:before {
  width: 2px;
  height: 16px;
}
#reticle i:after {
  width: 16px;
  height: 2px;
}
#reticle.empty i {
  border-color: #ff5a3c;
  border-style: dashed;
}
#reticle.kick i {
  transform: scale(1.25);
}
#hit-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  font: 0/0 a;
  opacity: 0;
  color: #dbd9b4;
}
#hit-marker:before,
#hit-marker:after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 3px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}
#hit-marker:after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
#notice {
  position: absolute;
  top: 24%;
  left: 10%;
  right: 10%;
  text-align: center;
  font-size: 28px;
  letter-spacing: 9px;
  color: #d4d6bd;
  text-shadow: 0 3px 10px #000;
  transition: opacity 0.2s;
}
#callout {
  position: absolute;
  top: 58%;
  left: 0;
  right: 0;
  text-align: center;
  font:
    700 62px Georgia,
    serif;
  letter-spacing: 18px;
  color: #e8d7a9;
  text-shadow:
    0 0 28px #c2541f,
    0 4px 6px #000;
  opacity: 0;
  transition: opacity 0.15s;
}
#callout.red {
  color: #ff5a3c;
  text-shadow:
    0 0 34px #ff2a10,
    0 4px 6px #000;
  animation: pulse 0.45s infinite alternate;
}
.warn {
  position: absolute;
  top: 50%;
  font-size: 72px;
  color: #ff4a2a;
  text-shadow: 0 0 26px #ff2a10;
  opacity: 0;
  transition: opacity 0.15s;
}
#warn-l {
  left: 2%;
}
#warn-r {
  right: 2%;
}
#boss {
  position: absolute;
  top: 15%;
  left: 25%;
  width: 50%;
  text-align: center;
  font-size: 20px;
  letter-spacing: 6px;
  color: #c8b4a0;
}
#boss > div {
  margin-top: 12px;
  height: 12px;
  background: #2a1513;
  border: 2px solid #7a3b2f;
}
#boss i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7a1408, #e0482a);
  transition: width 0.15s;
}
#rescue {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
#rescue strong {
  display: block;
  font:
    36px 'PMingLiU',
    serif;
  letter-spacing: 11px;
  margin: 10px 0;
  color: #e9e1b8;
}
#rescue > div {
  height: 8px;
  width: 360px;
  background: #1e2a22;
  margin: auto;
}
#rescue i {
  display: block;
  height: 100%;
  background: #9ad0a0;
  transition: width 0.2s;
}
#area-card {
  position: absolute;
  left: 0;
  right: 0;
  top: 36%;
  text-align: center;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s;
}
#area-card.show {
  opacity: 1;
}
#area-card span {
  display: block;
  font:
    22px Georgia,
    serif;
  letter-spacing: 18px;
  color: #b7c2ac;
}
#area-card strong {
  display: block;
  font:
    500 74px 'PMingLiU',
    serif;
  letter-spacing: 28px;
  margin-top: 18px;
  color: #e4e2d0;
  text-shadow: 0 4px 28px #000;
}
#boss-card {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 10%;
  background: linear-gradient(90deg, #000d, #0006 60%, transparent);
  pointer-events: none;
  animation: bosscard 3.2s both;
}
#boss-card span {
  font: 22px Georgia;
  letter-spacing: 14px;
  color: #c96a50;
}
#boss-card strong {
  font:
    700 124px Georgia,
    serif;
  letter-spacing: 18px;
  color: #efe3cf;
  text-shadow: 0 0 50px #a0200f;
  margin: 16px 0;
}
#boss-card em {
  font-style: normal;
  font-size: 28px;
  letter-spacing: 10px;
  color: #d7bfa5;
}
.overlay {
  z-index: 8;
  background: #06100bec;
  display: grid;
  place-items: center;
  text-align: center;
  backdrop-filter: blur(10px);
}
.overlay > div {
  width: 960px;
}
.overlay h2 {
  font-size: 84px;
  margin: 36px 0;
}
.overlay p {
  color: #9aa793;
  font-size: 24px;
  line-height: 2;
}
.overlay .primary {
  margin: 40px auto 14px;
}
.secondary {
  border: 0;
  background: none;
  color: #8f9f88;
  padding: 26px 40px;
  letter-spacing: 4px;
  font-size: 22px;
}
#cont-count {
  display: block;
  font:
    170px Georgia,
    serif;
  color: #e65a3a;
  text-shadow: 0 0 50px #a0200f;
}
#rank {
  font:
    700 150px Georgia,
    serif;
  color: #e8d29a;
  text-shadow: 0 0 50px #b85a1f;
  margin: 10px 0;
}
.stats {
  display: flex;
  justify-content: space-around;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: 30px 0;
  margin-top: 36px;
  font-size: 20px;
  color: #a1ad96;
}
.stats div {
  min-width: 130px;
}
.stats strong {
  display: block;
  color: #d6ddc9;
  font: 42px Consolas;
  margin-top: 14px;
}
#fatal {
  position: absolute;
  inset: 20%;
  z-index: 20;
  background: #141e17;
  padding: 35px;
  line-height: 2;
}
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #070c0a;
  place-items: center;
  text-align: center;
  color: #d5d6c8;
}
#rotate i {
  display: block;
  font-style: normal;
  font-size: 16vmin;
  color: var(--red);
}
#rotate strong {
  display: block;
  font:
    600 6vmin 'PMingLiU',
    'Noto Serif TC',
    serif;
  letter-spacing: 1.5vmin;
  margin: 4vmin 0 2vmin;
}
#rotate span {
  font-size: 3.6vmin;
  letter-spacing: 0.6vmin;
  color: #8f9b85;
}
@media (pointer: coarse) and (orientation: portrait) {
  #rotate {
    display: grid;
  }
}
body.playing #world {
  cursor: none;
}
@keyframes breathe {
  to {
    transform: scale(1.035);
  }
}
@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}
@keyframes lifeflash {
  50% {
    filter: brightness(2.4);
  }
}
@keyframes reloadfill {
  from {
    opacity: 0.1;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes needreload {
  to {
    box-shadow: 0 0 30px #ff2a1088;
  }
}
@keyframes bosscard {
  0% {
    opacity: 0;
    transform: translateX(-60px);
  }
  12% {
    opacity: 1;
    transform: none;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
