/* 대회 리스트 페이지 */
#contents {
    overflow-x: hidden;
    padding-bottom: 0 !important;
}

/* 모바일 전용 컨테이너 (PC에서는 숨김) */
.tournament_mobile_container {
    display: none;
}

.tournament_mobile_wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* PC 전용 컨테이너 */
.tournament_container {
    background: transparent;
    overflow-x: hidden;
    width: 100%;
}

.tournament_wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem 6rem 2rem;
    background: var(--white);
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* 탭 영역 */
.tournament_tabs_wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.tournament_tabs {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
}

.tournament_tabs::-webkit-scrollbar {
    display: none;
}

.tournament_tab {
    padding: 1rem 2rem;
    border: none;
    background: #A7C8FF;
    border-radius: 9rem;
    font-size: 1.5rem;
    line-height: 2.2rem;
    color: var(--white);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.tournament_tab:hover {
    background: #A7C8FF;
}

.tournament_tab.active {
    background: #0601FF;
    color: var(--white);
    border: none;
    font-weight: 600;
}

/* 필터 영역 (드롭다운) */
.filter_area {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter_select {
    padding: 0 1.6rem;
    border: 1px solid #ddd;
    border-radius: 0.6rem;
    background: var(--white);
    font-size: 1.5rem;
    line-height: 4.4rem;
    color: #444;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 9L9.29289 12.2929C9.68342 12.6834 10.3166 12.6834 10.7071 12.2929L14 9' stroke='%23797979' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 4rem;
    min-width: 18rem;
    height: 4.4rem;
    box-sizing: border-box;
}

.filter_select:focus {
    outline: none;
    border-color: #0601FF;
}

.year_select {
    /* 연도 셀렉트 특별 스타일 */
}

.status_select {
    /* 진행상태 셀렉트 특별 스타일 */
}

/* 검색 및 카운트 영역 */
.search_count_area {
    margin-bottom: 2rem;
}

.tournament_count {
    font-size: 1.5rem;
    line-height: 2rem;
    color: var(--font-black);
    font-weight: 400;
}

.tournament_count strong {
    font-weight: 700;
    color: #F8AD40;
}

/* 리스트 헤더 (PC만) */
.list_header {
    display: grid;
    grid-template-columns: 3fr 0.8fr 1.5fr 1.5fr 0.8fr 1.5fr;
    gap: 1rem;
    padding: 1.2rem 2rem;
    background: var(--white);
    border-bottom: 1px solid var(--black);
    border-top: 1px solid var(--black);
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 5rem;
    text-align: center;
}

.list_header div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 대회 리스트 */
.tournament_list {
    width: 100%;
}

.tournament_item {
    display: grid;
    grid-template-columns: 3fr 0.8fr 1.5fr 1.5fr 0.8fr 1.5fr;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    align-items: center;
    font-size: 1.5rem;
    line-height: 1.8rem;
    text-align: center;
}

.tournament_item:hover {
    background: #f9f9f9;
}

.tournament_item > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tournament_name {
    text-align: left;
}

.tournament_name a,
.tournament_name_text {
    color: #444;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
    display: inline-flex;
    align-items: center;
}

.tournament_name .external_link_icon {
    display: inline-block;
    margin-left: 0.4rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.tournament_name a:hover {
    color: #0601FF;
}

.tournament_status.ongoing {
    color: #2364cf;
}

.tournament_status.scheduled {
    color: #444;
}

.tournament_status.ended {
    color: #444;
}

/* 로딩 스피너 */
.loading_spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}

.spinner {
    width: 4rem;
    height: 4rem;
    border: 0.4rem solid #f3f3f3;
    border-top: 0.4rem solid #0601FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 모바일 스타일 */
@media screen and (max-width: 1023px) {
    .tournament_container,
    .tournament_container.page_container,
    .tournament_wrapper {
        display: none !important;
    }

    .tournament_mobile_container {
        display: block;
        width: 100%;
    }

    .tournament_mobile_wrapper {
        padding: 0;
        background: var(--white);
    }

    .tournament_tabs_wrapper {
        padding: 0;
        margin-bottom: 2rem;
    }

    .tournament_tabs {
        gap: 1.2rem;
        padding: 0 3rem;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tournament_tab {
        padding: 1.4rem 2.8rem;
        font-size: 2.8rem;
        line-height: 3rem;
        border-radius: 3.6757rem;
    }

    .filter_area {
        flex-direction: row;
        gap: 1.2rem;
        margin-bottom: 2rem;
        padding: 0 3rem;
        box-sizing: border-box;
        width: 100%;
    }

    .filter_select {
        flex: 1;
        padding: 0 2rem;
        font-size: 2.8rem;
        line-height: 7rem;
        height: 7rem;
        border-radius: 1rem;
        border-width: 2px;
        min-width: auto;
        padding-right: 5rem;
        box-sizing: border-box;
    }

    .search_count_area {
        padding: 1.5rem 3rem;
        margin-bottom: 2rem;
    }

    .tournament_count {
        font-size: 3rem;
        line-height: 3.6rem;
    }

    .tournament_list {
        display: flex;
        flex-direction: column;
        gap: 2.6rem;
        padding: 0 3rem 4rem 3rem;
    }

    .tournament_item_mobile {
        background: var(--white);
        border: 1px solid #ddd;
        border-radius: 0;
        padding: 2.4rem 4rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .tournament_name_mobile {
        font-weight: 700;
        font-size: 3rem;
        line-height: 4rem;
        color: var(--black);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tournament_name_mobile a {
        color: var(--black);
        text-decoration: none;
    }

    .tournament_info_row {
        display: flex;
        align-items: center;
        gap: 2rem;
        font-size: 3rem;
        line-height: 3.6rem;
        color: #444;
    }

    .tournament_info_row:not(:last-child) {
        border-bottom: 1px solid #ddd;
        padding-bottom: 2rem;
    }

    .tournament_status_mobile.ongoing {
        color: #2364cf;
    }

    .load_more_btn {
        width: 100%;
        padding: 2rem;
        margin: 2rem auto 4rem auto;
        background: transparent;
        border: none;
        font-size: 2.6rem;
        line-height: 3rem;
        color: #797979;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.8rem;
    }

    .load_more_btn:hover {
        color: #0601FF;
    }
}