* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #1a0e08; color: #fff6ea;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}
button { font-family: inherit; }
#stage {
  position: fixed; inset: 0;
  max-width: 480px; margin: 0 auto;
  background: #24140c;
  overflow: hidden;
}
#art, #scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; object-fit: cover; pointer-events: none;
}
#scene { z-index: 1; }
#hud {
  position: absolute; left: 12px; right: 12px; top: 10px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
}
.who { min-width: 0; flex: 0 1 34%; }
.who b { display: block; font-size: 18px; line-height: 1.1; text-shadow: 0 2px 0 #4a1c08; }
.who span { display: block; margin-top: 2px; font-size: 11px; color: #ffe0b8; }
.bars { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.bar { height: 10px; border-radius: 8px; background: rgba(0,0,0,.45); overflow: hidden; border: 1px solid rgba(255,255,255,.18); }
.bar i { display: block; height: 100%; width: 100%; border-radius: 8px; }
.hp i { background: linear-gradient(90deg, #ff5a3c, #ffb15a); }
.mp i { background: linear-gradient(90deg, #3aa0ff, #7ad7ff); }
.chapter {
  flex: 0 0 auto; font-size: 12px; padding: 6px 8px; border-radius: 8px;
  background: rgba(40,18,8,.62); color: #ffd7a8;
}
#foeBar {
  position: absolute; left: 18%; right: 18%; top: 18%; z-index: 3;
  height: 12px; border-radius: 8px; background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,220,180,.3); overflow: hidden; pointer-events: none;
}
#foeBar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #c23a2a, #ff8a3d); }
#foeLabel {
  position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 12px; color: #fff;
  text-shadow: 0 1px 1px #000;
}
#log {
  position: absolute; left: 12px; right: 12px; bottom: 126px; z-index: 3;
  min-height: 36px; font-size: 14px; line-height: 1.4; color: #fff3d8;
  text-shadow: 0 1px 2px #000; pointer-events: none;
}
#skills {
  position: absolute; left: 10px; right: 10px; bottom: 14px; z-index: 4;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.skill {
  height: 54px; border: 0; border-radius: 12px;
  background: rgba(48, 22, 10, .92); color: #fff6ea;
  display: flex; align-items: center; gap: 8px; padding: 0 10px;
  box-shadow: inset 0 0 0 1px rgba(255,186,120,.4);
}
.skill:active { transform: translateY(1px); }
.skill[disabled] { opacity: .4; }
.skill .mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: #ff8a3d; color: #3a1606; flex: none;
}
.skill .mark .mp-icon { width: 18px; height: 18px; }
.skill b { display: block; font-size: 14px; font-weight: 700; }
.skill em { display: block; font-style: normal; font-size: 11px; color: #ffd2a4; }
.story, #result {
  position: absolute; left: 16px; right: 16px; bottom: 140px; z-index: 5;
  background: rgba(28, 14, 8, .92); border-radius: 14px; padding: 14px 14px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.story p, #result p { margin: 0 0 12px; font-size: 15px; line-height: 1.55; color: #ffe8cc; }
.story button, #result button {
  width: 100%; height: 48px; border: 0; border-radius: 12px;
  background: #ff8a3d; color: #3a1606; font-size: 17px; font-weight: 700;
}
#result { text-align: center; bottom: auto; top: 26%; }
#result h2 { margin: 0 0 8px; font-size: 22px; }
.hidden { display: none !important; }
.float {
  position: absolute; z-index: 6; font-weight: 800; font-size: 22px; pointer-events: none;
  text-shadow: 0 2px 0 #3a1206; animation: up .7s ease forwards;
}
@keyframes up { to { transform: translateY(-36px); opacity: 0; } }
