* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #03070e;
  color: #e2f6ff;
  font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
}

.cockpit-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: crosshair;
}

.battlefield-bg {
  position: absolute;
  inset: -2%;
  background: url('assets/bgs/bg_01.webp') center center / cover no-repeat;
  filter: brightness(0.82) contrast(1.08);
  transition: background-image 0.5s ease, transform 0.2s ease-out;
  z-index: 1;
}

.battlefield-grid-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 35%, rgba(2, 8, 18, 0.72) 100%),
    repeating-linear-gradient(0deg, rgba(0, 240, 255, 0.03) 0px, rgba(0, 240, 255, 0.03) 1px, transparent 1px, transparent 4px);
  pointer-events: none;
  z-index: 2;
}

.enemy-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding-bottom: 70px;
}

.enemy-unit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.15s ease;
}

.enemy-hud-header {
  background: rgba(5, 14, 28, 0.86);
  border: 1px solid rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.25);
  padding: 8px 16px;
  border-radius: 6px;
  min-width: 310px;
  margin-bottom: 10px;
  backdrop-filter: blur(6px);
}

.enemy-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.enemy-code {
  font-size: 11px;
  color: #ff477e;
  font-weight: 700;
  letter-spacing: 1px;
}

.enemy-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.enemy-hp-bar-wrap {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.enemy-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2a5f, #ff7b00);
  transition: width 0.18s ease;
}

.enemy-shield-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
  transition: width 0.18s ease;
}

.enemy-hp-text {
  font-size: 11px;
  color: #9be8ff;
}

.enemy-sprite-wrap {
  position: relative;
  width: min(44vh, 420px);
  height: min(52vh, 480px);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 32px rgba(0, 240, 255, 0.18);
  background: rgba(4, 10, 20, 0.55);
}

.enemy-sprite-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.1s ease, transform 0.12s ease;
}

.hotspot {
  position: absolute;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
}

.hotspot-core { top: 46%; left: 50%; }
.hotspot-head { top: 22%; left: 50%; }
.hotspot-weapon { top: 42%; left: 24%; }
.hotspot-legs { top: 76%; left: 52%; }

.reticle-ring {
  width: 42px;
  height: 42px;
  border: 2px dashed rgba(255, 55, 95, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 55, 95, 0.5), inset 0 0 8px rgba(0, 240, 255, 0.4);
  animation: spinReticle 6s linear infinite;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.hotspot:hover .reticle-ring {
  transform: scale(1.25);
  border-color: #00f0ff;
  box-shadow: 0 0 18px #00f0ff;
}

.hotspot-label {
  position: absolute;
  bottom: -16px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  background: rgba(5, 12, 24, 0.88);
  color: #ff5c8a;
  padding: 1px 5px;
  border: 1px solid rgba(255, 92, 138, 0.6);
  border-radius: 3px;
}

@keyframes spinReticle {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.cockpit-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.cockpit-weapon-rig {
  position: absolute;
  right: 36px;
  bottom: 120px;
  width: 250px;
  background: rgba(6, 15, 30, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 8px;
  padding: 10px;
  z-index: 12;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.18);
  transition: transform 0.08s ease;
}

.cockpit-weapon-rig.recoil {
  transform: translate(12px, 14px) rotate(-3deg) scale(1.04);
}

.weapon-holo-frame {
  position: relative;
  width: 100%;
  height: 135px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: #040b16;
}

.weapon-holo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.muzzle-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,220,100,0.85) 0%, rgba(0,240,255,0.4) 50%, transparent 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.06s ease;
}

.muzzle-flash.active { opacity: 1; }

.viewmodel-telemetry { margin-top: 6px; }
.viewmodel-name { font-size: 13px; font-weight: 700; color: #00f0ff; }
.viewmodel-spec { font-size: 10px; color: #8ab8d0; }

.hud-top-bar {
  position: absolute;
  top: 8px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  gap: 12px;
}

.hud-top-left, .hud-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cockpit-badge {
  font-size: 12px;
  font-weight: 700;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.45);
  padding: 5px 10px;
  border-radius: 4px;
}

.selector-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #a4d8f0;
}

.tactical-select {
  background: rgba(6, 18, 34, 0.92);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

.hud-top-center {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(5, 14, 28, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.45);
  padding: 5px 16px;
  border-radius: 6px;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-label { font-size: 9px; color: #7ec8e3; letter-spacing: 1px; }
.score-value { font-size: 20px; font-weight: 800; color: #00ffcc; text-shadow: 0 0 10px rgba(0,255,204,0.5); }

.milestone-progress-wrap { width: 170px; }
.milestone-label { font-size: 9px; color: #ffb703; margin-bottom: 3px; }
.milestone-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.milestone-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ffb703, #ff2a5f); transition: width 0.2s ease; }

.hud-action-btn {
  background: rgba(0, 240, 255, 0.15);
  color: #e2f6ff;
  border: 1px solid #00f0ff;
  padding: 6px 11px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hud-action-btn:hover { background: #00f0ff; color: #04101e; }

/* 하제 PIP 작은 통신창 */
.haje-pip-window {
  position: absolute;
  top: 72px;
  left: 28px;
  width: 245px;
  background: rgba(8, 16, 30, 0.92);
  border: 1.5px solid #ff4791;
  box-shadow: 0 0 22px rgba(255, 71, 145, 0.28);
  border-radius: 8px;
  overflow: hidden;
  z-index: 18;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.haje-pip-window.pip-highlight {
  transform: scale(1.05);
  box-shadow: 0 0 32px rgba(255, 71, 145, 0.85);
}

.pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(255,71,145,0.28), rgba(0,240,255,0.15));
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
}

.pip-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff9d;
  box-shadow: 0 0 8px #00ff9d;
}

.pip-status-tag { font-size: 9px; color: #ff85b3; }

.pip-screen {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #050a14;
}

.pip-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

.pip-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0px, rgba(0,0,0,0.18) 1px, transparent 1px, transparent 3px);
  pointer-events: none;
}

.pip-alert-banner {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(255, 30, 86, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 3px 6px;
  border-radius: 3px;
}

.hidden { display: none !important; }
.pip-dialogue-box {
  padding: 8px 10px;
  background: rgba(5, 11, 22, 0.96);
  border-top: 1px solid rgba(255, 71, 145, 0.35);
}
.haje-pip-speaker { font-size: 10px; font-weight: 700; color: #ff6ea7; margin-bottom: 3px; }
.haje-pip-text { font-size: 11px; line-height: 1.4; color: #e8f7ff; min-height: 32px; }
.pip-expression-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255, 71, 145, 0.25); }
.pip-tab { background: rgba(10, 20, 36, 0.9); color: #9bbcd1; border: none; padding: 5px 0; font-size: 10px; cursor: pointer; }
.pip-tab.active { background: #ff4791; color: #fff; font-weight: 700; }

.cockpit-left-console {
  position: absolute; bottom: 115px; left: 28px; width: 245px;
  background: rgba(6, 15, 28, 0.9); border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 8px; padding: 9px; z-index: 18;
}
.pilot-mech-preview {
  position: relative; width: 100%; height: 92px; border-radius: 5px;
  overflow: hidden; margin-bottom: 8px; border: 1px solid rgba(0, 240, 255, 0.3);
}
.pilot-mech-preview img { width: 100%; height: 100%; object-fit: cover; }
.pilot-mech-overlay {
  position: absolute; bottom: 0; inset-inline: 0; background: rgba(0, 12, 26, 0.78);
  font-size: 9px; text-align: center; padding: 2px; color: #00f0ff;
}
.vital-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.vital-name { width: 46px; font-size: 9px; font-weight: 700; color: #90cae8; }
.vital-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.12); border-radius: 4px; overflow: hidden; }
.vital-fill { height: 100%; width: 100%; transition: width 0.2s ease; }
.vital-fill.hp { background: #00ff9d; }
.vital-fill.shield { background: #00f0ff; }
.vital-fill.en { background: #ffb703; }
.vital-val { width: 32px; font-size: 9px; text-align: right; }
.cockpit-sub-actions { display: flex; gap: 6px; margin-top: 6px; }
.console-btn {
  flex: 1; background: rgba(0, 240, 255, 0.14); color: #dff6ff;
  border: 1px solid rgba(0, 240, 255, 0.45); border-radius: 4px; padding: 4px; font-size: 10px; cursor: pointer;
}
.console-btn.danger { background: rgba(255, 42, 95, 0.18); border-color: #ff2a5f; }

.cockpit-weapon-dock {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  width: min(92vw, 1080px); background: rgba(5, 13, 25, 0.94);
  border: 1px solid rgba(0, 240, 255, 0.55); border-radius: 8px; padding: 7px 12px; z-index: 22;
}
.dock-header { display: flex; justify-content: space-between; font-size: 10px; color: #00f0ff; margin-bottom: 6px; font-weight: 700; }
.weapon-slots-container { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.weapon-card {
  display: flex; align-items: center; gap: 7px; background: rgba(10, 24, 44, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.28); border-radius: 6px; padding: 5px 7px; cursor: pointer; transition: all 0.15s ease;
}
.weapon-card:hover { border-color: #00f0ff; transform: translateY(-2px); }
.weapon-card.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(255, 71, 145, 0.22));
  border-color: #00f0ff; box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}
.weapon-card img { width: 46px; height: 38px; object-fit: cover; border-radius: 4px; border: 1px solid rgba(255,255,255,0.18); }
.weapon-card-info { overflow: hidden; }
.weapon-card-key { font-size: 9px; color: #ffb703; font-weight: 800; }
.weapon-card-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weapon-card-stat { font-size: 9px; color: #8ecae6; }

.cutin-overlay {
  position: absolute; inset: 0; background: rgba(2, 6, 15, 0.68);
  display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(3px);
}
.cutin-slash-bg {
  width: 100%; max-width: 980px; height: 290px;
  background: linear-gradient(105deg, rgba(12, 22, 42, 0.96) 0%, rgba(255, 42, 115, 0.32) 55%, rgba(6, 16, 32, 0.96) 100%);
  border-block: 3px solid #ff4791; box-shadow: 0 0 45px rgba(255, 71, 145, 0.65);
  display: flex; align-items: center; overflow: hidden; padding: 0 36px; gap: 28px;
}
.cutin-portrait-wrap { width: 260px; height: 100%; flex-shrink: 0; overflow: hidden; border-inline: 2px solid #00f0ff; }
.cutin-portrait-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.cutin-badge { display: inline-block; background: #ff2a5f; color: #fff; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 3px; margin-bottom: 8px; }
.cutin-title { font-size: 26px; font-weight: 900; color: #00f0ff; margin-bottom: 10px; }
.cutin-quote { font-size: 16px; color: #ffffff; line-height: 1.5; }

.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 15; }
.dmg-float {
  position: absolute; font-size: 22px; font-weight: 900; color: #ffea00;
  text-shadow: 0 0 10px #ff2a5f, 1px 1px 2px #000; transform: translate(-50%, -50%);
  animation: floatUp 0.75s ease-out forwards;
}
.hit-burst {
  position: absolute; width: 90px; height: 90px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffffff 0%, #00f0ff 45%, transparent 72%);
  animation: burstOut 0.32s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(0.9); }
}
@keyframes burstOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
}
.damage-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 110px rgba(255, 0, 55, 0.85); opacity: 0; transition: opacity 0.15s ease; z-index: 40;
}
.damage-vignette.active { opacity: 1; }


