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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0e14;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#app { position: fixed; inset: 0; }

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: none;
}

.hidden { display: none !important; }

/* ---------- 크로스헤어 ---------- */
#crosshair {
  position: fixed;
  width: 28px; height: 28px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}
#crosshair span { position: absolute; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.8); }
.ch-t { left: 12px; top: 0;    width: 4px; height: 7px; }
.ch-b { left: 12px; bottom: 0; width: 4px; height: 7px; }
.ch-l { left: 0;    top: 12px; width: 7px; height: 4px; }
.ch-r { right: 0;   top: 12px; width: 7px; height: 4px; }
.ch-dot { left: 12.5px; top: 12.5px; width: 3px; height: 3px; border-radius: 50%; }

/* ---------- 월드 라벨 ---------- */
#world-labels {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}
.float-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.5);
  white-space: nowrap;
}
.world-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(12, 14, 18, .82);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.12);
}
.world-chip .key {
  display: inline-block;
  background: #fff;
  color: #111;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  padding: 1px 5px;
  margin-right: 6px;
}
.world-chip .val { color: #ffd34d; }

/* ---------- 화면 효과 ---------- */
#vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(5,8,14,.55) 100%);
  z-index: 3;
}
#damage-flash {
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255,30,20,.5) 100%);
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 6;
}

/* ---------- HUD ---------- */
#hud {
  position: fixed; inset: 0;
  pointer-events: none;
  color: #eceae3;
  z-index: 7;
}

#money-chip {
  position: absolute;
  top: 16px; left: 18px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(12, 14, 18, .75);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 7px 16px 7px 9px;
  font-size: 17px;
  font-weight: 800;
  color: #ffd34d;
}
#money-chip .coin {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe27a, #d99a1f);
  border: 2px solid #a8740f;
}

#timer-chip {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 14, 18, .75);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 7px 20px;
}
#timer {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #f5f2e8;
  font-variant-numeric: tabular-nums;
}
#timer.danger { color: #ff5a4e; }

#map-wrap {
  position: absolute;
  top: 16px; right: 18px;
  text-align: right;
}
#minimap {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(12,14,18,.75);
}
#kill-count {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #aeb8c2;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

/* ---------- 하단 바 ---------- */
#bottombar {
  position: absolute;
  left: 50%; bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 22px;
}

.ring-group { display: flex; gap: 10px; }
.ring { position: relative; width: 54px; height: 54px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg {
  fill: rgba(12,14,18,.8);
  stroke: rgba(255,255,255,.14);
  stroke-width: 5;
}
.ring-fg {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 157;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .15s linear;
}
#ring-hp-fg  { stroke: #62d96b; }
#ring-hp-fg.low { stroke: #ff5a4e; }
#ring-sta-fg { stroke: #f5a623; }
.ring-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.ring-icon { font-size: 17px; }

#hotbar { display: flex; gap: 8px; align-items: flex-end; }
.slot {
  position: relative;
  width: 58px; height: 58px;
  background: rgba(12, 14, 18, .78);
  border: 2px solid rgba(255,255,255,.13);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.slot.active {
  border-color: #ff8c42;
  box-shadow: 0 0 12px rgba(255,140,66,.35);
}
.slot.empty { opacity: .55; }
.slot-icon { width: 44px; height: 22px; }
.slot-key {
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #111;
  font-size: 10px;
  font-weight: 900;
  border-radius: 4px;
  padding: 1px 5px;
}
.slot-count {
  position: absolute;
  top: 3px; right: 6px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
#ammo-chip {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  background: rgba(12,14,18,.85);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#ammo-chip.reloading { color: #ffd34d; }
.med-icon {
  width: 30px; height: 26px;
  background: #e3473c;
  border-radius: 5px;
  position: relative;
}
.med-icon span {
  position: absolute; inset: 0;
  background:
    linear-gradient(#fff, #fff) center/16px 5px no-repeat,
    linear-gradient(#fff, #fff) center/5px 16px no-repeat;
}
#slot-med.depleted .med-icon { filter: grayscale(1) brightness(.6); }

#reload-hint {
  position: absolute;
  right: 18px; bottom: 18px;
  font-size: 11px;
  color: #76828c;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

/* ---------- 탈출 ---------- */
#extract-wrap {
  position: absolute;
  left: 50%; top: 72px;
  transform: translateX(-50%);
  text-align: center;
}
#extract-label {
  font-size: 15px;
  font-weight: 800;
  color: #7CFC8a;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
  margin-bottom: 6px;
}
#extract-bg {
  width: 250px; height: 9px;
  background: rgba(12,14,18,.7);
  border: 1px solid rgba(124,252,138,.5);
  border-radius: 5px;
  overflow: hidden;
}
#extract-bar { width: 0; height: 100%; background: #7CFC8a; }

#extract-arrow {
  position: absolute;
  color: #7CFC8a;
  font-size: 22px;
  text-shadow: 0 0 10px rgba(124,252,138,.8);
  transform-origin: center;
}

/* ---------- 시작/결과 화면 ---------- */
.screen {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, rgba(16,22,28,.92), rgba(6,9,13,.97));
  color: #eceae3;
  z-index: 10;
  text-align: center;
  padding: 20px;
  cursor: default;
}
.screen h1 {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 4px 18px rgba(0,0,0,.9);
}
.screen h1 .accent { color: #ffd34d; }
.screen h1.fail { color: #ff5a4e; }
.screen .sub { font-size: 15px; color: #8a99a3; letter-spacing: 1px; }

.howto {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  color: #c7d0d6;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 18px 30px;
  line-height: 1.55;
}
.howto b { color: #ffd34d; }
.howto .green { color: #7CFC8a; font-weight: 700; }

.screen button {
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #14181c;
  background: #ffd34d;
  border: none;
  border-radius: 12px;
  padding: 14px 46px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.screen button:hover { background: #ffe27a; transform: translateY(-2px); }
.screen button:active { transform: translateY(0); }

#end-stats { display: flex; gap: 28px; font-size: 15px; color: #c7d0d6; }
#end-stats b { color: #ffd34d; font-size: 21px; }

#end-items {
  max-width: 420px;
  max-height: 170px;
  overflow-y: auto;
  font-size: 14px;
  color: #b8c4cc;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 12px 20px;
  line-height: 1.7;
}
#end-items:empty { display: none; }
#end-items .val { color: #ffd34d; }
