/**
 * 리치 테마 6 — 포인트 전환(헤더) + 포인트 전환·내역 모달
 * index_6 / casino_6 / slot_6 등 modal.html 을 쓰는 페이지에서 로드
 */

/*
 * #systemModals 는 rich6-board.css 에서 modal-content / modal-body 를 밝은 배경으로 고정함.
 * 포인트 모달은 어두운 팔레트 + 밝은 글자용 스타일이라, 밝은 배경이면 글자가 묻힘 → 이 블록으로 덮어씀.
 */
#systemModals #rewardModal.rich6-reward-modal .modal-content.rich6-reward-content,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-content.rich6-reward-history-content {
  border: 1px solid rgba(16, 170, 165, 0.38) !important;
  border-radius: 1.1rem !important;
  background: linear-gradient(165deg, #0f2324 0%, #0a1819 42%, #060e0f 100%) !important;
  color: #e8f4f3 !important;
  box-shadow: 0 18px 48px rgba(8, 52, 50, 0.38) !important;
  min-height: 0 !important;
}

#systemModals #rewardModal.rich6-reward-modal .modal-body.rich6-reward-body,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-body.rich6-reward-history-body {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: linear-gradient(180deg, rgba(8, 40, 38, 0.45) 0%, rgba(6, 18, 18, 0.28) 100%) !important;
  color: #e8f4f3 !important;
  max-height: min(76vh, 720px) !important;
}

#systemModals #rewardModal.rich6-reward-modal .modal-header.rich6-reward-header,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-header.rich6-reward-history-header {
  background: linear-gradient(90deg, rgba(22, 120, 118, 0.62) 0%, rgba(12, 70, 68, 0.42) 100%) !important;
  border-bottom: 1px solid rgba(100, 210, 200, 0.28) !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  text-align: left !important;
  padding: 1.15rem 1.25rem !important;
  margin-bottom: 0 !important;
}

#systemModals #rewardModal.rich6-reward-modal .modal-header .rich6-reward-title,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-header .rich6-reward-title,
#systemModals #rewardModal.rich6-reward-modal .modal-header .modal-title,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-header .modal-title {
  color: #f6fffe !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
}

#systemModals #rewardModal.rich6-reward-modal .rich6-reward-lead,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .rich6-reward-lead {
  color: rgba(232, 254, 252, 0.9) !important;
}

#systemModals #rewardModal.rich6-reward-modal .modal-header .btn-close,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-header .btn-close {
  position: relative !important;
  right: auto !important;
  top: auto !important;
  filter: invert(1) grayscale(1) brightness(1.15) !important;
  background-color: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  opacity: 0.95 !important;
}

#systemModals #rewardModal.rich6-reward-modal .modal-header .btn-close:hover,
#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-header .btn-close:hover {
  background-color: rgba(255, 255, 255, 0.22) !important;
  opacity: 1 !important;
}

#systemModals #rewardHistoryModal.rich6-reward-history-modal .modal-footer.rich6-reward-history-footer {
  margin: 0 !important;
  border-radius: 0 0 1rem 1rem !important;
  border-top: 1px solid rgba(80, 170, 160, 0.25) !important;
  background: rgba(0, 0, 0, 0.22) !important;
}

/* ---------- 헤더: 메시지 옆 포인트 전환 ---------- */
.header-main .rich6-auth-comp.rich6-point-exchange-btn {
  min-height: 2rem;
  border-radius: 999px !important;
  padding: 0.34rem 0.85rem !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(180deg, #e8f7a8 0%, #c8e860 100%) !important;
  color: #1e3a1a !important;
  border: 1px solid rgba(60, 90, 30, 0.35) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.header-main .rich6-auth-comp.rich6-point-exchange-btn i {
  font-size: 1rem;
  color: #2d5016;
}

.header-main .rich6-point-exchange-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
}

@media (max-width: 1199.98px) {
  .header-main .rich6-point-exchange-label {
    display: none;
  }
  .header-main .rich6-auth-comp.rich6-point-exchange-btn {
    padding: 0.34rem 0.62rem !important;
    min-width: 2.4rem;
    justify-content: center;
  }
}

.rich6-reward-modal .rich6-reward-dialog,
.rich6-reward-history-modal .rich6-reward-history-dialog {
  max-width: min(520px, calc(100vw - 1.5rem));
}

.rich6-reward-history-modal .rich6-reward-history-dialog {
  max-width: min(720px, calc(100vw - 1.5rem));
}

.rich6-reward-content,
.rich6-reward-history-content {
  border: 1px solid rgba(16, 170, 165, 0.28) !important;
  border-radius: 1.1rem !important;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(8, 52, 50, 0.35) !important;
  background: linear-gradient(165deg, #0f2324 0%, #0a1819 42%, #060e0f 100%) !important;
  color: #e8f4f3;
}

.rich6-reward-header,
.rich6-reward-history-header {
  background: linear-gradient(90deg, rgba(22, 120, 118, 0.55) 0%, rgba(12, 70, 68, 0.35) 100%) !important;
  padding: 1.15rem 1.25rem !important;
}

.rich6-reward-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding-right: 0.5rem;
}

.rich6-reward-icon-wrap {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(52, 211, 206, 0.35) 0%, rgba(18, 130, 126, 0.45) 100%);
  border: 1px solid rgba(120, 230, 225, 0.35);
  color: #bffffc;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.rich6-reward-icon-wrap .bi {
  line-height: 1;
}

.rich6-reward-icon-wrap.history {
  background: linear-gradient(145deg, rgba(120, 180, 255, 0.25) 0%, rgba(60, 100, 200, 0.35) 100%);
  border-color: rgba(160, 200, 255, 0.35);
  color: #cfe4ff;
}

.rich6-reward-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: #f2fffe !important;
}

.rich6-reward-lead {
  font-size: 0.78rem !important;
  line-height: 1.45 !important;
  color: rgba(220, 245, 243, 0.72) !important;
  margin-top: 0.28rem !important;
  max-width: 26rem;
}

.rich6-reward-body,
.rich6-reward-history-body {
  background: linear-gradient(180deg, rgba(8, 40, 38, 0.35) 0%, rgba(6, 18, 18, 0.2) 100%) !important;
  padding: 0.25rem 1.15rem 1.2rem !important;
}

.rich6-reward-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(120, 215, 210, 0.18);
  border-radius: 0.95rem;
  padding: 1rem 1.1rem;
}

.rich6-reward-panel.rich6-reward-balance-flow {
  padding: 1rem 1rem 1.05rem;
}

.rich6-reward-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(200, 238, 235, 0.92);
}

.rich6-reward-label.muted {
  color: rgba(180, 220, 217, 0.65);
}

.rich6-reward-amount .rich6-reward-num {
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.rich6-reward-unit {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(168, 230, 225, 0.85);
  margin-left: 0.15rem;
}

.rich6-reward-flow-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(160, 220, 216, 0.65);
  margin-bottom: 0.65rem;
  text-align: center;
}

.rich6-flow-kicker {
  font-size: 0.72rem;
  color: rgba(180, 220, 218, 0.55);
  margin-bottom: 0.2rem;
}

.rich6-flow-kicker.accent {
  color: rgba(120, 255, 230, 0.75);
}

.rich6-flow-value {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f4fffd;
}

.rich6-flow-value.accent {
  color: #9fffd9;
}

.rich6-reward-arrow {
  color: rgba(110, 210, 200, 0.65);
  font-size: 1.5rem;
  line-height: 1;
}

.rich6-reward-btn-primary {
  border-radius: 999px !important;
  padding: 0.62rem 1.25rem !important;
  font-weight: 800 !important;
  font-size: 0.88rem !important;
  border: none !important;
  background: linear-gradient(180deg, #2ee6c8 0%, #1aa89a 100%) !important;
  color: #05201c !important;
  box-shadow: 0 6px 20px rgba(30, 200, 180, 0.28);
}

.rich6-reward-btn-primary:hover {
  filter: brightness(1.06);
  color: #021512 !important;
}

.rich6-reward-btn-secondary {
  border-radius: 999px !important;
  padding: 0.62rem 1.15rem !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  background: transparent !important;
  border: 1px solid rgba(140, 220, 214, 0.45) !important;
  color: rgba(220, 252, 248, 0.95) !important;
}

.rich6-reward-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
}

.rich6-reward-history-body {
  padding-top: 0.5rem !important;
}

.rich6-reward-table-wrap {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(100, 200, 190, 0.2);
  border-radius: 0.85rem;
  padding: 0.5rem;
  overflow: hidden;
}

#rewardHistory.rich6-reward-dt.dataTable {
  margin-bottom: 0 !important;
}

#rewardHistory.rich6-reward-dt thead th {
  background: rgba(22, 100, 96, 0.55) !important;
  color: #e8fffc !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border-bottom: 1px solid rgba(100, 210, 200, 0.25) !important;
  padding: 0.65rem 0.5rem !important;
}

#rewardHistory.rich6-reward-dt tbody td {
  background: transparent !important;
  color: rgba(235, 252, 250, 0.95) !important;
  font-size: 0.82rem !important;
  border-color: rgba(80, 160, 155, 0.15) !important;
  padding: 0.55rem 0.5rem !important;
}

#rewardHistory.rich6-reward-dt tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02) !important;
}

#rewardHistory.rich6-reward-dt tbody tr:hover td {
  background: rgba(60, 200, 185, 0.12) !important;
}

.rich6-reward-history-footer {
  padding: 0.85rem 1.15rem 1.15rem !important;
  background: rgba(0, 0, 0, 0.15) !important;
}

.rich6-reward-footer-btn {
  border-radius: 999px !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  padding: 0.55rem 1.15rem !important;
}

.rich6-reward-footer-btn.ghost {
  background: transparent !important;
  border: 1px solid rgba(160, 225, 218, 0.4) !important;
  color: rgba(230, 252, 249, 0.95) !important;
}

.rich6-reward-footer-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.rich6-reward-footer-btn.primary {
  border: none !important;
  background: linear-gradient(180deg, #34d2b8 0%, #1a8f82 100%) !important;
  color: #031a17 !important;
}

.rich6-reward-footer-btn.primary:hover {
  filter: brightness(1.05);
}

@media (max-width: 575.98px) {
  .rich6-reward-history-footer .rich6-reward-footer-btn {
    width: 100%;
  }
}
