/* 도스커뮤니티 통일 팔레트.
   마크업은 그대로 두고 토큰만 도스 값으로 맞춰 전체 인상을 통일한다.
   값 출처는 assets/dos/dos.css — 바꿀 때 양쪽을 같이 손봐야 한다. */
:root {
  --bg: #0B0E13;
  --card: #121620;
  --text: #E6E9EF;
  --muted: #8894A8;
  --accent: #F04A2E;   /* 탈리 레드 — 사이트 전체 단일 액센트 */
  --accent2: #3FB68B;  /* 성공 */
  --danger: #C9392A;   /* 파괴적 동작 — 액센트와 구분되도록 더 어둡게 */
  --border: #262E3C;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F2F3F6;
    --card: #FFFFFF;
    --text: #131722;
    --muted: #5C6779;
    --accent: #D3341A;
    --accent2: #1F8A63;
    --danger: #A82A1D;
    --border: #D8DCE4;
  }
}

* { box-sizing: border-box; }
html { color-scheme: dark light; }
body {
  margin: 0;
  font-family: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
               "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wf-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.wf-header { border-bottom: 1px solid var(--border); background: var(--card-2); }
.wf-header__row { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.wf-logo { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.wf-nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.wf-main { flex: 1; padding: 1.5rem 0 2rem; }

.wf-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}
.wf-hero h1 { font-size: 1.75rem; margin: 0 0 0.75rem; }
.wf-hero p { color: var(--muted); max-width: 36rem; margin: 0 auto 1.5rem; line-height: 1.6; }

.wf-btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}
.wf-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.wf-btn--danger { background: #7f1d1d; border-color: var(--danger); color: #fecaca; }

.wf-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.wf-card--profile {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem 1.25rem;
  align-items: center;
}
.wf-profile-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}
.wf-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--card-2);
}
.wf-profile-avatar--placeholder {
  display: block;
  background: linear-gradient(145deg, var(--border), var(--card));
}
.wf-profile-head__main { min-width: 0; flex: 1; }
.wf-profile-head__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  line-height: 1.25;
}
.wf-profile-sooplines {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0;
}
.wf-profile-statlist {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.88rem;
}
.wf-profile-statlist__item { margin: 0; color: var(--muted); }
.wf-profile-statlist__label { color: var(--muted); margin-right: 0.2rem; }
.wf-profile-statlist__item strong { color: var(--text); font-weight: 600; }
@media (max-width: 720px) {
  .wf-card--profile { grid-template-columns: 1fr; }
  .wf-profile-grade,
  .wf-profile-actions { justify-self: start; }
}

.wf-profile-meta { color: var(--muted); font-size: 0.9rem; }
.wf-profile-meta strong { color: var(--text); }

.wf-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.wf-tab {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.wf-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
a.wf-tab {
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
  cursor: pointer;
}
a.wf-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.wf-btn--sm {
  padding: 0.32rem 0.6rem;
  font-size: 0.85rem;
}

.wf-mgr-reject {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  max-width: 14rem;
}
.wf-mgr-reject__ta {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
}

.wf-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.wf-table th, .wf-table td { border-bottom: 1px solid var(--border); padding: 0.5rem 0.35rem; text-align: left; }
.wf-table th { color: var(--muted); font-weight: 500; }
.wf-table--compact th,
.wf-table--compact td { padding: 0.4rem 0.45rem; font-size: 0.88rem; }

.wf-rewards-usage-filters__row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 36rem;
}
.wf-rewards-usage-filters__label {
  font-size: 0.9rem;
  color: var(--muted);
}
.wf-rewards-usage-filters__input {
  width: 100%;
  max-width: 24rem;
}
.wf-rewards-usage-filters__select {
  max-width: 32rem;
}
.wf-rewards-usage-filters {
  min-width: 0;
}
@media (min-width: 560px) {
  .wf-rewards-usage-filters__row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    max-width: 44rem;
  }
  .wf-rewards-usage-filters__label {
    flex: 0 0 auto;
    min-width: 5.5rem;
    margin: 0;
  }
  .wf-rewards-usage-filters__input,
  .wf-rewards-usage-filters__select {
    flex: 1 1 14rem;
    min-width: 0;
    max-width: none;
  }
}

.wf-rewards-usage-table-wrap {
  min-width: 0;
}
.wf-table--rewards-usage td,
.wf-table--rewards-usage th {
  vertical-align: top;
}
.wf-table--rewards-usage .wf-ru-date {
  white-space: nowrap;
  min-width: 9.25rem;
}
.wf-table--rewards-usage .wf-ru-soop {
  white-space: nowrap;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-table--rewards-usage .wf-ru-reward {
  min-width: 5rem;
  max-width: 18rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.wf-table--rewards-usage .wf-ru-user {
  min-width: 6rem;
  max-width: 18rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.wf-table--rewards-usage .wf-ru-num {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.wf-ru-grade {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  vertical-align: baseline;
}

/* 스트리머 대시보드 보유 테이블 · 모달 검색 결과: 긴 라벨 줄바꿈·정렬 */
.wf-table.wf-table--click .wf-ru-user {
  min-width: 5.5rem;
  max-width: 16rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.wf-table.wf-table--click .wf-ru-soop {
  white-space: nowrap;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-table.wf-table--click .wf-ru-reward {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 14rem;
}
.wf-table.wf-table--click .wf-ru-num {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wf-modal-viewer-pick {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}
.wf-modal-viewer-pick__legend {
  padding: 0 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.wf-modal-viewer-pick__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 12rem;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  margin-top: 0.2rem;
}
.wf-modal-viewer-pick__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  cursor: pointer;
  line-height: 1.45;
  min-width: 0;
}
.wf-modal-viewer-pick__item input[type="radio"] {
  margin-top: 0.2rem;
}
.wf-modal-viewer-pick__text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wf-grant-bulk-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  min-width: 0;
}
.wf-grant-bulk-upload-row input[type="file"] {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 100%;
  font-size: 0.9rem;
}
.wf-grant-bulk-errlist {
  margin: 0;
  padding-left: 1.2rem;
  max-height: 14rem;
  overflow: auto;
  line-height: 1.45;
}
.wf-grant-bulk-errlist li {
  margin: 0.2rem 0;
}

.wf-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
}
.wf-pagination__info { margin: 0; }

.wf-footer { border-top: 1px solid var(--border); padding: 1.25rem 0; margin-top: auto; background: var(--card-2); }
.wf-donation { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.5rem; line-height: 1.65; }
.wf-footer__company, .wf-footer__credit, .wf-footer__contact { display: block; }
.wf-copy { color: var(--muted); font-size: 0.8rem; margin: 0; }

.wf-form label { display: block; margin: 0.5rem 0 0.2rem; font-size: 0.9rem; color: var(--muted); }
.wf-form input, .wf-form textarea, .wf-form select {
  width: 100%; max-width: 32rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.wf-alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.wf-alert--ok { background: #14532d; border: 1px solid #166534; }
.wf-alert--err { background: #7f1d1d; border: 1px solid #991b1b; }

.wf-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 50; }
.wf-modal.is-open { display: flex; }
.wf-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.wf-modal__panel {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: min(640px, 94vw);
  max-height: 85vh;
  overflow: auto;
  padding: 1rem 1.25rem;
  width: 100%;
}
.wf-modal__close {
  position: absolute; right: 0.5rem; top: 0.35rem;
  border: none; background: transparent; color: var(--muted);
  font-size: 1.5rem; cursor: pointer;
}
.wf-modal__body { margin-top: 0.5rem; }

/* 모달: 시청자 검색 입력 */
.wf-modal-search-label {
  display: block;
  margin: 0 0 0.25rem;
}
.wf-modal-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}
.wf-modal-search-input {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 24rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
}
.wf-modal-search-input::placeholder {
  color: var(--muted);
  opacity: 1;
}
.wf-modal-search-input:hover {
  border-color: var(--border-strong);
}
.wf-modal-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.22);
}

/* 모달: 리워드 선택·수량 (교환 / 리워드 변경 / 행 상세) */
.wf-modal-form-block {
  margin-top: 1rem;
}
.wf-modal-field {
  margin-top: 0.75rem;
}
.wf-modal-field:first-child {
  margin-top: 0;
}
.wf-modal-field-label {
  display: block;
  margin: 0 0 0.35rem;
}
.wf-modal-select {
  display: block;
  width: 100%;
  max-width: 32rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
  cursor: pointer;
}
.wf-modal-select:hover {
  border-color: var(--border-strong);
}
.wf-modal-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.22);
}
.wf-modal-qty-input {
  width: 6.5rem;
  max-width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.35;
}
.wf-modal-qty-input--sm {
  width: 5rem;
}
.wf-modal-qty-input--xs {
  width: 4rem;
}
.wf-modal-qty-input:hover {
  border-color: var(--border-strong);
}
.wf-modal-qty-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.22);
}
.wf-modal-qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.35rem;
}
.wf-modal-qty-row--inline {
  margin-top: 0;
  gap: 0.4rem 0.6rem;
}

.wf-row-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* 스트리머 대시보드: 리워드별 세로 막대(이름 가로 나열) + 가로 스크롤 */
.wf-vbar-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}
.wf-vbar-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.65rem;
  min-height: 11.5rem;
  padding: 0.25rem 0.15rem 0;
  width: max-content;
}
.wf-vbar-col {
  flex: 0 0 4.75rem;
  width: 4.75rem;
  min-width: 4.75rem;
  max-width: 5.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.wf-vbar-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.2;
}
.wf-vbar-track {
  width: 100%;
  height: 8.5rem;
  border-radius: 6px 6px 2px 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.wf-vbar-fill {
  width: 100%;
  min-height: 0;
  border-radius: 4px 4px 0 0;
}
.wf-vbar-label {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  line-height: 1.25;
  color: var(--muted);
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

/* 리워드 총합 리스트: 최대 약 5행 높이 후 세로 스크롤 */
.wf-list-balance-scroll {
  max-width: 100%;
  overflow: hidden;
}
.wf-list-balance-scroll .wf-list-balance {
  max-height: calc(2.55rem * 5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.wf-list-balance__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.wf-list-balance__title {
  color: var(--muted);
  min-width: 0;
  flex: 1;
}
.wf-list-balance__num {
  color: var(--text);
  flex-shrink: 0;
}

.wf-table--click tbody tr.wf-row-viewer { cursor: pointer; }
.wf-table--click tbody tr.wf-row-viewer:hover { background: rgba(61, 139, 253, 0.08); }

/* 스트리머 관리(index): 페이지 가운데 정렬 */
.wf-streamer-manage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.wf-streamer-manage__title {
  margin: 0 0 0.35rem;
  text-align: center;
  width: 100%;
  max-width: 42rem;
}
.wf-streamer-manage__lead {
  margin: 0 0 1rem;
  text-align: center;
  width: 100%;
  max-width: 42rem;
}

/* 스트리머 관리(index): 메뉴 카드 */
.wf-streamer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 42rem;
}
.wf-streamer-nav__card {
  display: block;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.wf-streamer-nav__card:hover {
  border-color: var(--border-strong);
  background: var(--card-2);
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.wf-streamer-nav__card--primary {
  border-color: rgba(61, 139, 253, 0.45);
  background: linear-gradient(145deg, #1a2740 0%, var(--card) 100%);
}
.wf-streamer-nav__card--primary:hover {
  border-color: var(--accent);
}
.wf-streamer-nav__title {
  display: block;
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
}
.wf-streamer-nav__card--primary .wf-streamer-nav__title {
  color: #7eb8ff;
}
.wf-streamer-nav__desc {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.wf-section-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
  margin: 2rem 0 0.5rem;
}
.wf-section-head__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
}
.wf-section-head__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  margin-left: auto;
}
@media (max-width: 520px) {
  .wf-section-head {
    flex-wrap: wrap;
  }
  .wf-section-head__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}
