* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1210;
  font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #fff6e6;
  user-select: none;
}

/* 1280×720 논리 해상도 무대. JS가 창 크기에 맞춰 비율 유지 확대/축소한다. */
#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  transform-origin: center center;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #2b2320;
}

#game {
  position: absolute;
  inset: 0;
  width: 1280px;
  height: 720px;
  display: block;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  text-shadow: 0 2px 0 #000a;
}
.hud-left, .hud-center, .hud-right {
  position: absolute;
  top: 14px;
  background: #1a1210cc;
  border: 2px solid #ffb84d55;
  border-radius: 12px;
  padding: 8px 14px;
}
.hud-left { left: 16px; width: 300px; }
.hud-center { left: 50%; transform: translateX(-50%); text-align: center; min-width: 150px; }
.hud-right { right: 16px; text-align: right; min-width: 130px; }
.hud-label { font-size: 14px; color: #ffcf8a; font-weight: bold; }
#time-text { font-size: 40px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
#time-text.danger { color: #ff6b5b; }
#kills-text { font-size: 30px; font-weight: 900; line-height: 1.1; }
.bar {
  position: relative;
  height: 20px;
  background: #00000088;
  border-radius: 10px;
  overflow: hidden;
  margin: 3px 0 6px;
}
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; }
.hp-bar .fill { background: linear-gradient(#ff7b6b, #d8322a); }
.xp-bar { height: 10px; }
.xp-bar .fill { background: linear-gradient(#fff3a0, #f2c230); width: 0; }
#hp-text {
  position: absolute; inset: 0;
  font-size: 13px; font-weight: bold; text-align: center; line-height: 20px;
}
#banner {
  position: absolute;
  top: 130px; left: 0; right: 0;
  text-align: center;
  font-size: 44px; font-weight: 900;
  color: #ffdf6b;
  -webkit-text-stroke: 2px #4a1a00;
  opacity: 0;
  transition: opacity 0.3s;
}
#banner.show { opacity: 1; }

/* ---------- 오버레이 화면 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #120b08b0;
}
.panel {
  width: 640px;
  max-height: 680px;
  background: linear-gradient(#fff3dc, #ffe2b0);
  color: #3a1f0f;
  border: 5px solid #c4561d;
  border-radius: 22px;
  padding: 28px 40px;
  text-align: center;
  box-shadow: 0 12px 0 #7a2e0b, 0 20px 40px #000a;
}
.panel.wide { width: 1000px; }
.kicker { font-size: 16px; font-weight: bold; color: #c4561d; letter-spacing: 4px; }
h1 { font-size: 56px; font-weight: 900; color: #d83a1c; margin: 4px 0 10px; text-shadow: 0 4px 0 #ffb84d; }
h2 { font-size: 36px; font-weight: 900; color: #d83a1c; margin-bottom: 14px; }
.story { font-size: 18px; line-height: 1.6; margin-bottom: 16px; }
.howto {
  display: grid;
  gap: 8px;
  background: #fffaf0;
  border: 2px dashed #e0a060;
  border-radius: 12px;
  padding: 14px 18px;
  text-align: left;
  font-size: 16px;
}
.howto div { display: flex; align-items: center; gap: 4px; }
.howto span { margin-left: 10px; }
kbd {
  display: inline-block;
  min-width: 28px;
  padding: 2px 7px;
  background: #3a1f0f;
  color: #fff3dc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 3px 0 #000;
}
.rule { margin: 14px 0 18px; font-weight: bold; font-size: 17px; }
.btn {
  font-family: inherit;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  background: #e2471f;
  border: none;
  border-radius: 14px;
  padding: 12px 40px;
  cursor: pointer;
  box-shadow: 0 6px 0 #8a2508;
  transition: transform 0.08s;
}
.btn:hover { background: #f25a2f; transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #8a2508; }

#choices { display: flex; gap: 20px; justify-content: center; }
.choice {
  flex: 1;
  font-family: inherit;
  color: #3a1f0f;
  background: #fffaf0;
  border: 4px solid #e0a060;
  border-radius: 16px;
  padding: 18px 14px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s, border-color 0.1s;
}
.choice:hover { transform: translateY(-4px); border-color: #e2471f; }
.choice .key {
  display: inline-block; width: 30px; height: 30px; line-height: 30px;
  border-radius: 50%; background: #3a1f0f; color: #fff; font-weight: 900; margin-bottom: 6px;
}
.choice canvas { display: block; margin: 4px auto 8px; }
.choice .name { font-size: 22px; font-weight: 900; }
.choice .lv { font-size: 15px; color: #c4561d; font-weight: bold; margin: 2px 0 8px; }
.choice .desc { font-size: 15px; line-height: 1.45; min-height: 44px; }
.hint { margin-top: 16px; font-size: 15px; color: #7a4a2a; }

#result-desc { font-size: 19px; margin-bottom: 16px; line-height: 1.5; }
.stats { margin: 0 auto 22px; border-collapse: collapse; font-size: 20px; }
.stats th { text-align: left; padding: 6px 30px 6px 0; color: #7a4a2a; }
.stats td { text-align: right; font-weight: 900; padding: 6px 0; min-width: 120px; }
