/* =========================================================
   팀메이커 · MainContent.css
   메인 화면 전용: 본문 레이아웃, 카드, 친구, 목록,
   새 경매방 만들기 팝업
   (색상 변수는 base.css에 있음)
   ========================================================= */

/* ---------- 레이아웃 ---------- */
.layout {
  flex: 1; display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start;
  padding-top: 32px; padding-bottom: 32px;
}
.side-nav { flex: 1 1 180px; max-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px;
  border-radius: var(--radius-sm); color: var(--chip-text); text-decoration: none;
  font-family: var(--font-title); font-size: 21px; font-weight: 900; letter-spacing: -0.3px;
}
.nav-item img { width: 24px; height: 24px; }
.nav-item:hover { background: var(--chip); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

.page-head h1 { margin: 0 0 6px; font-family: var(--font-title); font-size: 30px; font-weight: 900; letter-spacing: -0.5px; }
.page-head p { margin: 0; font-size: 15px; color: var(--text-2); }

/* ---------- 카드 ---------- */
.card-row { display: flex; flex-wrap: wrap; gap: 16px; }
.card-row.align-start { align-items: flex-start; }
.card {
  min-width: 0; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.card-rooms { flex: 2 1 440px; padding: 24px; }
.card-friends { flex: 1 1 300px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.rooms-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.rooms-top > div { flex: 1 1 260px; min-width: 0; }
.rooms-top .card-desc { margin-top: 6px; }
.card-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--chip); color: var(--chip-text);
}
.card-icon.is-accent { background: var(--accent-soft); color: var(--accent); }
.card-title { margin: 0; font-size: 19px; font-weight: 700; }
.card-title-sm { margin: 0; font-size: 17px; font-weight: 700; }
.card-desc { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.6; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head-left { display: flex; align-items: center; gap: 8px; }

/* ---------- 목록 (경매방 · 지난 경매) ---------- */
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--divider); }
.list-main { flex: 1 1 220px; min-width: 0; }
.list-title { font-size: 15px; font-weight: 600; }
.list-sub { margin-top: 2px; font-size: 13px; color: var(--text-3); }
.status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--chip-text); }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--wait-dot); }   /* 대기 중 = 노랑 */
.status.is-busy::before { background: var(--play); }                                                     /* 진행 중 = 초록 */
.empty-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 16px; border-top: 1px solid var(--divider);
}
.empty-row p { margin: 0; font-size: 14px; color: var(--text-2); }

/* ---------- 친구 카드 ---------- */
.friend-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.friend-head-left { display: flex; align-items: center; gap: 8px; }
.my-uid b { color: var(--text); font-weight: 600; }
.sub-title { padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--chip-text); }
.request-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding: 10px 12px;
  border-radius: var(--radius-md); background: var(--accent-soft);
}
.request-row .avatar { background: var(--surface); }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--divider); }
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-sub { font-size: 12px; color: var(--text-3); }
.friend-scroll { max-height: 260px; overflow-y: auto; padding-right: 4px; }

/* =========================================================
   새 경매방 만들기 팝업
   ========================================================= */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px;
}
.modal {
  width: 100%; max-width: 820px; max-height: calc(100vh - 112px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: 20px;
}
/* 위 · 아래는 고정, 가운데만 스크롤 */
.modal-head {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--divider);
}
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.modal-sm { max-width: 400px; }
/* 다른 팝업 위에 뜨는 작은 팝업 (입력 확인) */
.modal-backdrop.is-top { z-index: 55; align-items: center; }
.modal-foot.is-end { justify-content: flex-end; }
.check-list { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.check-list li { position: relative; padding: 10px 12px 10px 30px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.5; }
.check-list li::before { content: '!'; position: absolute; left: 11px; top: 10px; width: 14px; text-align: center; font-weight: 700; color: var(--danger, #e5484d); }
.check-list b { font-weight: 700; }
.login-body { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 24px 24px; }
.login-body img { border-radius: 16px; }
.login-reason { margin: 0; font-size: 16px; font-weight: 600; text-align: center; }
.google-btn { min-height: 44px; display: flex; justify-content: center; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 24px; }
.modal-foot {
  flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--divider); background: var(--surface-2);
}

.m-section { display: flex; flex-direction: column; gap: 14px; padding: 18px 0; }
.m-section + .m-section { border-top: 1px solid var(--divider); }
.m-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--accent); }
.host-info { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius-md); background: var(--surface-2); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.char-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.char-count.is-full { color: var(--accent); font-weight: 700; }
/* 100자가 한 번에 보이도록 넓게, 줄바꿈 없이 자동 줄넘김 */
.intro-box { width: 100%; min-height: 64px; padding: 10px 12px; line-height: 1.5; resize: none; overflow: hidden; font: inherit; }
.lol-box { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--input-border); }
select.input.is-error { border-color: var(--danger); }
.riot-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.riot-name { font-size: 15px; font-weight: 700; }
.riot-tag { margin-left: 2px; font-weight: 500; color: var(--text-3); }
.riot-tiers { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.riot-tiers b { margin-right: 4px; color: var(--text); font-weight: 600; }
.riot-champs { display: flex; flex-wrap: wrap; gap: 6px; }
.champ { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--chip); font-size: 12px; color: var(--chip-text); }
.champ img { width: 24px; height: 24px; border-radius: 50%; }
.input.is-readonly { background: var(--input-disabled); color: var(--text-2); }
.m-title-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.unit { font-size: 14px; color: var(--text-2); }

/* 팀 수 */
.stepper { display: flex; align-items: center; width: fit-content; border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { width: 44px; height: 42px; border: 0; background: var(--surface); font-size: 18px; }
.stepper button:hover { background: var(--chip); }
.stepper button:disabled { color: var(--text-3); cursor: not-allowed; }
.stepper span { min-width: 44px; text-align: center; font-size: 15px; font-weight: 600; }

/* 팀장 */
.leader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; }
/* 로그인한 방장: 팀장을 미리 고를 수 있어서 한 줄에 2팀 */
.leader-grid.is-member { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 320px; }
.leader-grid.is-member .leader-hint { display: none; }
.leader-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-2); }
.leader-label { flex-shrink: 0; width: 40px; font-size: 14px; font-weight: 700; color: var(--accent); }
.leader-row .dd { flex: 1; }
.leader-row .dd-btn { min-height: 42px; padding: 0 10px; border-radius: 10px; font-size: 14px; background: var(--surface); }
.leader-hint { flex: 1; font-size: 13px; color: var(--text-3); text-align: right; }
.leader-row .bonus { width: 64px; min-height: 40px; padding: 0 8px; border-radius: 8px; font-size: 14px; text-align: right; background: var(--surface); }

/* 매몰 방지 스위치 */
.switch { position: relative; flex-shrink: 0; width: 40px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: var(--offline); }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left 0.15s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] span { left: 19px; }

/* 매몰 방지 설명: 아이콘 오른쪽에 표시 */
.tip { position: relative; display: inline-flex; }
.tip-btn {
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-3); display: flex; align-items: center; justify-content: center; cursor: help;
}
.tip-box {
  display: none; position: absolute; top: 50%; left: 34px; transform: translateY(-50%); z-index: 5;
  width: 280px; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--tooltip-bg); color: var(--tooltip-text); font-size: 13px; line-height: 1.6;
}
.tip-box b { display: block; margin-bottom: 4px; }
.tip-ex { display: block; margin-top: 6px; color: var(--tooltip-sub); }
.tip:hover .tip-box, .tip:focus-within .tip-box { display: block; }
/* 위쪽에 뜨는 설명 상자 (경매 화면처럼 오른쪽 자리가 좁을 때) */
.tip.is-up .tip-box { top: auto; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(280px, calc(100vw - 32px)); text-align: left; font-weight: 400; }

.bid-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); }
.bid-chip { padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }

/* 참여자: 왼쪽 초대 보낸 사람 / 오른쪽 초대하기 */
.invite-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
#lolInviteNote { flex: 1 1 100%; margin: 0; }
.invite-sent { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.invite-box { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px; border: 1px solid var(--border); }
.friend-pick { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--divider); }
.scroll-list { max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.scroll-list-sm { max-height: 232px; gap: 8px; }
.sent-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.sent-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sent-warn { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--danger); }   /* 롤 방: 템플릿 정보 없음 */
.sent-row .btn-reject { flex-shrink: 0; min-height: 30px; padding: 0 10px; font-size: 13px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border); }

/* 빈 상태 */
.empty-box { flex: 1; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.empty-box .empty-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--text-3); display: flex; align-items: center; justify-content: center; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--chip-text); }
.empty-friends .card-icon img { width: 24px; height: 24px; }
.empty-friends { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 16px; border-radius: var(--radius-md); border: 1px dashed var(--input-border); text-align: center; }
/* 친구 0명 안내 이미지: 이미지가 준비되면 <img class="empty-img">로 바꾸면 됨 */
.empty-img {
  width: 112px; height: 112px; border-radius: 16px; object-fit: contain;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px dashed var(--input-border); font-size: 12px; color: var(--text-3);
}

/* 더미 */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dummy-chip { max-width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border-radius: 999px; background: var(--chip); font-size: 13px; }
.dummy-chip .tag { font-size: 11px; font-weight: 700; color: var(--chip-text); }
.dummy-chip .desc { color: var(--text-3); }
.dummy-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); display: flex; align-items: center; justify-content: center; transition: color .15s, background .15s; }
.dummy-chip button:hover, .dummy-chip button:focus-visible { background: var(--danger-soft); color: var(--danger-hover); }   /* 더미 삭제(X): 호버하면 빨강 */

/* ---------- 모바일 ---------- */
@media (max-width: 767px) {
  .layout { gap: 16px; padding-top: 16px; }
  .side-nav { max-width: none; flex-direction: row; }
  .nav-item { font-size: 18px; min-height: 44px; }
  .rooms-top .btn { width: 100%; }
  .leader-grid, .leader-grid.is-member { grid-template-columns: minmax(0, 1fr); }
  .modal-backdrop { padding: 16px 8px; }
  .modal { max-height: calc(100vh - 32px); }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .tip-box { top: 30px; left: auto; right: 0; transform: none; width: min(280px, 80vw); }
}
.riot-name { overflow-wrap: anywhere; }   /* 긴 롤 닉네임도 칸 밖으로 안 나가게 */

/* 팀 구성 안내: 마지막 줄이 입력칸 아래 선과 같은 높이 */
.team-hint { align-self: flex-end; margin: 0 0 -3px; line-height: 1.6; }   /* 줄 간격만큼 내려서 글자 아래가 입력칸 아래 선에 맞게 */
.confirm-body { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-2); word-break: keep-all; white-space: pre-line; }
.icon-btn-spacer { flex-shrink: 0; width: 36px; }

/* ---------- 문의하기 팝업 ---------- */
.modal-md { max-width: 560px; }
.inquiry-body { display: flex; flex-direction: column; gap: 18px; padding-top: 20px; }
.inq-kinds { margin: 0; padding: 0; border: 0; min-width: 0; }
.inq-kinds legend { padding: 0; margin-bottom: 8px; }
.kind-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-radius: var(--radius-md); }
.kind-group.is-error .kind-option { border-color: var(--danger); }
.kind-option {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input-bg);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.kind-option:hover { border-color: var(--text-3); }
.kind-option input { position: absolute; opacity: 0; pointer-events: none; }
.kind-name { font-size: 15px; font-weight: 700; }
.kind-desc { font-size: 12px; color: var(--text-3); line-height: 1.4; word-break: keep-all; }
.kind-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.kind-option:has(input:checked) .kind-name { color: var(--accent); }
.kind-option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.inq-textarea { min-height: 180px; padding: 12px; line-height: 1.6; resize: vertical; font: inherit; }
.hint-inline.is-required { color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  .kind-group { grid-template-columns: minmax(0, 1fr); }
  .kind-option { flex-direction: row; align-items: baseline; gap: 10px; }
}

/* 친구: 거절은 호버하면 빨강, 수락은 조금 진하게 */
.btn-reject { transition: color .15s, background .15s, border-color .15s; }
.btn-reject:hover:not(:disabled), .btn-reject:focus-visible { background: var(--danger-soft); border-color: var(--danger-hover); color: var(--danger-hover); }
.btn-accept { transition: filter .15s; }
.btn-accept:hover:not(:disabled) { filter: brightness(0.92); }
.friend-row .icon-btn.is-danger { flex-shrink: 0; margin-left: auto; }

/* 방 만들기: 친구 그룹으로 한 번에 초대 */
.group-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.group-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent); font-size: 12px; font-weight: 700; }
.group-chip b { font-weight: 600; color: var(--text-3); }
.group-chip:hover:not(:disabled) { background: var(--accent-soft); }
.group-chip:disabled { border-color: var(--border); color: var(--text-3); cursor: default; }
.link-plain { color: var(--accent); font-weight: 600; text-decoration: none; }
.link-plain:hover { text-decoration: underline; }
