/* =============================================================
   achv.me - league.css
   League list, detail, and admin page styles
   @import common.css - loaded from PHP
   ============================================================= */

/* Table (desktop) */






/* --- League Cover Image --- */
.achv-league-cover {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--achv-surface);
    border-radius: var(--achv-radius);
    overflow: hidden;
}

/* --- League Detail Header --- */
.achv-league-header {
    display: flex;
    align-items: center;
    gap: var(--achv-sp-4);
    padding: var(--achv-sp-5) 0;
}

.achv-league-header--has-cover {
    position: relative;
    padding-top: var(--achv-sp-3);
}

.achv-league-header__logo {
    width: 64px;
    height: 64px;
    border-radius: var(--achv-radius);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--achv-surface);
    border: 2px solid var(--achv-bg);
}

.achv-league-header__logo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--achv-text-muted);
    border: 2px solid var(--achv-border);
}

.achv-league-header--has-cover .achv-league-header__logo {
    border: 3px solid var(--achv-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.achv-league-header__name {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--achv-text);
}

.achv-league-header__meta {
    color: var(--achv-text-secondary);
    font-size: 14px;
    margin-top: var(--achv-sp-1);
}

/* --- League Tabs --- */
.achv-league-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    margin-bottom: var(--achv-sp-4);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 3px;
}

.achv-league-tabs::-webkit-scrollbar {
    display: none;
}

.achv-league-tabs__item {
    padding: 10px 8px;
    text-decoration: none;
    color: var(--achv-text-secondary);
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 3px solid var(--achv-border);
    transition: color 0.15s ease, border-color 0.15s ease;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 500;
}

.achv-league-tabs__item:hover {
    color: var(--achv-text);
    text-decoration: none;
}

.achv-league-tabs__item--active {
    color: var(--achv-primary);
    border-bottom-color: var(--achv-primary);
    font-weight: 600;
}

/* 모바일: overflow-x scroll 컨테이너에서 flex:1 grow 가 작동 안 하는 브라우저 보강.
   5 그룹 자연 폭 합이 viewport 안에 들어가므로 scroll 불필요 — visible 로 전환해 grow 회복 +
   item 자체도 flex 로 만들어 inner content 가운데 정렬 강제 (text-align 이 덮이는 환경 대비) */
@media (max-width: 640px) {
    .achv-league-tabs {
        overflow-x: visible;
    }
    .achv-league-tabs__item {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* --- Subtabs (2-depth, 그룹 안 sub) --- */
.achv-league-subtabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: -8px 0 var(--achv-sp-3) 0;
    padding: 4px 0;
    border-bottom: 1px solid var(--achv-border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.achv-league-subtabs::-webkit-scrollbar { display: none; }
.achv-league-subtabs__item {
    padding: 6px 14px;
    font-size: 14px;
    color: var(--achv-text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.achv-league-subtabs__item:hover {
    background: rgba(230, 2, 0, 0.06);
    color: var(--achv-text);
    text-decoration: none;
}
.achv-league-subtabs__item--active {
    color: #fff;
    background: var(--achv-primary);
    font-weight: 600;
}

/* --- 바로가기 (Issue #452) ---
   리그가 등록한 외부 주소(카페·SNS·규정 문서). 전 탭에 나온다.
   탭·서브탭과 같은 방식(밑줄·채움)으로 그리면 탭 줄이 하나 더 있는 것처럼 보여,
   테두리 칩 + 링크 색(보조 블루) + 외부 표시(↗)로 「여기서 나간다」를 읽히게 한다. */
.achv-league-links {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: -4px 0 var(--achv-sp-3) 0;
    padding: 2px 0 6px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.achv-league-links::-webkit-scrollbar {
    display: none;
}
.achv-league-links__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--achv-border);
    border-radius: 999px;
    background: var(--achv-bg);
    color: var(--achv-secondary);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
/* 아이콘이 아니라 표시다 — icon_url 컬럼은 입력·저장 경로가 없어 항상 비어 있다. */
.achv-league-links__item::after {
    content: '\2197';
    font-size: 13px;
    opacity: 0.6;
}
.achv-league-links__item:hover,
.achv-league-links__item:focus-visible {
    border-color: var(--achv-secondary);
    background: var(--achv-secondary-light);
    text-decoration: none;
}

@media (max-width: 640px) {
    /* 터치 타겟 44px */
    .achv-league-links__item {
        min-height: 44px;
    }
}

/* 기록실 3단계 — 정규시즌/플레이오프(subtabs) 아래의 항목 줄.
   서브탭과 같은 굵기로 그리면 어느 줄이 상위인지 읽히지 않아 한 단계 약하게 둔다
   (배경 대신 테두리, 활성도 채우지 않고 밑줄). */
.achv-league-itemtabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin: -4px 0 var(--achv-sp-3) 0;
    padding: 2px 0 6px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.achv-league-itemtabs::-webkit-scrollbar { display: none; }
.achv-league-itemtabs__item {
    padding: 4px 12px;
    font-size: 14px;
    color: var(--achv-text-secondary);
    text-decoration: none;
    border: 1px solid var(--achv-border);
    border-radius: 999px;
    transition: border-color 0.12s, color 0.12s;
    white-space: nowrap;
}
.achv-league-itemtabs__item:hover {
    color: var(--achv-text);
    border-color: var(--achv-text-secondary);
    text-decoration: none;
}
.achv-league-itemtabs__item--active {
    color: var(--achv-primary);
    border-color: var(--achv-primary);
    font-weight: 600;
}

.achv-league-rules {
    text-align: left;
    line-height: 1.7;
    background: var(--achv-bg-soft, #f8fafc);
    padding: 16px;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: keep-all;
}
.achv-league-section {
    padding: 20px 16px;
}
.achv-league-section__title {
    margin: 0 0 16px 0;
    font-size: 17px;
    font-weight: 700;
    padding-left: 8px;
    border-left: 4px solid var(--achv-primary, #e60200);
}
.achv-league-empty {
    color: var(--achv-text-secondary, #6b7280);
    padding: 16px 0;
}
.achv-league-hint {
    color: var(--achv-text-secondary, #6b7280);
    font-size: 13px;
    margin: 0 0 12px 0;
}

/* --- H2H 매트릭스 (대진표) --- */
.achv-league-h2h-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.achv-league-h2h {
    border-collapse: collapse;
    font-size: 13px;
    margin: 0 auto;
    min-width: 100%;
}
.achv-league-h2h th,
.achv-league-h2h td {
    border: 1px solid var(--achv-border, #e5e7eb);
    padding: 6px 10px;
    text-align: center;
    white-space: nowrap;
}
.achv-league-h2h__corner {
    background: var(--achv-bg-soft, #f8fafc);
    font-weight: 700;
    font-size: 13px;
    color: var(--achv-text-secondary, #6b7280);
}
.achv-league-h2h__col {
    background: var(--achv-bg-soft, #f8fafc);
    font-weight: 600;
    min-width: 60px;
}
.achv-league-h2h__row {
    background: var(--achv-bg-soft, #f8fafc);
    font-weight: 600;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 1;
}
.achv-league-h2h__diag {
    background: #f1f5f9;
    color: #cbd5e1;
}
.achv-league-h2h__empty {
    color: #d1d5db;
}
.achv-league-h2h__cell {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.achv-league-h2h__cell--win {
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
    font-weight: 700;
}
.achv-league-h2h__cell--loss {
    background: rgba(220, 38, 38, 0.06);
    color: #b91c1c;
}
.achv-league-h2h__total {
    background: rgba(230, 2, 0, 0.06);
    font-weight: 700;
    color: var(--achv-primary, #e60200);
}

/* --- 커뮤니티: 게시판 sub-탭 + iframe --- */
.achv-community__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--achv-border, #e5e7eb);
    margin-bottom: 16px;
}
.achv-community__tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--achv-text-dim, #6b7280);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.12s, border-color 0.12s;
    white-space: nowrap;
}
.achv-community__tab:hover {
    color: var(--achv-text, #1e293b);
    text-decoration: none;
}
.achv-community__tab--active {
    color: var(--achv-primary, #e60200);
    border-bottom-color: var(--achv-primary, #e60200);
    font-weight: 700;
}
.achv-community__frame-wrap {
    display: block;
}
.achv-community__desc {
    padding: 8px 12px;
    background: var(--achv-bg-soft, #f8fafc);
    border-left: 3px solid var(--achv-primary, #e60200);
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--achv-text-dim, #6b7280);
}
.achv-community__frame {
    width: 100%;
    height: 800px;
    max-height: 8000px;
    border: none;
    background: #fff;
    display: block;
    overflow: hidden;
}
@media (max-width: 640px) {
    .achv-community__frame {
        height: 600px;
    }
}

/* --- 팀/선수 검색 --- */
.achv-league-search {
    margin-top: 12px;
}
.achv-league-search__input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--achv-border, #e5e7eb);
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}
.achv-league-search__input:focus {
    outline: none;
    border-color: var(--achv-primary, #e60200);
    box-shadow: 0 0 0 3px rgba(230, 2, 0, 0.12);
}
.achv-league-search__status {
    font-size: 13px;
    color: var(--achv-text-dim, #6b7280);
    margin: 8px 4px;
    min-height: 1.2em;
}
.achv-league-search__results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.achv-league-search__section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--achv-text-dim, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.achv-league-search__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.achv-league-search__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border: 1px solid var(--achv-border, #e5e7eb);
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    color: var(--achv-text, #1e293b);
    transition: border-color 0.12s, transform 0.08s, box-shadow 0.15s;
}
.achv-league-search__item:hover {
    border-color: var(--achv-primary, #e60200);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none;
}
.achv-league-search__item--team   { border-left: 3px solid #1d4ed8; }
.achv-league-search__item--player { border-left: 3px solid #16a34a; }
.achv-league-search__name {
    font-weight: 600;
    font-size: 15px;
}
.achv-league-search__meta {
    font-size: 13px;
    color: var(--achv-text-dim, #6b7280);
}
.achv-league-venues {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.achv-league-venue-card {
    border: 1px solid var(--achv-border, #e5e7eb);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.achv-league-venue-card:hover {
    border-color: var(--achv-primary, #e60200);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.achv-league-venue-card--primary {
    border-color: var(--achv-primary, #e60200);
    border-left-width: 4px;
}
.achv-league-venue-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.achv-league-venue-card__name {
    font-weight: 700;
    font-size: 15px;
}
.achv-league-venue-card__badge {
    background: var(--achv-primary, #e60200);
    color: #fff;
    font-size: 12px;
    padding: 1px 8px;
    border-radius: 3px;
    font-weight: 600;
}
.achv-league-venue-card__addr,
.achv-league-venue-card__note {
    color: var(--achv-text-secondary, #6b7280);
    font-size: 13px;
    margin-top: 2px;
}
.achv-league-venue-card__map {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--achv-secondary, #1d4ed8);
    text-decoration: none;
}
.achv-league-venue-card__map:hover { text-decoration: underline; }

/* --- 리그 관리 > 경기장 탭 (venue picker) --- */
.achv-vpick {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 16px 0;
}
@media (min-width: 900px) {
    .achv-vpick { grid-template-columns: 1fr 1fr; align-items: start; }
}
.achv-vpick__pane {
    border: 1px solid var(--achv-border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.achv-vpick__pane-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--achv-border, #e5e7eb);
    background: var(--achv-bg-soft, #f8fafc);
}
.achv-vpick__pane-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.achv-vpick__count {
    display: inline-block;
    min-width: 22px;
    padding: 0 6px;
    margin-left: 4px;
    border-radius: 11px;
    background: var(--achv-primary, #e60200);
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
}
.achv-vpick__warn {
    margin: 0;
    padding: 8px 14px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    border-bottom: 1px solid var(--achv-border, #e5e7eb);
}
.achv-vpick__filters {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--achv-border, #e5e7eb);
}
.achv-vpick__search { flex: 1 1 auto; min-width: 0; }
.achv-vpick__region { flex: 0 0 auto; max-width: 40%; }
.achv-vpick__search,
.achv-vpick__region { font-size: 16px; }

.achv-vpick__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px;
    overflow-y: auto;
}
.achv-vpick__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--achv-border-light, #f1f5f9);
}
.achv-vpick__item:last-child { border-bottom: none; }
.achv-vpick__item--primary { background: rgba(230, 2, 0, 0.04); }
.achv-vpick__item--off { opacity: 0.62; }
.achv-vpick__item--pool:hover { background: var(--achv-bg-soft, #f8fafc); }

.achv-vpick__rank {
    flex: 0 0 22px;
    font-size: 13px;
    font-weight: 700;
    color: var(--achv-text-secondary, #6b7280);
    text-align: center;
}
.achv-vpick__body { flex: 1 1 auto; min-width: 0; }
.achv-vpick__item--open { box-shadow: inset 3px 0 0 var(--achv-secondary, #1d4ed8); }
.achv-vpick__meta,
.achv-vpick__note {
    font-size: 13px;
    color: var(--achv-text-secondary, #6b7280);
    margin-top: 2px;
    overflow-wrap: anywhere;
}
.achv-vpick__note { font-style: italic; }
.achv-vpick__badge {
    background: var(--achv-primary, #e60200);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 3px;
}
.achv-vpick__badge--off {
    background: var(--achv-text-secondary, #6b7280);
}

.achv-vpick__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
}
.achv-vpick__icon,
.achv-vpick__pri {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border: 1px solid var(--achv-border, #e5e7eb);
    border-radius: 4px;
    background: #fff;
    color: var(--achv-text, #111827);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.achv-vpick__icon:hover:not(:disabled),
.achv-vpick__pri:hover { border-color: var(--achv-primary, #e60200); }
.achv-vpick__icon:disabled { opacity: 0.35; cursor: default; }
.achv-vpick__icon--danger:hover:not(:disabled) {
    border-color: #dc2626;
    color: #dc2626;
}
.achv-vpick__pri[aria-pressed="true"] {
    background: var(--achv-primary, #e60200);
    border-color: var(--achv-primary, #e60200);
    color: #fff;
    font-weight: 700;
}
.achv-vpick__empty {
    padding: 24px 14px;
    text-align: center;
    font-size: 14px;
    color: var(--achv-text-secondary, #6b7280);
}
.achv-vpick__more {
    margin: 0;
    padding: 8px 14px;
    border-top: 1px solid var(--achv-border, #e5e7eb);
    font-size: 13px;
    color: var(--achv-text-secondary, #6b7280);
}

/* --- 구장 상세 패널 (AchvVenueDetail 를 담는 껍데기) --- */
.achv-vp-detail {
    margin: 0 0 16px;
    border: 1px solid var(--achv-secondary, #1d4ed8);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.achv-vp-detail[hidden] { display: none; }
.achv-vp-detail__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--achv-border, #e5e7eb);
    background: var(--achv-bg-soft, #f8fafc);
}
.achv-vp-detail__title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.achv-vp-detail__map {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--achv-secondary, #1d4ed8);
    text-decoration: none;
    white-space: nowrap;
}
.achv-vp-detail__map:hover { text-decoration: underline; }
.achv-vp-detail__warn {
    margin: 0;
    padding: 8px 14px;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    border-bottom: 1px solid var(--achv-border, #e5e7eb);
}
.achv-vp-detail__body { padding: 14px; }
@media (max-width: 599px) {
    .achv-vp-detail__head { flex-wrap: wrap; }
    .achv-vp-detail__title { flex: 1 0 100%; }
    .achv-vp-detail__body { padding: 10px; }
}

.achv-vpick__bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 0 0 16px;
    border: 1px solid var(--achv-primary, #e60200);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}
/* display:flex 가 UA 의 [hidden]{display:none} 을 이긴다 — 명시적으로 다시 숨긴다. */
.achv-vpick__bar[hidden] { display: none; }
.achv-vpick__bar-msg {
    flex: 1 1 auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--achv-primary, #e60200);
}


@media (max-width: 599px) {
    .achv-vpick__filters { flex-wrap: wrap; }
    .achv-vpick__region { max-width: none; width: 100%; }
    .achv-vpick__list { max-height: 340px; }
    .achv-vpick__bar { flex-wrap: wrap; }
    .achv-vpick__bar-msg { flex: 1 0 100%; }
    /* 이름이 버튼 4개에 밀려 3줄로 접히지 않도록 조작부를 아랫줄로 내린다. */
    .achv-vpick__item:not(.achv-vpick__item--pool) { flex-wrap: wrap; }
    .achv-vpick__item:not(.achv-vpick__item--pool) .achv-vpick__body { flex: 1 1 calc(100% - 32px); }
    .achv-vpick__item:not(.achv-vpick__item--pool) .achv-vpick__actions {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}

/* --- Season Select --- */
.achv-league-season-select {
    margin: var(--achv-sp-3) 0;
}

.achv-league-season-select select {
    padding: 6px 10px;
    border: 1px solid var(--achv-border);
    border-radius: var(--achv-radius-sm);
    font-size: 14px;
    color: var(--achv-text);
    background: var(--achv-bg);
}

/* --- Introduction --- */
.achv-league-intro__desc {
    line-height: 1.7;
    color: var(--achv-text);
}

/* --- Standings & Stats Tables --- */
.achv-standings,
.achv-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.achv-standings th, .achv-standings td,
.achv-stats-table th, .achv-stats-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--achv-border);
    text-align: center;
    font-size: 14px;
}

.achv-standings th,
.achv-stats-table th {
    background: var(--achv-surface);
    font-weight: 600;
    color: var(--achv-text);
    position: sticky;
    top: 0;
}

.achv-standings tbody tr:nth-child(even),
.achv-stats-table tbody tr:nth-child(even) {
    background: var(--achv-surface);
}

.achv-standings tbody tr:hover,
.achv-stats-table tbody tr:hover {
    background: var(--achv-surface-alt);
}

.achv-standings td:nth-child(2) {
    text-align: left;
}

/* --- 경기 일정 카드 (table 폐기 — 카드 list, 한 row 당 1 카드, 카드 내부는 팀 페이지 와 동일 vertical layout) --- */
.achv-schedule__cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
/* 카드 자체는 .achv-game-card 의 기본 flex column layout 사용 (head / matchup / meta / actions 위에서 아래로) */
.achv-game-card {
    background: #fff;
    border: 1px solid var(--achv-border, #e2e8f0);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.15s;
}
.achv-game-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.achv-game-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--achv-text-dim, #64748b);
}
.achv-game-card__date {
    font-weight: 600;
}
.achv-game-card__badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
}
.achv-game-card__badge--scheduled { background: #dbeafe; color: #1e40af; }
.achv-game-card__badge--in_progress { background: #fee2e2; color: #b91c1c; }
.achv-game-card__badge--completed { background: #dcfce7; color: #166534; }
.achv-game-card__badge--cancelled,
.achv-game-card__badge--suspended { background: #f3f4f6; color: #6b7280; }
.achv-game-card__matchup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}
.achv-game-card__team {
    font-weight: 600;
}
.achv-game-card__team--away { text-align: right; }
.achv-game-card__team--home { text-align: left; }
.achv-game-card__score {
    font-size: 16px;
    font-weight: 700;
    color: var(--achv-text, #1e293b);
    white-space: nowrap;
    text-align: center;
}
.achv-game-card__score-dash {
    margin: 0 4px;
    color: var(--achv-text-dim, #64748b);
}
.achv-game-card__vs {
    color: var(--achv-text-dim, #64748b);
    font-weight: 400;
    font-size: 14px;
}
.achv-game-card__meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--achv-text-dim, #64748b);
}
.achv-game-card__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid var(--achv-border, #e2e8f0);
}
.achv-game-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    border: 1px solid var(--achv-border, #e2e8f0);
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: var(--achv-text, #1e293b);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.achv-game-card__btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.achv-game-card__btn-icon {
    flex-shrink: 0;
}
.achv-game-card__btn-icon--live {
    animation: achv-pulse-icon 1.5s infinite;
}
@keyframes achv-pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.achv-game-card__btn--primary {
    background: var(--achv-primary, #e60200);
    color: #fff;
    border-color: var(--achv-primary, #e60200);
}
.achv-game-card__btn--primary:hover { opacity: 0.9; }
.achv-game-card__btn--record {
    background: var(--achv-bg-soft, #f8fafc);
}
.achv-game-card__btn--record:hover {
    background: var(--achv-bg-soft, #e2e8f0);
}
.achv-game-card__btn--disabled,
.achv-game-card__btn:disabled {
    background: var(--achv-bg-soft, #f1f5f9);
    color: var(--achv-text-dim, #94a3b8);
    cursor: not-allowed;
    border-color: var(--achv-border, #e2e8f0);
}
.achv-game-card--cancelled,
.achv-game-card--suspended {
    opacity: 0.7;
}

/* --- 모바일 480px 미만 — 카드 정보 vertical stack, 버튼 가로 유지 --- */
@media (max-width: 480px) {
    .achv-schedule__cards {
        grid-template-columns: 1fr;
    }
    .achv-game-card__matchup {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 4px;
    }
    .achv-game-card__team--away,
    .achv-game-card__team--home {
        text-align: center;
    }
    .achv-game-card__actions {
        /* 가로 유지 — 사용자 명시 (b) */
        grid-template-columns: 1fr 1fr;
    }
}

/* --- 팀 페이지의 경기 카드 actions — 3 버튼 (참석 / 라인업 / 상태별) --- */
.achv-sched-card .achv-game-card__actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}
.achv-sched-card .achv-game-card__btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 8px;
    border: 1px solid var(--achv-border, #e2e8f0);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: var(--achv-text, #1e293b);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    white-space: nowrap;
    min-width: 0;
}
.achv-sched-card .achv-game-card__btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.achv-sched-card .achv-game-card__btn:not(:disabled):active {
    transform: translateY(0);
}
.achv-game-card__btn-icon {
    flex-shrink: 0;
}
.achv-game-card__btn-label {
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 참석 버튼 — 미투표 sky 색조 */
.achv-game-card__btn--att {
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #7dd3fc;
    color: #0369a1;
}
.achv-game-card__btn--att:hover {
    background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
}
.achv-game-card__btn--att[aria-expanded="true"] {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px #bae6fd inset;
}
/* 참석 버튼 — 투표 후 상태별 배경 */
.achv-game-card__btn--att-attending {
    background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #16a34a;
    color: #166534;
}
.achv-game-card__btn--att-absent {
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
    border-color: #dc2626;
    color: #991b1b;
}
.achv-game-card__btn--att-late {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    border-color: #d97706;
    color: #92400e;
}
/* 라인업 버튼 — 파랑 */
.achv-game-card__btn--lineup {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
}
.achv-game-card__btn--lineup:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
}
/* 상태별 우측 버튼 (primary override — sched-card 안에선 더 polished) */
.achv-sched-card .achv-game-card__btn--primary {
    background: linear-gradient(180deg, #e60200 0%, #b91c1c 100%);
    color: #fff;
    border-color: #b91c1c;
}
.achv-sched-card .achv-game-card__btn--primary:hover {
    background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%);
}
/* LIVE 아이콘 — 펄스 애니메이션 */
.achv-game-card__btn-icon--live {
    animation: achv-pulse-icon 1.5s infinite;
    color: #fff;
}
@keyframes achv-pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
/* disabled — 흐림 */
.achv-sched-card .achv-game-card__btn:disabled,
.achv-sched-card .achv-game-card__btn--disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}
.achv-sched-card .achv-game-card__btn:disabled:hover,
.achv-sched-card .achv-game-card__btn--disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* 모바일 480px — 3 column 유지하되 라벨 줄임 */
@media (max-width: 480px) {
    .achv-sched-card .achv-game-card__actions {
        padding: 8px 10px;
        gap: 4px;
    }
    .achv-sched-card .achv-game-card__btn {
        padding: 8px 4px;
        font-size: 14px;
        gap: 3px;
    }
}

.achv-standings a,
.achv-stats-table a {
    color: var(--achv-secondary);
    text-decoration: none;
}

.achv-standings a:hover,
.achv-stats-table a:hover {
    text-decoration: underline;
}

/* Table scroll wrapper for mobile */
/* Sortable columns */
.achv-stats-table__sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.achv-stats-table__sortable:hover {
    background: var(--achv-secondary-light);
}

.achv-stats-table__sortable--active {
    color: var(--achv-primary);
    background: var(--achv-primary-light);
}

/* --- Player Rank Cards (Guinness) --- */
.achv-player-rank {
    display: grid;
    gap: var(--achv-sp-4);
}

.achv-player-rank__card {
    background: var(--achv-bg);
    border: 1px solid var(--achv-border);
    border-radius: var(--achv-radius);
    overflow: hidden;
    box-shadow: var(--achv-shadow-sm);
}

.achv-player-rank__title {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    padding: 10px 14px;
    background: var(--achv-surface);
    border-bottom: 2px solid var(--achv-primary);
    color: var(--achv-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.achv-player-rank__empty {
    padding: 16px;
    color: var(--achv-text-muted);
    font-size: 13px;
    text-align: center;
    margin: 0;
}

.achv-player-rank__list {
    display: flex;
    flex-direction: column;
}

.achv-player-rank__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--achv-border);
    transition: background 0.12s ease;
}

.achv-player-rank__row:last-child {
    border-bottom: none;
}

.achv-player-rank__row:hover {
    background: var(--achv-surface);
    text-decoration: none;
}

.achv-player-rank__row--first {
    background: #fffbeb;
}

.achv-player-rank__row--first:hover {
    background: var(--achv-warning-light);
}

.achv-player-rank__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    background: var(--achv-surface);
    color: var(--achv-text-muted);
    border: 1px solid var(--achv-border);
}

.achv-player-rank__num--gold {
    background: #fbbf24;
    color: #fff;
    border-color: #f59e0b;
}

.achv-player-rank__num--silver {
    background: #9ca3af;
    color: #fff;
    border-color: var(--achv-info);
}

.achv-player-rank__num--bronze {
    background: #d97706;
    color: #fff;
    border-color: #b45309;
}

.achv-player-rank__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.achv-player-rank__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--achv-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achv-player-rank__team {
    font-size: 13px;
    color: var(--achv-text-muted);
}

.achv-player-rank__value {
    font-size: 18px;
    font-weight: 800;
    color: var(--achv-primary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-left: auto;
}

/* --- Admin Page --- */
.achv-admin-league {
    max-width: 960px;
    margin: var(--achv-sp-5) auto;
    padding: 0 var(--achv-sp-4);
}

.achv-admin-league__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--achv-sp-5);
    font-variant-numeric: tabular-nums;
}

.achv-admin-league__table th,
.achv-admin-league__table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--achv-border);
    text-align: left;
    font-size: 14px;
}

.achv-admin-league__table th {
    background: var(--achv-surface);
    font-weight: 600;
    color: var(--achv-text);
}

.achv-admin-league__table tbody tr:nth-child(even) {
    background: var(--achv-surface);
}

/* 표 안의 링크. ⚠ button 은 여기서 빼야 한다 — 이 규칙이 .achv-btn 을 이겨서
   «수정·삭제» 같은 동작 버튼이 글자만 있는 링크처럼 보였다 (클래스는 버튼인데 모양은 링크). */
.achv-admin-league__table a:not(.achv-btn) {
    color: var(--achv-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    text-decoration: none;
}

.achv-admin-league__table a:not(.achv-btn):hover {
    text-decoration: underline;
}

/* 표 안 버튼들은 좁으니 조금 붙여 둔다 */
.achv-admin-league__table .achv-btn + .achv-btn {
    margin-left: 4px;
}

.achv-admin-league__form {
    max-width: 480px;
}

.achv-admin-league__form div {
    margin-bottom: var(--achv-sp-3);
}

.achv-admin-league__form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--achv-sp-1);
    color: var(--achv-text);
}

/* 입력·선택 규격은 common.css 의 .achv-form__input 정본이 함께 맡는다. 여기엔 폭만 적는다. */
.achv-admin-league__form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.achv-admin-league__form select,
.achv-admin-league__form textarea {
    width: 100%;
}

/* 저장 버튼 — .achv-btn--primary 와 같은 규격 */
.achv-admin-league__form button[type="submit"] {
    min-height: 40px;
    padding: 8px 24px;
    background: var(--achv-primary);
    color: #fff;
    border: 1px solid var(--achv-primary);
    border-radius: var(--achv-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.achv-admin-league__form button[type="submit"]:hover {
    background: var(--achv-primary-hover);
    border-color: var(--achv-primary-hover);
}

.achv-admin-league__form button[type="submit"]:focus-visible {
    outline: 2px solid var(--achv-secondary);
    outline-offset: 2px;
}

/* --- Responsive: Small Mobile --- */
@media (max-width: 480px) {
    /* Cover image: shorter on mobile */
    .achv-league-cover {
        height: 100px;
        border-radius: 0;
    }

    /* League detail header: tighter */
    .achv-league-header {
        gap: var(--achv-sp-3);
    }

    .achv-league-header__logo {
        width: 48px;
        height: 48px;
    }

    .achv-league-header__name {
        font-size: 20px;
    }

    /* League tabs: touch target */
    .achv-league-tabs__item {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 10px var(--achv-sp-2);
    }

    /* Season select: prevent iOS zoom */
    .achv-league-season-select select {
        font-size: 16px;
    }

    /* Stats tables: smaller, sticky first col */
    .achv-standings th, .achv-standings td,
    .achv-stats-table th, .achv-stats-table td {
        padding: 6px 8px;
        font-size: 14px;
    }

    .achv-standings td:first-child,
    .achv-standings th:first-child,
    .achv-stats-table td:first-child,
    .achv-stats-table th:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: var(--achv-bg);
    }

    .achv-standings th:first-child,
    .achv-stats-table th:first-child {
        background: var(--achv-surface);
    }

    .achv-standings tbody tr:nth-child(even) td:first-child,
    .achv-stats-table tbody tr:nth-child(even) td:first-child {
        background: var(--achv-surface);
    }

    /* Also sticky second col for standings (team name) */
    .achv-standings td:nth-child(2),
    .achv-standings th:nth-child(2) {
        position: sticky;
        left: 0;
        z-index: 2;
    }

    /* Player rank cards: single column */
    .achv-player-rank {
        grid-template-columns: 1fr;
    }

    /* Admin form: prevent iOS zoom */
    .achv-admin-league__form input[type="text"],
    .achv-admin-league__form input[type="number"],
    .achv-admin-league__form input[type="date"],
    .achv-admin-league__form select,
    .achv-admin-league__form textarea {
        font-size: 16px;
    }

    .achv-admin-league__form button[type="submit"] {
        width: 100%;
        min-height: 44px;
    }

    /* Admin table: scroll wrapper needed from HTML, but reduce padding */
    .achv-admin-league__table th,
    .achv-admin-league__table td {
        padding: 6px 8px;
        font-size: 14px;
    }
}

/* --- Responsive: Tablet+ --- */
@media (min-width: 768px) {
    .achv-player-rank {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .achv-player-rank {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── 부·조 필터 (migration_096) ───────────────────────────────────── */

.achv-dg-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.achv-dg-filter select {
    padding: 6px 10px;
    border: 1px solid var(--achv-border);
    border-radius: var(--achv-radius, 6px);
    background: var(--achv-bg);
    color: var(--achv-text);
    /* iOS 확대 방지 */
    font-size: 16px;
}

/* 순위표·등록현황에서 팀명 옆에 붙는 부·조 표시 */
.achv-dg-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--achv-surface);
    color: var(--achv-text-secondary);
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}

/* 기록 열람범위에 막혔을 때 (migration_097) */
.achv-records-locked {
    padding: 32px 16px;
    text-align: center;
    color: var(--achv-text-secondary);
    background: var(--achv-surface);
    border: 1px solid var(--achv-border);
    border-radius: var(--achv-radius, 8px);
}
.achv-records-locked p { margin: 0 0 12px; }
.achv-records-locked p:last-child { margin-bottom: 0; }

/* =============================================================
   기록 표 — 숫자 칸 정렬 (2026-09-18 UI 통일)
   순위·팀명·선수명은 왼쪽/가운데 그대로 두고 수치 칸만 오른쪽으로 모은다.
   자릿수가 흔들리면 위아래로 훑어 읽기 어렵다.
   ============================================================= */
.achv-standings th:nth-child(n+3),
.achv-standings td:nth-child(n+3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.achv-stats-table th:nth-child(n+4),
.achv-stats-table td:nth-child(n+4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* 열 머리도 줄바꿈하지 않는다 — «경 기» 처럼 세로로 접히면 표 높이가 커진다 */
.achv-standings th,
.achv-stats-table th {
    white-space: nowrap;
}

/* 선수·팀 이름은 줄바꿈하지 않는다 — 좁은 화면에서 한 글자씩 접혀 행이 몇 배로 커진다.
   표는 이미 가로 스크롤 안에 있다. */
.achv-standings td:nth-child(2),
.achv-stats-table td:nth-child(2),
.achv-stats-table td:nth-child(3) {
    white-space: nowrap;
}

/* 기록 내려받기 줄 — 예전엔 두 곳이 인라인 style 이라 글자 크기·문구가 달랐다 */
.achv-league-export {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.achv-league-export__link {
    font-size: 13px;
    color: var(--achv-secondary);
}
