:root {
  color-scheme: dark;
  --gold: #d8b175;
  --muted: #aa9986;
  --line: #574536;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --mono: Menlo, Consolas, monospace;
}
* {
  box-sizing: border-box;
}
html,
body,
#game {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}
body {
  background: #100e0d;
  color: #eee5d8;
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  user-select: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 2px solid #ffc969;
  outline-offset: 3px;
}
button:hover {
  filter: brightness(1.28);
}
[hidden] {
  display: none !important;
}
canvas {
  image-rendering: pixelated;
}
#game {
  display: flex;
  flex-direction: column;
  background: #171513;
}
header {
  height: 75px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 29px;
  background: linear-gradient(100deg, #171513, #0f0f10 55%, #171513);
  border-bottom: 1px solid #625139;
  box-shadow: 0 2px 12px #000;
  z-index: 3;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.crest {
  width: 43px;
  height: 48px;
}
.brand h1 {
  font: 900 27px/1.18 var(--serif);
  letter-spacing: 4px;
  color: #f0d7aa;
  margin: 0;
  text-shadow: 2px 2px #342518;
}
.brand small {
  display: block;
  letter-spacing: 3.4px;
  font:
    9px/1.5 Georgia,
    serif;
  letter-spacing: 3.35px;
  color: #bc9b65;
  margin-top: 2px;
}
.chapter {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 15px;
  white-space: nowrap;
}
.chapter i,
.loadTitle i,
.waveText i {
  position: relative;
  width: 43px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #82613e);
}
.chapter i:last-child,
.loadTitle i:last-child,
.waveText i:last-child {
  transform: rotate(180deg);
}
.chapter i:after,
.loadTitle i:after,
.waveText i:after {
  content: "";
  width: 4px;
  height: 4px;
  position: absolute;
  right: 0;
  top: -1.5px;
  background: #b08c56;
  transform: rotate(45deg);
}
.chapter span {
  font:
    12px Georgia,
    serif;
  letter-spacing: 2px;
  color: var(--gold);
}
.chapter b {
  font: 600 16px var(--serif);
  letter-spacing: 3px;
}
.tools {
  display: flex;
  align-items: center;
  gap: 9px;
}
.tools button,
#dialogActions button {
  background: linear-gradient(#28231e, #1a1919);
  border: 1px solid #564634;
  color: #e3c493;
}
.tools button {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iconBtn {
  width: 36px;
}
.tools #pause {
  gap: 9px;
  padding: 0 16px;
  letter-spacing: 2px;
  font-size: 13px;
}
.pausesign {
  width: 9px;
  height: 13px;
  border-inline: 3px solid #dcb77d;
}
main {
  flex: 1;
  position: relative;
  isolation: isolate;
  min-height: 0;
  overflow: hidden;
  background: #302825;
  touch-action: none;
}
#world,
#cinema,
.vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#cinema {
  pointer-events: none;
  image-rendering: auto;
}
.vignette {
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      #0c0a0980,
      transparent 19%,
      transparent 71%,
      #100e0c96
    ),
    radial-gradient(ellipse at 50% 50%, transparent 45%, #0d0b0a5a 100%);
}
.panel {
  background: linear-gradient(120deg, #1b1917f7, #141415f0);
  border: 1px solid #65533e;
  box-shadow:
    inset 0 0 0 3px #171513,
    inset 0 0 0 4px #40352a,
    0 3px 10px #0008;
  position: relative;
}
.panel:before,
.panel:after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: #aa8856;
  top: -1px;
  left: -1px;
}
.panel:after {
  top: auto;
  left: auto;
  right: -1px;
  bottom: -1px;
}
.heroHud {
  position: absolute;
  top: 22px;
  left: 25px;
  width: 257px;
  height: 77px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.portrait {
  height: 58px;
  width: 54px;
  background: radial-gradient(ellipse at bottom, #653b2d, #242024 72%);
  border: 1px solid #6d5540;
  overflow: hidden;
  flex-shrink: 0;
}
.portrait canvas {
  width: 100%;
  height: 100%;
}
.vitals {
  flex: 1;
  padding-right: 4px;
}
.heroName {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}
.heroName strong {
  font: 700 16px var(--serif);
  letter-spacing: 1.5px;
}
.heroName span {
  color: #b99a68;
  font: 10px var(--mono);
}
.heroName b {
  font-size: 12px;
  padding-left: 2px;
}
.hp,
.xp {
  position: relative;
  background: #0d0c0c;
  border: 1px solid #594231;
  overflow: hidden;
}
.hp {
  height: 15px;
}
.hp i,
.xp i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(#be5747, #8e322d);
  transition: width 0.16s;
}
.hp span {
  position: absolute;
  inset: 0;
  text-align: center;
  font: bold 9px/13px var(--mono);
  color: #f2e5d2;
  text-shadow: 1px 1px #41211d;
}
.xp {
  height: 4px;
  margin-top: 4px;
  border: none;
}
.xp i {
  background: #b99b57;
  width: 0;
}
.xpnote {
  display: flex;
  justify-content: space-between;
  font: 8px var(--mono);
  color: #b1a28b;
  letter-spacing: 0.5px;
  margin-top: 3px;
}
.waveHud {
  position: absolute;
  left: 50%;
  top: 15px;
  transform: translateX(-50%);
  width: 185px;
  text-align: center;
  text-shadow:
    0 2px 4px #000,
    0 0 12px #000;
}
.waveText {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 700 15px var(--serif);
  color: #e9cb8b;
  letter-spacing: 2px;
}
.waveText i {
  width: 30px;
}
.clockline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}
.clockline i {
  height: 3px;
  width: 3px;
  transform: rotate(45deg);
  background: #a28664;
}
.clockline strong {
  font:
    700 31px/1.3 Georgia,
    serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: #f4e9d7;
}
.scoreHud {
  display: flex;
  position: absolute;
  right: 25px;
  top: 22px;
  align-items: center;
  padding: 10px 16px;
  gap: 14px;
}
.scoreHud > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.scoreHud span {
  font-size: 11px;
  color: #c1b29e;
}
.scoreHud b {
  font:
    700 17px Georgia,
    serif;
  color: #ecdec3;
  font-variant-numeric: tabular-nums;
}
.scoreHud > i {
  height: 18px;
  width: 1px;
  background: #554532;
}
.edge {
  pointer-events: none;
  position: absolute;
  width: 15px;
  height: 15px;
  border: solid #9a7e50;
  opacity: 0.7;
}
.edgeTL {
  left: 9px;
  top: 9px;
  border-width: 2px 0 0 2px;
}
.edgeTR {
  right: 9px;
  top: 9px;
  border-width: 2px 2px 0 0;
}
.edgeBL {
  left: 9px;
  bottom: 9px;
  border-width: 0 0 2px 2px;
}
.edgeBR {
  right: 9px;
  bottom: 9px;
  border-width: 0 2px 2px 0;
}
.loadout {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.loadTitle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
  font: 600 11px var(--serif);
  color: #ead5b3;
  letter-spacing: 3px;
  text-shadow: 0 1px 4px black;
}
.loadTitle i {
  width: 38px;
}
#skills {
  display: flex;
  gap: 7px;
}
.skill {
  position: relative;
  padding: 0;
  width: 63px;
  height: 66px;
  background: #171519;
  border: 1px solid #9c8359;
  box-shadow:
    0 0 0 2px #171415,
    0 3px 8px black,
    inset 0 0 0 2px #3f352a;
}
.skill:after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 2px;
  border: 1px solid #92806a55;
}
.skill canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.skill .key {
  position: absolute;
  left: 3px;
  top: 3px;
  border: 1px solid #806d52;
  background: #151415e8;
  color: #e7d4ae;
  padding: 0 3px;
  font: 9px/13px var(--mono);
  z-index: 1;
}
.skill .skillName {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  font: 600 11px/18px var(--serif);
  letter-spacing: 1px;
  color: #f5e9dc;
  background: linear-gradient(transparent, #141116 33%);
  text-shadow: 0 1px 1px #000;
}
.skill .cool {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  background: #101018ab;
  pointer-events: none;
}
.skill .cdText {
  position: absolute;
  left: 0;
  right: 0;
  top: 33%;
  font: bold 16px var(--mono);
  color: white;
  text-shadow: 1px 2px #000;
}
.skill.potion {
  margin-left: 10px;
  width: 54px;
}
.skill.potion:before {
  content: "";
  position: absolute;
  left: -10px;
  top: 12%;
  height: 76%;
  width: 1px;
  background: linear-gradient(transparent, #a1865d, transparent);
}
.mapPanel {
  position: absolute;
  bottom: 19px;
  right: 25px;
  width: 146px;
  background: #141414e8;
  border: 1px solid #68573f;
  padding: 5px;
  box-shadow: 0 3px 8px #0006;
}
.mapTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 4px;
  color: #c2ad8c;
  font: 10px var(--serif);
  letter-spacing: 1px;
}
.mapTitle b {
  font:
    9px Georgia,
    serif;
}
.mapTitle i {
  display: inline-block;
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  border: 1px solid #b79561;
}
#map {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #4c4132;
}
#drops {
  position: absolute;
  bottom: 22px;
  left: 26px;
  text-shadow: 1px 1px 3px black;
  font-size: 12px;
  background: linear-gradient(90deg, #171314a6, transparent);
  padding: 5px 15px 4px 8px;
  pointer-events: none;
}
.feedTitle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c1ac8c;
  font: 10px var(--serif);
  margin-bottom: 5px;
}
.feedTitle i {
  width: 14px;
  height: 1px;
  background: #a88b5c;
}
.feedItem {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 22px;
}
.feedItem i {
  display: inline-block;
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: currentColor;
  box-shadow: 0 0 4px currentColor;
}
.feedItem b {
  font: 10px var(--mono);
  color: #d3c9bd;
}
footer {
  flex: none;
  height: 34px;
  border-top: 1px solid #554835;
  background: #151414;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #b5a694;
}
.location,
.controls,
.auto {
  display: flex;
  align-items: center;
  gap: 9px;
}
.location strong {
  font-weight: 500;
  color: #d2c5ad;
}
.location i,
.auto i {
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: #bc9658;
}
.location span {
  color: #74634f;
}
.controls {
  gap: 18px;
  color: #bcb2a6;
}
.controls span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.controls kbd {
  border: 1px solid #51483e;
  border-radius: 2px;
  padding: 1px 4px;
  color: #c2b39e;
  font: 9px var(--mono);
}
.auto i {
  background: #96b88a;
  border-radius: 50%;
  box-shadow: 0 0 5px #8ea87877;
}
#notice {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -5px);
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    #1b1513ed 23%,
    #1b1513ed 77%,
    transparent
  );
  padding: 8px 34px;
  color: #f9d799;
  font: 700 16px var(--serif);
  white-space: nowrap;
  letter-spacing: 2px;
  transition: 0.2s;
}
#notice.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#joy {
  pointer-events: none;
  position: absolute;
  display: none;
  width: 82px;
  height: 82px;
  border: 1px solid #d1be9f90;
  border-radius: 50%;
  background: #221e1d65;
}
#joy > div {
  position: absolute;
  left: 26px;
  top: 26px;
  width: 28px;
  height: 28px;
  background: #b6997080;
  border: 1px solid #d3b888aa;
  border-radius: 50%;
}
#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #08070bd1;
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 18px;
}
#dialog {
  text-align: center;
  padding: 28px;
  max-width: 600px;
  width: min(100%, 490px);
  max-height: 100%;
  overflow-y: auto;
  box-shadow:
    0 10px 90px #000,
    inset 0 0 0 4px #191716,
    inset 0 0 0 5px #574530;
}
.dialogorn {
  font: 16px Georgia;
  color: #c69455;
}
#dialog small {
  display: block;
  font: 10px Georgia;
  letter-spacing: 4px;
  color: #bfa274;
  margin-top: 10px;
}
#dialog h2 {
  font: 700 30px var(--serif);
  letter-spacing: 5px;
  color: #efdcba;
  margin: 8px 0;
}
#dialog p {
  white-space: pre-line;
  line-height: 1.85;
  color: #beaf99;
  font-size: 13px;
  margin: 13px 0 20px;
}
#dialogActions {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
}
#audioLevels {
  display: grid;
  grid-template-columns: auto minmax(55px, 1fr) 5ch;
  gap: 4px 12px;
  align-items: center;
  text-align: left;
  padding: 8px 4px;
  margin: 0 0 18px;
  border-block: 1px solid #584632;
  color: #e1ceb0;
  font-size: 12px;
}
#audioLevels input {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: #d1a366;
}
#audioLevels output {
  color: #c1ad91;
  font: 11px var(--mono);
  text-align: right;
}
#dialogActions button {
  padding: 9px 16px;
  min-height: 38px;
}
#dialogActions .choice {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
}
.choice canvas {
  width: 38px;
  height: 38px;
}
.choice b,
.choice small {
  display: block;
}
#dialog .choice small {
  font: 12px sans-serif;
  letter-spacing: 0;
  color: #c2b29d;
  margin-top: 4px;
}
@media (max-width: 760px) {
  header {
    height: 60px;
    padding: 0 13px;
  }
  .brand {
    gap: 6px;
  }
  .brand h1 {
    font-size: 22px;
  }
  .crest {
    width: 33px;
    height: 40px;
  }
  .brand small {
    font-size: 7px;
    letter-spacing: 2.8px;
  }
  .chapter {
    display: none;
  }
  .tools {
    gap: 5px;
  }
  .tools button {
    height: 31px;
  }
  .iconBtn {
    width: 31px;
  }
  .tools #pause {
    padding: 0 9px;
    font-size: 12px;
  }
  .heroHud {
    left: 12px;
    top: 12px;
    width: 173px;
    height: 59px;
    padding: 5px;
    gap: 5px;
  }
  .portrait {
    width: 38px;
    height: 44px;
  }
  .heroName strong {
    font-size: 13px;
  }
  .heroName {
    margin-bottom: 3px;
  }
  .heroName span {
    font-size: 8px;
  }
  .heroName b {
    font-size: 10px;
  }
  .xpnote {
    font-size: 7px;
  }
  .hp {
    height: 12px;
  }
  .hp span {
    font-size: 8px;
    line-height: 10px;
  }
  .waveHud {
    top: 12px;
    left: auto;
    right: 12px;
    transform: none;
    width: 110px;
  }
  .waveText {
    font-size: 12px;
    gap: 5px;
  }
  .waveText i {
    width: 12px;
  }
  .clockline strong {
    font-size: 25px;
  }
  .scoreHud {
    top: 79px;
    left: 12px;
    right: auto;
    padding: 5px 8px;
    gap: 9px;
  }
  .scoreHud canvas {
    width: 16px;
    height: 16px;
  }
  .scoreHud span {
    display: none;
  }
  .scoreHud b {
    font-size: 13px;
  }
  .scoreHud > i {
    height: 12px;
  }
  .scoreHud > div {
    gap: 4px;
  }
  .loadout {
    bottom: 15px;
  }
  .loadTitle {
    font-size: 9px;
    margin-bottom: 6px;
  }
  .skill {
    width: 49px;
    height: 53px;
  }
  .skill.potion {
    width: 45px;
    margin-left: 6px;
  }
  #skills {
    gap: 5px;
  }
  .skill .skillName {
    font-size: 9px;
    line-height: 15px;
  }
  .mapPanel {
    bottom: auto;
    top: 79px;
    right: 12px;
    width: 77px;
    padding: 3px;
  }
  .mapTitle {
    font-size: 7px;
    letter-spacing: 0;
  }
  .mapTitle b {
    font-size: 7px;
  }
  #drops {
    left: 13px;
    bottom: 102px;
    font-size: 10px;
    padding: 3px 6px;
  }
  .feedItem {
    line-height: 16px;
  }
  .feedTitle {
    font-size: 8px;
  }
  .controls {
    display: none;
  }
  footer {
    height: 27px;
    padding: 0 13px;
    font-size: 9px;
  }
  .edge {
    width: 9px;
    height: 9px;
  }
}
@media (max-height: 560px) and (min-width: 761px) {
  header {
    height: 52px;
  }
  .heroHud,
  .scoreHud {
    top: 11px;
  }
  .waveHud {
    top: 6px;
  }
  .loadout {
    bottom: 8px;
  }
  .skill {
    height: 47px;
    width: 49px;
  }
  footer {
    height: 24px;
  }
}
#upgrade {
  position: absolute;
  left: 26px;
  top: 106px;
  color: #ffe3ab;
  border: 1px solid #a58351;
  background: linear-gradient(#4e3521, #271e18);
  padding: 6px 12px;
  font-size: 12px;
  box-shadow: 0 2px 7px #0008;
}
#combo {
  position: absolute;
  right: 32px;
  top: 28%;
  color: #f4c579;
  pointer-events: none;
  text-align: right;
  text-shadow:
    2px 2px #321f18,
    0 2px 7px #20130d;
  transition: opacity 0.25s;
}
#combo small {
  font:
    8px Georgia,
    serif;
  letter-spacing: 2px;
}
#combo b {
  font:
    italic bold 40px/0.95 Georgia,
    serif;
}
#combo em {
  font: italic 700 12px var(--serif);
  margin-left: 5px;
}
@media (max-width: 760px) {
  #upgrade {
    top: 112px;
    left: 12px;
    font-size: 10px;
  }
  #combo {
    top: 30%;
    right: 14px;
  }
  #combo b {
    font-size: 27px;
  }
  #combo small {
    font-size: 6px;
  }
}
.touchHint {
  display: none;
}
#gearCard {
  position: absolute;
  left: 26px;
  bottom: 124px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(105deg, #1a1b25f7, #27212af7);
  border: 1px solid #9182a1;
  box-shadow:
    inset 0 0 0 2px #17151d,
    0 3px 9px #0009;
  color: #ede5fd;
  padding: 7px;
  text-align: left;
}
#gearCard > canvas {
  width: 40px;
  height: 40px;
  border: 1px solid #76677d;
}
#gearCard strong,
#gearCard small,
#gearCard em {
  display: block;
}
#gearCard strong {
  font: 600 14px var(--serif);
  letter-spacing: 1px;
}
#gearCard small {
  font-size: 8px;
  letter-spacing: 1px;
  color: #d6b2ec;
}
#gearCard em {
  color: #b3c89a;
  font: 9px sans-serif;
  margin-top: 2px;
}
#gearCard kbd {
  background: #413443;
  color: #e9d9ec;
  font: 10px sans-serif;
  padding: 4px;
}
@media (pointer: coarse) {
  #gearCard kbd span {
    display: none;
  }
}
@media (max-width: 760px) {
  .touchHint {
    display: block;
    font-size: 8px;
    letter-spacing: 0.3px;
    color: #ac9b88;
  }
  #gearCard {
    bottom: 172px;
    left: 12px;
    gap: 5px;
    padding: 4px;
  }
  #gearCard > canvas {
    width: 27px;
    height: 29px;
  }
  #gearCard strong {
    font-size: 10px;
  }
  #gearCard kbd {
    font-size: 8px;
  }
}
.portrait[data-gear="1"] {
  border-color: #81bbd4;
}
.portrait[data-gear="2"] {
  border-color: #e6b45d;
}

#combo .furyMeter {
  height: 3px;
  width: 84px;
  margin: 5px 0 3px auto;
  background: #1c1618;
  border: 1px solid #80715477;
}
.furyMeter i {
  display: block;
  height: 100%;
  background: #e6bc69;
  transform-origin: left;
}
.furyLabel {
  font: 9px var(--mono);
  color: #ddc8a0;
}
#combo.frenzy {
  color: #ffbe6c;
  text-shadow:
    1px 2px #441b17,
    0 0 13px #f87f2d88;
}
.frenzy .furyMeter i {
  background: #fff2a7;
  box-shadow: 0 0 5px #ff9b3f;
}
.frenzy .furyLabel {
  color: #ffd79c;
}
@media (max-width: 760px) {
  #combo .furyMeter {
    width: 56px;
  }
  .furyLabel {
    font-size: 7px;
  }
}
