/* 닌자 모드 HUD — 640×360 픽셀 상자(#ui) 안에 px로 놓는다. nclient.js가 .nj 요소를 만들고 지운다.
   왼쪽 위 230×40은 공용 "나가기" 버튼 자리라 비워 둔다. 글꼴: --px 12px, --px-s 10px, --px-l 15px, --kanji 16px 배수.
   창 모양(.nj-frame)은 style.css의 .win과 같은 금테 + 모서리 점. 키 모양은 style.css의 .kc를 그대로 쓴다. */
.nj {
  position: absolute; left: 0; top: 0; width: 640px; height: 360px; z-index: 4; pointer-events: none; overflow: hidden;
  font-family: var(--px); font-size: 12px; line-height: 16px; color: var(--txt);
  text-shadow: 1px 1px 0 #000; -webkit-font-smoothing: none; word-break: keep-all;
}
.nj b, .nj h3 { font-weight: 400; }
.nj i { font-style: normal; display: block; }
.nj img { image-rendering: pixelated; display: block; }
.nj .kc { text-shadow: none; }
.nj .dim { color: var(--dim); }

.nj-frame {
  background-color: rgba(12, 11, 15, .92); border: 1px solid var(--gold); outline: 1px solid #000;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px var(--line), 2px 2px 0 rgba(0, 0, 0, .55);
  background-image: linear-gradient(var(--gold-hi), var(--gold-hi)), linear-gradient(var(--gold-hi), var(--gold-hi)), linear-gradient(var(--gold-hi), var(--gold-hi)), linear-gradient(var(--gold-hi), var(--gold-hi));
  background-size: 3px 3px; background-repeat: no-repeat; background-position: 0 0, 100% 0, 0 100%, 100% 100%;
}

/* 위 가운데: 단계 · 시간 · 장소와 날씨 */
.nj-phase { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.nj-ph { font-family: var(--px); color: var(--txt); background: rgba(12, 11, 15, .9); border: 1px solid var(--gold); outline: 1px solid #000; padding: 1px 7px 2px; }
.nj-ph.warn { background: var(--red); border-color: var(--gold-hi); color: #fff; }
.nj-time { font-family: var(--px-l); font-size: 15px; line-height: 18px; min-width: 34px; color: var(--gold-hi); }
.nj-place { font-family: var(--px-s); font-size: 10px; line-height: 12px; color: var(--dim); }

/* 오른쪽 위: 닌자 목록 (색 · 이름 · 딴 판 수) · 그 아래 쓰러짐 알림 */
.nj-players { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.nj-p { display: flex; align-items: center; gap: 5px; height: 17px; background: rgba(12, 11, 15, .85); border: 1px solid var(--line); outline: 1px solid #000; padding: 0 5px; white-space: nowrap; }
.nj-p > i { width: 6px; height: 6px; outline: 1px solid #000; }
.nj-p.me { border-color: var(--gold); }
.nj-p.me span { color: var(--gold-hi); }
.nj-p.dead span { text-decoration: line-through; color: var(--faint); }
.nj-p.dead > i { opacity: .3; }
.nj-pips { display: flex; gap: 2px; }
.nj-pips u { display: block; width: 5px; height: 5px; border: 1px solid var(--dim); text-decoration: none; }
.nj-pips u.on { background: var(--gold-hi); border-color: var(--gold-hi); }
.nj-feed { position: absolute; right: 8px; top: 92px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.nj-feed div { font-family: var(--px-s); font-size: 10px; line-height: 12px; padding: 1px 6px 2px; background: rgba(0, 0, 0, .62); color: var(--txt); white-space: nowrap; transition: opacity .3s steps(3); }
.nj-feed div.me { color: var(--gold-hi); border-left: 2px solid var(--red-hi); }
.nj-feed div.old { opacity: .35; }

/* 알림 한 줄 */
.nj-toast {
  position: absolute; left: 50%; top: 40px; transform: translateX(-50%); padding: 3px 12px 4px; white-space: nowrap;
  background: rgba(12, 11, 15, .94); border: 1px solid var(--line); outline: 1px solid #000; opacity: 0; transition: opacity .15s steps(3);
}
.nj-toast.on { opacity: 1; }
.nj-toast.warn { color: var(--gold-hi); border-color: var(--gold); }
.nj-toast.bad { background: var(--red); color: #fff; border-color: var(--gold-hi); }

/* 판 소개: 날씨 글자 · 장소 · 내 무기 */
.nj-intro { position: absolute; left: 0; right: 0; top: 62px; display: flex; flex-direction: column; align-items: center; opacity: 0; transition: opacity .3s steps(4); }
.nj-intro.on { opacity: 1; }
.nj-ik { font-family: var(--kanji); font-size: 32px; line-height: 34px; color: #fff; background: var(--red); width: 40px; text-align: center; box-shadow: 2px 2px 0 #000; text-shadow: none; }
.nj-ititle { margin-top: 8px; font-family: var(--px-l); font-size: 30px; line-height: 34px; color: var(--txt); text-shadow: 2px 2px 0 #000; }
.nj-isub { margin-top: 2px; color: var(--dim); }
.nj-icard { margin-top: 12px; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 4px; max-width: 470px; }
.nj-ipic { width: 120px; height: 70px; overflow: hidden; flex: none; }
.nj-ipic img { margin-left: -20px; margin-top: -8px; }
.nj-iname { font-family: var(--px-l); font-size: 15px; line-height: 20px; color: var(--gold-hi); }
.nj-ilab { font-family: var(--px-s); font-size: 10px; color: var(--gold); margin-right: 8px; vertical-align: 2px; }
.nj-idesc { color: var(--txt); margin-top: 2px; }

/* 준비 안내 */
.nj-guide { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); width: 360px; padding: 5px 10px 6px; display: none; text-shadow: none; font-family: var(--px-s); font-size: 10px; line-height: 15px; }
.nj-guide .kc { font-size: 10px; }
.nj-guide.on { display: block; }
.nj-guide p { line-height: 15px; }
.nj-guide p + p { margin-top: 2px; }
.nj-guide b { color: var(--gold-hi); margin-right: 4px; }

/* 아래: 무기와 덫(왼쪽) · 상태(가운데) · 받아넘기기 · 수리검 · 도구(오른쪽) */
.nj-bottom { position: absolute; left: 8px; right: 8px; bottom: 7px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.nj-left { display: flex; flex-direction: column; gap: 3px; width: 200px; }
.nj-right { display: flex; justify-content: flex-end; width: 200px; }
.nj-mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.nj-weapon { position: relative; display: flex; align-items: center; gap: 6px; width: 176px; height: 38px; padding: 0 6px 0 4px; }
.nj-weapon.off .nj-wname { color: var(--dim); }
.nj-wicon { width: 34px; height: 30px; display: grid; place-items: center; flex: none; overflow: hidden; }
.nj-wicon img { max-width: 34px; max-height: 30px; }
.nj-wname { color: var(--gold-hi); white-space: nowrap; }
.nj-wsub { font-family: var(--px-s); font-size: 10px; line-height: 12px; color: var(--dim); white-space: nowrap; }
.nj-meter { position: absolute; left: 2px; bottom: 2px; height: 2px; max-width: calc(100% - 4px); background: var(--gold-hi); }
.nj-slots { display: flex; gap: 3px; flex-wrap: wrap; }
.nj-right .nj-slots { justify-content: flex-end; flex-wrap: wrap-reverse; }
.nj-slot {
  display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 5px 0 3px; white-space: nowrap;
  background: rgba(12, 11, 15, .9); border: 1px solid var(--line); outline: 1px solid #000;
}
.nj-slot img { max-width: 14px; max-height: 14px; }
.nj-slot b { color: var(--gold-hi); min-width: 7px; text-align: right; }
.nj-slot b:empty { display: none; }
.nj-slot.off { border-color: #1c1a20; }
.nj-slot.off .nj-name, .nj-slot.off b { color: var(--faint); }
.nj-slot.off img { opacity: .4; }
.nj-slot.on { border-color: var(--gold-hi); background: rgba(163, 36, 28, .55); }
.nj-status { height: 12px; font-family: var(--px-s); font-size: 10px; line-height: 12px; color: var(--blue); text-align: center; white-space: nowrap; }
.nj-status.bad { color: var(--red-hi); }
.nj-status.good { color: var(--gold-hi); }
.nj-bar { width: 96px; height: 4px; background: #000; border: 1px solid var(--line); display: none; }
.nj-bar.on { display: block; }
.nj-bar > i { height: 100%; width: 100%; background: var(--blue); }
.nj-bar.low > i { background: var(--red-hi); }
.nj-bar.psn { border-color: #3c5a34; }
.nj-bar.psn > i { background: #8fce7a; }

/* 판 결과 · 나가기 묻기 */
.nj-result, .nj-ask { position: absolute; left: 0; top: 0; width: 640px; height: 360px; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, .6); }
.nj-result.on, .nj-ask.on { display: flex; }
.nj-ask { z-index: 2; }
.nj-sheet { min-width: 300px; max-width: 460px; padding: 10px 14px 9px; text-shadow: none; }
.nj-sheet h3 { font-family: var(--px-l); font-size: 15px; line-height: 18px; color: var(--gold-hi); padding-bottom: 5px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.nj-sheet h3.win { color: var(--gold-hi); }
.nj-sheet h3.lose { color: var(--red-hi); }
.nj-sheet p { color: var(--dim); }
.nj-sheet p .kc { margin-right: 2px; }
.nj-table { display: grid; gap: 1px; margin: 8px 0 6px; }
.nj-row { display: grid; grid-template-columns: 8px 1fr 104px 26px 34px; gap: 8px; align-items: center; height: 19px; padding: 0 6px; border: 1px solid transparent; }
.nj-row > i { width: 6px; height: 6px; outline: 1px solid #000; }
.nj-row.nj-head { height: 13px; font-family: var(--px-s); font-size: 10px; line-height: 12px; color: var(--faint); }
.nj-row.me { border-color: var(--line); background: rgba(255, 255, 255, .04); }
.nj-row.win .nm { color: var(--gold-hi); }
.nj-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nj-row .wp { display: flex; align-items: center; gap: 4px; font-family: var(--px-s); font-size: 10px; color: var(--dim); white-space: nowrap; }
.nj-row .wp img { max-width: 16px; max-height: 12px; }
.nj-row .kl { text-align: right; color: var(--txt); }
.nj-log { font-family: var(--px-s); font-size: 10px; line-height: 13px; color: var(--txt); border-top: 1px solid var(--line); padding-top: 5px; margin-bottom: 4px; }
.nj-log .t { display: inline-block; width: 30px; color: var(--faint); }
.nj-note { font-family: var(--px-s); font-size: 10px; line-height: 12px; color: var(--gold) !important; margin-top: 3px; }
.nj-foot { font-family: var(--px-s); font-size: 10px; margin-top: 6px; }
