* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: system-ui, -apple-system, sans-serif; }
#app { display: block; width: 100vw; height: 100vh; }

#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; }

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: rgba(255,255,255,0.85);
  box-shadow: 0 0 4px rgba(0,0,0,0.7);
  opacity: 0; transition: opacity 0.2s;
}
#hud.locked #crosshair { opacity: 1; }

#hint {
  position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.55); padding: 9px 18px;
  border-radius: 20px; font-size: 14px; white-space: nowrap;
  transition: opacity 0.3s;
}
#hud.locked #hint { opacity: 0; }

#timebar {
  position: absolute; right: 20px; bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.55); padding: 10px 14px; border-radius: 14px;
  pointer-events: auto; color: #fff;
}
#timebar input[type=range] { width: 160px; accent-color: #c9a86a; }
#timebar button {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
#timebar button:hover { background: rgba(255,255,255,0.35); }
#timelabel { font-size: 13px; min-width: 26px; text-align: center; }

#eprompt {
  position: absolute; left: 50%; top: 56%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.62); padding: 6px 14px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity 0.15s; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.25);
}

#fprompt {
  position: absolute; left: 50%; top: 62%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.62); padding: 6px 14px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity 0.15s; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.25);
}

#lprompt {
  position: absolute; left: 50%; top: 68%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.62); padding: 6px 14px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity 0.15s; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.25);
}
#bedprompt {
  position: absolute; left: 50%; top: 56%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.62); padding: 6px 14px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity 0.15s; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.25);
}
#tvprompt {
  position: absolute; left: 50%; top: 50%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.62); padding: 6px 14px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity 0.15s; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.25);
}
#npcprompt {
  position: absolute; left: 50%; top: 56%; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,0.62); padding: 6px 14px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: opacity 0.15s; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.25);
}

#subtitle {
  position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%);
  max-width: 80%; text-align: center; color: #f0ece2; background: rgba(0,0,0,0.72);
  padding: 10px 20px; border-radius: 10px; font-size: 19px; line-height: 1.5;
  letter-spacing: 0.02em; opacity: 0; transition: opacity 0.35s; pointer-events: none;
  text-shadow: 0 1px 3px #000;
}
#subtitle.on { opacity: 1; }

#loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  color: #fff; font-size: 18px; background: rgba(0,0,0,0.6);
  padding: 14px 28px; border-radius: 12px;
}
#loading.hidden { display: none; }

#intro {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #05060a; color: #d8d2c4; cursor: pointer; transition: opacity 0.8s;
}
#intro.off { opacity: 0; pointer-events: none; }
#introtext { max-width: 640px; text-align: center; white-space: pre-line; line-height: 2; font-size: 19px; letter-spacing: 0.03em; }
#introgo { display: inline-block; margin-top: 28px; font-size: 15px; color: #9a927f; }
#langpick { display: flex; gap: 12px; justify-content: center; margin-bottom: 26px; }
.langbtn { font: 15px system-ui, sans-serif; color: #cfc8ba; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.25); padding: 8px 18px; border-radius: 8px; cursor: pointer; }
.langbtn:hover { background: rgba(255,255,255,0.12); }
.langbtn.active { color: #fff; background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.55); }
#langbtn { font: 13px system-ui, sans-serif; color: #e8e2d6; background: none; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px; padding: 2px 8px; cursor: pointer; }
#endprompt {
  position: absolute; left: 50%; top: 60%; transform: translateX(-50%);
  color: #ffdca8; background: rgba(0,0,0,0.62); padding: 6px 14px; border-radius: 8px;
  font-size: 15px; opacity: 0; transition: opacity 0.15s; pointer-events: none;
  border: 1px solid rgba(255,180,120,0.35);
}
#ending {
  position: absolute; inset: 0; display: none; flex-direction: column; gap: 24px;
  align-items: center; justify-content: center; background: rgba(0,0,0,0.92);
  color: #e8e2d6; text-align: center; pointer-events: auto; z-index: 30;
}
#ending.on { display: flex; }
#endingtext { font-size: 26px; line-height: 1.7; letter-spacing: 0.03em; max-width: 70%; white-space: pre-line; }
#endingbtns { display: flex; gap: 16px; }
#endingbtns button {
  font-size: 15px; color: #e8e2d6; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
  padding: 10px 22px; border-radius: 8px; cursor: pointer;
}
#endingbtns button:hover { background: rgba(255,255,255,0.22); }

/* 붙잡힘 섬광(HauntController) — 순간 백색 플래시 */
#hauntflash { position: fixed; inset: 0; z-index: 28; background: #e6e4de; opacity: 0; pointer-events: none; }
/* 지속 목표선: 상단 중앙, 저채도·작게. opacity는 JS가 구동 */
#objective { position: fixed; top: 46px; left: 50%; transform: translateX(-50%); z-index: 12;
  color: #d9d2c4; font: 15px/1.4 'Nanum Myeongjo', serif; letter-spacing: .02em;
  text-shadow: 0 1px 3px #000, 0 0 10px #000; opacity: 0; pointer-events: none; white-space: nowrap; }
/* 향 집기 프롬프트(다른 *prompt와 동일 톤) */
#incenseprompt { position: fixed; top: 54%; left: 50%; transform: translate(-50%,-50%); z-index: 12;
  background: rgba(0,0,0,.55); color: #fff; padding: 6px 12px; border-radius: 6px;
  font: 14px system-ui, sans-serif; opacity: 0; transition: opacity .15s; pointer-events: none; }
/* 수렴 노트 오버레이 */
#journal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 25;
  width: min(560px, 86vw); max-height: 74vh; overflow-y: auto; padding: 26px 30px;
  background: rgba(14,12,10,.93); border: 1px solid rgba(200,180,140,.28); border-radius: 10px;
  color: #e6ddc9; font: 15px/1.7 'Nanum Myeongjo', serif; opacity: 0; pointer-events: none; transition: opacity .18s; }
#journal.on { opacity: 1; pointer-events: auto; }
#journaltitle { font-size: 18px; color: #c9b487; border-bottom: 1px solid rgba(200,180,140,.25); padding-bottom: 10px; margin-bottom: 14px; }
#journal .frag { margin: 7px 0; color: #d6cdb8; }
#journal .frag.dim { color: #7a7466; font-style: italic; }
#journal .synth { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(200,120,90,.4);
  color: #e8c9a0; font-size: 16px; font-weight: 700; line-height: 1.6; }
#journalhint { margin-top: 18px; text-align: right; color: #6f6858; font-size: 12px; }
