/* 정보·순위 탭 캡션 오른쪽 끝의 레이팅 제외/반영 토글 버튼.
   대회 예정(tourney_upcoming)·대회 결과(tourney_result) 한국어·다국어 4개 페이지가 공유한다.
   캡션 줄은 흰 배경이므로 밝은 배경 기준 색을 쓴다. */

/* 캡션(.round-title)과 버튼을 한 줄에 두는 래퍼. 순위 탭은 카테고리 필터가 있는
   .ftd-player-category-heading 을 이미 flex 로 쓰므로 그쪽은 버튼만 끝에 붙인다. */
.tourney-caption-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tourney-caption-row > .round-title {
    flex: 0 1 auto;
    min-width: 0;
}

.tourney-caption-row > .tourney-rating-policy-button {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    top: 0;
}

/* 순위 캡션은 .round-title 의 margin-right:auto 가 이미 오른쪽으로 밀어준다.
   여기서 또 margin-left:auto 를 주면 auto 여백이 둘로 나뉘어 필터가 가운데로 간다. */
.ftd-player-category-heading > .tourney-rating-policy-button {
    flex: 0 0 auto;
    margin: 0;
    top: 0;
}
.tourney-rating-policy-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 0 10px;
    padding: 2px 10px;
    border: 1px solid #d3d8e0;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: -0.01em;
    white-space: nowrap;
    vertical-align: middle;
    position: relative;
    top: -1px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

/* 현재 상태 표시등 — 초록: 레이팅 반영 중, 회색: 미반영. 글자는 "누르면 무엇이 되는지"(동작)라
   상태는 색으로만 알린다. 미반영은 경고가 아니라 분류이므로 온라인 '연습' 배지와 같은 중립 회색. */
.tourney-rating-policy-button::before {
    content: '';
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tourney-rating-policy-button.is-excluded {
    border-color: #dcdfe4;
    background: #eef0f3;
    color: #4b5563;
}

.tourney-rating-policy-button.is-excluded::before {
    background: #9ca3af;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}

.tourney-rating-policy-button:hover:not(:disabled) {
    border-color: #b6bcc6;
    background: #f3f4f6;
}

.tourney-rating-policy-button.is-excluded:hover:not(:disabled) {
    border-color: #b6bcc6;
    background: #e5e7eb;
}

.tourney-rating-policy-button:focus-visible {
    outline: 2px solid #6f9bff;
    outline-offset: 2px;
}

.tourney-rating-policy-button:disabled {
    opacity: 0.55;
    cursor: default;
}

/* 정책 조회 전(비활성)·전환 처리 중에는 표시등을 회색으로 둬서 확정 상태처럼 보이지 않게 한다. */
.tourney-rating-policy-button:disabled::before {
    background: #c8ccd3;
    box-shadow: none;
}

.tourney-rating-policy-button[aria-busy="true"] {
    cursor: progress;
}

/* 앱 다크 테마(html.fs-app-theme-dark)에서는 정보줄 배경이 어두우므로 칩도 어둡게. */
html.fs-app-theme-dark .tourney-rating-policy-button {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
}

html.fs-app-theme-dark .tourney-rating-policy-button.is-excluded {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.13);
    color: #d1d5db;
}

html.fs-app-theme-dark .tourney-rating-policy-button:hover:not(:disabled),
html.fs-app-theme-dark .tourney-rating-policy-button.is-excluded:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 480px) {
    .tourney-rating-policy-button {
        gap: 4px;
        margin-left: 8px;
        padding: 2px 8px;
        font-size: 11px;
    }
    .tourney-rating-policy-button::before {
        width: 5px;
        height: 5px;
    }
}
