/* /var/www/maple-app/css/style.css - 전역 레이아웃 및 3단 네비게이션, 타이머 대시보드 스타일 */
:root {
  --bg-main: #14161d;
  --bg-card: #1e222d;
  --bg-header: #101217;
  --border-color: #2e3444;
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --primary: #f0883e;
  --primary-hover: #ff9854;
  --accent: #58a6ff;
  --danger: #f85149;
  --success: #238636;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
}

/* ==========================================================================
   1. 상단 네비게이션 헤더 (보스 계산기 / 종합표 / 재획 타이머 3단 메뉴)
   ========================================================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-left { display: flex; align-items: center; gap: 24px; }
.nav-left h2 { font-size: 1.25rem; white-space: nowrap; color: var(--primary); }
/* 기능 설명: 네비게이션 상단 브랜드 로고 이미지와 타이틀 텍스트를 정렬하는 스타일 */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  white-space: nowrap;
  color: var(--primary);
  margin: 0;
}

.nav-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}
.nav-link:hover { color: var(--text-main); background-color: #1a1e27; }
.nav-link.active {
  color: #fff;
  background-color: #21262d;
  border: 1px solid #30363d;
}

/* 메인 컨테이너 */
.container { max-width: 1240px; margin: 24px auto; padding: 0 16px; }

/* ==========================================================================
   2. 재획 타이머 전용 페이지 (/timer) 카드 그리드 스타일
   ========================================================================== */
.timer-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: var(--bg-card);
  padding: 18px 24px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.timer-page-header h2 { font-size: 1.4rem; font-weight: 700; }

.timer-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* 대형 타이머 카드 */
.timer-hero-card {
  background: #171b24;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px 20px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}
.timer-hero-card:hover {
  border-color: #48546a;
  background: #1c212c;
  transform: translateY(-2px);
}

/* 동작 중 하이라이트 */
.timer-hero-card.running {
  border-color: var(--primary);
  background: #1f232d;
  box-shadow: 0 0 14px rgba(240, 136, 62, 0.25);
}
.timer-hero-card.running .hero-time {
  color: #ffc107;
}

/* 종료 시 깜빡임 경고 */
.timer-hero-card.ended {
  border-color: var(--danger);
  animation: pulse-alert 0.8s infinite alternate;
}
@keyframes pulse-alert {
  from { box-shadow: 0 0 6px var(--danger); }
  to { box-shadow: 0 0 20px var(--danger); }
}

.hero-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}
.hero-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.badge-rune { background: rgba(240, 136, 62, 0.2); color: var(--primary); }
.badge-union { background: rgba(88, 166, 255, 0.2); color: var(--accent); }
.badge-half { background: rgba(46, 160, 67, 0.2); color: #3fb950; }
.badge-two { background: rgba(163, 113, 247, 0.2); color: #bc8cff; }

.hero-reset-btn {
  background: #252b37;
  border: 1px solid #374052;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.hero-reset-btn:hover { color: #fff; background: #323b4c; }

.hero-time {
  font-size: 2.8rem;
  font-weight: 900;
  font-family: Consolas, monospace;
  margin: 12px 0 4px 0;
  color: #e6edf3;
  letter-spacing: 1px;
}
.hero-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.timer-hero-card.running .hero-status {
  color: #3fb950;
  font-weight: 600;
}

.hero-progress {
  width: 100%;
  height: 6px;
  background: #252b38;
  border-radius: 3px;
  overflow: hidden;
}
.hero-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--primary);
  transition: width 1s linear;
}
.hero-progress-bar.bar-union { background: var(--accent); }

/* 유니온 제어 액션 카드 */
.timer-action-card {
  background: var(--bg-card);
  border: 1px dashed #3e4759;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.timer-action-card h3 { font-size: 1.15rem; margin-bottom: 6px; color: var(--accent); }
.timer-action-card p { font-size: 0.85rem; margin-bottom: 16px; }

/* ==========================================================================
   타이머 전용 추가 스타일 (아이콘, 핀 버튼, PIP, 자유 타이머, 하단 유니온 바)
   ========================================================================== */
/* 기능 설명: 알람음 설정 영역을 라벨(위)과 셀렉트박스(아래) 세로 2단 구조로 정렬하고 우측 버튼들과 높이를 일치시키는 스타일 */
/* 기능 설명: 알람음 드롭다운과 2개 버튼의 높이(40px), 패딩, 폰트 규격을 동일하게 일치시키고 수평 일직선으로 정렬하는 스타일 */
.timer-header-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 셀렉트 박스: 높이 40px, 라운드 8px */
.sound-select-group select {
  height: 40px;
  background: #171b24;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  min-width: 220px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s ease;
}

.sound-select-group select:focus,
.sound-select-group select:hover {
  border-color: var(--primary);
}

/* 우측 사운드 테스트 및 PIP 모드 버튼: 높이 40px, 폰트/라운드 동일 통일 */
.timer-header-btns .btn-sound-test,
.timer-header-btns .btn-pip {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
}

.timer-header-btns .btn-sound-test {
  background: #252b37;
  border: 1px solid #374052;
  color: var(--text-main);
  transition: all 0.2s ease;
}
.timer-header-btns .btn-sound-test:hover {
  background: #323b4c;
  color: #fff;
}

.timer-header-btns .btn-pip {
  background: linear-gradient(135deg, #1f6feb, #238636);
  color: #fff;
  border: none;
  transition: opacity 0.2s ease;
}
.timer-header-btns .btn-pip:hover {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .timer-header-btns {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }
  .sound-select-group {
    width: 100%;
    justify-content: space-between;
  }
  .sound-select-group select {
    width: 68%;
    min-width: unset;
  }
  .timer-header-btns .btn-sound-test,
  .timer-header-btns .btn-pip {
    width: 100%;
  }
}

.btn-pip {
  background: linear-gradient(135deg, #1f6feb, #238636);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-pip:hover { opacity: 0.9; }

.badge-icon {
  margin-right: 5px;
  font-size: 0.95rem;
  vertical-align: middle;
}

.badge-custom {
  background: rgba(240, 136, 62, 0.2);
  color: #ff9854;
}

.hero-top-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hero-pin-btn {
  background: #252b37;
  border: 1px solid #374052;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.hero-pin-btn:hover {
  color: #fff;
  background: #323b4c;
}
.hero-pin-btn.pinned {
  background: #f0883e;
  border-color: #f0883e;
  color: #101217;
  font-weight: 800;
}

.hero-progress-bar.bar-custom {
  background: #ff9854;
}

/* 자유 타이머 분/초 설정 컨트롤 */
.custom-timer-ctrls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.custom-timer-ctrls input {
  width: 52px;
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 4px;
  padding: 3px 6px;
  text-align: center;
}

/* 하단으로 이동한 유니온 동시 가동 바 */
.union-bottom-bar {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.union-bar-info h3 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 4px;
}
.btn-large {
  padding: 12px 24px;
  font-size: 1rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .union-bottom-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* 기능 설명: PIP 버튼, 타이머별 아이콘 뱃지, 자유 타이머 입력 컨트롤 및 3열 일치형 유니온 바 스타일 */
.timer-header-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-pip {
  background: linear-gradient(135deg, #1f6feb, #238636);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-pip:hover { opacity: 0.9; }

.badge-icon {
  margin-right: 5px;
  font-size: 0.95rem;
}

.badge-custom {
  background: rgba(240, 136, 62, 0.2);
  color: #ff9854;
}

.hero-progress-bar.bar-custom {
  background: #ff9854;
}

/* 자유 타이머 분/초 컨트롤 */
.custom-timer-ctrls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.custom-timer-ctrls input {
  width: 52px;
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 4px;
  padding: 4px 6px;
  text-align: center;
}
.ctrl-unit { font-weight: 600; }
.btn-custom-set {
  background: #252b37;
  border: 1px solid #374052;
  color: #e6edf3;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-custom-set:hover {
  background: #3a4457;
  color: #fff;
}

/* [요청 1 반영]: 위 3개 컬럼 전체 폭(100%)을 채우는 전용 카드 */
.union-sync-full-card {
  grid-column: 1 / -1; /* 위쪽 3열 가로 폭과 완벽 일치 */
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.union-sync-info h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 4px;
}
.union-sync-info p {
  font-size: 0.88rem;
}
.btn-union-sync {
  padding: 13px 26px;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .union-sync-full-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* 기능 설명: 타이머 대시보드 제목 및 뱃지 아이콘의 픽셀 선명도와 수직 정렬을 보정하는 스타일 */
.title-icon {
  width: 26px;
  height: 26px;
  vertical-align: -4px;
  margin-right: 8px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.badge-icon-img {
  width: 17px;
  height: 17px;
  vertical-align: -2px;
  margin-right: 5px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ==========================================================================
   3. 보스 계산기 (메인) & 종합표 (/record) 공통 스타일
   ========================================================================== */
.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #1f2737, #191e2b);
  border: 1px solid var(--border-color);
  padding: 18px 24px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.grand-profit { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.summary-actions { display: flex; gap: 8px; align-items: center; }

.add-char-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.input-group { display: flex; gap: 10px; width: 45%; }
.input-group input, .modal-input-group input, .record-form-grid input, select {
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  width: 100%;
}
.api-status-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #161b22;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #30363d;
}

/* 캐릭터 보스 카드 */
.cards-grid { display: flex; flex-direction: column; gap: 16px; }
.character-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}
.char-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: #171b24;
  border-bottom: 1px solid var(--border-color);
}
.char-profit { font-weight: 700; color: var(--accent); margin-right: 12px; }
.char-ocid { font-size: 0.75rem; color: var(--text-muted); }

.boss-table { width: 100%; border-collapse: collapse; text-align: left; }
.boss-table th, .boss-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #232834;
  vertical-align: middle;
  white-space: nowrap;
}
.boss-table tr.cleared { background-color: rgba(35, 134, 54, 0.12); }
.th-clear, .td-clear { text-align: center; width: 95px; min-width: 95px; }
.party-select { width: 75px; text-align: center; }
.price-cell { font-weight: 600; color: #e6edf3; }

/* 종합표 통계 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
}
.mb-4 { margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 8px;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-value { font-size: 1.35rem; font-weight: 700; margin-top: 6px; }
.stat-value.highlight { color: var(--accent); }
.total-card { border-color: var(--primary); background: linear-gradient(135deg, #232836, #1e222d); }

/* 기능 설명: 종합표 통계 카드의 수익 텍스트와 게임 아이콘을 정렬하고 도트 이미지를 선명하게 보정하는 스타일 */
.stat-value-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.stat-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  /* 메이플 고유 도트 이미지가 깨지거나 뭉개지지 않도록 픽셀 선명도 유지 */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.stat-card .stat-value {
  margin-top: 0; /* 컨테이너 정렬에 맞춰 기존 상단 여백 제거 */
}

.boss-history-list { list-style: none; margin-top: 12px; }
.boss-week-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #232834;
}
.badge-profit { color: var(--primary); font-weight: 700; font-size: 1.05rem; }

.record-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 120px;
  gap: 12px;
  margin-top: 16px;
  align-items: flex-end;
}
.record-form-grid label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.form-btn-wrapper button { height: 38px; }
.w-100 { width: 100%; }

/* 버튼 */
button { cursor: pointer; border: none; border-radius: 6px; font-weight: 600; }
.btn-primary { background: var(--primary); color: #fff; padding: 9px 16px; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #30363d; color: var(--text-main); padding: 9px 17px; }
.btn-outline { background: transparent; border: 1px solid #58a6ff; color: #58a6ff; padding: 9px 15px; }
.btn-outline:hover { background: rgba(88, 166, 255, 0.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { font-size: 0.8rem; padding: 5px 10px; }

/* 모달 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: #1b1f28;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
}
.modal-desc { font-size: 0.85rem; color: var(--text-muted); margin: 8px 0 16px 0; }
.modal-status-text { font-size: 0.8rem; margin: 8px 0 18px 0; color: var(--accent); }
.modal-actions { display: flex; justify-content: space-between; align-items: center; }
.modal-right-btns { display: flex; gap: 8px; }

@media (max-width: 900px) {
  .timer-page-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .record-form-grid { grid-template-columns: 1fr; }
}

/* 기능 설명: 제목 아이콘과 글자 사이의 간격을 밀착(4px)시키고 글자 높이에 맞게 자동 조절하는 스타일 */
.section-title,
.card-title {
  display: flex;
  align-items: center;
  gap: 5px; /* 이미지와 글자 사이 간격을 자연스럽게 밀착 */
  margin-bottom: 16px;
}

.heading-icon {
  height: 1.2em; /* 글자 크기(font-size)에 맞춰 자동 비례 */
  width: auto;
  margin-right: 0; /* 이중 여백 방지를 위해 마진 제거 */
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  flex-shrink: 0;
}

/* ==========================================================================
   사냥 상세 기록 테이블 전용 열(Column) 완벽 정렬 스타일
   ========================================================================== */
/* 기능 설명: 수동 기록 폼(3열+버튼) 및 조각 실시간 시세 설정 카드 레이아웃 스타일 */
.record-form-3col {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.5fr 1fr;
  gap: 12px;
  align-items: flex-end;
}

.piece-price-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 480px;
  margin-top: 10px;
}

.piece-price-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.piece-price-input-wrap label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.piece-price-input-wrap input {
  background: #0d1117;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.piece-price-form .btn-primary {
  height: 42px;
  padding: 0 22px;
  white-space: nowrap;
}

/* ==========================================================================
   사냥 상세 기록 4열(날짜, 메소 수익, 조각 수량, 관리) 최적화 정렬
   ========================================================================== */
.record-table {
  width: 100%;
  border-collapse: collapse;
}

.record-table th,
.record-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

/* 1열: 날짜 (중앙 정렬) */
.record-table th:nth-child(1),
.record-table td:nth-child(1) {
  text-align: center;
  width: 160px;
}

/* 2열: 메소 수익 (우측 정렬 - 숫자와 헤더 라인 일치) */
.record-table th:nth-child(2),
.record-table td:nth-child(2) {
  text-align: right;
  padding-right: 32px;
}

/* 3열: 조각 수량 (중앙 정렬) */
.record-table th:nth-child(3),
.record-table td:nth-child(3) {
  text-align: center;
  width: 180px;
}

/* 4열: 관리 (중앙 정렬) */
.record-table th:nth-child(4),
.record-table td:nth-child(4) {
  text-align: center;
  width: 100px;
}

@media (max-width: 768px) {
  .record-form-3col {
    grid-template-columns: 1fr;
  }
  .piece-price-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
}

/* ==========================================================================
   5. [모바일 전용 UI]: m.도메인 및 768px 이하 스마트폰 최적화
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. 상단 네비게이션: 2열 구성 및 가로 스크롤 탭 */
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    gap: 8px;
  }
  .nav-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .nav-links {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 6px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-link {
    font-size: 0.82rem;
    padding: 6px 10px;
    flex-shrink: 0;
  }

  /* 2. 본문 컨테이너 여백 축소 */
  .container {
    padding: 0 10px;
    margin: 14px auto;
  }

  /* 3. 요약 바 세로 배치 */
  .summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }
  .grand-profit {
    font-size: 1.5rem;
  }
  .summary-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .summary-actions #btn-refresh-boss {
    grid-column: span 2; /* 갱신 버튼은 하단 전체 너비 */
  }

  /* 4. 캐릭터 등록 폼 세로 정렬 */
  .add-char-section {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .input-group {
    width: 100%;
  }
  .api-status-tag {
    text-align: center;
  }

  /* 5. 보스 테이블 가로 터치 스크롤 지원 */
  .char-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .boss-table th, .boss-table td {
    padding: 8px 6px;
    font-size: 0.8rem;
  }
  .boss-table select {
    padding: 4px 6px;
    font-size: 0.78rem;
  }
  .party-select {
    width: 58px;
  }

  /* 6. 종합표(/record) 대시보드 및 입력 폼 */
  .stats-grid {
    grid-template-columns: 1fr; /* 1열로 보기 쉽게 정렬 */
    gap: 10px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-value {
    font-size: 1.2rem;
  }
  .record-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .form-btn-wrapper button {
    width: 100%;
    margin-top: 4px;
  }

  /* 7. 재획 타이머(/timer) 전용 모바일 레이아웃 */
  .timer-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }
  .timer-page-grid {
    grid-template-columns: 1fr; /* 스마트폰에서는 1열 대형 카드 */
    gap: 14px;
  }
  .timer-hero-card {
    min-height: 150px;
    padding: 18px 14px;
  }
  .hero-time {
    font-size: 2.3rem; /* 모바일 폭에 맞춘 폰트 축소 */
  }
}

/* 기능 설명: 보스 계산기 목록 테이블 내 보스 아이콘의 픽셀 선명도와 수평 정렬을 제어하는 스타일 */
.boss-name-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.boss-icon-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated; /* 메이플 도트 뭉개짐 방지 */
  flex-shrink: 0;
  border-radius: 3px;
}

/* ==========================================================================
   보스 계산기: 난이도 뱃지 체크박스 및 파티원 +- 스텝퍼 UI 스타일
   ========================================================================== */
.diff-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.diff-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

/* 커스텀 체크박스 */
.diff-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid #4a5263;
  border-radius: 4px;
  background: #12151d;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  display: inline-grid;
  place-content: center;
  margin: 0;
}

.diff-checkbox:checked {
  background: #1f6feb;
  border-color: #388bfd;
}

.diff-checkbox:checked::before {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}

/* 난이도 공통 알약 뱃지 */
.diff-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.25;
  text-align: center;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.diff-btn-label:hover .diff-pill {
  filter: brightness(1.15);
}

/* 5대 난이도별 전용 색상 테마 */
.diff-pill-easy {
  background: #383e4c;
  color: #e2e8f0;
  border: 1px solid #4c5364;
}

.diff-pill-normal {
  background: #18a39b;
  color: #ffffff;
  border: 1px solid transparent;
}

.diff-pill-hard {
  background: #d63384;
  color: #ffffff;
  border: 1px solid transparent;
}

.diff-pill-chaos {
  background: #252018;
  color: #ffb703;
  border: 1px solid #f59e0b;
}

.diff-pill-extreme {
  background: #3d1b22;
  color: #f87171;
  border: 1px solid #ef4444;
}

/* 파티원 (+ -) 스텝퍼 컨테이너 */
.party-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: #181c26;
  border: 1px solid #333a4a;
  border-radius: 9999px;
  width: 84px;
  height: 27px;
  padding: 0 4px;
  box-sizing: border-box;
  user-select: none;
}

.btn-step {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-step:hover {
  color: #ffffff;
}

.party-num {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  min-width: 16px;
  text-align: center;
}

/* 기능 설명: 넥슨 Open API 이용약관 준수 배지 및 법적 고지 푸터 영역 전용 스타일 */
.site-footer {
  margin-top: 60px;
  padding: 40px 20px 50px;
  background: #0d1017;
  border-top: 1px solid #21262d;
  color: #8b949e;
  font-size: 0.82rem;
  line-height: 1.6;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

/* 넥슨 Open API 알약 배지 */
.nexon-api-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #161b22;
  border: 1px solid #30363d;
  padding: 7px 18px;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.82rem;
  color: #c9d1d9;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.nexon-api-badge:hover {
  background: #1c212c;
  border-color: #58a6ff;
  transform: translateY(-1px);
}

.nexon-brand {
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.nexon-open-api {
  font-weight: 900;
  color: #0084ff; /* 넥슨 오픈 API 고유 블루 컬러 */
  letter-spacing: 0.3px;
}

/* 법적 면책 조항 및 라이선스 안내 */
.footer-disclaimer {
  max-width: 820px;
}

.footer-disclaimer p {
  margin: 4px 0;
  word-break: keep-all;
}

.footer-links {
  display: flex;
  gap: 18px;
  margin-bottom: 4px;
}

.footer-links a {
  color: #c9d1d9;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-copyright {
  color: #484f58;
  font-size: 0.78rem;
  margin-top: 6px;
}