/* ==========================================================================
   FCO 백금 계산기 메인 스타일시트
   - 다크 모드 고정 (FC 온라인 인게임 강화실 다크 & 네온그린 테마)
   ========================================================================== */

:root {
  --bg-page: #0b0d12;
  --bg-page-pattern:
    radial-gradient(ellipse at 50% 0%, rgba(7, 244, 104, 0.08) 0%, transparent 55%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 10px);
  --bg-topbar: linear-gradient(90deg, #0d1017 0%, #171c26 50%, #0d1017 100%);
  --bg-panel: #141820;
  --bg-panel-header: #10131a;
  --bg-panel-sub: #0d1016;
  --bg-input: #090b0f;
  --bg-dropdown: #11151e;
  --bg-total-bar: #0d1016;

  --border-main: #2a3140;
  --border-strong: #3a4356;
  --border-row: #1e2431;

  --text-primary: #ffffff;
  --text-secondary: #a8b2c3;
  --text-muted: #687387;
  --text-total-label: #a8b2c3;
  --text-total-attempts: #ffffff;

  --accent-neon: #07f468;
  --accent-point: #07f468;
  --accent-sub-bp: #07f468;
  --panel-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);

  /* 빈 방패 카드 슬롯 테마 변수 (다크) */
  --shield-bg: linear-gradient(160deg, #3c4250 0%, #1a1e26 50%, #07f468 100%);
  --shield-inner-bg: linear-gradient(180deg, #272b35 0%, #12151b 65%, #090b0f 100%);
  --shield-plus-color: #07f468;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-page);
  background-image: var(--bg-page-pattern);
  color: var(--text-primary);
  font-family: "FCOAllSans", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  padding-bottom: 70px;
  line-height: 1.45;
}

/* ==========================================================================
   상단 GNB 바 (중앙 정렬 헤더)
   ========================================================================== */
.fco-topbar {
  background: var(--bg-topbar);
  border-bottom: 2.5px solid var(--accent-neon);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  color: #ffffff;
}

.topbar-title {
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  text-align: center;
}

/* ==========================================================================
   메인 컨테이너 & 3단 박스 공통
   ========================================================================== */
.container {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 0 20px;
}

.fco-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-top: 2px solid var(--border-strong);
  margin-bottom: 22px;
  box-shadow: var(--panel-shadow);
}

/* ==========================================================================
   최상단 기본 검색바 (.top-search-section)
   ========================================================================== */
.top-search-section {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
  position: relative;
  z-index: 400;
}

.top-search-container {
  position: relative;
  width: 100%;
  max-width: 560px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  height: 46px;
  padding: 0 16px;
  gap: 12px;
  box-shadow: var(--panel-shadow);
  transition: border-color 0.15s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--accent-point);
}

.search-label-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-point);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.player-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}

.player-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.player-search-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 3px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 350;
  display: none;
}

.player-search-dropdown.is-open {
  display: block;
}

.player-search-dropdown::-webkit-scrollbar {
  width: 10px;
}

.player-search-dropdown::-webkit-scrollbar-track {
  background: #c9c9c9;
}

.player-search-dropdown::-webkit-scrollbar-thumb {
  background: #15e75f;
}

.player-search-dropdown .quickPlayer > span.name {
  max-width: 340px;
}

.search-empty-guide {
  padding: 14px 10px;
  font-size: 12.5px;
  color: #7e7e8c;
  text-align: center;
  background: #ffffff;
}

/* ==========================================================================
   [슬림 브릿지 바] 시작 등급 ➔ 최종 목표 등급 + 하단 화이트 기준가 도킹 바 (시안 1)
   ========================================================================== */
.grade-bridge-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 180;
}

.grade-bridge-container {
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.grade-bridge-bar {
  width: 100%;
  background: #181c26;
  border: 1px solid #2d3343;
  border-bottom: 2px solid var(--accent-neon);
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: stretch;
  color: #ffffff;
}

.bridge-cell-wrap {
  position: relative;
  display: flex;
}

.bridge-cell-wrap:last-child {
  background: #1d222e;
}

.bridge-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  color: #e2e8f0;
  transition: background-color 0.15s ease;
}

.bridge-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
}

.bridge-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}

.bridge-chevron {
  color: var(--accent-neon);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.bridge-trigger[aria-expanded="true"] .bridge-chevron {
  transform: rotate(180deg);
}

.bridge-divider {
  background: #10131a;
  border-left: 1px solid #2b3140;
  border-right: 1px solid #2b3140;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-neon);
  font-size: 13px;
  font-weight: 900;
  user-select: none;
}

/* 하단 도킹: 다크 기준가 바 */
.grade-bridge-prices {
  width: 100%;
  background: #12161f;
  border-left: 1px solid var(--border-main);
  border-right: 1px solid var(--border-main);
  border-bottom: 1px solid var(--border-main);
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: stretch;
}

.bridge-price-cell {
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bridge-price-cell.is-target {
  background: #161b26;
}

.bridge-price-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.bridge-price-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.bridge-price-val.is-target {
  color: var(--accent-point);
}

.bridge-price-divider {
  background: #0d1017;
  border-left: 1px solid #252b39;
  border-right: 1px solid #252b39;
}

/* 스쿼드메이커 2열 뱃지 팝오버 */
.badge-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #181c26;
  border: 1.5px solid var(--accent-neon);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
  padding: 10px;
  z-index: 250;
  display: none;
  width: 150px;
}

.target-badge-popover {
  left: auto;
  right: 0;
}

.badge-popover.is-open {
  display: block;
}

.popover-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.popover-grid .fco-badge {
  width: 100%;
  height: 34px;
  font-size: 18px;
}

/* ==========================================================================
   [박스 2] 엑셀형 강화 비용 산출 계산서 테이블
   ========================================================================== */
.invoice-header {
  background: var(--bg-panel-header);
  padding: 18px 26px;
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.invoice-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.invoice-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 19px;
  background: var(--accent-point);
}

/* 계산 방식 전환 탭 (1. 정석 풀게이지 / 2. AI 최소 예산 최적화) */
.calc-mode-tabs {
  display: inline-flex;
  background: #090b0f;
  padding: 3px;
  border-radius: 4px;
  border: 1px solid var(--border-main);
  gap: 4px;
}

.calc-mode-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.calc-mode-btn:hover {
  color: var(--text-primary);
}

.calc-mode-btn.is-active {
  background: #1d2432;
  color: var(--accent-neon);
  border-color: var(--accent-neon);
  box-shadow: 0 2px 10px rgba(7, 244, 104, 0.15);
}

.calc-mode-btn .ai-sparkle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-neon);
  color: #10131a;
  font-size: 11px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.3px;
}

/* 하단 산출 유의사항 및 직접 수정 안내 배너 */
.invoice-notice-banner {
  background: #11151d;
  border-top: 1px solid var(--border-main);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.invoice-notice-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.invoice-notice-text strong {
  color: var(--text-primary);
}

.ai-mode-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 244, 104, 0.1);
  color: var(--accent-neon);
  border: 1px solid rgba(7, 244, 104, 0.35);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

.cell-slots-input {
  width: 72px;
  text-align: center;
}

.slot-tag-ai {
  color: var(--accent-point);
  font-weight: 700;
}

/* 선수 미선택 시 계산서 빈 상태(Empty State) 영역 */
.excel-table tbody tr.invoice-empty-row:hover {
  background: transparent;
}

.invoice-empty-cell {
  padding: 120px 24px !important;
  text-align: center !important;
  background: var(--bg-panel);
}

.invoice-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.invoice-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.invoice-empty-desc {
  font-size: 13.5px;
  color: var(--text-muted);
}

.excel-table-wrapper {
  overflow-x: auto;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.excel-table th {
  background: var(--bg-panel-sub);
  padding: 14px 14px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--border-main);
  white-space: nowrap;
}

.excel-table td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--border-row);
  vertical-align: top;
  white-space: nowrap;
  color: var(--text-primary);
}

.excel-table th.th-center,
.excel-table td.td-center {
  text-align: center;
}

.excel-table th.th-left,
.excel-table td.td-left {
  text-align: left;
}

.excel-table th.th-right,
.excel-table td.td-right {
  text-align: right;
}

.excel-table tbody tr:hover {
  background: rgba(128, 128, 128, 0.04);
}

.stage-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  gap: 6px;
}

.stage-cell .arrow {
  color: var(--text-muted);
  font-weight: 700;
}

.cell-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.excel-table td.td-center .cell-input-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.cell-input-wrap-center {
  align-items: center;
  justify-content: center;
}

.cell-input-wrap-attempts {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.cell-attempts-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
}

.cell-input {
  box-sizing: border-box;
  height: 32px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  padding: 5px 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  width: 120px;
  font-family: inherit;
}

.cell-input:focus {
  border-color: var(--accent-point);
}

/* 예상 시도 횟수 전용 컴팩트 인풋 */
.cell-input.cell-attempts-input {
  width: 48px;
  height: 25px;
  padding: 2px 4px;
  font-size: 13px;
  text-align: center;
  border-radius: 3px;
  -moz-appearance: textfield;
}

.cell-input.cell-attempts-input::-webkit-outer-spin-button,
.cell-input.cell-attempts-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cell-input-with-unit {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 6px;
}

.cell-input-piece,
.cell-input-protect {
  text-align: right;
  width: 110px;
}

.cell-protect-na-box {
  width: 110px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  box-sizing: border-box;
}

.badge-protect-na {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #7b889b;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  letter-spacing: -0.2px;
}

.text-muted {
  color: #5d6778 !important;
}

.cell-material-sub {
  width: 110px;
  display: flex;
  justify-content: flex-end;
}

.input-unit-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.cell-slots-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.slots-stepper-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 2px 4px;
  gap: 1px;
  transition: background-color 0.15s ease;
}

.slots-stepper-box:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* 네모칸 없이 순수 텍스트 5칸 밀착 표시 */
.cell-slots-raw-input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
  text-align: right;
  width: 24px;
  padding: 0;
  font-family: inherit;
  cursor: text;
  -moz-appearance: textfield;
}

.cell-slots-raw-input::-webkit-outer-spin-button,
.cell-slots-raw-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cell-slots-raw-input:focus {
  border-bottom: 2px solid var(--accent-point) !important;
  border-radius: 0;
}

.cell-slots-unit {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
  user-select: none;
  line-height: 1;
}

/* 마우스 호버 시 위아래 뜨는 화살표 버튼 */
.slots-stepper-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 14px;
  height: 24px;
  margin-left: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.slots-stepper-box:hover .slots-stepper-controls,
.slots-stepper-box:focus-within .slots-stepper-controls {
  opacity: 1;
  pointer-events: auto;
}

.stepper-arrow-btn {
  background: transparent;
  border: none;
  padding: 0;
  width: 14px;
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.stepper-arrow-btn:hover {
  color: var(--accent-point);
  background: rgba(255, 255, 255, 0.15);
}

.stepper-arrow-btn:active {
  transform: scale(0.85);
}

.cell-rate-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.stage-rate-val {
  font-weight: 800;
  color: var(--accent-point);
  font-size: 15.5px;
  letter-spacing: -0.2px;
}

.cell-input-sub {
  font-size: 11.5px;
  color: var(--accent-sub-bp);
  font-weight: 600;
  white-space: nowrap;
}

/* OVR 미니 칩 배지 */
.ovr-chip {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 6px;
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.35);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-point);
  letter-spacing: 0.2px;
  line-height: 1.3;
}

/* 보호비 한글 BP 서브텍스트 */
.cell-input-sub-bp {
  width: 110px;
  text-align: right;
  display: block;
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 11.5px;
  white-space: nowrap;
}

.cost-summary-val {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.stage-total-val {
  font-weight: 800;
  color: var(--accent-point);
  font-size: 15.5px;
  letter-spacing: -0.2px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

/* 최종 누적 합계 바 */
.total-summary-panel {
  background: var(--bg-total-bar);
  border-top: 2px solid var(--accent-neon);
  padding: 24px 30px;
}

.total-row-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.total-metric-box {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.total-metric-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-total-label);
}

.total-metric-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-neon);
}

/* [박스 3] 푸터 */
.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.disclaimer-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  padding: 16px 20px;
  line-height: 1.65;
  box-shadow: var(--panel-shadow);
}

.disclaimer-box p {
  font-size: 12px;
  color: var(--text-secondary);
}

.disclaimer-box strong {
  color: var(--text-primary);
}

/* 반응형 */
@media (max-width: 768px) {
  .fco-topbar {
    padding: 12px 16px;
  }

  .bridge-trigger {
    padding: 10px 14px;
  }
}
