@charset "utf-8";

/* 항상 스크롤바 공간 확보 */
body {
    overflow-y: scroll !important;
}

/* Bootstrap 모달 열릴 때 생기는 padding 제거 */
body.modal-open {
    padding-right: 0 !important;
}

/* 공통 레이아웃 / 헤더  */
.header-row {
    background-color: var(--bs-secondary-bg);
}

/* 카드 스타일 */
.match-card {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(var(--bs-body-color-rgb), .08);
    transition: transform 0.2s, background-color 0.2s;
}

.match-card:hover {
    background-color: var(--bs-secondary-bg);
}

/* 라이트모드 hover 보정 */
[data-bs-theme="light"] .match-card:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* 팀 / 점수 영역 */
.emblem {
    width: 55px;
    height: 55px;
    object-fit: contain;
}

/* 카테고리 / 배지 */
.category-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 5px;
    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    border: 1px solid var(--bs-border-color);
}

/* 선택지 / 결과 표시 */
.selection-row {
    border-radius: 0;
    transition: all 0.2s;
}

/* 승리팀 강조 */
.selection-winner {
    color: #0d6efd !important;
}

[data-bs-theme="dark"] .selection-winner {
    color: #6ea8fe !important;
}

/* 기본 선택지 */
.selection-default {
    color: var(--bs-secondary-color) !important;
}

/* 카테고리 */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bs-body-bg);
}

.filter-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 5px;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border-right: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color 0.2s;
    flex: 0 0 25%;
}

/* PC 8칸 */
@media (min-width: 992px) {
    .filter-item {
        flex: 0 0 12.5%;
        border-bottom: none;
    }
    .filter-item:nth-child(8n) {
        border-right: none;
    }
}

/* 모바일 4칸 */
@media (max-width: 991.98px) {
    .filter-item:nth-child(4n) {
        border-right: none;
    }
    .filter-item:nth-last-child(-n+4) {
        border-bottom: none;
    }
}

.filter-item:hover {
    background-color: var(--bs-tertiary-bg);
}

.filter-item.active {
    background-color: var(--bs-primary);
    color: #fff !important;
    font-weight: bold;
}

/* 날짜 필터  */
.date-filter-container {
    display: flex;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bs-body-bg);
}

.date-item {
    flex: 1;
    padding: 10px 5px;
    text-align: center;
    text-decoration: none;
    color: var(--bs-body-color);
    border-right: 1px solid var(--bs-border-color);
    transition: background-color 0.2s;
}

.date-item:last-child {
    border-right: none;
}

.date-item:hover {
    background-color: var(--bs-tertiary-bg);
}

.date-item.active {
    background-color: #0d6efd !important;
    color: #fff !important;
    font-weight: bold;
}

.date-item small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
}

/* 폼 / 버튼 */
.card-footer {
    border-top: 1px solid rgba(0, 0, 0, .05);
}

/* 팀 선택 박스 */
.cursor-pointer {
    cursor: pointer !important;
}

/* 랭킹 모달 (sticky header) */
#modal_ranking .sticky-top {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] #modal_ranking .sticky-top {
    background-color: #2b3035;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 가이드 모달 */
#modal_guide .modal-dialog {
    margin: 10px;
    max-width: none;
}

@media (min-width: 576px) {
    #modal_guide .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
}

@media (min-width: 992px) {
    #modal_guide .modal-dialog {
        max-width: 700px;
    }
}

/* 공통 알림 모달 */
.custom-alert-dialog {
    margin: 1rem;
    max-width: none;
}

@media (min-width: 576px) {
    .custom-alert-dialog {
        max-width: 400px;
        margin: 1.75rem auto;
    }
}

#modal_common_alert .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#modal_common_alert .modal-footer .btn {
    font-weight: bold;
    border: none;
}

[data-bs-theme="dark"] #modal_common_alert .modal-content {
    background-color: #2b3035;
    color: #fff;
}

/* 각 게임 중간 레이아웃 */
.match-body {
	padding: 10px;
	display: grid;
	grid-template-columns: 1fr minmax(120px, auto) 1fr;
	align-items: stretch;
	gap: 8px;
	text-align: center;
}

/* Box (공통) */
.team,
.draw-box {
	padding: 10px 6px !important;
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow: hidden;
	position: relative;
}

.team input,
.draw-box input {
	margin-top: 4px;
}

.team {
	background: transparent;
	justify-content: space-between;
}

.team-img {
	width: 50px;
	height: 50px;
	object-fit: contain;
	flex-shrink: 0;
}

.team-img-modal {
	width: 30px;
	height: 30px;
	object-fit: contain;
	flex-shrink: 0;
}

.team-name {
	width: 100%;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.draw-box {
	min-width: 150px;
	justify-content: center;
	text-align: center;
	gap: 4px;
}

.draw-box .score {
	width: 100%;
	background: color-mix(
		in srgb,
		var(--bs-secondary-bg) 50%,
		transparent
	);
	padding: 10px;
	border-radius: 10px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	font-weight: 800;
	white-space: nowrap;
}

.draw-box .draw-text {
	font-size: .8rem;
	color: var(--bs-secondary-color);
}

.draw-top {
	margin-top: 5px;
}

.percent {
	font-size: .8rem;
	color: var(--bs-secondary-color);
}

.score .sep {
	margin: 0 4px;
	opacity: .5;
}

/* 팀 선택 박스  */
.team:has(input:checked) {
	background: rgba(13,110,253,.08);
	box-shadow: inset 0 0 0 2px #0d6efd;
}

.draw-box:has(input:checked) {
	background: rgba(13,110,253,.12);
	box-shadow: inset 0 0 0 2px #0d6efd;
}

/* 남은 시간  */
.remain-time {
	color: #ff0000;
	font-size: 0.7rem;
}

/* 모바일 */
@media (max-width: 576px) {
	.match-body {
		grid-template-columns: 1fr 90px 1fr;
	}

	.draw-box {
		min-width: 0;
		width: 90px;
	}

	.draw-box .score {
		font-size: 1rem;
	}

	.team-name {
		font-size: 0.9rem;
		font-weight: 500;
		line-height: 1;
	}

	.draw-text {
		font-size: 0.9rem;
	}
}

.emblem-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    	background: color-mix(
		in srgb,
		var(--bs-secondary-bg) 50%,
		transparent
	);
    border-radius: 10px;
	color: rgba(var(--bs-secondary-color-rgb), .2);
    font-size: 1.2rem;
	font-weight: 700;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    box-sizing: border-box;
}


.filter-item-admin {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 5px;
    font-size: 0.85rem;
    color: var(--bs-body-color);
    text-decoration: none;
    border-right: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color 0.2s;
    flex: 0 0 20%;
}

.filter-item-admin:nth-child(5n) {
    border-right: none;
}

.filter-item-admin:hover {
    background-color: var(--bs-tertiary-bg);
}

.filter-item-admin.active {
    background-color: var(--bs-primary);
    color: #fff !important;
    font-weight: bold;
}
