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

body {
  background-color: #03060d;
  color: #00f3ff;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.terminal-wrapper {
  width: 800px;
  height: 550px;
  background: rgba(4, 10, 20, 0.9);
  border: 2px solid #00f3ff;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
  padding: 30px;
  position: relative;
  border-radius: 8px;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* --- 셋업 스크린 네온 스타일 --- */
.matrix-title {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 25px;
  letter-spacing: 2px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.input-group input {
  flex: 1;
  background: #061524;
  border: 1px solid #00f3ff;
  padding: 10px;
  color: #fff;
  font-family: monospace;
  font-size: 1rem;
}

.faction-title { font-size: 0.9rem; margin-bottom: 10px; }
.faction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 30px; }

.faction-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 243, 255, 0.2);
  padding: 15px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.faction-card h3 { font-size: 1rem; margin-bottom: 5px; }
.faction-card p { font-size: 0.75rem; color: #8faab5; }

/* 부대별 고유 네온 컬러 */
.faction-card.squad-blue { border-color: rgba(0, 243, 255, 0.3); color: #00f3ff; }
.faction-card.squad-blue.selected { border-color: #00f3ff; background: rgba(0, 243, 255, 0.15); box-shadow: 0 0 15px #00f3ff; }

.faction-card.squad-orange { border-color: rgba(255, 136, 0, 0.3); color: #ff8800; }
.faction-card.squad-orange.selected { border-color: #ff8800; background: rgba(255, 136, 0, 0.15); box-shadow: 0 0 15px #ff8800; }

.faction-card.squad-green { border-color: rgba(0, 255, 102, 0.3); color: #00ff66; }
.faction-card.squad-green.selected { border-color: #00ff66; background: rgba(0, 255, 102, 0.15); box-shadow: 0 0 15px #00ff66; }

.faction-card.squad-red { border-color: rgba(255, 42, 0, 0.3); color: #ff2a00; }
.faction-card.squad-red.selected { border-color: #ff2a00; background: rgba(255, 42, 0, 0.15); box-shadow: 0 0 15px #ff2a00; }

.glitch-btn {
  background: #00f3ff; color: #000; border: none; padding: 12px;
  font-family: monospace; font-weight: bold; font-size: 1rem;
  cursor: pointer; letter-spacing: 2px; transition: all 0.2s ease;
}
.glitch-btn:hover { background: #fff; box-shadow: 0 0 15px #00f3ff; }

/* --- 배틀 스크린 스타일 --- */
.battle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 243, 255, 0.3);
  padding-bottom: 10px;
  font-size: 0.9rem;
}

.header-left { display: flex; flex-direction: column; gap: 4px; }
.turn-indicator { font-weight: bold; color: #00ff66; animation: pulse 1s infinite alternate; }

/* 신규: 메인으로 가기(포기) 버튼 스타일 */
.quit-btn {
  background: transparent;
  border: 1px solid #ff2a00;
  color: #ff2a00;
  padding: 6px 12px;
  font-family: monospace;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-shadow: 0 0 4px #ff2a00;
}
.quit-btn:hover {
  background: rgba(255, 42, 0, 0.15);
  box-shadow: 0 0 8px #ff2a00;
  color: #fff;
}

.status-zone { display: flex; justify-content: space-between; align-items: center; margin: 25px 0; }
.hp-box { width: 44%; }
.hp-label { font-size: 0.85rem; margin-bottom: 5px; font-weight: bold; }
.hp-label.Government { color: #ff2a00; text-shadow: 0 0 8px #ff2a00; }

.hp-bar-container {
  width: 100%; height: 16px; background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--squad-color, #00f3ff);
  box-shadow: 0 0 8px var(--squad-color, rgba(0, 243, 255, 0.2));
  border-radius: 3px; overflow: hidden; margin-bottom: 5px;
}
.hp-bar-container.government { border-color: #ff2a00; box-shadow: 0 0 8px rgba(255, 42, 0, 0.2); }

.hp-bar-fill { height: 100%; background: var(--squad-color, #00f3ff); box-shadow: 0 0 8px var(--squad-color, #00f3ff); transition: width 0.4s ease-out; }
.hp-bar-fill.enemy { background: linear-gradient(90deg, #ff5500, #ff2a00); box-shadow: 0 0 8px #ff2a00; }
.hp-text { font-size: 0.8rem; text-align: right; color: #8faab5; }
.vs-sign { font-size: 1.5rem; font-weight: bold; color: #ff2a00; font-style: italic; }

.log-box {
  flex: 1; background: #040d1a; border: 1px solid rgba(0, 243, 255, 0.2);
  padding: 15px; font-size: 0.85rem; line-height: 1.6;
  overflow-y: auto; margin-bottom: 20px; color: #cbdce3;
}

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.skill-btn {
  background: #061524; border: 1px solid var(--squad-color); color: var(--squad-color);
  padding: 15px; font-family: monospace; font-weight: bold; text-align: left;
  cursor: pointer; border-radius: 4px; transition: all 0.2s ease;
  text-shadow: 0 0 4px var(--squad-color);
}
.skill-btn:hover:not(:disabled) { background: var(--squad-bg); box-shadow: 0 0 12px var(--squad-color); }
.skill-btn:disabled { opacity: 0.3; cursor: not-allowed; border-color: #333 !important; color: #555 !important; text-shadow: none !important; }

/* 결과 오버레이 (숨김 상태 보장) */
.result-overlay {
  display: none !important; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(3, 6, 13, 0.95); z-index: 20;
  flex-direction: column; justify-content: center; align-items: center; gap: 25px; border-radius: 6px;
}
.result-overlay.active { display: flex !important; }
.result-overlay h1 { font-size: 2.2rem; letter-spacing: 2px; text-shadow: 0 0 15px currentColor; }

@keyframes pulse { from { opacity: 0.4; } to { opacity: 1; } }