/* ========================================
   리그전 독립 페이지 전용 스타일
   ======================================== */

/* ── 당겨서 새로고침 방지 ── */
html, body {
    overscroll-behavior-y: none;
}

/* 모달 내부는 스크롤 전파 차단만 (none이 아닌 contain) */
.modal-content,
#tournamentModal .modal-content,
#tournamentDetailModal .modal-content {
    overscroll-behavior-y: contain;
}

/* ── CSS 변수 ── */
:root {
	--primary-color:            #9C27B0;
	--primary-dark:             #7B1FA2;
	--primary-light:            #F3E5F5;
	--primary-accent:           #CE93D8;
	--primary-shadow:           rgba(156,39,176,0.35);
	--header-gradient-start:    #9C27B0;
	--header-gradient-end:      #7B1FA2;
	--btn-primary-bg:           linear-gradient(135deg,#9C27B0,#7B1FA2);
}

/* ── 테마: 오션 블루 ── */
[data-theme="ocean"] {
	--primary-color:            #0288D1;
	--primary-dark:             #01579B;
	--primary-light:            #E1F5FE;
	--primary-accent:           #81D4FA;
	--primary-shadow:           rgba(2,136,209,0.35);
	--header-gradient-start:    #0288D1;
	--header-gradient-end:      #01579B;
	--btn-primary-bg:           linear-gradient(135deg,#0288D1,#01579B);
}

/* ── 테마: 오렌지 ── */
[data-theme="orange"] {
	--primary-color:            #F57C00;
	--primary-dark:             #E65100;
	--primary-light:            #FFF3E0;
	--primary-accent:           #FFCC80;
	--primary-shadow:           rgba(245,124,0,0.35);
	--header-gradient-start:    #F57C00;
	--header-gradient-end:      #E65100;
	--btn-primary-bg:           linear-gradient(135deg,#F57C00,#E65100);
}

/* ── 테마: 에메랄드 ── */
[data-theme="emerald"] {
	--primary-color:            #00897B;
	--primary-dark:             #00695C;
	--primary-light:            #E0F2F1;
	--primary-accent:           #80CBC4;
	--primary-shadow:           rgba(0,137,123,0.35);
	--header-gradient-start:    #00897B;
	--header-gradient-end:      #00695C;
	--btn-primary-bg:           linear-gradient(135deg,#00897B,#00695C);
}

/* ── 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: auto; overflow-y: scroll; -webkit-text-size-adjust: 100%; }
body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
	background: #f5f5f5;
	min-height: 100vh;
	-webkit-overflow-scrolling: touch;
}

@keyframes slideIn {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── 헤더 ── */
.league-header {
	background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
	color: #fff;
	padding: 0 16px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
	position: sticky;
	top: 0;
	z-index: 100;
}
/* 헤더 내부 컨텐츠를 league-main과 동일한 폭으로 제한 */
.league-header-inner {
	max-width: 700px;
	margin: 0 auto;
	padding: 14px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.league-header-title { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
/* 헤더 아이콘 버튼 (로그인·설정·로그아웃) */
#leagueLoginBtn:hover,
#leagueSettingsBtn:hover {
	background: rgba(255,255,255,0.35) !important;
}
#leagueSettingsBtn:hover {
	transform: rotate(90deg);
}
#leagueLogoutBtn:hover {
	background: rgba(244,67,54,1) !important;
	transform: scale(1.1);
	box-shadow: 0 2px 8px rgba(244,67,54,0.5);
}

/* ── 모달 내 폼 공통 (새 리그전 등) ── */
.form-group { margin-bottom: 16px; }
.form-group label {
	display: block; font-size: 13px; font-weight: 700;
	color: #555; margin-bottom: 6px;
}
.form-control {
	width: 100%; padding: 10px 13px;
	border: 2px solid #e0e0e0; border-radius: 10px;
	font-size: 14px; font-family: inherit;
	outline: none; transition: border-color 0.2s; box-sizing: border-box;
}
.form-control:focus { border-color: var(--primary-color); }

/* ── 모달 내 버튼 공통 ── */
.btn {
	padding: 11px 22px; border: none; border-radius: 8px;
	cursor: pointer; font-weight: 700; font-size: 14px;
	font-family: inherit; transition: opacity 0.2s, transform 0.15s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-add       { background: var(--primary-color); color: #fff; }
.btn-secondary { background: #f0f0f0; color: #444; }

/* ── 메인 ── */
.league-main { max-width: 700px; margin: 0 auto; padding: 16px; }

/* ── 열기 버튼 ── */
.league-open-btn {
	display: block; width: 100%; padding: 18px;
	background: linear-gradient(135deg, #FF9800, #F57C00);
	color: #fff; border: none; border-radius: 14px;
	font-size: 17px; font-weight: 800; cursor: pointer; text-align: center;
	box-shadow: 0 4px 16px rgba(156,39,176,0.3);
	margin-bottom: 20px; transition: transform 0.15s, box-shadow 0.15s; font-family: inherit;
}
.league-open-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(156,39,176,0.4); }

/* ── 안내 카드 ── */
.league-info-card {
	background: #fff; border-radius: 14px; padding: 18px 16px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.08); margin-bottom: 14px;
}
.league-info-card h3 { font-size: 15px; font-weight: 800; color: var(--primary-color); margin-bottom: 10px; }
.league-info-card ul { list-style: none; }
.league-info-card ul li {
	font-size: 13px; color: #555; padding: 6px 0;
	border-bottom: 1px solid #f5f5f5;
	display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
}
.league-info-card ul li:last-child { border-bottom: none; }
.league-info-card ul li .li-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

/* ── 로그인 모달 ── */
.league-login-group { margin-bottom: 14px; }
.league-login-group label { display: block; font-size: 13px; font-weight: 700; color: #555; margin-bottom: 6px; }
.league-login-group input {
	width: 100%; padding: 11px 14px; border: 2px solid #e0e0e0;
	border-radius: 10px; font-size: 15px; outline: none;
	transition: border-color 0.2s; font-family: inherit;
}
.league-login-group input:focus { border-color: var(--primary-color); }

/* ============================================================
   리그전 회원 관리 - 회원관리와 동일한 레이아웃
============================================================ */

/* ── 섹션 타이틀 ── */
.lm-section-title {
	display: flex; align-items: center; gap: 8px;
	padding: 0 2px; margin-top: 14px; margin-bottom: 6px;
	font-size: 15px; font-weight: 800; color: #333;
}
.lm-count-badge {
	font-size: 16px; color: #fff; background: #444;
	border-radius: 20px; padding: 1px 8px; font-weight: 600;
}

/* ── 섹션 래퍼 ── */
.lm-section-wrap {
	margin-bottom: 16px; background: #f8f9fa;
	border-radius: 14px; overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ── 검색/정렬 ── */
.lm-search-section {
	padding: 14px 18px 12px;
	background: #f8f9fa;
	border-top: 2px solid #e0e0e0;
	border-bottom: 2px solid #e0e0e0;
}
.lm-search-box { display: flex; gap: 10px; margin-bottom: 10px; }
.lm-search-box input {
	flex: 1; padding: 10px 14px; border: 2px solid #e0e0e0;
	border-radius: 10px; font-size: 14px; font-family: inherit;
	outline: none; transition: border-color 0.2s;
}
.lm-search-box input:focus { border-color: var(--primary-color); }

.lm-filter-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.lm-filter-btn {
	padding: 6px 12px; border: 2px solid #e0e0e0;
	border-radius: 20px; background: white;
	font-size: 12px; font-weight: 600; cursor: pointer;
	transition: all 0.2s; font-family: inherit;
}
.lm-filter-btn.active {
	background: var(--primary-color); color: white; border-color: var(--primary-color);
}

/* ── 목록 영역 ── */
.lm-list-section { padding: 12px 6px; background: #fff; }

/* ── 빈 상태 ── */
.lm-empty-state { text-align: center; padding: 40px 0; color: #bbb; }
.lm-empty-state svg {
	width: 48px; height: 48px; margin: 0 auto 8px; display: block; opacity: 0.35;
}
.lm-empty-state p { font-size: 14px; }

/* ── 팀 그룹 헤더 ── */
.lm-team-group { margin-bottom: 8px; }
.lm-team-header {
	display: flex; align-items: center; gap: 8px;
	padding: 8px 14px; border-radius: 10px;
	margin-bottom: 8px; margin-top: 16px;
	background: var(--primary-light, #ede7f6);
}
.lm-team-group:first-child .lm-team-header { margin-top: 0; }
.lm-team-label { font-size: 15px; font-weight: 900; color: var(--primary-dark); }
.lm-team-count { font-size: 12px; color: #fff; border-radius: 20px; padding: 2px 10px; font-weight: 700; }
.lm-team-paid  { font-size: 12px; color: #2d9e5f; margin-left: auto; }

/* ── 회원 카드 (회원관리 .member-card 동일) ── */
.lm-member-card {
	background: white;
	border: 2px solid #e0e0e0;
	border-radius: 12px;
	padding: 10px;
	margin-bottom: 10px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	animation: slideIn 0.25s ease;
}

/* 카드 상단: 이름+뱃지 / 수정·삭제 */
.lm-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0;
	flex-wrap: wrap;
	gap: 6px;
}
.lm-card-name-row {
	display: flex; align-items: center; gap: 7px; flex-wrap: wrap; flex: 1; min-width: 0;
}
.lm-member-name {
	font-size: 18px; font-weight: 700; color: #333;
}
.lm-skill-badge {
	display: inline-block; padding: 3px 9px; border-radius: 12px;
	font-size: 12px; font-weight: 700;
	background: var(--primary-light); color: var(--primary-dark);
}
.lm-paid-badge-ok {
	display: inline-block; padding: 3px 9px; border-radius: 12px;
	font-size: 12px; font-weight: 700;
	background: #e6f9ee; color: #2d9e5f;
}
.lm-paid-badge-no {
	display: inline-block; padding: 3px 9px; border-radius: 12px;
	font-size: 12px; font-weight: 700;
	background: #ffeaea; color: #e05353;
}

/* 수정/삭제 버튼 (회원관리 .btn-edit/.btn-delete 동일) */
.lm-member-actions { display: flex; gap: 4px; flex-shrink: 0; }
.lm-btn-edit-card, .lm-btn-delete-card {
	padding: 5px 10px; border: none; border-radius: 6px;
	font-size: 13px; font-weight: 700; cursor: pointer; color: white;
	transition: all 0.2s; font-family: inherit;
}
.lm-btn-edit-card   { background: #2196F3; }
.lm-btn-delete-card { background: #f44336; }
.lm-btn-edit-card:hover, .lm-btn-delete-card:hover {
	transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 카드 정보 - 한 줄 정렬 */
.lm-card-info-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 6px;
	font-size: 13px;
	color: #666;
	min-height: 24px;
}
.lm-info-spacer { margin-left: auto; }
.lm-info-phone a { color: #555; text-decoration: none; }
.lm-info-phone a:hover { text-decoration: underline; }
.lm-info-gender {
	border-radius: 8px; padding: 2px 7px;
	font-size: 12px; font-weight: 700;
}
.lm-gender-m { background: #e3f2fd; color: #1565C0; }
.lm-gender-w { background: #fce4ec; color: #c2185b; }

/* 무소속 태그 */
.lm-team-none {
	background: #f0f0f0; color: #999;
	border-radius: 12px; padding: 2px 8px;
	font-size: 11px; font-weight: 600; margin-left: 4px;
}

/* 팀명 태그 (스케줄 필드처럼 구분) */
.lm-team-tag {
	display: inline-flex; align-items: center;
	border-radius: 8px; padding: 2px 5px;
	font-size: 11px;;
}

/* ── 폼 섹션 토글 (회원관리 .form-section 동일) ── */
.lm-form-section { overflow: hidden; }

.lm-form-header {
	display: flex; justify-content: space-between; align-items: center;
	padding: 16px 20px;
	background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
	color: white; cursor: pointer;
	transition: background 0.3s;
	border-top: 2px solid rgba(255,255,255,0.1);
}
.lm-form-section.mode-edit .lm-form-header {
	background: linear-gradient(135deg, #FF9800, #F57C00);
}
.lm-form-header:hover { filter: brightness(0.93); }

.lm-form-header-content { display: flex; align-items: center; gap: 12px; }
.lm-form-header-icon    { font-size: 13px; transition: transform 0.3s; }
.lm-form-header-title   { font-size: 15px; font-weight: 700; }

.lm-form-section.mode-add  .lm-form-header-title::before { content: "➕ "; }
.lm-form-section.mode-edit .lm-form-header-title::before { content: "✏️ "; }

.lm-form-body {
	padding: 20px; background: #f8f9fa;
}
.lm-form-section.collapsed .lm-form-body { display: none; }

/* ── 폼 그리드 ── */
.lm-form-grid {
	display: grid; grid-template-columns: 1fr 1fr;
	gap: 14px; margin-bottom: 14px;
}
.lm-form-group { margin-bottom: 0; }
.lm-full-width { grid-column: 1 / -1; }

.lm-form-group label {
	display: block; font-size: 13px; font-weight: 600;
	color: #555; margin-bottom: 5px;
}
.lm-form-group input,
.lm-form-group select {
	width: 100%; padding: 12px; border: 2px solid #e0e0e0;
	border-radius: 10px; font-size: 15px; font-family: inherit;
	outline: none; transition: border-color 0.2s; background: #fff;
}
.lm-form-group input:focus,
.lm-form-group select:focus { border-color: var(--primary-color); }

/* 성별 버튼 */
.lm-gender-row { display: flex; gap: 8px; }
.lm-gender-btn {
	flex: 1; padding: 11px; border: 2px solid #e0e0e0;
	border-radius: 10px; background: #fff; cursor: pointer;
	font-weight: 700; font-size: 15px; font-family: inherit;
	transition: all 0.2s; color: #555;
}
.lm-gender-btn.active {
	background: var(--primary-color); color: #fff; border-color: var(--primary-color);
}

/* 납부 체크 */
.lm-paid-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.lm-paid-row input[type="checkbox"] {
	width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary-color);
}
.lm-paid-row label { font-size: 14px; cursor: pointer; color: #444; font-weight: 500; }

/* 폼 액션 버튼 */
.lm-form-actions { display: flex; gap: 8px; }
.lm-btn-submit {
	flex: 1; padding: 13px; border: none; border-radius: 10px;
	font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
	transition: opacity 0.2s, transform 0.15s;
}
.lm-btn-submit:hover { opacity: 0.88; transform: translateY(-1px); }
.lm-btn-add  { background: linear-gradient(135deg, #4CAF50, #45a049); color: #fff; }
.lm-btn-edit-form { background: linear-gradient(135deg, #FF9800, #F57C00); color: #fff; }
.lm-btn-reset {
	padding: 13px 18px; border: none; border-radius: 10px;
	background: #e0e0e0; color: #555; font-size: 15px; font-weight: 700;
	cursor: pointer; font-family: inherit; transition: background 0.2s;
}
.lm-btn-reset:hover { background: #d0d0d0; }

/* ── 반응형 ── */
@media (max-width: 480px) {
	.league-main        { padding: 12px; }
	.league-header-title { font-size: 16px; }
	.league-open-btn    { font-size: 15px; padding: 15px; }
	.lm-form-grid       { gap: 10px; }
	.lm-member-name     { font-size: 16px; }
	.lm-btn-edit-card,
	.lm-btn-delete-card { padding: 5px 8px; font-size: 12px; }
	.lm-form-body       { padding: 16px 14px; }
}

/* ── 안내 토글 ── */
.league-info-toggle {
	margin-bottom: 14px;
}
.league-info-toggle-header {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	background: #444;
	color: #fff;
	border-radius: 20px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	transition: opacity 0.2s;
	margin-bottom: 10px;
}
.league-info-toggle-header:hover { opacity: 0.85; }
.league-info-toggle-icon {
	font-size: 11px;
	transition: transform 0.2s;
}
.league-info-toggle-body .league-info-card {
	border-radius: 0;
	box-shadow: none;
	border-top: 1px solid #f0e6ff;
	margin-bottom: 0;
}
.league-info-toggle-body .league-info-card:last-child {
	border-bottom: none;
}
/* ── 리그전 달력 ── */
.tour-calendar-wrap {
	overflow: hidden;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
	margin: 12px 0 0;
	padding: 14px 12px 10px;
	overflow: hidden;
}
.tour-cal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}
.tour-cal-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--primary-dark);
}
.tour-cal-nav {
	background: none;
	border: none;
	font-size: 22px;
	color: var(--primary-color);
	cursor: pointer;
	padding: 0 8px;
	line-height: 1;
}
.tour-cal-nav:hover { color: #6A0080; }
.tour-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 2px;
	width: 100%;
	box-sizing: border-box;
}
.tour-cal-dow {
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	color: #aaa;
	padding: 4px 0;
}
.tour-cal-dow:first-child { color: #e53935; }
.tour-cal-dow:last-child  { color: #1565C0; }
.tour-cal-day {
	position: relative;
	text-align: center;
	padding: 5px 2px 5px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	cursor: default;
	min-height: 38px;
}
.tour-cal-day.has-tour {
	cursor: pointer;
	background: var(--primary-light);
	font-weight: 700;
	color: var(--primary-dark);
}
.tour-cal-day.has-tour:hover { background: #E1BEE7; }
.tour-cal-day.today {
	background: transparent;
	border: 2px solid var(--primary-color);
	font-weight: 800;
	color: #6A0080;
}
.tour-cal-day.today.has-tour { background: transparent; border-color: var(--primary-dark); }
.tour-cal-day.other-month { color: #ccc; }
.tour-cal-day.sun { color: #e53935; }
.tour-cal-day.sat { color: #1565C0; }
.tour-cal-names {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 3px;
}
.tour-cal-name {
	display: block;
	font-size: 9px;
	font-weight: 700;
	color: var(--primary-dark);
	background: var(--primary-light);
	border-radius: 4px;
	padding: 1px 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.4;
}
.tour-cal-name.team {
	background: #222;
	color: #fff;
}

/* ── 달력 폴딩 버튼 ── */
.tour-cal-fold-wrap { margin: 10px 0 0; }
.tour-cal-fold-btn {
	width: 100%;
	padding: 10px 16px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, #4CAF50, #45a049);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: background 0.2s;
}
.tour-cal-fold-btn:hover { background: linear-gradient(135deg, #4CAF50, #45a049); }
.tour-cal-fold-btn.open { background: #4A148C; border-radius: 10px 10px 0 0; }
.tour-cal-fold-wrap .tour-calendar-wrap { border-radius: 0 0 12px 12px; margin-top: 0; }

/* ── 광고 배너 ── */
#lmAdBanner {
    margin: 8px 10px;
    padding: 10px 14px;
    background: #444;
    border-left: 4px solid #ff6600;
    border-radius: 8px;
    font-size: 14px;
	font-weight: 600;
    color: #fff;
    line-height: 1.6;
}
