.hud {
  position: fixed; top: 16px; left: 16px;
  z-index: 80; padding: 10px 14px;
  background: #fffdf8; border: 3px solid #2a1f3d;
  box-shadow: 4px 4px 0 #2a1f3d; border-radius: 6px;
  font-size: 12px; pointer-events: none;
  display: none;
}
.hud.show { display: block; }
.hud .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hud .label { font-family: 'Press Start 2P', monospace; font-size: 9px; color: #6b5e85; }
.hud .key {
  display: inline-block; padding: 2px 5px; background: #2a1f3d; color: #fffdf8;
  border-radius: 3px; font-family: 'Press Start 2P', monospace; font-size: 8px;
}
.hud .quests {
  margin-top: 8px; padding-top: 6px;
  border-top: 1px dashed #6b5e85;
  font-family: 'Press Start 2P', monospace; font-size: 10px; color: #c8264f;
}

.prompt {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 70;
  padding: 8px 14px; background: #ffe45e; color: #2a1f3d;
  border: 3px solid #2a1f3d; box-shadow: 4px 4px 0 #2a1f3d; border-radius: 6px;
  font-family: 'Press Start 2P', monospace; font-size: 10px;
  pointer-events: none;
  animation: bobble 0.6s ease-in-out infinite alternate;
  display: none;
}
.prompt.show { display: block; }
@keyframes bobble { from { transform: translate(-50%, 0); } to { transform: translate(-50%, -4px); } }
.prompt .key {
  display: inline-block; padding: 2px 5px; margin-right: 4px;
  background: #2a1f3d; color: #fffdf8; border-radius: 3px; font-size: 9px;
}

.dialog {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: min(94vw, 760px); z-index: 100;
  background: #fffdf8; border: 4px solid #2a1f3d;
  box-shadow: 8px 8px 0 #2a1f3d; border-radius: 12px;
  padding: 18px 22px;
  display: none;
}
.dialog.show { display: block; animation: dlgPop 220ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes dlgPop {
  from { opacity: 0; transform: translate(-50%, 20px) scale(0.92); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 2px dashed #6b5e85;
}
.dialog-speaker {
  font-family: 'Press Start 2P', monospace; font-size: 11px;
  color: #c8264f; letter-spacing: 0.04em;
}
.dialog-period { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #6b5e85; }
.dialog-text {
  font-family: 'Galmuri11', sans-serif; font-size: 14px;
  color: #2a1f3d; line-height: 1.8; min-height: 90px;
  white-space: pre-wrap;
}
.dialog-text .accent { color: #c8264f; font-weight: 500; }
.dialog-text .num    { background: #ffe45e; padding: 0 4px; color: #2a1f3d; }
.dialog-foot {
  margin-top: 10px; display: flex; justify-content: space-between;
  align-items: center; font-family: 'Press Start 2P', monospace; font-size: 9px;
}
.dialog-progress { color: #6b5e85; }
.dialog-next { color: #c8264f; animation: blink 1s step-end infinite; }
.dialog-detail-hint {
  padding: 3px 8px;
  background: #2a1f3d; color: #ffe45e;
  border-radius: 4px; letter-spacing: 0.04em;
}

.ending {
  position: fixed; inset: 0; z-index: 250;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px;
  background: rgba(42, 31, 61, 0.92);
  color: #fffdf8;
  text-align: center;
}
.ending.show { display: flex; }
.ending h2 {
  font-family: 'Galmuri14', 'Galmuri11', sans-serif;
  font-size: clamp(1.4rem, 4.5vw, 2.4rem);
  color: #ffe45e;
  text-shadow: 4px 4px 0 #c8264f;
  letter-spacing: 0.02em;
}
.ending p { font-family: 'Galmuri11', sans-serif; font-size: 1rem; line-height: 1.8; max-width: 600px; }
.ending .links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 12px; }
.ending .links a {
  padding: 10px 16px;
  background: #fffdf8; color: #2a1f3d;
  border: 3px solid #2a1f3d; box-shadow: 4px 4px 0 #c8264f;
  border-radius: 6px; text-decoration: none;
  font-family: 'Press Start 2P', monospace; font-size: 10px;
  letter-spacing: 0.04em;
}
.ending .links a:hover { background: #ffe45e; }
.ending .replay {
  margin-top: 16px;
  padding: 8px 16px;
  background: transparent; color: #fffdf8; border: 2px solid #fffdf8;
  border-radius: 6px; font-family: 'Press Start 2P', monospace; font-size: 9px;
  cursor: pointer;
}
.ending .replay:hover { background: #fffdf8; color: #2a1f3d; }
